Hi3559AV100 TL8189FS WIFI调试.
硬件设计
驱动配置
rtl8189FS驱动移植(待完善)
&mmc3 {
status = "okay";
cap-sdio-irq;
};
驱动打印
~ # cat /proc/mci/mci_info
MCI0: pluged_connected
Type: MMC card(SDHC)
Mode: HS400
Speed Class: Class 0
Uhs Speed Grade: Less than 10MB/sec(0h)
Host work clock: 198MHz
Card support clock: 198MHz
Card work clock: 198MHz
Card error count: 0
MCI1: pluged_connected
Type: SDIO card Mode:
Speed Class: Class 0
Uhs Speed Grade: Less than 10MB/sec(0h)
Host work clock: 25MHz
Card support clock: 25MHz
Card work clock: 25MHz
Card error count: 0
MCI2: invalid
MCI3: invalid
~ # lsmod
Module Size Used by Tainted: G
8189fs 1100254 0
~ # iwconfig
wlan0 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/100 Signal level=0 dBm Noise level=0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
eth0 Link encap:Ethernet HWaddr B2:9A:1B:58:5F:57
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::b09a:1bff:fe58:5f57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:680 errors:0 dropped:0 overruns:0 frame:0
TX packets:154 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:93913 (91.7 KiB) TX bytes:16690 (16.2 KiB)
Interrupt:44
lo no wireless extensions.
配置AP
WPA2-PSK配置:
~ # cat /etc/Wireless/hostapd.conf
interface=wlan0
driver=nl80211
ctrl_interface=/var/hostapd
ssid=HisiAP
channel=6
hw_mode=g
ieee80211n=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40-]
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
wpa_passphrase=12345678
hostapd启动:
~ # ./hostapd-3 /etc/Wireless/hostapd.conf &
~ # Configuration file: /etc/Wireless/hostapd.conf
[ 61.804125] random: crng init done
rfkill: Cannot open RFKILL control device
[ 62.501043] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
wlan0: interface state UNINITIALIZED->HT_SCAN
20/40 MHz operation not permitted on channel pri=6 sec=2 based on overlapping BSSes
Using interface wlan0 with hwaddr 30:4a:26:75:5a:73 and ssid "HisiAP"
random: Cannot read from /dev/random: Resource temporarily unavailable
random: Only 0/20 bytes of strong random data available
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
[ 64.411051] RTL871X: assoc success
[ 64.414507] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 64.421602] RTL871X: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:TKIP
wlan0: interface state HT_SCAN->ENABLED
wlan0: AP-ENABLED
hostapd需要开启的配置:
CONFIG_DRIVER_NL80211=y
CONFIG_ACS=y
CONFIG_IEEE80211N=y
开启DHCP
拷贝udhcpd.conf文件,修改网段为192.168.1.x
ifconfig wlan0 192.168.1.1
~ # ifconfig
eth0 Link encap:Ethernet HWaddr 1A:F2:72:7C:67:4E
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::18f2:72ff:fe7c:674e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:274 errors:0 dropped:0 overruns:0 frame:0
TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:36598 (35.7 KiB) TX bytes:8590 (8.3 KiB)
Interrupt:44
wlan0 Link encap:Ethernet HWaddr 30:4A:26:75:5A:73
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::324a:26ff:fe75:5a73/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63 errors:0 dropped:2 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:116 (116.0 B)
修改配置文件:
# Sample udhcpd configuration file (/etc/udhcpd.conf)
# Values shown are defaults
# The start and end of the IP lease block
start 192.168.1.20
end 192.168.1.254
# The interface that udhcpd will use
interface wlan0
opt dns 192.168.1.2 192.168.10.10
option subnet 255.255.255.0
opt router 192.168.1.2
创建目录和空文件/var/lib/misc/udhcpd.leases
~ # udhcpd -fS /etc/Wireless/udhcpd.conf &
~ # udhcpd: started, v1.26.2
连接WIFI
手机搜索HisiAP,密码:12345678
~ # wlan0: STA 30:a2:c2:9b:fb:37 IEEE 802.11: associated
[ 438.583766] RTL871X: send eapol packet
[ 438.591049] RTL871X: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:TKIP
[ 438.607009] RTL871X: recv eapol packet
[ 438.611101] RTL871X: send eapol packet
[ 438.750707] RTL871X: recv eapol packet
wlan0: AP-STA-CONNECTED 30:a2:c2:9b:fb:37[ 438.750804] RTL871X: set pairwise key camid:4, addr:30:a2:c2:9b:fb:37, kid:0, type:AES
wlan0: STA 30:a2:c2:9b:fb:37 RADIUS: starting accounting session AE24A77BE1DECF58
wlan0: STA 30:a2:c2:9b:fb:37 WPA: pairwise key handshake completed (RSN)
udhcpd: sending OFFER of 192.168.1.20
udhcpd: sending OFFER of 192.168.1.20
udhcpd: sending ACK to 192.168.1.20
udhcpd: sending ACK to 192.168.1.20
手机连接成功,获取IP地址:192.168.1.20
ping手机测试:
~ # ping 192.168.1.20
PING 192.168.1.20 (192.168.1.20): 56 data bytes
64 bytes from 192.168.1.20: seq=0 ttl=64 time=419.152 ms
64 bytes from 192.168.1.20: seq=1 ttl=64 time=85.743 ms
64 bytes from 192.168.1.20: seq=2 ttl=64 time=96.736 ms
64 bytes from 192.168.1.20: seq=3 ttl=64 time=8.445 ms
64 bytes from 192.168.1.20: seq=4 ttl=64 time=22.328 ms
64 bytes from 192.168.1.20: seq=5 ttl=64 time=35.820 ms
64 bytes from 192.168.1.20: seq=6 ttl=64 time=52.484 ms
64 bytes from 192.168.1.20: seq=7 ttl=64 time=65.592 ms
64 bytes from 192.168.1.20: seq=8 ttl=64 time=77.517 ms
64 bytes from 192.168.1.20: seq=9 ttl=64 time=92.197 ms
64 bytes from 192.168.1.20: seq=10 ttl=64 time=106.776 ms
64 bytes from 192.168.1.20: seq=11 ttl=64 time=6.444 ms
64 bytes from 192.168.1.20: seq=12 ttl=64 time=9.960 ms
64 bytes from 192.168.1.20: seq=13 ttl=64 time=5.536 ms
64 bytes from 192.168.1.20: seq=14 ttl=64 time=3.637 ms
64 bytes from 192.168.1.20: seq=15 ttl=64 time=7.563 ms
64 bytes from 192.168.1.20: seq=16 ttl=64 time=4.451 ms
64 bytes from 192.168.1.20: seq=17 ttl=64 time=4.374 ms
64 bytes from 192.168.1.20: seq=18 ttl=64 time=6.318 ms
^C
--- 192.168.1.20 ping statistics ---
19 packets transmitted, 19 packets received, 0% packet loss
round-trip min/avg/max = 3.637/58.477/419.152 ms
iperf吞吐测试
华硕电脑连接wifi,获取IP地址为192.168.1.24,命令行里面允许iperf:iperf -s
~ # iperf -c 192.168.1.24
Connecting to host 192.168.1.24, port 5201
[ 4] local 192.168.1.1 port 43006 connected to 192.168.1.24 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 1.12 MBytes 9.34 Mbits/sec 0 99.8 KBytes
[ 4] 1.00-2.00 sec 2.14 MBytes 18.0 Mbits/sec 2 74.1 KBytes
[ 4] 2.00-3.00 sec 3.46 MBytes 29.0 Mbits/sec 9 111 KBytes
[ 4] 3.00-4.00 sec 3.89 MBytes 32.6 Mbits/sec 0 123 KBytes
[ 4] 4.00-5.00 sec 2.77 MBytes 23.3 Mbits/sec 0 123 KBytes
[ 4] 5.00-6.00 sec 3.02 MBytes 25.3 Mbits/sec 0 130 KBytes
[ 4] 6.00-7.00 sec 3.54 MBytes 29.7 Mbits/sec 0 130 KBytes
[ 4] 7.00-8.00 sec 3.47 MBytes 29.1 Mbits/sec 0 130 KBytes
[ 4] 8.00-9.00 sec 2.58 MBytes 21.6 Mbits/sec 0 130 KBytes
[ 4] 9.00-10.00 sec 2.06 MBytes 17.2 Mbits/sec 0 130 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 28.0 MBytes 23.5 Mbits/sec 11 sender
[ 4] 0.00-10.00 sec 27.8 MBytes 23.3 Mbits/sec receiver
23.3 Mbits/sec