[Miscellaneous Android Development] trekker99:
This is what I get when the phone boots up.

<4>[504, Thread-55] [ 27.145965] ## wifi_probe
<4>[504, Thread-55] [ 27.145965] wifi_set_power = 1
<3>[504, Thread-55] [ 27.508422] bcm_wifi_set_power: wifi power successed to pull up
<4>[504, Thread-55] [ 27.508453] dhd_enable_mmchost_polling: /sys/devices/platform/msm_sdcc.3/polling
<4>[504, Thread-55] [ 27.508544] set_polling : no need to enable polling for slot 3 (as host->pdev_id)
<4>[504, Thread-55] [ 27.520446]
<4>[504, Thread-55] [ 27.520446] Dongle Host Driver, version 4.218.248.6
<4>[20, kworker/u:1] [ 27.597106] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
<6>[20, kworker/u:1] [ 27.807128] mmc1: new SDIO card at address 0001
<4>[20, kworker/u:1] [ 27.808471]
<4>[20, kworker/u:1] [ 27.808471] bcmsdh_probe: new hardware use GPIO 18 as oob
<4>[20, kworker/u:1] [ 27.808624] alloc static buf at df440000!
<4>[20, kworker/u:1] [ 27.808807] dhd_common_init:fw_path = /data/misc/wifi/load/firmware.bin
<4>[20, kworker/u:1] [ 27.808807] dhd_common_init:nv_path = /data/misc/wifi/load/nvram.txt
<4>[20, kworker/u:1] [ 27.810119] DHD: dongle ram size is set to 294912(orig 294912)
<4>[20, kworker/u:1] [ 27.919799] dhd_preinit_ioctls: use MAC address in ram *REMOVED*
<4>[20, kworker/u:1] [ 27.920135] Firmware version = wl0: Feb 11 2011 17:00:41 version 4.218.248.23
<4>[20, kworker/u:1] [ 28.071472] Set btc_params 70 = 50
<4>[20, kworker/u:1] [ 28.075225] dhd_keep_alive_onoff result:41
<4>[20, kworker/u:1] [ 28.075775] eth0: Broadcom Dongle Host Driver mac=*REMOVED*
<4>[20, kworker/u:1] [ 28.075805] Enter wl_control_wl_start
<4>[20, kworker/u:1] [ 28.075805] Exited wl_control_wl_start
<4>[338, netd] [ 28.098388] current firmware_path[]=/system/vendor/firmware/fw_bcm4329.bin
<4>[338, netd] [ 28.098388] written as a string:/system/vendor/firmware/fw_bcm4329.bin
<4>[338, netd] [ 28.098419] GOT STA FIRMWARE
<4>[338, netd] [ 28.098419] SET firmware_path[]=/system/vendor/firmware/fw_bcm4329.bin , str_p:bf02df94

When the wifi is switched off,

<4>[1612, dhcpcd] [ 6934.683074] do_exit: exit code=9
<6>[1610, wpa_supplicant] [ 6934.697540] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
<4>[1610, wpa_supplicant] [ 6934.741180] do_exit: exit code=9
<4>[1608, logwrapper] [ 6934.741516] do_exit: exit code=9
<3>[1, init] [ 6934.741912] init: untracked pid 1610 exited
<4>[1802, Thread-435] [ 6934.952575] dhd_module_cleanup: Enter
<4>[1802, Thread-435] [ 6934.974395] ## wifi_remove
<4>[1802, Thread-435] [ 6934.974426] wifi_set_power = 0
<3>[1802, Thread-435] [ 6934.976562] bcm_wifi_set_power: wifi power successed to pull down
<4>[1802, Thread-435] [ 6934.976562] dhd_enable_mmchost_polling: /sys/devices/platform/msm_sdcc.3/polling
<4>[1802, Thread-435] [ 6934.976684] set_polling : no need to enable polling for slot 3 (as host->pdev_id)
<6>[1607, kworker/u:4] [ 6934.997100] mmc1: card 0001 removed
<4>[1802, Thread-435] [ 6936.281799] dhd_module_cleanup: Exited

If i do a "insmod dhd.ko"

<4>[2173, insmod] [ 7018.186981] ## wifi_probe
<4>[2173, insmod] [ 7018.187011] wifi_set_power = 1
<3>[2173, insmod] [ 7018.340667] bcm_wifi_set_power: wifi power successed to pull up
<4>[2173, insmod] [ 7018.340667] dhd_enable_mmchost_polling: /sys/devices/platform/msm_sdcc.3/polling
<4>[2173, insmod] [ 7018.340789] set_polling : no need to enable polling for slot 3 (as host->pdev_id)
<4>[2173, insmod] [ 7018.354064]
<4>[2173, insmod] [ 7018.354095] Dongle Host Driver, version 4.218.248.6
<4>[1194, kworker/u:3] [ 7018.407836] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
<6>[1194, kworker/u:3] [ 7018.508148] mmc1: new SDIO card at address 0001
<4>[1194, kworker/u:3] [ 7018.511505]
<4>[1194, kworker/u:3] [ 7018.511535] bcmsdh_probe: new hardware use GPIO 18 as oob
<4>[1194, kworker/u:3] [ 7018.511657] alloc static buf at df440000!
<4>[1194, kworker/u:3] [ 7018.511871] dhd_common_init:fw_path = /data/misc/wifi/load/firmware.bin
<4>[1194, kworker/u:3] [ 7018.511871] dhd_common_init:nv_path = /data/misc/wifi/load/nvram.txt
<4>[1194, kworker/u:3] [ 7018.513183] DHD: dongle ram size is set to 294912(orig 294912)
<4>[1194, kworker/u:3] [ 7018.513427] dhd_early_suspend: enter
<4>[1194, kworker/u:3] [ 7018.513427] dhd_early_suspend: >>>>>DHD_BUS_DOWN<<<<<
<4>[1194, kworker/u:3] [ 7018.513977] _dhdsdio_download_firmware: dongle image file download failed
<4>[1194, kworker/u:3] [ 7018.513977] dhd_bus_start: dhdsdio_probe_download failed. firmware = /data/misc/wifi/load/firmware.bin nvram = /data/misc/wifi/load/nvram.txt
<4>[1194, kworker/u:3] [ 7018.514007] dhdsdio_probe: failed
<4>[1194, kworker/u:3] [ 7018.514312] ------------[ cut here ]------------
<4>[1194, kworker/u:3] [ 7018.514343] WARNING: at /home/huangqiwu/shendu/jb/kernel/huawei/honor/kernel/irq/manage.c:510 irq_set_irq_wake+0xa4/0x124()
<4>[1194, kworker/u:3] [ 7018.514343] Unbalanced IRQ 146 wake disable
<4>[1194, kworker/u:3] [ 7018.514343] Modules linked in: dhd(+) [last unloaded: dhd]
<4>[1194, kworker/u:3] [ 7018.514373] [<c0049340>] (unwind_backtrace+0x0/0x11c) from [<c00cb740>] (warn_slowpath_common+0x4c/0x64)
<4>[1194, kworker/u:3] [ 7018.514404] [<c00cb740>] (warn_slowpath_common+0x4c/0x64) from [<c00cb7d8>] (warn_slowpath_fmt+0x2c/0x3c)
<4>[1194, kworker/u:3] [ 7018.514404] [<c00cb7d8>] (warn_slowpath_fmt+0x2c/0x3c) from [<c0103f88>] (irq_set_irq_wake+0xa4/0x124)
<4>[1194, kworker/u:3] [ 7018.514465] [<c0103f88>] (irq_set_irq_wake+0xa4/0x124) from [<bf020d14>] (bcmsdh_unregister_oob_intr+0x18/0x78 [dhd])
<4>[1194, kworker/u:3] [ 7018.514495] [<bf020d14>] (bcmsdh_unregister_oob_intr+0x18/0x78 [dhd]) from [<bf001b3c>] (dhd_bus_detach+0x50/0x74 [dhd])
<4>[1194, kworker/u:3] [ 7018.514526] [<bf001b3c>] (dhd_bus_detach+0x50/0x74 [dhd]) from [<bf001cc0>] (dhd_detach+0x160/0x1d8 [dhd])
<4>[1194, kworker/u:3] [ 7018.514556] [<bf001cc0>] (dhd_detach+0x160/0x1d8 [dhd]) from [<bf019418>] (dhd_bus_register+0x9c/0x154 [dhd])
<4>[1194, kworker/u:3] [ 7018.514617] [<bf019418>] (dhd_bus_register+0x9c/0x154 [dhd]) from [<bf019a1c>] (dhdsdio_probe+0x4e0/0x558 [dhd])
<4>[1194, kworker/u:3] [ 7018.514648] [<bf019a1c>] (dhdsdio_probe+0x4e0/0x558 [dhd]) from [<bf0211e4>] (bcmsdh_probe+0x1cc/0x240 [dhd])
<4>[1194, kworker/u:3] [ 7018.514678] [<bf0211e4>] (bcmsdh_probe+0x1cc/0x240 [dhd]) from [<c04381b4>] (sdio_bus_probe+0x88/0xec)
<4>[1194, kworker/u:3] [ 7018.514709] [<c04381b4>] (sdio_bus_probe+0x88/0xec) from [<c02dc894>] (driver_probe_device+0x144/0x28c)
<4>[1194, kworker/u:3] [ 7018.514709] [<c02dc894>] (driver_probe_device+0x144/0x28c) from [<c02db650>] (bus_for_each_drv+0x4c/0x84)
<4>[1194, kworker/u:3] [ 7018.514739] [<c02db650>] (bus_for_each_drv+0x4c/0x84) from [<c02dc6d4>] (device_attach+0x74/0xa0)
<4>[1194, kworker/u:3] [ 7018.514739] [<c02dc6d4>] (device_attach+0x74/0xa0) from [<c02dbec8>] (bus_probe_device+0x24/0x40)
<4>[1194, kworker/u:3] [ 7018.514770] [<c02dbec8>] (bus_probe_device+0x24/0x40) from [<c02da49c>] (device_add+0x3f8/0x574)
<4>[1194, kworker/u:3] [ 7018.514770] [<c02da49c>] (device_add+0x3f8/0x574) from [<c04383a4>] (sdio_add_func+0x34/0x4c)
<4>[1194, kworker/u:3] [ 7018.514801] [<c04383a4>] (sdio_add_func+0x34/0x4c) from [<c0437a00>] (mmc_attach_sdio+0x278/0x324)
<4>[1194, kworker/u:3] [ 7018.514801] [<c0437a00>] (mmc_attach_sdio+0x278/0x324) from [<c0431a80>] (mmc_rescan+0x294/0x390)
<4>[1194, kworker/u:3] [ 7018.514831] [<c0431a80>] (mmc_rescan+0x294/0x390) from [<c00dff98>] (process_one_work+0x1fc/0x354)
<4>[1194, kworker/u:3] [ 7018.514831] [<c00dff98>] (process_one_work+0x1fc/0x354) from [<c00e0ab0>] (worker_thread+0x1f4/0x370)
<4>[1194, kworker/u:3] [ 7018.514862] [<c00e0ab0>] (worker_thread+0x1f4/0x370) from [<c00e41d0>] (kthread+0x7c/0x84)
<4>[1194, kworker/u:3] [ 7018.514862] [<c00e41d0>] (kthread+0x7c/0x84) from [<c0044c58>] (kernel_thread_exit+0x0/0x8)
<4>[1194, kworker/u:3] [ 7018.514892] ---[ end trace 1201ea99aa51e015 ]---
<4>[1194, kworker/u:3] [ 7018.514892] ------------[ cut here ]------------
<4>[1194, kworker/u:3] [ 7018.514892] WARNING: at /home/huangqiwu/shendu/jb/kernel/huawei/honor/kernel/irq/manage.c:1183 __free_irq+0x98/0x1b8()
<4>[1194, kworker/u:3] [ 7018.514923] Trying to free already-free IRQ 146
<4>[1194, kworker/u:3] [ 7018.514923] Modules linked in: dhd(+) [last unloaded: dhd]
<4>[1194, kworker/u:3] [ 7018.514923] [<c0049340>] (unwind_backtrace+0x0/0x11c) from [<c00cb740>] (warn_slowpath_common+0x4c/0x64)
<4>[1194, kworker/u:3] [ 7018.514953] [<c00cb740>] (warn_slowpath_common+0x4c/0x64) from [<c00cb7d8>] (warn_slowpath_fmt+0x2c/0x3c)
<4>[1194, kworker/u:3] [ 7018.514953] [<c00cb7d8>] (warn_slowpath_fmt+0x2c/0x3c) from [<c010419c>] (__free_irq+0x98/0x1b8)
<4>[1194, kworker/u:3] [ 7018.514984] [<c010419c>] (__free_irq+0x98/0x1b8) from [<c0104310>] (free_irq+0x54/0x78)
<4>[1194, kworker/u:3] [ 7018.515014] [<c0104310>] (free_irq+0x54/0x78) from [<bf020d30>] (bcmsdh_unregister_oob_intr+0x34/0x78 [dhd])
<4>[1194, kworker/u:3] [ 7018.515045] [<bf020d30>] (bcmsdh_unregister_oob_intr+0x34/0x78 [dhd]) from [<bf001b3c>] (dhd_bus_detach+0x50/0x74 [dhd])
<4>[1194, kworker/u:3] [ 7018.515075] [<bf001b3c>] (dhd_bus_detach+0x50/0x74 [dhd]) from [<bf001cc0>] (dhd_detach+0x160/0x1d8 [dhd])
<4>[1194, kworker/u:3] [ 7018.515106] [<bf001cc0>] (dhd_detach+0x160/0x1d8 [dhd]) from [<bf019418>] (dhd_bus_register+0x9c/0x154 [dhd])
<4>[1194, kworker/u:3] [ 7018.515136] [<bf019418>] (dhd_bus_register+0x9c/0x154 [dhd]) from [<bf019a1c>] (dhdsdio_probe+0x4e0/0x558 [dhd])
<4>[1194, kworker/u:3] [ 7018.515197] [<bf019a1c>] (dhdsdio_probe+0x4e0/0x558 [dhd]) from [<bf0211e4>] (bcmsdh_probe+0x1cc/0x240 [dhd])
<4>[1194, kworker/u:3] [ 7018.515197] [<bf0211e4>] (bcmsdh_probe+0x1cc/0x240 [dhd]) from [<c04381b4>] (sdio_bus_probe+0x88/0xec)
<4>[1194, kworker/u:3] [ 7018.515228] [<c04381b4>] (sdio_bus_probe+0x88/0xec) from [<c02dc894>] (driver_probe_device+0x144/0x28c)
<4>[1194, kworker/u:3] [ 7018.515228] [<c02dc894>] (driver_probe_device+0x144/0x28c) from [<c02db650>] (bus_for_each_drv+0x4c/0x84)
<4>[1194, kworker/u:3] [ 7018.515258] [<c02db650>] (bus_for_each_drv+0x4c/0x84) from [<c02dc6d4>] (device_attach+0x74/0xa0)
<4>[1194, kworker/u:3] [ 7018.515258] [<c02dc6d4>] (device_attach+0x74/0xa0) from [<c02dbec8>] (bus_probe_device+0x24/0x40)
<4>[1194, kworker/u:3] [ 7018.515289] [<c02dbec8>] (bus_probe_device+0x24/0x40) from [<c02da49c>] (device_add+0x3f8/0x574)
<4>[1194, kworker/u:3] [ 7018.515289] [<c02da49c>] (device_add+0x3f8/0x574) from [<c04383a4>] (sdio_add_func+0x34/0x4c)
<4>[1194, kworker/u:3] [ 7018.515319] [<c04383a4>] (sdio_add_func+0x34/0x4c) from [<c0437a00>] (mmc_attach_sdio+0x278/0x324)
<4>[1194, kworker/u:3] [ 7018.515319] [<c0437a00>] (mmc_attach_sdio+0x278/0x324) from [<c0431a80>] (mmc_rescan+0x294/0x390)
<4>[1194, kworker/u:3] [ 7018.515350] [<c0431a80>] (mmc_rescan+0x294/0x390) from [<c00dff98>] (process_one_work+0x1fc/0x354)
<4>[1194, kworker/u:3] [ 7018.515350] [<c00dff98>] (process_one_work+0x1fc/0x354) from [<c00e0ab0>] (worker_thread+0x1f4/0x370)
<4>[1194, kworker/u:3] [ 7018.515380] [<c00e0ab0>] (worker_thread+0x1f4/0x370) from [<c00e41d0>] (kthread+0x7c/0x84)
<4>[1194, kworker/u:3] [ 7018.515380] [<c00e41d0>] (kthread+0x7c/0x84) from [<c0044c58>] (kernel_thread_exit+0x0/0x8)
<4>[1194, kworker/u:3] [ 7018.515380] ---[ end trace 1201ea99aa51e016 ]---
<4>[2179, sh] [ 7018.517639] do_exit: exit code=256

While doing this, I realised that I forgot to rename the firmware I copied to /data/misc/load to firmware.bin. So I did that and here is the result.

<4>[2365, insmod] [ 7111.483459] ## wifi_probe
<4>[2365, insmod] [ 7111.483459] wifi_set_power = 1
<3>[2365, insmod] [ 7111.779602] bcm_wifi_set_power: wifi power successed to pull up
<4>[2365, insmod] [ 7111.779602] dhd_enable_mmchost_polling: /sys/devices/platform/msm_sdcc.3/polling
<4>[2365, insmod] [ 7111.779724] set_polling : no need to enable polling for slot 3 (as host->pdev_id)
<4>[2365, insmod] [ 7111.795928]
<4>[2365, insmod] [ 7111.795928] Dongle Host Driver, version 4.218.248.6
<4>[28521, kworker/u:1] [ 7111.861694] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
<6>[28521, kworker/u:1] [ 7112.064453] mmc1: new SDIO card at address 0001
<4>[28521, kworker/u:1] [ 7112.065734]
<4>[28521, kworker/u:1] [ 7112.065734] bcmsdh_probe: new hardware use GPIO 18 as oob
<4>[28521, kworker/u:1] [ 7112.065887] alloc static buf at df440000!
<4>[28521, kworker/u:1] [ 7112.066070] dhd_common_init:fw_path = /data/misc/wifi/load/firmware.bin
<4>[28521, kworker/u:1] [ 7112.066070] dhd_common_init:nv_path = /data/misc/wifi/load/nvram.txt
<4>[28521, kworker/u:1] [ 7112.067291] DHD: dongle ram size is set to 294912(orig 294912)
<4>[28521, kworker/u:1] [ 7112.067565] dhd_early_suspend: enter
<4>[28521, kworker/u:1] [ 7112.067565] dhd_early_suspend: >>>>>DHD_BUS_DOWN<<<<<
<4>[28521, kworker/u:1] [ 7112.162872] dhd_preinit_ioctls: use MAC address in nvram *REMOVED*
<4>[28521, kworker/u:1] [ 7112.163208] Firmware version = wl0: Feb 11 2011 17:00:41 version 4.218.248.23
<4>[28521, kworker/u:1] [ 7112.311187] Set btc_params 70 = 50
<4>[28521, kworker/u:1] [ 7112.317779] dhd_keep_alive_onoff result:41
<4>[28521, kworker/u:1] [ 7112.321258] eth0: Broadcom Dongle Host Driver mac=*REMOVED*
<4>[28521, kworker/u:1] [ 7112.321319] Enter wl_control_wl_start
<4>[28521, kworker/u:1] [ 7112.321350] Exited wl_control_wl_start

It looks like the driver loaded correctly. The mac address was not the correct one (loaded from nvram.txt and not ram) and it looked like netd didn't kick in to load STA firmware. This means I can't do a survey/station scan and "switching on" the wifi in shendu fails.

I am still trying things here and there.