http://code.google.com/p/rtl8192cu/source/browse/
有提供 debian, android, android ics 的 sdk, porting guide。
ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上
2012年8月22日 星期三
hotspot (wifiap) 的 dhcp lease time
hotspot 的 dhcp,dns 等動作是交給 dnsmasq 這個程式來作。
netd 的 TetherController.cpp 是負責叫起 dnsmasq 動作的部份。
dnsmasq 跟一般的 command 一樣,是由 command argument 決定動作。
argument 也由 TetherController.cpp 負責。
dhcp 的 lease time 也由 argument 決定。
以下就是準備好 argument,然後用execv( ) 啟動 dnsmasq 的 code:
其中 : "--dhcp-range=%s,%s,1h" 最後一項就是 lease_time: 1h。
dnsmasq 啟動後,會由 read_opts( ) 負責 parsing argument, update parameter.
修改後,client 端可以用 showlease wlan0 這個 command 來看收到的 dhcp server 傳來的 lease time 是多少。
netd 的 TetherController.cpp 是負責叫起 dnsmasq 動作的部份。
dnsmasq 跟一般的 command 一樣,是由 command argument 決定動作。
argument 也由 TetherController.cpp 負責。
dhcp 的 lease time 也由 argument 決定。
以下就是準備好 argument,然後用execv( ) 啟動 dnsmasq 的 code:
int num_processed_args = 4 + (num_addrs/2) + 1; // 1 null for termination
char **args = (char **)malloc(sizeof(char *) * num_processed_args);
args[num_processed_args - 1] = NULL;
args[0] = (char *)"/system/bin/dnsmasq";
args[1] = (char *)"--no-daemon";
args[2] = (char *)"--no-resolv";
args[3] = (char *)"--no-poll";
int nextArg = 4;
for (int addrIndex=0; addrIndex < num_addrs;) {
char *start = strdup(inet_ntoa(addrs[addrIndex++]));
char *end = strdup(inet_ntoa(addrs[addrIndex++]));
asprintf(&(args[nextArg++]),"--dhcp-range=%s,%s,1h", start, end);
}
if (execv(args[0], args)) {
LOGE("execl failed (%s)", strerror(errno));
}
其中 : "--dhcp-range=%s,%s,1h" 最後一項就是 lease_time: 1h。
dnsmasq 啟動後,會由 read_opts( ) 負責 parsing argument, update parameter.
修改後,client 端可以用 showlease wlan0 這個 command 來看收到的 dhcp server 傳來的 lease time 是多少。
2012年5月25日 星期五
android: enable wifi ap mode
因為這版bsp,wifi 可以動。所以看看是不是 ap mode 也可以起得來。
直接 enable thethering -- portable Wi-Fi hotspot。
結果是 Error。
log 是..
所以問題應該是在:
然後記得以前 auron 說過,當初 ap mode fail 是 interface name 不對。
對照一下,果然,前面 wlan_tool 使用 softap0,後面 framework 都用 wlap0。
所以修改一下 wlan_tool
... 這個是在 atheros wifi sdk 的 driver project 中..
附記:auron 改 WifiService.java ,其中 SOFTAP_IFACE=" " 她改 wlan1
要注意 可以作為 tether 的 interface 寫在 framework/base/core/res/res/values/config.xml:
直接 enable thethering -- portable Wi-Fi hotspot。
結果是 Error。
log 是..
E/WifiService( 2379): ath: load Wi-Fi driver for AP mode.
set_cpu_freq, wp 0
I/wlan_tool( 2679): loadAPdriver+
I/wlan_tool( 2680): AP wifi loading
I/wlan_tool( 2684): Try to load AP driver with ifname=softap0 devmode=ap
AR6000: configuration opcode 7 is only used for RTOS systems, not Linux systemsD/dalvikvm( 2379): GC_CONCURRENT freed 979K,
45% free 4279K/7751K, external 2765K/3965K, paused 4ms+6ms
AR6K: ** HIF layer does not support scatter requests (17)
W/Netd ( 2309): action=5, iface=softap0
wmi_control_rx() : Unknown id 0x101e
D/Tethering( 2379): interfaceLinkStatusChanged softap0, false
D/NetdConnector( 2379): RCV <- {600 Iface linkstate softap0 down}
W/Netd ( 2309): action=5, iface=softap0
/Tethering( 2379): interfaceLinkStatusChanged softap0, false
D/NetdConnector( 2379): RCV <- {600 Iface linkstate softap0 down}
D/Tethering( 2379): softap0 is not a tetherable iface, ignoring
W/Netd ( 2309): action=5, iface=softap0
D/Tethering( 2379): interfaceLinkStatusChanged softap0, false
D/NetdConnector( 2379): RCV <- {600 Iface added softap0}
D/NetdConnector( 2379): RCV <- {600 Iface linkstate softap0 down}
I/wlan_tool( 2699): ar6000 AP driver loaded
I/wlan_tool( 2701): loadAPdriver-
D/SoftapController( 2309): Softap driver stop: 0
D/SoftapController( 2309): fwReloadSoftap: argv[2]:wlan0 argv[3]:AP
D/SoftapController( 2309): Softap fwReload - Ok
D/SoftapController( 2309): Softap driver start: 0
D/NetdConnector( 2379): SND -> {softap stop wlan0} {null}
D/NetdConnector( 2379): RCV <- {200 Softap operation succeeded}
D/NetdConnector( 2379): RSP <- {200 Softap operation succeeded}
D/NetdConnector( 2379): SND -> {softap fwreload wlan0 AP} {null}
D/NetdConnector( 2379): RCV <- {200 Softap operation succeeded}
D/NetdConnector( 2379): RSP <- {200 Softap operation succeeded}
D/NetdConnector( 2379): SND -> {softap start wlan0} {null}
D/NetdConnector( 2379): RCV <- {200 Softap operation succeeded}
D/NetdConnector( 2379): RSP <- {200 Softap operation succeeded}
E/SoftapController( 2309): AR6000_IOCTL wlap0 set wlan state failed: -1:No such device
D/NetdConnector( 2379): SND -> {softap set wlan0 wlap0 "xxxAndroidAP" open null} {null}
D/NetdConnector( 2379): RCV <- {400 Softap operation failed (No such device)}
D/NetdConnector( 2379): RSP <- {400 Softap operation failed (No such device)}
E/WifiService( 2379): Exception in startAccessPoint()
所以問題應該是在:
E/SoftapController( 2309): AR6000_IOCTL wlap0 set wlan state failed: -1:No such device
然後記得以前 auron 說過,當初 ap mode fail 是 interface name 不對。
對照一下,果然,前面 wlan_tool 使用 softap0,後面 framework 都用 wlap0。
所以修改一下 wlan_tool
... 這個是在 atheros wifi sdk 的 driver project 中..
附記:auron 改 WifiService.java ,其中 SOFTAP_IFACE=" " 她改 wlan1
要注意 可以作為 tether 的 interface 寫在 framework/base/core/res/res/values/config.xml:
標籤
- 3g (19)
- 工作的備worklog (93)
- 自言自語 (36)
- 草稿 (1)
- 亂亂寫 (8)
- 翻譯 (3)
- administration (76)
- alsa (7)
- android (299)
- apple (5)
- application (42)
- archlinux (1)
- audio (3)
- avr (6)
- backup_restore (2)
- bluetooth (5)
- bookmark (38)
- bootloader (21)
- browser (5)
- cellphone (28)
- command (8)
- Configuration (27)
- debug (7)
- django (1)
- driver (15)
- earphone (1)
- editor (1)
- EFL (1)
- ffmpeg (18)
- Filesystem (4)
- GCC (8)
- Gentoo (1)
- google (1)
- Graphic (3)
- hardware (40)
- hero (7)
- hibernation (9)
- iMX51 (38)
- Info (3)
- Install (30)
- java (4)
- Kernel (102)
- language (2)
- life (2)
- make (11)
- MantainLog (38)
- MCU_P (9)
- memo (8)
- microcontroller (3)
- MINGW (7)
- network (19)
- OpenCL (1)
- OS (11)
- package (3)
- pad (1)
- ProblemAndSolve (15)
- programming (8)
- Python (7)
- raspberry_pi (23)
- SDL (2)
- sensation (13)
- setup (3)
- software_package (36)
- SQL (1)
- suspend (2)
- ToDo (5)
- tool (3)
- ubuntu (1)
- VersionControl (45)
- Virtualization (15)
- VLC (5)
- wheezy (1)
- wifi (3)
- Windows (16)
- xiaomi (1)
- xperia (1)