hostapd挂载不上驱动bcmdhd.ko以及SDIO读写错误
报错一:在配置AP模式的时候,出现挂载不上bcmdhd.ko的情况,并且是有规律的一次可以,一次不可以
hostapd的执行脚本如下:
1 #!/bin/sh 2 3 dir=`dirname $0` 4 cd $dir 5 modprobe ahci.ko 6 modprobe bcmdhd.ko 7 sleep 3 8 9 ifconfig wlan0 up 10 ifconfig wlan0 192.168.1.2 11 udhcpd /etc/udhcpd.conf 12 hostapd /etc/hostapd_5G.conf -B 13 sleep 3 14 #udhcpc -i wlan0&
即:modprobe bcmhdh.ko
报错:
解决:
将ifconfig配置移到hostapd配置之后执行
如下:
#!/bin/sh dir=`dirname $0` cd $dir modprobe ahci.ko modprobe bcmdhd.ko #sleep 3 #ifconfig wlan0 up #ifconfig wlan0 192.168.1.2 hostapd /etc/hostapd_5G.conf -B #sleep 3 ifconfig wlan0 192.168.1.2 udhcpd /etc/udhcpd.conf #udhcpc -i wlan0&
这样每次启动后都可以加载上驱动,具体什么原因还不清楚,有待考证。
二、wifi驱动加载正常,但是执行hostapd配置启动网卡和wifi时,出现SDIO相关的读写错误
在刚开机一段时间不会报错,运行一段时间后报错。猜测是和硬件设置相关的错误
执行./start_hostapd.sh,打印信息如下:
1 ~/wifi # ./start_hostapd.sh 2 Configuration file: /etc/hostapd_5G_1.conf 3 Could not set interface wlan0 flags (UP): Operation not permitted 4 nl80211: Could not set interface 'wlan0' UP 5 nl80211: deinit ifname=wlan0 disabled_11b_rates=0 6 nl80211 driver initialization failed. 7 wlan0: interface state UNINITIALIZED->DISABLED 8 wlan0: AP-DISABLED 9 wlan0: CTRL-EVENT-TERMINATING 10 hostapd_free_hapd_data: Interface wlan0 wasn't started
查看报错信息:
1 brd: module loaded 2 loop: module loaded 3 hisi-sfc hisi_spi_nor.0: SPI Nor ID Table Version 1.2 4 hisi-sfc hisi_spi_nor.0: unrecognized Manufacturer ID 5 hisi-sfc hisi_spi_nor.0: spi nor register fail! 6 hisi-sfc: probe of hisi_spi_nor.0 failed with error -2 7 SPI Nand ID Table Version 2.7 8 Cannot found a valid SPI Nand Device 9 hisi_spi_nand_probe(175): Error: driver probe, result: -19 10 libphy: hisi_gemac_mii_bus: probed 11 libphy: Fixed MDIO Bus: probed 12 hi_gmac_v200 101c0000.ethernet: invalid resource 13 hi_gmac_v200 101c0000.ethernet (unnamed net_device) (uninitialized): using random MAC address 7e:fa:d6:57:5e:e9 14 attached PHY 1 to driver Generic PHY, PHY_ID=0x1cc916 15 Higmac dma_sg_phy: 0x0000000063c80000 16 ETH: rgmii, phy_addr=1 17 hi_gmac_v200 101e0000.ethernet: invalid resource 18 hi_gmac_v200 101e0000.ethernet (unnamed net_device) (uninitialized): using random MAC address d2:e5:99:76:cb:5f 19 xhci-hcd 12300000.xhci_0: xHCI Host Controller 20 xhci-hcd 12300000.xhci_0: new USB bus registered, assigned bus number 1 21 xhci-hcd 12300000.xhci_0: hcc params 0x0220fe6d hci version 0x110 quirks 0x00010010 22 xhci-hcd 12300000.xhci_0: irq 48, io mem 0x12300000 23 hub 1-0:1.0: USB hub found 24 hub 1-0:1.0: 1 port detected 25 xhci-hcd 12300000.xhci_0: xHCI Host Controller 26 xhci-hcd 12300000.xhci_0: new USB bus registered, assigned bus number 2 27 usb usb2: We don't know the algorithms for LPM for this host, disabling LPM. 28 hub 2-0:1.0: USB hub found 29 hub 2-0:1.0: 1 port detected 30 xhci-hcd 12310000.xhci_1: xHCI Host Controller 31 xhci-hcd 12310000.xhci_1: new USB bus registered, assigned bus number 3 32 xhci-hcd 12310000.xhci_1: hcc params 0x0220fe6d hci version 0x110 quirks 0x00010010 33 xhci-hcd 12310000.xhci_1: irq 49, io mem 0x12310000 34 hub 3-0:1.0: USB hub found 35 hub 3-0:1.0: 1 port detected 36 xhci-hcd 12310000.xhci_1: xHCI Host Controller 37 xhci-hcd 12310000.xhci_1: new USB bus registered, assigned bus number 4 38 usb usb4: We don't know the algorithms for LPM for this host, disabling LPM. 39 hub 4-0:1.0: USB hub found 40 hub 4-0:1.0: 1 port detected 41 usbcore: registered new interface driver usb-storage 42 mousedev: PS/2 mouse device common for all mice 43 i2c /dev entries driver 44 hibvt-i2c 12110000.i2c: hibvt-i2c0@100000hz registered 45 hibvt-i2c 12111000.i2c: hibvt-i2c1@100000hz registered 46 hibvt-i2c 12112000.i2c: hibvt-i2c2@100000hz registered 47 hibvt-i2c 12113000.i2c: hibvt-i2c3@100000hz registered 48 hibvt-i2c 12114000.i2c: hibvt-i2c4@100000hz registered 49 hibvt-i2c 12115000.i2c: hibvt-i2c5@100000hz registered 50 hibvt-i2c 12116000.i2c: hibvt-i2c6@100000hz registered 51 hibvt-i2c 12117000.i2c: hibvt-i2c7@100000hz registered 52 hibvt-i2c 12118000.i2c: hibvt-i2c8@100000hz registered 53 hibvt-i2c 12119000.i2c: hibvt-i2c9@100000hz registered 54 hibvt-i2c 1211a000.i2c: hibvt-i2c10@100000hz registered 55 hibvt-i2c 1211b000.i2c: hibvt-i2c11@100000hz registered 56 usbcore: registered new interface driver uvcvideo 57 USB Video Class driver (1.1.1) 58 sdhci: Secure Digital Host Controller Interface driver 59 sdhci: Copyright(c) Pierre Ossman 60 sdhci-pltfm: SDHCI platform and OF driver helper 61 mmc0: SDHCI controller on 100f0000.eMMC [100f0000.eMMC] using ADMA 64-bit in legacy mode 62 mmc1: SDHCI controller on 10100000.SD [10100000.SD] using ADMA 64-bit in legacy mode 63 mmc2: SDHCI controller on 10120000.SDIO [10120000.SDIO] using ADMA 64-bit in legacy mode 64 usbcore: registered new interface driver usbhid 65 usbhid: USB HID core driver 66 NET: Registered protocol family 10 67 NET: Registered protocol family 17 68 lib80211: common routines for IEEE802.11 drivers 69 mmc0: CMDQ supported: depth: 32 70 mmc0: new HS400 Enhanced strobe MMC card at address 0001 71 mmc0: -524: cmdq: unable to set-up 72 lib80211_crypt: registered algorithm 'NULL' 73 lib80211_crypt: registered algorithm 'WEP' 74 lib80211_crypt: registered algorithm 'CCMP' 75 lib80211_crypt: registered algorithm 'TKIP' 76 mmcblk0: mmc0:0001 SLD32G 28.9 GiB 77 hctosys: unable to open rtc device (rtc0) 78 clk: Not disabling unused clocks 79 mmcblk0boot0: mmc0:0001 SLD32G partition 1 4.00 MiB 80 mmcblk0boot1: mmc0:0001 SLD32G partition 2 4.00 MiB 81 mmcblk0rpmb: mmc0:0001 SLD32G partition 3 4.00 MiB 82 mmcblk0: p1(u-boot-squre.bin) p2(uImage_hi3559av100_multi-core) p3(rootfs_hi3559av100_27000M.ext4) 83 EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null) 84 VFS: Mounted root (ext4 filesystem) on device 179:3. 85 Freeing unused kernel memory: 320K (ffffffc004860000 - ffffffc0048b0000) 86 mmc2: queuing unknown CIS tuple 0x80 (2 bytes) 87 mmc2: queuing unknown CIS tuple 0x80 (3 bytes) 88 mmc2: queuing unknown CIS tuple 0x80 (3 bytes) 89 mmc2: queuing unknown CIS tuple 0x80 (7 bytes) 90 mmc2: queuing unknown CIS tuple 0x81 (9 bytes) 91 random: fast init done 92 mmc2: tuning done! candidates 0xF80FFFFF: 93 valid phase shift [27, 19] Final Phase:7 94 mmc2: new ultra high speed SDR104 SDIO card at address 0001 95 IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready 96 sys_config: loading out-of-tree module taints kernel. 97 Module himedia: init ok 98 Hisilicon Media Memory Zone Manager 99 hi_osal 1.0 init success! 100 hi3559av100_base: module license 'Proprietary' taints kernel. 101 Disabling lock debugging due to kernel taint 102 load sys.ko for Hi3559AV100...OK! 103 load tde.ko for Hi3559AV100...OK! 104 load region.ko for Hi3559AV100...OK! 105 load gdc.ko for Hi3559AV100...OK! 106 load vgs.ko for Hi3559AV100...OK! 107 load dis.ko for Hi3559AV100...OK! 108 load vi.ko for Hi3559AV100...OK ! 109 ISP Mod init! 110 load vpss.ko for Hi3559AV100...OK! 111 load avs.ko for Hi3559AV100...OK! 112 load vo.ko for Hi3559AV100...OK! 113 load hifb.ko OK! 114 load chnl.ko for Hi3559AV100...OK! 115 load vedu.ko for Hi3559AV100...OK! 116 load rc.ko for Hi3559AV100...OK! 117 load venc.ko for Hi3559AV100...OK! 118 load h264e.ko for Hi3559AV100...OK! 119 load h265e.ko for Hi3559AV100...OK! 120 load jpege.ko for Hi3559AV100...OK! 121 load jpegd.ko ....OK! 122 load hi_vfmw.ko ....OK 123 load vdec.ko ....OK 124 load ive.ko for Hi3559AV100...OK! 125 126 127 ipcm detecting thread running! 128 129 ##message recv thread run 130 load nnie.ko for Hi3559AV100...OK! 131 load dsp.ko for Hi3559AV100...OK! 132 133 load dpu_rect.ko for Hi3559AV100...OK! 134 load dpu_match.ko for Hi3559AV100...OK! 135 load hi_piris.ko OK!! 136 Load sensor_spi.ko for Hi3559AV100...OK ! 137 load hi_mipi driver successful! 138 load mipi_tx driver successful! 139 hi_gmac_v200 101c0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx 140 IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready 141 libata version 3.00 loaded. 142 dhd_module_init: in Dongle Host Driver, version 1.579.77.41.9 (r) 143 ======== dhd_wlan_init_plat_data ======== 144 dhd_wlan_init_gpio: WL_REG_ON=50, WL_HOST_WAKE=0 145 dhd_wlan_init_gpio: oob_irq=101, oob_irq_flags=0x414 146 dhd_wifi_platform_load: Enter 147 Power-up adapter 'DHD generic adapter' 148 wifi_platform_set_power = 1 149 ======== PULL WL_REG_ON(50) HIGH! ======== 150 wifi_platform_bus_enumerate device present 1 151 ======== Card detection to detect SDIO card! ======== 152 bcmsdh_register: register client driver 153 bcmsdh_sdmmc_probe: Enter num=1 154 bcmsdh_sdmmc_probe: Enter num=2 155 bus num (host idx)=2, slot num (rca)=1 156 found adapter info 'DHD generic adapter' 157 sdioh_attach: set sd_f2_blocksize 256 158 sdioh_attach: sd clock rate = 0 159 dhdsdio_probe : no mutex held. set lock 160 F1 signature read @0x18000000=0x15264345 161 F1 signature OK, socitype:0x1 chip:0x4345 rev:0x6 pkg:0x2 162 DHD: dongle ram size is set to 819200(orig 819200) at 0x198000 163 dhd_conf_set_chiprev: chip=0x4345, chiprev=6 164 CFG80211-ERROR) wl_setup_wiphy : 165 Registering Vendor80211 166 CFG80211-ERROR) wl_init_prof : 167 wl_init_prof: No profile 168 wl_escan_attach: Enter 169 wl_escan_init: Enter 170 wl_create_event_handler(): thread:wl_escan_handler:628 started 171 tsk Enter, tsk = 0xffffffc01f1b0180 172 dhd_attach(): thread:dhd_watchdog_thread:629 started 173 dhd_attach(): thread:dhd_dpc:62a started 174 dhd_attach(): thread:dhd_rxf:62b started 175 dhd_deferred_work_init: work queue initialized 176 dhd_bus_set_default_min_res_mask: Unhandled chip id 177 sdioh_cis_read: func_cis_ptr[0]=0x10ac 178 Dongle Host Driver, version 1.579.77.41.9 (r) 179 wl_ext_iapsta_attach_netdev: bssidx=0 180 Register interface [wlan0] MAC: cc:b8:a8:68:3a:c4 181 182 dhd_wl_ioctl: returning as busstate=0 183 dhd_bus_devreset: == Power OFF == 184 bcmsdh_oob_intr_unregister: Enter 185 bcmsdh_oob_intr_unregister: irq is not registered 186 dhd_txglom_enable: enable 0 187 dhd_conf_set_txglom_params: txglom_mode=multi-desc 188 dhd_conf_set_txglom_params: txglomsize=0, deferred_tx_len=0 189 dhd_conf_set_txglom_params: tx_in_rx=1, txinrx_thres=-1, dhd_txminmax=1 190 dhd_conf_set_txglom_params: tx_max_offset=0, txctl_tmo_fix=300 191 dhd_bus_devreset: WLAN OFF DONE 192 wifi_platform_set_power = 0 193 ======== PULL WL_REG_ON(50) LOW! ======== 194 dhdsdio_probe : the lock is released. 195 dhd_module_init: Exit err=0 196 dhd_open: Enter ffffffc021b7e000 197 dhd_open : no mutex held. set lock 198 199 Dongle Host Driver, version 1.579.77.41.9 (r) 200 wl_ext_iapsta_attach_netdev: bssidx=0 201 wl_android_wifi_on in 1 202 wl_android_wifi_on in 2: g_wifi_on=0 203 wifi_platform_set_power = 1 204 ======== PULL WL_REG_ON(50) HIGH! ======== 205 mmc2: queuing unknown CIS tuple 0x80 (2 bytes) 206 mmc2: queuing unknown CIS tuple 0x80 (3 bytes) 207 mmc2: queuing unknown CIS tuple 0x80 (3 bytes) 208 mmc2: queuing unknown CIS tuple 0x80 (7 bytes) 209 mmc2: queuing unknown CIS tuple 0x81 (9 bytes) 210 mmc2: tuning done! candidates 0xF80FFFFF: 211 valid phase shift [27, 19] Final Phase:7 212 sdioh_start: set sd_f2_blocksize 256 213 214 215 dhd_bus_devreset: == WLAN ON == 216 F1 signature read @0x18000000=0x15264345 217 F1 signature OK, socitype:0x1 chip:0x4345 rev:0x6 pkg:0x2 218 DHD: dongle ram size is set to 819200(orig 819200) at 0x198000 219 dhd_bus_set_default_min_res_mask: Unhandled chip id 220 dhd_conf_read_config: Ignore config file /system/etc/firmware/config.txt 221 Final fw_path=/system/etc/firmware/fw_bcm43455c0_ag_apsta.bin 222 Final nv_path=/system/etc/firmware/nvram_ap6255.txt 223 Final clm_path=/system/etc/firmware/clm.blob 224 Final conf_path=/system/etc/firmware/config.txt 225 dhd_os_open_image: /system/etc/firmware/fw_bcm43455c0_ag_apsta.bin (483181 bytes) open success 226 dhd_os_open_image: /system/etc/firmware/nvram_ap6255.txt (1644 bytes) open success 227 NVRAM version: AP6255_NVRAM_V1.0_29052015 228 dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded. 229 random: crng init done 230 bcmsdh_sdmmc: enable F2 failed:-62 231 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 232 bcmsdh_sdmmc: enable F2 failed:-62 233 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 234 bcmsdh_sdmmc: enable F2 failed:-62 235 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 236 dhd_bus_init: enable 0x06, ready 0x02 (waited 3006383us) 237 bcmsdh_oob_intr_register: HW_OOB irq=101 flags=0x4 238 bcmsdh_oob_intr_register: enable_irq_wake failed with -22 239 sdioh_buffer_tofrom_bus: TX FAILED ffffffc02162c020, addr=0x08000, pkt_len=160, ERR=-84 240 dhd_bcmsdh_send_buf: sdio error -1, abort command and terminate frame. 241 mmc2: tuning done! candidates 0xF80FFFFF: 242 valid phase shift [27, 19] Final Phase:7 243 dhdcdc_query_ioctl: dhdcdc_msg failed w/status -5 244 sdioh_buffer_tofrom_bus: TX FAILED ffffffc02162c020, addr=0x08000, pkt_len=64, ERR=-84 245 dhd_bcmsdh_send_buf: sdio error -1, abort command and terminate frame. 246 mmc2: tuning done! candidates 0xF80FFFFF: 247 valid phase shift [27, 19] Final Phase:7 248 dhdcdc_set_ioctl: dhdcdc_msg failed w/status -5 249 dhd_bus_devreset: == Power OFF == 250 bcmsdh_oob_intr_unregister: Enter 251 dhd_txglom_enable: enable 0 252 dhd_conf_set_txglom_params: txglom_mode=multi-desc 253 dhd_conf_set_txglom_params: txglomsize=0, deferred_tx_len=0 254 dhd_conf_set_txglom_params: tx_in_rx=1, txinrx_thres=-1, dhd_txminmax=1 255 dhd_conf_set_txglom_params: tx_max_offset=0, txctl_tmo_fix=300 256 dhd_bus_devreset: WLAN OFF DONE 257 dhdsdio_dpc: Bus down, ret 258 wifi_platform_set_power = 0 259 ======== PULL WL_REG_ON(50) LOW! ======== 260 wl_android_wifi_on: Failed 261 dhd_open : wl_android_wifi_on failed (-14) 262 dhd_stop: Enter ffffffc021b7e000 263 wl_android_wifi_off in 1 264 wl_android_wifi_off in 2: g_wifi_on=0, on_failure=1 265 dhd_wl_ioctl: returning as busstate=0 266 dhd_net_bus_devreset: dhd_bus_devreset: -35 267 sdioh_disable_func_intr: error for read SDIO_CCCR_IENx : 0xffffff92 268 wifi_platform_set_power = 0 269 ======== PULL WL_REG_ON(50) LOW! ======== 270 wl_android_wifi_off out 271 wl_ext_iapsta_dettach_netdev: Enter 272 dhd_stop: Exit 273 dhd_open : the lock is released. 274 dhd_open: Exit ret=-1 275 dhd_wl_ioctl: returning as busstate=0 276 CFG80211-ERROR) wl_bss_iovar_war : 277 wl_bss_iovar_war: GET revinfo FAILED. ret:-19 278 dhd_wl_ioctl: returning as busstate=0 279 CFG80211-ERROR) wl_customer6_legacy_chip_check : 280 wl_customer6_legacy_chip_check: GET revinfo FAILED. ret:-19 281 dhd_wl_ioctl: returning as busstate=0 282 CFG80211-ERROR) wl_cfg80211_add_del_bss : 283 'bss 3' failed with -19 284 CFG80211-ERROR) wl_cfg80211_change_virtual_iface : 285 AP-STA Downgrade failed 286 dhd_wl_ioctl: returning as busstate=0 287 CFG80211-ERROR) wl_bss_iovar_war : 288 wl_bss_iovar_war: GET revinfo FAILED. ret:-19 289 dhd_wl_ioctl: returning as busstate=0 290 CFG80211-ERROR) wl_customer6_legacy_chip_check : 291 wl_customer6_legacy_chip_check: GET revinfo FAILED. ret:-19 292 dhd_wl_ioctl: returning as busstate=0 293 CFG80211-ERROR) wl_cfg80211_add_del_bss : 294 'bss 3' failed with -19 295 CFG80211-ERROR) wl_cfg80211_change_virtual_iface : 296 AP-STA Downgrade failed 297 dhd_open: Enter ffffffc021b7e000 298 dhd_open : no mutex held. set lock 299 300 Dongle Host Driver, version 1.579.77.41.9 (r) 301 wl_ext_iapsta_attach_netdev: bssidx=0 302 wl_android_wifi_on in 1 303 wl_android_wifi_on in 2: g_wifi_on=0 304 wifi_platform_set_power = 1 305 ======== PULL WL_REG_ON(50) HIGH! ======== 306 mmc2: queuing unknown CIS tuple 0x80 (2 bytes) 307 mmc2: queuing unknown CIS tuple 0x80 (3 bytes) 308 mmc2: queuing unknown CIS tuple 0x80 (3 bytes) 309 mmc2: queuing unknown CIS tuple 0x80 (7 bytes) 310 mmc2: queuing unknown CIS tuple 0x81 (9 bytes) 311 mmc2: tuning done! candidates 0xF80FFFFF: 312 valid phase shift [27, 19] Final Phase:7 313 sdioh_start: set sd_f2_blocksize 256 314 315 316 dhd_bus_devreset: == WLAN ON == 317 F1 signature read @0x18000000=0x15264345 318 F1 signature OK, socitype:0x1 chip:0x4345 rev:0x6 pkg:0x2 319 DHD: dongle ram size is set to 819200(orig 819200) at 0x198000 320 dhd_bus_set_default_min_res_mask: Unhandled chip id 321 dhd_conf_read_config: Ignore config file /system/etc/firmware/config.txt 322 Final fw_path=/system/etc/firmware/fw_bcm43455c0_ag_apsta.bin 323 Final nv_path=/system/etc/firmware/nvram_ap6255.txt 324 Final clm_path=/system/etc/firmware/clm.blob 325 Final conf_path=/system/etc/firmware/config.txt 326 dhd_os_open_image: /system/etc/firmware/fw_bcm43455c0_ag_apsta.bin (483181 bytes) open success 327 sdioh_buffer_tofrom_bus: TX FAILED ffffffc0210ab000, addr=0x09000, pkt_len=2048, ERR=-84 328 dhdsdio_membytes: membytes transfer failed 329 mmc2: tuning done! candidates 0x0: 330 no valid phase shift! use default 0 331 bcmsdh_sdmmc: Failed to Write byte F1:@0x1000a=00, Err: -5 332 bcmsdh_sdmmc: Failed to Write byte F1:@0x1000a=00, Err: -5 333 bcmsdh_sdmmc: Failed to Write byte F1:@0x1000a=00, Err: -5 334 dhdsdio_membytes: FAILED to set window back to 0x18100000 335 dhdsdio_download_code_file: error -1 on writing 2048 membytes at 0x001f1000 336 _dhdsdio_download_firmware: dongle image file download failed 337 bcmsdh_sdmmc: Failed to Write byte F1:@0x1000e=00, Err: -5 338 bcmsdh_sdmmc: Failed to Write byte F1:@0x1000e=00, Err: -5 339 bcmsdh_sdmmc: Failed to Write byte F1:@0x1000e=00, Err: -5 340 dhdsdio_htclk: Failed access turning clock off: -35 341 dhd_bus_devreset Failed to download binary to the dongle 342 dhd_net_bus_devreset: dhd_bus_devreset: -35 343 dhd_wl_ioctl: returning as busstate=0 344 dhd_net_bus_devreset: dhd_bus_devreset: -35 345 sdioh_disable_func_intr: error for read SDIO_CCCR_IENx : 0xfffffffb 346 wifi_platform_set_power = 0 347 ======== PULL WL_REG_ON(50) LOW! ======== 348 wl_android_wifi_on: Failed 349 dhd_open : wl_android_wifi_on failed (-35) 350 dhd_stop: Enter ffffffc021b7e000 351 wl_android_wifi_off in 1 352 wl_android_wifi_off in 2: g_wifi_on=0, on_failure=1 353 dhd_wl_ioctl: returning as busstate=0 354 dhd_net_bus_devreset: dhd_bus_devreset: -35 355 sdioh_disable_func_intr: error for read SDIO_CCCR_IENx : 0xffffff92 356 wifi_platform_set_power = 0 357 ======== PULL WL_REG_ON(50) LOW! ======== 358 wl_android_wifi_off out 359 wl_ext_iapsta_dettach_netdev: Enter 360 dhd_stop: Exit 361 dhd_open : the lock is released. 362 dhd_open: Exit ret=-1 363 dhd_inetaddr_notifier_call: bus not ready, exit 364 dhd_open: Enter ffffffc021b7e000 365 dhd_open : no mutex held. set lock 366 367 Dongle Host Driver, version 1.579.77.41.9 (r) 368 wl_ext_iapsta_attach_netdev: bssidx=0 369 wl_android_wifi_on in 1 370 wl_android_wifi_on in 2: g_wifi_on=0 371 wifi_platform_set_power = 1 372 ======== PULL WL_REG_ON(50) HIGH! ======== 373 mmc2: queuing unknown CIS tuple 0x80 (2 bytes) 374 mmc2: queuing unknown CIS tuple 0x80 (3 bytes) 375 mmc2: queuing unknown CIS tuple 0x80 (3 bytes) 376 mmc2: queuing unknown CIS tuple 0x80 (7 bytes) 377 mmc2: queuing unknown CIS tuple 0x81 (9 bytes) 378 mmc2: tuning done! candidates 0xF80FFFFF: 379 valid phase shift [27, 19] Final Phase:7 380 sdioh_start: set sd_f2_blocksize 256 381 382 383 dhd_bus_devreset: == WLAN ON == 384 F1 signature read @0x18000000=0x15264345 385 F1 signature OK, socitype:0x1 chip:0x4345 rev:0x6 pkg:0x2 386 DHD: dongle ram size is set to 819200(orig 819200) at 0x198000 387 dhd_bus_set_default_min_res_mask: Unhandled chip id 388 dhd_conf_read_config: Ignore config file /system/etc/firmware/config.txt 389 Final fw_path=/system/etc/firmware/fw_bcm43455c0_ag_apsta.bin 390 Final nv_path=/system/etc/firmware/nvram_ap6255.txt 391 Final clm_path=/system/etc/firmware/clm.blob 392 Final conf_path=/system/etc/firmware/config.txt 393 dhd_os_open_image: /system/etc/firmware/fw_bcm43455c0_ag_apsta.bin (483181 bytes) open success 394 dhd_os_open_image: /system/etc/firmware/nvram_ap6255.txt (1644 bytes) open success 395 NVRAM version: AP6255_NVRAM_V1.0_29052015 396 dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded. 397 bcmsdh_sdmmc: enable F2 failed:-62 398 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 399 bcmsdh_sdmmc: enable F2 failed:-62 400 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 401 bcmsdh_sdmmc: enable F2 failed:-62 402 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 403 dhd_bus_init: enable 0x06, ready 0x02 (waited 3006383us) 404 bcmsdh_oob_intr_register: HW_OOB irq=101 flags=0x4 405 bcmsdh_oob_intr_register: enable_irq_wake failed with -22 406 sdioh_buffer_tofrom_bus: TX FAILED ffffffc02162c020, addr=0x08000, pkt_len=160, ERR=-84 407 dhd_bcmsdh_send_buf: sdio error -1, abort command and terminate frame. 408 mmc2: tuning done! candidates 0xF80FFFFF: 409 valid phase shift [27, 19] Final Phase:7 410 dhdcdc_query_ioctl: dhdcdc_msg failed w/status -5 411 dhd_check_hang: Event HANG send up due to re=0 te=0 e=-110 s=1 412 dhd_os_send_hang_message: Event HANG send up due to re=0 te=0 s=1 413 dhd_prot_ioctl : bus is down. we have nothing to do - bs: 1, has: 1 414 dhd_bus_devreset: == Power OFF == 415 dhdsdio_isr : bus is down. we have nothing to do 416 bcmsdh_oob_intr_unregister: Enter 417 dhd_txglom_enable: enable 0 418 dhd_conf_set_txglom_params: txglom_mode=multi-desc 419 dhd_conf_set_txglom_params: txglomsize=0, deferred_tx_len=0 420 dhd_conf_set_txglom_params: tx_in_rx=1, txinrx_thres=-1, dhd_txminmax=1 421 dhd_conf_set_txglom_params: tx_max_offset=0, txctl_tmo_fix=300 422 dhd_bus_devreset: WLAN OFF DONE 423 wifi_platform_set_power = 0 424 ======== PULL WL_REG_ON(50) LOW! ======== 425 wl_android_wifi_on: Failed 426 dhd_open : wl_android_wifi_on failed (-14) 427 dhd_stop: Enter ffffffc021b7e000 428 wl_android_wifi_off in 1 429 wl_android_wifi_off in 2: g_wifi_on=0, on_failure=1 430 dhd_wl_ioctl: returning as busstate=0 431 dhd_net_bus_devreset: dhd_bus_devreset: -35 432 sdioh_disable_func_intr: error for read SDIO_CCCR_IENx : 0xffffff92 433 wifi_platform_set_power = 0 434 ======== PULL WL_REG_ON(50) LOW! ======== 435 wl_android_wifi_off out 436 wl_ext_iapsta_dettach_netdev: Enter 437 dhd_stop: Exit 438 dhd_open : the lock is released. 439 dhd_open: Exit ret=-1 440 CFG80211-ERROR) wl_cfg80211_hang : 441 In : chip crash eventing, reason=0x8001 442 ------------[ cut here ]------------ 443 WARNING: CPU: 1 PID: 32 at net/wireless/sme.c:948 __cfg80211_disconnected+0x1b8/0x1e8 [cfg80211] 444 Modules linked in: bcmdhd cfg80211 ahci libahci libata hi_user(O) hi_mipi_tx(O) hi_mipi(O) hi3559av100_acodec(PO) hi3559av100_adec(PO) hi3559av100_aenc(PO) hi3559av100_ao(PO) hi3559av100_ai(PO) hi3559av100_aio(PO) hi3559av100_hdmi(PO) hi_sensor_spi(O) hi_sensor_i2c(O) hi_piris(O) hi_pwm(O) hi3559av100_dpu_match(PO) hi3559av100_dpu_rect(PO) hi3559av100_dsp(PO) hi3559av100_nnie(PO) hi_ipcm(O) hi3559av100_ive(PO) hi3559av100_vdec(PO) hi3559av100_vfmw(PO) hi3559av100_jpegd(PO) hi3559av100_jpege(PO) hi3559av100_h265e(PO) hi3559av100_h264e(PO) hi3559av100_venc(PO) hi3559av100_rc(PO) hi3559av100_vedu(PO) hi3559av100_chnl(PO) hifb(O) hi3559av100_vo(PO) hi3559av100_avs(PO) hi3559av100_vpss(PO) hi3559av100_isp(PO) hi3559av100_vi(PO) hi3559av100_dis(PO) hi3559av100_vgs(PO) hi3559av100_gdc(PO) hi3559av100_rgn(PO) 445 hi3559av100_tde(PO) hi3559av100_sys(PO) hi3559av100_base(PO) hi_osal(O) sys_config(O) 446 447 CPU: 1 PID: 32 Comm: kworker/u8:1 Tainted: P O 4.9.37 #9 448 Hardware name: Hisilicon HI3559AV100 DEMO Board (DT) 449 Workqueue: cfg80211 cfg80211_event_work [cfg80211] 450 task: ffffffc022523000 task.stack: ffffffc022648000 451 PC is at __cfg80211_disconnected+0x1b8/0x1e8 [cfg80211] 452 LR is at cfg80211_process_wdev_events+0x178/0x1a8 [cfg80211] 453 pc : [<ffffff800168cd90>] lr : [<ffffff8001669e70>] pstate: 80000005 454 sp : ffffffc02264bc50 455 x29: ffffffc02264bc50 x28: ffffffc022410ea8 456 x27: ffffff80016926cc x26: 0000000000000000 457 x25: 0000000000000000 x24: ffffff80088b7108 458 x23: ffffffc01f180000 x22: ffffffc0211a3800 459 x21: ffffffc01f1802a0 x20: ffffffc021b7e000 460 x19: ffffffc01f530ad0 x18: 0000000000000001 461 x17: 0000007fa5f86ac0 x16: 0000000000000000 462 x15: 0000000000002000 x14: 0000000000000001 463 x13: ffffff80088b7448 x12: 0000000000000000 464 x11: ffffff8008898000 x10: 00000000000007e0 465 x9 : ffffffc022648000 x8 : ffffffc022523840 466 x7 : 0000000b54e88be0 x6 : 0000000000000000 467 x5 : 0000000000000000 x4 : 0000000000000001 468 x3 : 0000000000000001 x2 : 0000000000000000 469 x1 : ffffffc01f530ad0 x0 : 0000000000000003 470 471 ---[ end trace a977d3aed83d3f39 ]--- 472 Call trace: 473 Exception stack(0xffffffc02264ba50 to 0xffffffc02264bb80) 474 ba40: ffffffc01f530ad0 0000007fffffffff 475 ba60: ffffffc02264bc50 ffffff800168cd90 0000000080000005 000000000000003d 476 ba80: 0000000000000000 0000000000000400 0000000000000200 0000000000000002 477 baa0: 0000000000000001 0000000000000000 ffffffc02264bac0 ffffff80080c8df4 478 bac0: ffffffc02264bb20 ffffff80080bf1c8 ffffffc023b85700 ffffffc020c16000 479 bae0: ffffffc02264bb30 ffffff80080bf444 ffffffc023b85700 ffffffc020c16000 480 bb00: ffffff80088b71a0 ffffffc023b98700 0000000000000080 0000000000040925 481 bb20: 0000000000000003 ffffffc01f530ad0 0000000000000000 0000000000000001 482 bb40: 0000000000000001 0000000000000000 0000000000000000 0000000b54e88be0 483 bb60: ffffffc022523840 ffffffc022648000 00000000000007e0 ffffff8008898000 484 [<ffffff800168cd90>] __cfg80211_disconnected+0x1b8/0x1e8 [cfg80211] 485 [<ffffff8001669e70>] cfg80211_process_wdev_events+0x178/0x1a8 [cfg80211] 486 [<ffffff8001669ed4>] cfg80211_process_rdev_events+0x34/0x78 [cfg80211] 487 [<ffffff8001665044>] cfg80211_event_work+0x1c/0x30 [cfg80211] 488 [<ffffff80080b1ae8>] process_one_work+0x1d0/0x390 489 [<ffffff80080b1cf0>] worker_thread+0x48/0x4b0 490 [<ffffff80080b7cbc>] kthread+0xe4/0xf8 491 [<ffffff8008082ee0>] ret_from_fork+0x10/0x30
关键信息:
1 NVRAM version: AP6255_NVRAM_V1.0_29052015 2 dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded. 3 random: crng init done 4 bcmsdh_sdmmc: enable F2 failed:-62 5 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 6 bcmsdh_sdmmc: enable F2 failed:-62 7 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 8 bcmsdh_sdmmc: enable F2 failed:-62 9 bcmsdh_sdmmc: Failed to Write byte F0:@0x00002=06, Err: -62 10 dhd_bus_init: enable 0x06, ready 0x02 (waited 3006383us) 11 bcmsdh_oob_intr_register: HW_OOB irq=101 flags=0x4 12 bcmsdh_oob_intr_register: enable_irq_wake failed with -22 13 sdioh_buffer_tofrom_bus: TX FAILED ffffffc02162c020, addr=0x08000, pkt_len=160, ERR=-84 14 dhd_bcmsdh_send_buf: sdio error -1, abort command and terminate frame. 15 mmc2: tuning done! candidates 0xF80FFFFF: 16 valid phase shift [27, 19] Final Phase:7 17 dhdcdc_query_ioctl: dhdcdc_msg failed w/status -5 18 sdioh_buffer_tofrom_bus: TX FAILED ffffffc02162c020, addr=0x08000, pkt_len=64, ERR=-84 19 dhd_bcmsdh_send_buf: sdio error -1, abort command and terminate frame. 20 mmc2: tuning done! candidates 0xF80FFFFF: 21 valid phase shift [27, 19] Final Phase:7 22 dhdcdc_set_ioctl: dhdcdc_msg failed w/status -5 23 dhd_bus_devreset: == Power OFF == 24 bcmsdh_oob_intr_unregister: Enter 25 dhd_txglom_enable: enable 0 26 dhd_conf_set_txglom_params: txglom_mode=multi-desc 27 dhd_conf_set_txglom_params: txglomsize=0, deferred_tx_len=0 28 dhd_conf_set_txglom_params: tx_in_rx=1, txinrx_thres=-1, dhd_txminmax=1 29 dhd_conf_set_txglom_params: tx_max_offset=0, txctl_tmo_fix=300 30 dhd_bus_devreset: WLAN OFF DONE 31 dhdsdio_dpc: Bus down, ret 32 wifi_platform_set_power = 0 33 ======== PULL WL_REG_ON(50) LOW! ======== 34 wl_android_wifi_on: Failed 35 dhd_open : wl_android_wifi_on failed (-14) 36 dhd_stop: Enter ffffffc021b7e000 37 wl_android_wifi_off in 1 38 wl_android_wifi_off in 2: g_wifi_on=0, on_failure=1 39 dhd_wl_ioctl: returning as busstate=0 40 dhd_net_bus_devreset: dhd_bus_devreset: -35 41 sdioh_disable_func_intr: error for read SDIO_CCCR_IENx : 0xffffff92 42 wifi_platform_set_power = 0 43 ======== PULL WL_REG_ON(50) LOW! ======== 44 wl_android_wifi_off out 45 wl_ext_iapsta_dettach_netdev: Enter 46 dhd_stop: Exit 47 dhd_open : the lock is released. 48 dhd_open: Exit ret=-1 49 dhd_wl_ioctl: returning as busstate=0 50 CFG80211-ERROR) wl_bss_iovar_war : 51 wl_bss_iovar_war: GET revinfo FAILED. ret:-19 52 dhd_wl_ioctl: returning as busstate=0 53 CFG80211-ERROR) wl_customer6_legacy_chip_check : 54 wl_customer6_legacy_chip_check: GET revinfo FAILED. ret:-19 55 dhd_wl_ioctl: returning as busstate=0 56 CFG80211-ERROR) wl_cfg80211_add_del_bss : 57 'bss 3' failed with -19 58 CFG80211-ERROR) wl_cfg80211_change_virtual_iface : 59 AP-STA Downgrade failed 60 dhd_wl_ioctl: returning as busstate=0 61 CFG80211-ERROR) wl_bss_iovar_war : 62 wl_bss_iovar_war: GET revinfo FAILED. ret:-19 63 dhd_wl_ioctl: returning as busstate=0 64 CFG80211-ERROR) wl_customer6_legacy_chip_check : 65 wl_customer6_legacy_chip_check: GET revinfo FAILED. ret:-19 66 dhd_wl_ioctl: returning as busstate=0 67 CFG80211-ERROR) wl_cfg80211_add_del_bss : 68 'bss 3' failed with -19 69 CFG80211-ERROR) wl_cfg80211_change_virtual_iface : 70 AP-STA Downgrade failed 71 dhd_open: Enter ffffffc021b7e000 72 dhd_open : no mutex held. set lock 73 74 Dongle Host Driver, version 1.579.77.41.9 (r)
可以看到:
17 dhdcdc_query_ioctl: dhdcdc_msg failed w/status -5
18 sdioh_buffer_tofrom_bus: TX FAILED ffffffc02162c020, addr=0x08000, pkt_len=64, ERR=-84
19 dhd_bcmsdh_send_buf: sdio error -1, abort command and terminate frame.
20 mmc2: tuning done! candidates 0xF80FFFFF:
SDIO读写错误导致固件传输失败。
SDIO相关的设置主要在设备树中,根据以下链接,定位到SDIO的时钟频率问题,将其设置为140M或120M,就正常。
mmc3: SDIO@0x10120000 { compatible = "hisi-sdhci"; reg = <0x10120000 0x1000>; interrupts = <0 76 4>; clocks = <&clock HI3559AV100_MMC3_CLK>; clock-names = "mmc_clk"; resets = <&clock 0x23c 27>, <&clock 0x23c 29>, <&clock 0x23c 30>; reset-names = "crg_reset", "dll_reset", "sampl_reset"; max-frequency = <120000000>; crg_regmap = <&clock>; misc_regmap = <&misc_ctrl>; iocfg_regmap = <&ioconfig>; bus-width = <4>; cap-mmc-highspeed; sd-uhs-sdr104; devid = <3>; status = "disabled"; };
但是之前一直用的198M的SDIO接wifi,也没有这个问题,重新编译内核之后就出现这个问题,应该是还有其他地方设置不对。
以后要用到Mesh组网,SDIO的时钟还是要设置为198M。还是有待解决。