8devices/qcacld-2.0

Fail to register the interface driver hif_usb

terrycmchan opened this issue · 22 comments

Hi,

I ported this driver to OpenWRT.
I think the driver can be initiated but cannot be probed with the below errors.

[ 1903.356837] R0: wlan: [1653:E :HDD] Name = [gEnableHostapdEdcaLocal] Value = [0]
[ 1903.362880] R0: wlan: [1653:E :HDD] Name = [g_sta_change_cc_via_beacon] Value = [0]
[ 1903.380940] usb_hif_submit_ctrl_out failed,result = -71
[ 1903.384717] Unable to get target information from the device
[ 1903.395312] usb_hif_submit_ctrl_out failed,result = -71
[ 1903.399135] hif_usb: probe of 1-1.1:1.0 failed with error -5
[ 1903.405006] usbcore: registered new interface driver hif_usb
[ 1905.509518] R0: wlan: [1653:E :HDD] hdd_hif_register_driver: 17753: HIF registration failed
[ 1905.516426] R0: wlan: [1653:F :HDD] hdd_driver_init: WLAN Driver Initialization failed
[ 1905.524342] Try to unregister hif_driver
[ 1905.528219] usbcore: deregistering interface driver hif_usb
[ 1905.533984] hif_unregister_driver!!!!!!
[ 1905.544560] kmodloader: 1 module could not be probed
[ 1905.548295] kmodloader: - wlan - 0

Can anyone help me?
Thanks!

Could you show the output of commands:
ls /lib/firmware/
uname -a
lsusb
Also, could paste full dmesg log?

Hi Nevinskas,
Please find below:

ls /lib/firmware/
Data.msc athwlan.bin fakeboar.bin otp.bin otp30.bin qca61x4.bin qwlan.bin qwlan30.bin regulatory.db utf.bin utf30.bin wlan
uname -a
Linux OpenWrt 4.14.109 #0 Fri Apr 26 03:30:11 2019 mips GNU/Linux
lsusb
Bus 001 Device 007: ID 0cf3:e500 Qualcomm Atheros Communications
Bus 001 Device 008: ID 08bb:2912 Texas Instruments PCM2912A Audio Codec
Bus 001 Device 002: ID 0000:0000
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Also, I will send you the full dmesg log later.
Thanks!

You have connected to the wrong USB port.
The one that You are connected is for bluetooth.

Hi Nevinskas,
Thanks for your great help!
I will modify and test it.

Hi Nevinskas,
After fixed the wrong USB port issue (actually the WiFi port was corrupted by the initial issue), I still got error. Please find the log from this link.
https://drive.google.com/open?id=1U6vFsjyWBLNZo6xLYKjY30wJXdyTXpo3

Thanks!

From what you are powering up this device?
It seems that it is powered enough.

[    6.173247] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    6.339514] usb 1-1.1: new high-speed USB device number 3 using ehci-platform
[    6.491238] usb 1-1.1: rejected 1 configuration due to insufficient available bus power
[    6.497823] usb 1-1.1: no configuration chosen from 1 choice
[    6.599505] usb 1-1.2: new full-speed USB device number 4 using ehci-platform
[    6.849509] usb 1-1.3: new full-speed USB device number 5 using ehci-platform
[    7.002248] usb 1-1.3: rejected 1 configuration due to insufficient available bus power
[    7.008842] usb 1-1.3: no configuration chosen from 1 choice
[    9.668196] jffs2: notice: (409) jffs2_build_xattr_subsystem: complete building xattr subsystem, 3 of xdatum (2 unchecked, 1 orphan) and 25 of xref (1 dead, 0 orphan) found.

and:

[   22.649188] random: jshn: uninitialized urandom read (4 bytes read)
[   30.385713] usb 1-1.1: new config #1 exceeds power limit by 400mA
[   30.417583] usb 1-1.3: new config #1 exceeds power limit by 400mA
[   33.353291] br-lan: port 1(eth0) entered blocking state

Hi Nevinskas,
The power will be given later.
Thus, I load this module later again.

Hi Nevinskas,

Please find the log in which I insert the wlan.ko after the power is ready.
https://drive.google.com/open?id=1nLixJz3Cjrsq0yS0cnRkRkuZJ91pKO5X

Thanks for your help!

Can you tell me what kind of the device it is?
What power supply you are using?

Hi Nevinskas,

The board is Carambola2 and is powered from a USB port.
But it is no problem with another wifi module.

What is USB port rating, that powers the Carambola2?

With another WiFi module you mean Blue Bean or Carambola2?

Hi Nevinskas,

The rating is 2 Amps
And tested with RT5370

Hi Nevinskas,

Are there any other reasons that cause HIFExchangeBMIMsg() return false?

Could you verify that Blue Bean is working with our driver on any other platform?

Sorry for late reply.
We have tested on Windows 10 and it works fine.

Hi Nevinskas,

After I modified the timeout of usb_control_msg(), I found that as below.

The problem seems the Blue Bean does not send the response to the host when calling
bmi_download_firmware() -> BMIGetTargetInfo() -> HIFExchangeBMIMsg() (hif_usb.c) -> HIFCtrlMsgExchange().
After calling usb_hif_submit_ctrl_out() successfully, the driver is waiting usb_hif_submit_ctrl_in().

Please help!

Hi,

Anybody can help?

There is a bug on this github source.
I fixed it. Thanks...

@terrycmchan I think i have the same problem. Can you please share the changes to fix the it? Thanks

Hi,
I've compiled the QCA driver for linux and when the module is loaded below error is observed,
[ 252.195969] wlan_usb: loading driver v4.5.20.037
[ 252.196247] hif_usb_probe
[ 252.293159] hif_usb_probe[202]
[ 252.293159]
[ 257.291593] Enter:hif_usb_disable_lpm,Line:127
[ 257.291628] hif_usb_disable_lpm: LPM isn't enabled
[ 257.291644] Exit:hif_usb_disable_lpm,Line:154
[ 257.291661] BCDDevice : 300
[ 257.291690] RX Bulk Ep:0x81 maxpktsz:512
[ 257.291821] athusb: alloc resources lpipe:4 hpipe:0xC0408980 urbs:32
[ 257.291839] RX Bulk Ep:0x82 maxpktsz:512
[ 257.291909] athusb: alloc resources lpipe:5 hpipe:0xC0410980 urbs:32
[ 257.291926] RX Bulk Ep:0x83 maxpktsz:512
[ 257.292007] athusb: alloc resources lpipe:6 hpipe:0xC0418980 urbs:32
[ 257.292024] RX Bulk Ep:0x84 maxpktsz:512
[ 257.292097] athusb: alloc resources lpipe:7 hpipe:0xC0420980 urbs:32
[ 257.292114] TX Bulk Ep:0x01 maxpktsz:512
[ 257.292192] athusb: alloc resources lpipe:0 hpipe:0xC0008900 urbs:32
[ 257.292209] TX Bulk Ep:0x02 maxpktsz:512
[ 257.292274] athusb: alloc resources lpipe:1 hpipe:0xC0010900 urbs:32
[ 257.292291] TX Bulk Ep:0x03 maxpktsz:512
[ 257.292370] athusb: alloc resources lpipe:2 hpipe:0xC0018900 urbs:32
[ 257.292386] TX Bulk Ep:0x04 maxpktsz:512
[ 257.292451] athusb: alloc resources lpipe:3 hpipe:0xC0020900 urbs:32
[ 257.292535] /proc/cld/athdiagpfs created
[ 257.295449] wlan: [3279:E :HDD] hdd_apply_cfg_ini: Reg Parameter gRArateLimitInterval > allowed Maximum [600 > 300]. Enforcing Default= 60
[ 257.296727] wlan: [3279:E :HDD] hdd_apply_cfg_ini: Reg Parameter gBusBandwidthHighThreshold < allowed Minimum [2000 < 10000]. Enforcing Default= 40000
[ 257.296770] wlan: [3279:E :HDD] hdd_apply_cfg_ini: Reg Parameter gBusBandwidthMediumThreshold < allowed Minimum [500 < 3000]. Enforcing Default= 10000
[ 257.296817] wlan: [3279:E :HDD] hdd_apply_cfg_ini: Reg Parameter gBusBandwidthComputeInterval < allowed Minimum [100 < 1000]. Enforcing Default= 3000
[ 257.297072] wlan: [3279:E :HDD] wlan_hdd_cfg80211_init: wiphy->bands[i] is NULL, i = 2
[ 257.319012] usb_hif_submit_ctrl_out failed,result = -71
[ 257.319047] Unable to get target information from the device
[ 257.319074] wlan: [3279:F :VOS] vos_open: BMI failed to download target
[ 257.319596] wlan: [3279:F :HDD] hdd_wlan_startup: vos_open failed
[ 257.319675] /proc/cld/athdiagpfs removed
[ 257.319696] /proc/cld removed
[ 257.332824] usb_hif_submit_ctrl_out failed,result = -71
[ 257.333089] hif_usb: probe of 2-1.4.1:1.0 failed with error -5
[ 257.333453] usbcore: registered new interface driver hif_usb
[ 259.330246] wlan: [3279:F :HDD] hdd_driver_init:12846 WLAN Driver Initialization failed
[ 259.330278] Try to unregister hif_driver
[ 259.330292] usbcore: deregistering interface driver hif_usb
[ 259.330635] hif_unregister_driver!!!!!!
[ 259.330652] wlan_usb: driver load failure
[ 259.335720] insmod (3279) used greatest stack depth: 3720 bytes left

..
Please help on this. Thanks in advance.

root@Invendis:~# lsusb
Bus 002 Device 008: ID 10c4:ea71
Bus 002 Device 010: ID 0cf3:9378
Bus 002 Device 006: ID 0424:2514
Bus 002 Device 005: ID 0b95:772b
Bus 002 Device 004: ID 0b95:772b
Bus 002 Device 003: ID 0b95:772b
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 002: ID 0424:2514
Bus 002 Device 001: ID 1d6b:0002

Hi,

Please post more details on platform, I am not even sure if that is x86 or any embedded platform and etc.
Make sure you have copied firmware/usb/* from driver source under /lib/firmware/ on system driver is running.

An error printed as -71 is EPROTO, Protocol error.
Something is going between USB host/hub and USB devices, might indicate power issue.