From: Michael Braun <hidden> Date: 2014-06-12 17:34:47
The usb wifi device AVM Fritz Stick N v2b (USB 057c:8501) is listed as supported by rt2800usb, but loading the driver fails for me (kernel 3.15-rc7 and older).
ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 detected
ieee80211 phy0: rt2x00usb_vendor_request: Error - Vendor Request 0x09 failed for offset 0x0000 with error -32
ieee80211 phy0: rt2x00lib_probe_dev: Error - Failed to allocate device
rt2800usb: probe of 1-1.3:1.0 failed with error -32
usbcore: registered new interface driver rt2800usb
From searching the web, it looks like other users using the same device are hit by this error too, and some users of similar devices using the same driver experience similar errors.
I've tested these patches using a USB 057c:8501 wifi device in client mode (scanning + connect to WPA protected BSS + network access). With the patches applied, the device works fine. Without, it fails.
I've also tested that USB 148f:5370 (which is another usb wifi device using the same driver), which worked also without these patches applied, still works after applying these patches.
Regards,
M. Braun
v2: fix endianness and coding style. Using rt2x00usb_register_read does not work for me.
---
Michael Braun (2):
rt2800usb:fix efuse detection
rt2800usb:fix hang during firmware load
drivers/net/wireless/rt2x00/rt2800usb.c | 39 +++++++++++++++++++++++++++++--
drivers/net/wireless/rt2x00/rt2x00usb.h | 1 +
2 files changed, 37 insertions(+), 3 deletions(-)
From: Michael Braun <hidden> Date: 2014-06-12 17:34:45
The device 057c:8501 (AVM Fritz! WLAN v2 rev. B) currently does not
load. One thing observed is that the vendors driver detects EFUSE mode
for this device, but rt2800usb does not. This is due to rt2800usb
lacking a check for the firmware mode present in the vendors driver,
that this patch adopts for rt2800usb.
With this patch applied, the 'RF chipset' detection does no longer fail.
Signed-off-by: Michael Braun <michael-dev-1SGGS//iJ+Y38rf8aCqVIw@public.gmane.org>
---
drivers/net/wireless/rt2x00/rt2800usb.c | 30 +++++++++++++++++++++++++++++-
drivers/net/wireless/rt2x00/rt2x00usb.h | 1 +
2 files changed, 30 insertions(+), 1 deletion(-)
@@ -229,6 +229,27 @@ static enum hrtimer_restart rt2800usb_tx_sta_fifo_timeout(struct hrtimer *timer)/**Firmwarefunctions*/+staticintrt2800usb_autorun_detect(structrt2x00_dev*rt2x00dev)+{+__le32reg;+u32fw_mode;++/* cannot use rt2x00usb_register_read here as it uses different+*mode(MULTI_READvs.DEVICE_MODE)anddoesnotpassthe+*magicvalueUSB_MODE_AUTORUN(0x11)tothedevice,thusthe+*returnedvaluewouldbeinvalid.+*/+rt2x00usb_vendor_request(rt2x00dev,USB_DEVICE_MODE,+USB_VENDOR_REQUEST_IN,0,USB_MODE_AUTORUN,+®,sizeof(reg),REGISTER_TIMEOUT_FIRMWARE);+fw_mode=le32_to_cpu(reg);++if((fw_mode&0x00000003)==2)+return1;++return0;+}+staticchar*rt2800usb_get_firmware_name(structrt2x00_dev*rt2x00dev){returnFIRMWARE_RT2870;
From: Michael Braun <hidden> Date: 2014-06-12 17:34:48
The device 057c:8501 (AVM Fritz! WLAN v2 rev. B) boots into a state that does
not actually require loading a firmware file. The vendors driver finds out
about this by checking a firmware state register, so this patch adds this here.
Finally, with this patch applied, my wifi dongle actually becomes
useful (scan + connect to wpa network works).
Signed-off-by: Michael Braun <michael-dev-1SGGS//iJ+Y38rf8aCqVIw@public.gmane.org>
---
drivers/net/wireless/rt2x00/rt2800usb.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
@@ -278,8 +278,13 @@ static int rt2800usb_write_firmware(struct rt2x00_dev *rt2x00dev,/**Writefirmwaretodevice.*/-rt2x00usb_register_multiwrite(rt2x00dev,FIRMWARE_IMAGE_BASE,-data+offset,length);+if(rt2800usb_autorun_detect(rt2x00dev)){+rt2x00_info(rt2x00dev,+"Firmware loading not required - NIC in AutoRun mode\n");+}else{+rt2x00usb_register_multiwrite(rt2x00dev,FIRMWARE_IMAGE_BASE,+data+offset,length);+}rt2x00usb_register_write(rt2x00dev,H2M_MAILBOX_CID,~0);rt2x00usb_register_write(rt2x00dev,H2M_MAILBOX_STATUS,~0);--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Jun 12, 2014 at 07:33:36PM +0200, Michael Braun wrote:
The device 057c:8501 (AVM Fritz! WLAN v2 rev. B) currently does not
load. One thing observed is that the vendors driver detects EFUSE mode
for this device, but rt2800usb does not. This is due to rt2800usb
lacking a check for the firmware mode present in the vendors driver,
that this patch adopts for rt2800usb.
With this patch applied, the 'RF chipset' detection does no longer fail.
Signed-off-by: Michael Braun <michael-dev-1SGGS//iJ+Y38rf8aCqVIw@public.gmane.org>
On Thu, Jun 12, 2014 at 07:33:41PM +0200, Michael Braun wrote:
The device 057c:8501 (AVM Fritz! WLAN v2 rev. B) boots into a state that does
not actually require loading a firmware file. The vendors driver finds out
about this by checking a firmware state register, so this patch adds this here.
Finally, with this patch applied, my wifi dongle actually becomes
useful (scan + connect to wpa network works).
Signed-off-by: Michael Braun <michael-dev-1SGGS//iJ+Y38rf8aCqVIw@public.gmane.org>