海思mv100(android 4.4)WiFi调试

MT7601U是一种高度集成的WiFi单芯片,支持150 Mbps的PHY速率。它完全符合ieee 802.11n和ieee 802.11 b/g标准,提供丰富的无线连接功能。在高标准下,从扩展的距离中提供可靠的、具有成本效益的吞吐量

在设置里设置热点后,报如下错误

01-03 16:09:09.746 D/WifiHW ( 1997): uevent path:/sys/bus/usb/devices/./uevent
01-03 16:09:09.746 D/WifiHW ( 1997): uevent path:/sys/bus/usb/devices/../uevent
01-03 16:09:09.746 D/WifiHW ( 1997): uevent path:/sys/bus/usb/devices/1-1/uevent
01-03 16:09:09.747 D/WifiHW ( 1997): uevent path:/sys/bus/usb/devices/1-2/uevent
01-03 16:09:09.747 D/WifiHW ( 1997): pid:vid : 148f:7601
01-03 16:09:09.747 D/WifiHW ( 1997): find device id = 4, and mode = 1
01-03 16:09:09.747 E/WifiHW ( 1997): Cannot load prealloc module
01-03 16:09:09.747 E/WifiStateMachine( 1997): Failed to load driver for softap

显然驱动没有加载,需要打开配置项:BOARD_WLAN_DEVICE_MT7601U

sdk_mv100\device\hisilicon\Hi3798MV100\BoardConfig.mk


# Enable WiFi Only module used in the board.
# Supported WiFi Only modules:
#   RealTek RTL8188EUS (1T1R 2.4G)(Supported mode: STA, AP, WiFi Direct)
#   RealTek RTL8188ETV (1T1R 2.4G)(Supported mode: STA, AP, WiFi Direct)
#   RealTek RTL8192EU  (2T2R 2.4G)(Supported mode: STA, AP, WiFi Direct)
#   RealTek RTL8192DU  (2T2R 5G)(Supported mode: STA, AP, WiFi Direct)
#   RealTek RTL8812AU  (11ac 2T2R 2.4G+5G)(Supported mode: STA, AP, WiFi Direct)
#   MediaTek MT7601U   (1T1R 2.4G)(Supported mode: STA, AP, WiFi Direct)
#   MediaTek RT5572    (2T2R 2.4G+5G)(Supported mode: STA, AP)
#   Atheros AR9374-B   (2T2R 2.4G+5G)(Supported mode: STA, AP, WiFi Direct)
#   Atheros QCA1021G   (2T2R 2.4G)(Supported mode: STA, AP, WiFi Direct)
#   Atheros QCA1021X   (2T2R 2.4G+5G)(Supported mode: STA, AP, WiFi Direct)
# Set to 'y', enable the WiFi module, the driver will be compiled.
# Set to 'n', disable the WiFi module, the driver won't be compiled.
# Can set more than one module to 'y'.
# Example:
#   enable RTL8188EUS : BOARD_WLAN_DEVICE_RTL8188EUS = y
#   disable RTL8188EUS: BOARD_WLAN_DEVICE_RTL8188EUS = n

# MT7601U
BOARD_WLAN_DEVICE_MT7601U := y

编译后集成到system分区

cfg80211.ko
mt7601Uap.ko
mt7601Usta.ko
mtprealloc7601Usta.ko

运行服务“start wpa_supplicant”,报如下错误

01-04 10:11:30.507 I/wpa_supplicant(21303): wpa_supplicant v2.0-devel-4.4.2_rtw_r11967.20140818
01-04 10:11:30.507 I/wpa_supplicant(21303): define REALTEK_WIFI_VENDOR
01-04 10:11:30.508 I/wpa_supplicant(21303): Successfully initialized wpa_supplicant
01-04 10:11:30.508 E/wpa_supplicant(21303): Failed to open config file '/data/misc/wifi/wpa_supplicant.conf', error: No such file or directory
01-04 10:11:30.508 E/wpa_supplicant(21303): Failed to read or parse configuration '/data/misc/wifi/wpa_supplicant.conf'.

复制文件到data分区

cp /system/etc/wifi/wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf

再次运行wpa_supplicant

01-04 10:15:53.382 I/wpa_supplicant(24097): wpa_supplicant v2.0-devel-4.4.2_rtw_r11967.20140818
01-04 10:15:53.382 I/wpa_supplicant(24097): define REALTEK_WIFI_VENDOR
01-04 10:15:53.382 I/wpa_supplicant(24097): Successfully initialized wpa_supplicant
01-04 10:15:53.383 E/wpa_supplicant(24097): nl80211: Could not add multicast membership for scan events: -2 (No such file or directory)
01-04 10:15:53.384 E/wpa_supplicant(24097): Failed to initialize driver 'nl80211'
01-04 10:15:53.384 E/wpa_supplicant(24097): wlan0: Unsupported driver 'nl80211'

加载nl80211驱动

insmod cfg80211.ko

再次运行wpa_supplicant

01-04 10:41:52.482 I/wpa_supplicant( 8735): wpa_supplicant v2.0-devel-4.4.2_rtw_r11967.20140818
01-04 10:41:52.482 I/wpa_supplicant( 8735): define REALTEK_WIFI_VENDOR
01-04 10:41:52.482 I/wpa_supplicant( 8735): Successfully initialized wpa_supplicant
01-04 10:41:52.483 I/wpa_supplicant( 8735): rfkill: Cannot open RFKILL control device
01-04 10:41:52.484 I/wpa_supplicant( 8735): nl80211: no Using driver-based off-channel TX
01-04 10:41:52.484 I/wpa_supplicant( 8735): nl80211: Driver does not support authentication/association or connect commands
01-04 10:41:52.485 E/wpa_supplicant( 8735): Could not read interface wlan0 flags: No such device
01-04 10:41:52.485 E/wpa_supplicant( 8735): wlan0: Failed to initialize driver interface

卸载cfg80211,加载cfg80211_ath6k.ko

rmmod cfg80211.ko
insmod cfg80211_ath6k.ko

再次运行wpa_supplicant

01-04 11:01:18.379 I/wpa_supplicant(20943): wpa_supplicant v2.0-devel-4.4.2_rtw_r11967.20140818
01-04 11:01:18.379 I/wpa_supplicant(20943): define REALTEK_WIFI_VENDOR
01-04 11:01:18.379 I/wpa_supplicant(20943): Successfully initialized wpa_supplicant
01-04 11:01:18.381 I/wpa_supplicant(20943): rfkill: Cannot open RFKILL control device
01-04 11:01:18.382 E/wpa_supplicant(20943): Could not read interface wlan0 flags: No such device
01-04 11:01:18.382 E/wpa_supplicant(20943): wlan0: Failed to initialize driver interface

卸载cfg80211_ath6k,加载cfg80211.ko, 加载mt7601Usta.ko 和mtprealloc7601Usta.ko

再次运行wpa_supplicant,日志变成如下:

[ 1090.760108] P2pGroupTabInit .
[ 1090.763316] P2pScanChannelDefault <=== count = 3, Channels are 1, 6,11 separately
[ 1090.771118] P2pCfgInit::
[ 1090.774005] ==>WaitForAsicReady MAC_CSR0=0x76010500
[ 1091.368258] RtmpOSFileOpen(): Error 2 opening /etc/Wireless/RT2870STA/MT7601USTA.dat
[ 1091.376213] Open file "/etc/Wireless/RT2870STA/MT7601USTA.dat" failed!
[ 1091.382820] 1. Phy Mode = 14
[ 1091.385734] ERROR!!! RTMPReadParametersHook failed, Status[=0x00000001]
[ 1091.449848] unlink cmd rsp urb
[ 1091.452948] Bulk In Failed. Status=-2, BIIdx=0x0, BIRIdx=0x0, actual_length= 0x0
[ 1091.470668] CMDTHREAD_RESET_BULK_IN: Cannot do bulk in because flags(0x1080042) on !
[ 1091.508630] !!! rt28xx init fail !!!

把system\etc\Wireless拷入system分区


[ 1836.325276] P2pGroupTabInit .  
[ 1836.328495] P2pScanChannelDefault <=== count = 3, Channels are 1, 6,11 separately   
[ 1836.336254] P2pCfgInit:: 
[ 1836.339136] ==>WaitForAsicReady MAC_CSR0=0x76010500
[ 1836.930672] cfg_mode=9
[ 1836.933079] cfg_mode=9
[ 1836.935471] wmode_band_equal(): Band Equal!
[ 1836.940983] Key1Str is Invalid key length(0) or Type(0)
[ 1836.946368] Key2Str is Invalid key length(0) or Type(0)
[ 1836.951785] Key3Str is Invalid key length(0) or Type(0)
[ 1836.957148] Key4Str is Invalid key length(0) or Type(0)
[ 1836.963118] ###### Force at HT20 (BW_20) mode !!! ########
[ 1836.975254] 1. Phy Mode = 14
[ 1836.978157] 2. Phy Mode = 14
[ 1836.981056] NVM is Efuse and its size =1d[1e0-1fc] 
[ 1836.994883] ERROR!!! MT7601 E2PROM: WRONG VERSION 0xb, should be 9
[ 1837.022029] 3. Phy Mode = 14
[ 1837.025016] AntCfgInit: primary/secondary ant 0/1
[ 1837.226029] ---> InitFrequencyCalibration
[ 1837.230157] InitFrequencyCalibrationMode:Unknow mode = 3
[ 1837.235492] InitFrequencyCalibration: frequency offset in the EEPROM = 110(0x6e)
[ 1837.242909] <--- InitFrequencyCalibration
[ 1837.246992] RTMPSetPhyMode: channel is out of range, use first channel=1 
[ 1837.259416] MCS Set = ff 00 00 00 01
[ 1837.273252] <==== STA : rt28xx_init, Status=0
[ 1837.280430] 80211> re-init bands...
[ 1837.283984] 80211> RFICType = 1
[ 1837.287221] NumOfChan ===> 14
[ 1837.290339] 80211> Number of channel = 0x44
[ 1837.294559] 80211> Number of rate = 12
[ 1837.298323] 80211> CurTxPower = 0 dBm
[ 1837.302019] 80211> TxStream = 1
[ 1837.306513] 0x1300 = 00064300
[ 1837.309567] RTMPDrvOpen(1):Check if PDMA is idle!
[ 1837.314650] RTMPDrvOpen(2):Check if PDMA is idle!
[ 1837.319693] <================ UP : RTMP_SEM_EVENT_UP(STA)
[ 1837.333962] 80211> CFG80211_OpsPmksaFlush ==>

wpa_supplicant启动成功

root@Hi3798MV100:/system/etc/Wireless/RT2870STA # ps | grep wpa
wifi 16267 1 3312 1564 8011d4cc 76ea27a8 S /system/bin/wpa_supplicant
root@Hi3798MV100:/system/etc/Wireless/RT2870STA # busybox ifconfig
eth0 Link encap:Ethernet HWaddr 0A:3C:66:8C:CC:55
inet addr:192.168.3.119 Bcast:192.168.3.255 Mask:255.255.255.0
inet6 addr: fe80::83c:66ff:fe8c:cc55/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15386 errors:0 dropped:0 overruns:0 frame:0
TX packets:16688 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8627820 (8.2 MiB) TX bytes:3036981 (2.8 MiB)
Interrupt:103
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:893 errors:0 dropped:0 overruns:0 frame:0
TX packets:893 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:138126 (134.8 KiB) TX bytes:138126 (134.8 KiB)
wlan0 Link encap:Ethernet HWaddr 0C:C6:55:90:A9:76
inet6 addr: fe80::ec6:55ff:fe90:a976/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:30145 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8691008 (8.2 MiB) TX bytes:0 (0.0 B)

此时启动热点,则加载驱动会失败

root@Hi3798MV100:/system/lib/modules # insmod mt7601Uap.ko
[ 780.052339] rtusb init rt2870 --->
[ 780.055798] Error: Driver 'rt2870' is already registered, aborting...
insmod: init_module 'mt7601Uap.ko' failed (Device or resource busy)
root@Hi3798MV100:/system/lib/modules # lsmod
mt7601Usta 1746566 1 - Live 0x00000000 (O)
cfg80211 368396 1 mt7601Usta, Live 0x00000000 (O)
mtprealloc 1766 1 mt7601Usta, Live 0x00000000 (PO)
create 968 0 - Live 0x00000000 (O)
tntfs 542784 0 - Live 0x00000000 (PO)
bt_usb 15802 0 - Live 0x00000000 (O)
xhci_hcd 99472 0 - Live 0x00000000
ohci_hcd 20490 0 - Live 0x00000000
ehci_hcd 47214 0 - Live 0x00000000

需要重启系统,就可以打开热点了(基本是只要ifconfig 有wlan0就OK了),日志大概如下:

行 755: 01-04 15:58:53.205 D/WifiHW ( 1456): uevent path:/sys/bus/usb/devices/./uevent
行 757: 01-04 15:58:53.205 D/WifiHW ( 1456): uevent path:/sys/bus/usb/devices/../uevent
行 759: 01-04 15:58:53.205 D/WifiHW ( 1456): uevent path:/sys/bus/usb/devices/1-2/uevent
行 761: 01-04 15:58:53.205 D/WifiHW ( 1456): pid:vid : 148f:7601
行 777: 01-04 15:58:53.350 D/WifiHW ( 1456): uevent path:/sys/bus/usb/devices/./uevent
行 779: 01-04 15:58:53.350 D/WifiHW ( 1456): uevent path:/sys/bus/usb/devices/../uevent
行 781: 01-04 15:58:53.350 D/WifiHW ( 1456): uevent path:/sys/bus/usb/devices/1-2/uevent
行 783: 01-04 15:58:53.350 D/WifiHW ( 1456): pid:vid : 148f:7601
行 785: 01-04 15:58:53.351 D/SoftapController( 1456): SoftAP started successfully
行 987: 01-04 15:58:54.209 W/Netd ( 1456): No subsystem found in netlink event
行 1003: 01-04 15:58:54.213 D/DHCP ( 1456): ifc_init_returning 0
行 1005: 01-04 15:58:54.214 D/DHCP ( 1456): ifc_close
行 1007: 01-04 15:58:54.223 D/CommandListener( 1456): Setting iface cfg
行 1009: 01-04 15:58:54.223 D/DHCP ( 1456): ifc_init_returning 0
行 1011: 01-04 15:58:54.223 D/DHCP ( 1456): ifc_set_addr(wlan0, xx) = 0
行 1013: 01-04 15:58:54.223 D/CommandListener( 1456): Trying to bring up wlan0
行 1015: 01-04 15:58:54.223 D/DHCP ( 1456): ifc_up(wlan0) = 0
行 1017: 01-04 15:58:54.223 W/Netd ( 1456): No subsystem found in netlink event
行 1019: 01-04 15:58:54.223 D/DHCP ( 1456): ifc_close
行 1021: 01-04 15:58:54.223 W/Netd ( 1456): No subsystem found in netlink event
行 1023: 01-04 15:58:54.223 W/Netd ( 1456): No subsystem found in netlink event
行 1025: 01-04 15:58:54.224 W/Netd ( 1456): No subsystem found in netlink event
行 1031: 01-04 15:58:54.229 D/TetherController( 1456): tetherInterface(wlan0)
行 1039: 01-04 15:58:54.244 D/CommandListener( 1456): property_get(pppoe.result), value:0, ret:1
行 1041: 01-04 15:58:54.244 D/CommandListener( 1456): setNetShare eth0
行 1043: 01-04 15:58:54.244 D/TetherController( 1456): setNetShare ifname:eth0, gw:192.168.43.0/24
行 1049: 01-04 15:58:54.272 D/TetherController( 1456): Setting IP forward enable = 1
行 1051: 01-04 15:58:54.492 D/TetherController( 1456): Starting tethering services
行 1053: 01-04 15:58:54.492 D/TetherController( 1456): Sending update msg to dnsmasq [update_ifaces:wlan0]
行 1055: 01-04 15:58:54.492 D/TetherController( 1456): Tethering services running
行 1061: 01-04 15:58:54.498 D/TetherController( 1456): setDnsForwarders(0 = '8.8.8.8')
行 1063: 01-04 15:58:54.498 D/TetherController( 1456): setDnsForwarders(1 = '8.8.4.4')
行 1065: 01-04 15:58:54.498 D/TetherController( 1456): Sending update msg to dnsmasq [update_dns:8.8.8.8:8.8.4.4]
行 1077: 01-04 15:58:54.503 D/TetherController( 1456): setDnsForwarders(0 = '8.8.8.8')
行 1079: 01-04 15:58:54.503 D/TetherController( 1456): setDnsForwarders(1 = '8.8.4.4')
行 1081: 01-04 15:58:54.503 D/TetherController( 1456): Sending update msg to dnsmasq [update_dns:8.8.8.8:8.8.4.4]
行 1117: 01-04 15:58:54.509 V/NatController( 1456): enableNat(intIface=<wlan0>, extIface=<eth0>)
行 1119: 01-04 15:58:54.519 W/Netd ( 1456): No subsystem found in netlink event
行 1121: 01-04 15:58:54.529 W/Netd ( 1456): No subsystem found in netlink event
行 1123: 01-04 15:58:54.534 V/NatController( 1456): runCmd(/system/bin/ip route flush cache) res=0
行 1125: 01-04 15:58:54.539 V/NatController( 1456): runCmd(/system/bin/iptables -t nat -A natctrl_nat_POSTROUTING -o eth0 -j MASQUERADE) res=0
行 1127: 01-04 15:58:54.545 V/NatController( 1456): runCmd(/system/bin/iptables -A natctrl_FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -g natctrl_tether_counters) res=0
行 1129: 01-04 15:58:54.550 V/NatController( 1456): runCmd(/system/bin/iptables -A natctrl_FORWARD -i wlan0 -o eth0 -m state --state INVALID -j DROP) res=0
行 1131: 01-04 15:58:54.555 V/NatController( 1456): runCmd(/system/bin/iptables -A natctrl_FORWARD -i wlan0 -o eth0 -g natctrl_tether_counters) res=0
行 1133: 01-04 15:58:54.560 V/NatController( 1456): runCmd(/system/bin/iptables -A natctrl_tether_counters -i wlan0 -o eth0 -m quota2 --name wlan0_eth0 --grow -j RETURN) res=0
行 1135: 01-04 15:58:54.566 V/NatController( 1456): runCmd(/system/bin/iptables -A natctrl_tether_counters -i eth0 -o wlan0 -m quota2 --name eth0_wlan0 --grow -j RETURN) res=0
行 1137: 01-04 15:58:54.571 V/NatController( 1456): runCmd(/system/bin/iptables -D natctrl_FORWARD -j DROP) res=1
行 1139: 01-04 15:58:54.576 V/NatController( 1456): runCmd(/system/bin/iptables -A natctrl_FORWARD -j DROP) res=0
行 1141: 01-04 15:58:54.591 D/CommandListener( 1456): property_get(pppoe.result), value:0, ret:1
行 1143: 01-04 15:58:54.591 D/CommandListener( 1456): setNetShare eth0
行 1145: 01-04 15:58:54.591 D/TetherController( 1456): setNetShare ifname:eth0, gw:192.168.43.0/24
行 1149: 01-04 15:58:54.616 D/TetherController( 1456): Setting IP forward enable = 1

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值