The wlan0 device is present on the hammerhead but cannot be brought up without firmware.
What's the best way to handle the firmware in this project? shoving the firmware in a device specific package or creating a linux-firmware package like debian.
# iw dev
phy#0
Interface wlan0
ifindex 21
type managed
Interface p2p0
ifindex 20
type managed
[ 225.011177] Dongle Host Driver, version 1.88.45 (r)^M
[ 225.011179] Compiled in drivers/net/wireless/bcmdhd on Jun 1 2017 at 19:34:52^M
[ 225.023786] wl_android_wifi_on in^M
[ 225.027053] wifi_set_power = 1^M
[ 225.180141] bcm_wifi_set_power: wifi power successed to pull up^M
[ 225.386147] =========== WLAN going back to live ========^M
[ 225.442482] _dhdsdio_download_firmware: dongle image file download failed^M
[ 225.448343] dhd_bus_start: dhdsdio_probe_download failed. firmware = /vendor/firmware/fw_bcmdhd.bin nvram = /etc/wifi/bcmdhd.cal^M
[ 225.459859] dhd_bus_devreset: dhd_bus_start fail with -1^M
[ 225.465099] dhd_dev_reset: dhd_bus_devreset: -1^M
[ 225.469694] dhd_open : wl_android_wifi_on failed (-1)^M
[ 225.474648] wl_android_wifi_off in^M
[ 225.478051] dhd_prot_ioctl : bus is down. we have nothing to do^M
[ 225.484031] wifi_set_power = 0^M
[ 225.587031] bcm_wifi_set_power: wifi power successed to pull down^M
[ 225.592147] =========== WLAN placed in RESET ========^M
There is a linux-firmware package in Alpine Linux. Does it have the driver already?
If not, I guess creating a linux-firmware-postmarketos package would be good (or more the Alpine way: one package per driver, depending on the driver size - keeping the packages as splitted as possible for minimal install size, they do that in lots of cases) There could theoretically be multiple devices, that use the same wifi chip, so it would be good not to keep it in the device specific package.
The file isn't in the linux-firmware package. It also seems to be using some android linux-firmware interface since I'm not getting any udev events for firmware requests.
Shouldn't the Wifi firmware be already present in all mainline kernels post 4.9? If they added hammerhead to mainline, surely they must have thought about getting support for Wifi going?
Correct me if I'm wrong but hammerhead is not added to mainline (and it probably isn't going to, unless we do it) and the kernel does not have "firmware", which is proprietary software to be able to communicate with devices - that'd be illegal
Hammerhead is added to the mainline.. however currently just initial board support is present (uart + sdcard support)
Yeah phoronix likes some hyperbole for news value, the nexus 5 mainline support is not complete yet.
Question is: What's better? utilise what's already theoretically working in the 3.4 kernel and maybe make use of the Android HAL (if the latter makes sense) or port all missing functions for 4.11+ and potentially even submit those changes to mainline?
@dzervas wrote:
the kernel does not have "firmware", which is proprietary software to be able to communicate with devices
@Alexandroid99 wrote:
What's better? utilise what's already theoretically working in the 3.4 kernel and maybe make use of the Android HAL (if the latter makes sense) or port all missing functions for 4.11+ and potentially even submit those changes to mainline?
To get security patches, we must get on mainline in the long run. I've written about that in detail in the introduction post.
With that being said, there isn't much, that is working with mainline right now (although @bhush9, who is the hero, that is working on mainlining hammerhead, just said in IRC that Wifi would be fairly easy for him to implement). The screen does not work yet, usb does not work yet (including charging?) etc.
Choose what you want to work on. If you have kernel developer skills (or want to learn it), go for mainline. If you want to improve the situation a bit, until we have mainline working and possibly work on higher layers of the stack, such as a packaging a mobile UI, work on the LineageOS kernel until it meets your high level needs - and the high level improvements will be useful even if we replace the kernel at some point with mainline.
I've added the broadcom firmware from the linux-firmware package (it's in there, just with another name) but I'm still getting (new) errors:
This is with:
bcm4329-fullmac-4.bin)[ 307.708469] =========== WLAN going back to live ========
[ 307.854332] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[ 316.888472] dhd_bus_init: enable 0x06, ready 0x02 (waited 3006383us)
[ 316.888739] dhd_bus_start failed bus is not ready
[ 316.888757] dhd_bus_devreset: dhd_bus_start fail with -19
[ 316.888763] dhd_dev_reset: dhd_bus_devreset: -19
[ 316.888802] dhd_open : wl_android_wifi_on failed (-19)
[ 316.888808] wl_android_wifi_off in
[ 316.888877] mmc0: Data CRC error
[ 316.888881] msmsdcc_data_err: opcode 0x00000035
[ 316.888886] msmsdcc_data_err: blksz 64, blocks 1
[ 316.889017] sps:BAM 0xf9884000 (va:0xf0378000) enabled: ver:0x6, number of pipes:6
[ 316.889859] sps:BAM 0xf9884000 (va:0xf0378000) enabled: ver:0x6, number of pipes:6
[ 316.891257] mmc0: Data CRC error
[ 316.891261] msmsdcc_data_err: opcode 0x00000035
[ 316.891265] msmsdcc_data_err: blksz 64, blocks 1
[ 316.893384] mmc0: Data CRC error
[ 316.893388] msmsdcc_data_err: opcode 0x00000035
[ 316.893393] msmsdcc_data_err: blksz 64, blocks 1
[ 316.895480] dhdcdc_set_ioctl: dhdcdc_msg failed w/status -5
[ 316.895685] wifi_set_power = 0
[ 316.995726] bcm_wifi_set_power: wifi power successed to pull down
[ 316.995731] =========== WLAN placed in RESET ========
With brcmfmac4329-sdio.bin instead:
[ 132.769148] =========== WLAN going back to live ========
[ 132.857039] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[ 141.919078] dhd_bus_init: enable 0x06, ready 0x02 (waited 3006383us)
[ 141.919446] dhd_bus_start failed bus is not ready
[ 141.919457] dhd_bus_devreset: dhd_bus_start fail with -19
[ 141.919463] dhd_dev_reset: dhd_bus_devreset: -19
[ 141.919511] dhd_open : wl_android_wifi_on failed (-19)
[ 141.919516] wl_android_wifi_off in
[ 141.919600] mmc0: Data CRC error
[ 141.919604] msmsdcc_data_err: opcode 0x00000035
[ 141.919609] msmsdcc_data_err: blksz 64, blocks 1
[ 141.919781] sps:BAM 0xf9884000 (va:0xf0378000) enabled: ver:0x6, number of pipes:6
[ 141.920799] sps:BAM 0xf9884000 (va:0xf0378000) enabled: ver:0x6, number of pipes:6
[ 141.922171] mmc0: Data CRC error
[ 141.922175] msmsdcc_data_err: opcode 0x00000035
[ 141.922179] msmsdcc_data_err: blksz 64, blocks 1
[ 141.924269] mmc0: Data CRC error
[ 141.924273] msmsdcc_data_err: opcode 0x00000035
[ 141.924278] msmsdcc_data_err: blksz 64, blocks 1
[ 141.928803] dhdcdc_set_ioctl: dhdcdc_msg failed w/status -5
[ 141.929095] wifi_set_power = 0
[ 142.105443] bcm_wifi_set_power: wifi power successed to pull down
[ 142.105454] =========== WLAN placed in RESET ========
When trying to start the interface:
$ ip link set wlan0 up
ip: ioctl 0x8914 failed: Operation not permitted
Sometimes the bus starts fine but the driver still doesn't work:
[ 304.418531] =========== WLAN going back to live ========
[ 304.474151] F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2
[ 304.474633] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[ 304.501448] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[ 313.568501] dhd_bus_init: enable 0x06, ready 0x02 (waited 3006383us)
[ 313.568760] wifi_get_mac_addr
[ 313.572906] bcm_wifi_get_mac_addr: READ MAC ADDRESS BC:F5:AC:FE:D1:7D
[ 313.572992] mmc0: Data CRC error
[ 313.572996] msmsdcc_data_err: opcode 0x00000035
[ 313.573001] msmsdcc_data_err: blksz 320, blocks 1
[ 313.575247] mmc0: Data CRC error
[ 313.575251] msmsdcc_data_err: opcode 0x00000035
[ 313.575255] msmsdcc_data_err: blksz 320, blocks 1
[ 313.577345] mmc0: Data CRC error
[ 313.577350] msmsdcc_data_err: opcode 0x00000035
[ 313.577354] msmsdcc_data_err: blksz 320, blocks 1
[ 313.579448] dhdcdc_set_ioctl: dhdcdc_msg failed w/status -5
[ 313.579455] dhd_preinit_ioctls: can't set MAC address , error=-5
[ 313.579461] dhd_open : wl_android_wifi_on failed (-14)
[ 313.579488] mmc0: Data CRC error
[ 313.579492] msmsdcc_data_err: opcode 0x00000035
[ 313.579497] msmsdcc_data_err: blksz 128, blocks 1
[ 313.581575] mmc0: Data CRC error
[ 313.581580] msmsdcc_data_err: opcode 0x00000035
[ 313.581584] msmsdcc_data_err: blksz 128, blocks 1
[ 313.583657] mmc0: Data CRC error
[ 313.583661] msmsdcc_data_err: opcode 0x00000035
[ 313.583665] msmsdcc_data_err: blksz 128, blocks 1
[ 313.585732] dhdcdc_query_ioctl: dhdcdc_msg failed w/status -5
[ 313.585739] CFGP2P-ERROR) wl_cfgp2p_bss_isup : 'wl bss -C 0' failed: -5
[ 313.585746] CFGP2P-ERROR) wl_cfgp2p_bss_isup : NOTE: this ioctl error is normal when the BSS has not been created yet.
[ 313.585766] wl_android_wifi_off in
[ 313.585795] mmc0: Data CRC error
[ 313.585799] msmsdcc_data_err: opcode 0x00000035
[ 313.585803] msmsdcc_data_err: blksz 64, blocks 1
[ 313.587896] mmc0: Data CRC error
[ 313.587900] msmsdcc_data_err: opcode 0x00000035
[ 313.587904] msmsdcc_data_err: blksz 64, blocks 1
[ 313.590017] mmc0: Data CRC error
[ 313.590022] msmsdcc_data_err: opcode 0x00000035
[ 313.590026] msmsdcc_data_err: blksz 64, blocks 1
[ 313.592085] dhdcdc_set_ioctl: dhdcdc_msg failed w/status -5
[ 313.592315] wifi_set_power = 0
[ 313.692358] bcm_wifi_set_power: wifi power successed to pull down
[ 313.692363] =========== WLAN placed in RESET ========
It looks like the firmware works fine but the mmc sdio config is wrong
I don't think you can use BCM4329 for this phone. The hammerhead should be BCM4339
I've checked it with the BCM4339 firmware from that repository, it still doesn't improve
[ 55.184129] Dongle Host Driver, version 1.88.45 (r)
[ 55.184132] Compiled in drivers/net/wireless/bcmdhd on Feb 19 2018 at 20:49:25
[ 55.184139] wl_android_wifi_on in
[ 55.184145] wifi_set_power = 1
[ 55.355252] bcm_wifi_set_power: wifi power successed to pull up
[ 55.562107] =========== WLAN going back to live ========
[ 55.624039] F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2
[ 55.631034] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[ 55.653343] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[ 64.691777] dhd_bus_init: enable 0x06, ready 0x02 (waited 3006383us)
[ 64.692067] wifi_get_mac_addr
[ 64.692080] bcm_wifi_get_mac_addr: Failed to get information from file /persist/wifi/.macaddr (-2)
[ 64.692162] mmc0: Data CRC error
[ 64.692167] msmsdcc_data_err: opcode 0x00000035
[ 64.692172] msmsdcc_data_err: blksz 320, blocks 1
[ 64.694498] mmc0: Data CRC error
[ 64.694503] msmsdcc_data_err: opcode 0x00000035
[ 64.694507] msmsdcc_data_err: blksz 320, blocks 1
[ 64.696639] mmc0: Data CRC error
[ 64.696643] msmsdcc_data_err: opcode 0x00000035
[ 64.696648] msmsdcc_data_err: blksz 320, blocks 1
[ 64.698767] dhdcdc_set_ioctl: dhdcdc_msg failed w/status -5
[ 64.698774] dhd_preinit_ioctls: can't set MAC address , error=-5
[ 64.698780] dhd_open : wl_android_wifi_on failed (-14)
[ 64.698808] mmc0: Data CRC error
[ 64.698812] msmsdcc_data_err: opcode 0x00000035
[ 64.698817] msmsdcc_data_err: blksz 128, blocks 1
[ 64.700930] mmc0: Data CRC error
[ 64.700935] msmsdcc_data_err: opcode 0x00000035
[ 64.700939] msmsdcc_data_err: blksz 128, blocks 1
[ 64.703093] mmc0: Data CRC error
[ 64.703098] msmsdcc_data_err: opcode 0x00000035
[ 64.703102] msmsdcc_data_err: blksz 128, blocks 1
[ 64.705280] dhdcdc_query_ioctl: dhdcdc_msg failed w/status -5
[ 64.705286] CFGP2P-ERROR) wl_cfgp2p_bss_isup : 'wl bss -C 0' failed: -5
[ 64.705293] CFGP2P-ERROR) wl_cfgp2p_bss_isup : NOTE: this ioctl error is normal when the BSS has not been created yet.
[ 64.705314] wl_android_wifi_off in
[ 64.705343] mmc0: Data CRC error
[ 64.705348] msmsdcc_data_err: opcode 0x00000035
[ 64.705352] msmsdcc_data_err: blksz 64, blocks 1
[ 64.707469] mmc0: Data CRC error
[ 64.707474] msmsdcc_data_err: opcode 0x00000035
[ 64.707478] msmsdcc_data_err: blksz 64, blocks 1
[ 64.709589] mmc0: Data CRC error
[ 64.709594] msmsdcc_data_err: opcode 0x00000035
[ 64.709598] msmsdcc_data_err: blksz 64, blocks 1
[ 64.711715] dhdcdc_set_ioctl: dhdcdc_msg failed w/status -5
[ 64.711945] wifi_set_power = 0
[ 64.811988] bcm_wifi_set_power: wifi power successed to pull down
[ 64.811994] =========== WLAN placed in RESET ========
And the same thing happens with /persist mounted
I'm wondering, now @bhush9 is going to switch the hammerhead to mainline, does wifi work there? It would still need the firmware obviously, but that should then be relatively easy to get working right?
I think this can be closed now as WiFi works with Nexus 5 mainline
Most helpful comment
I think this can be closed now as WiFi works with Nexus 5 mainline