No interface for my dlink DWA-140 (RT 2870 chipset)

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=6061

Strider

12-04-2010 08:04:50

I have a dlink usb dongle using RT 2870 chipset (at least that is what lsusb shows me).

When I insert the dongle I get the following message in my kernel log

phy0 -> rt2800_init_eeprom Error - Invalid RT chipset detected

I'm using 2.6.33.2 kernel.

Browsing the source code I found this error message in lib2800.c but I have no clue on how to debug this.

Thanks for any help

IvD

12-04-2010 09:09:36

Please enable debugging output, and show _all_ rt2x00 debug messages.

Strider

18-04-2010 20:18:50

I enabled debugging output via CONFIG_RT2X00_LIB_DEBUGFS=y and CONFIG_RT2X00_DEBUG=y in my .config file, recompiled my kernel modules and installed them. Here is what I got (which is not much more as before)

[codevk9981xl]Apr 18 22:06:22 Megatron kernel: phy0 -> rt2800_init_eeprom: Error - Invalid RT chipset detected.
Apr 18 22:06:22 Megatron kernel: phy0 -> rt2x00lib_probe_dev: Error - Failed to allocate device.
Apr 18 22:06:22 Megatron kernel: usbcore: registered new interface driver rt2800usb
[/codevk9981xl]

IvD

18-04-2010 21:11:57

You are really missing the line which contains 'Chipset detected ' along with the RT and RF chipset identification.

Strider

19-04-2010 19:57:56

Ivo,

the version of rt2800lib.c that I have (2.6.33.2 kernel) does not get to point to print the chip info. It just prints 'invalid RT chipset selected.' and then exits the function 'rt2800_init_eeprom' with a return code.

Anyhow, I modified the code in rt2800lib.c to print the chip info before exiting the function. Here is now how my kernel.log looks like

[code29ml0rti]Apr 19 21:48:42 Megatron kernel: phy1 -> rt2800_init_eeprom: Error - Invalid RT chipset detected.
Apr 19 21:48:42 Megatron kernel: phy1 -> rt2x00_print_chip: Info - Chipset detected - rt: 0000, rf: 0008, rev: 30710213.
Apr 19 21:48:42 Megatron kernel: phy1 -> rt2x00lib_probe_dev: Error - Failed to allocate device.[/code29ml0rti]

And this is the output from lsusb

[code29ml0rti]Bus 003 Device 007: ID 07d1:3c0a D-Link System DWA-140 RangeBooster N USB Adapter(rev.B2)[/code29ml0rti]

Hope this helps
wink

IvD

19-04-2010 21:14:24

Can you post your patch with the modifications?

Strider

19-04-2010 21:36:37

Ivo,

I only added one line after the error message was printed

[code1hc86o86][chris@Megatron rt2x00]$ diff -C 10 'rt2800lib.c~' rt2800lib.c
*** rt2800lib.c~ 2010-04-19 21:27:08.847113564 +0200
--- rt2800lib.c 2010-04-19 21:27:08.897935959 +0200
***************
*** 1846,1865 ****
--- 1846,1866 ----
* identifies itself as rt2860 in the CSR register.
*/
if (rt2x00_check_rev(chip, 0xfff00000, 0x28600000) ||
rt2x00_check_rev(chip, 0xfff00000, 0x28700000) ||
rt2x00_check_rev(chip, 0xfff00000, 0x28800000)) {
rt2x00_set_chip_rt(rt2x00dev, RT2870);
} else if (rt2x00_check_rev(chip, 0xffff0000, 0x30700000)) {
rt2x00_set_chip_rt(rt2x00dev, RT3070);
} else {
ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
+ rt2x00_print_chip(rt2x00dev);
return -ENODEV;
}
}
rt2x00_print_chip(rt2x00dev);

if (!rt2x00_rf(&rt2x00dev->chip, RF2820) &&
!rt2x00_rf(&rt2x00dev->chip, RF2850) &&
!rt2x00_rf(&rt2x00dev->chip, RF2720) &&
!rt2x00_rf(&rt2x00dev->chip, RF2750) &&
!rt2x00_rf(&rt2x00dev->chip, RF3020) &&[/code1hc86o86]

IvD

20-04-2010 18:13:26

Could you try a linux-wireless.git or the compat-wireless package to use a more recent version of the driver?
The code you changed is quite different compared to the latest version, so perhaps it is working now.

Strider

25-04-2010 20:30:37

After some struggling finding the right config parameters to enable, I managed to install the drivers from compat-wireless (with debugging enabled). I now get a little bit farther but I'm still stuck. Here is the output from kernel.log when I plug in my usb dongle

[code35k33r2v]Apr 25 22:19:18 Megatron kernel: usb 3-4: USB disconnect, address 2
Apr 25 22:19:24 Megatron kernel: usb 3-4: new high speed USB device using ehci_hcd and address 5
Apr 25 22:19:24 Megatron kernel: phy1 -> rt2x00_set_chip: Info - Chipset detected - rt: 3071, rf: 0008, rev: 0213.
Apr 25 22:19:24 Megatron kernel: phy1: Selected rate control algorithm 'minstrel'
Apr 25 22:19:24 Megatron kernel: Registered led device: rt2800usb-phy1::radio
Apr 25 22:19:24 Megatron kernel: Registered led device: rt2800usb-phy1::assoc
Apr 25 22:19:24 Megatron kernel: Registered led device: rt2800usb-phy1::quality
Apr 25 22:19:24 Megatron kernel: usbcore: registered new interface driver rt2800usb
Apr 25 22:19:54 Megatron kernel: phy1 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'.
Apr 25 22:19:54 Megatron kernel: rt2800usb 3-4:1.0: firmware: requesting rt2870.bin
Apr 25 22:19:54 Megatron kernel: phy1 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.8.
Apr 25 22:19:54 Megatron kernel: phy1 -> rt2x00lib_request_firmware: Error - Current firmware does not support detected chipset.
[/code35k33r2v]

Apparently I have a rt3071 chipset ? Do I have to load new firmware ?

IvD

26-04-2010 07:54:53

Yes, you have to find a firmware blob which is 8k large, make sure you get the correct firmware file from the Ralink website.

Strider

26-04-2010 19:30:18

Ok, I've downloaded the latest firmware from ralink. When I plug in my usb dongle, no error messages anymore. But when I bring up my wlan0 interface, I get the message 'DCHP IP lease attempt failed.'. Looking at kernel.log, here is what I found

[code2dtnc656]Apr 26 21:20:23 Megatron kernel: phy1 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'.
Apr 26 21:20:23 Megatron kernel: rt2800usb 2-4:1.0: firmware: requesting rt2870.bin
Apr 26 21:20:23 Megatron kernel: phy1 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.22.
Apr 26 21:20:23 Megatron kernel: phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 3, CWmax: 4, Aifs: 2, TXop: 102.
Apr 26 21:20:23 Megatron kernel: phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 4, CWmax: 5, Aifs: 2, TXop: 188.
Apr 26 21:20:23 Megatron kernel: phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 2 - CWmin: 5, CWmax: 10, Aifs: 3, TXop: 0.
Apr 26 21:20:23 Megatron kernel: phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 3 - CWmin: 5, CWmax: 10, Aifs: 7, TXop: 0.
Apr 26 21:20:27 Megatron kernel: wlan0: direct probe to 00:1c:f0:c5:c7:0b (try 1)
Apr 26 21:20:27 Megatron kernel: wlan0: direct probe responded
Apr 26 21:20:27 Megatron kernel: wlan0: authenticate with 00:1c:f0:c5:c7:0b (try 1)
Apr 26 21:20:27 Megatron kernel: wlan0: authenticated
Apr 26 21:20:27 Megatron kernel: wlan0: associate with 00:1c:f0:c5:c7:0b (try 1)
Apr 26 21:20:27 Megatron kernel: wlan0: RX AssocResp from 00:1c:f0:c5:c7:0b (capab=0x431 status=0 aid=1)
Apr 26 21:20:27 Megatron kernel: wlan0: associated
Apr 26 21:20:39 Megatron kernel: phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 2, CWmax: 3, Aifs: 2, TXop: 47.
Apr 26 21:20:39 Megatron kernel: phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 3, CWmax: 4, Aifs: 2, TXop: 94.
Apr 26 21:20:39 Megatron kernel: phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 2 - CWmin: 4, CWmax: 10, Aifs: 3, TXop: 0.
Apr 26 21:20:39 Megatron kernel: phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 3 - CWmin: 4, CWmax: 10, Aifs: 7, TXop: 0.
Apr 26 21:20:39 Megatron kernel: wlan0: deauthenticating from 00:1c:f0:c5:c7:0b by local choice (reason=3) [/code2dtnc656]
Followed by (a second later)
[code2dtnc656]Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x06 failed for offset 0x1204 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x06 failed for offset 0x1328 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for offset 0x0208 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x0c failed for offset 0x0000 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for offset 0x7010 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for offset 0x7010 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for offset 0x7010 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for offset 0x7010 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for offset 0x7010 with error -71.
Apr 26 21:20:40 Megatron kernel: phy1 -> rt2x00usb_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0xffff8800
[/code2dtnc656].

In messages.log I found
[code2dtnc656]Apr 26 21:20:29 Megatron dhcpcd: wlan0: rebinding lease of 192.168.0.199
Apr 26 21:20:30 Megatron dhcpcd: wlan0: NAK: from 192.168.0.1
Apr 26 21:20:31 Megatron dhcpcd: wlan0: broadcasting for a lease
[/code2dtnc656]

gwingerde

28-04-2010 09:21:22

Please note that the RT3071 is not supported yet with the 2.6.33.x kernels, nor with the upcoming 2.6.34 kernel.

Your best bet is using the latest compat-wireless package, which does support the RT3071.

Strider

28-04-2010 19:26:36

Gertjan,

as stated in my previous posts I did install the latest compat-wireless drivers with my 2.6.33.3 kernel... wink

The results above are with those compat-wireless drivers installed.

gwingerde

01-05-2010 18:39:53

OK. Sorry, didn't read the whole thread.

Did you enable RT30xx support? This is disabled by default (for now). You can enable it by editing the config.mk file and removing the '#' before the CONFIG_RT2800PCI_RT30XX and CONFIG_RT2800USB_RT30XX symbols. After editing the config.mk file recompile the compat-wireless package.

Strider

02-05-2010 21:33:35

I have an USB dongle and I already enabled CONFIG_RT2800USB_RT30XX in config.mk (if I didn't I got compilation errors).
Should I enable the PCI one too ?

Strider

05-05-2010 21:31:28

I also enabled CONFIG_RT2800PCI_RT30XX in the config.mk. I recompiled and tested same result cry

Anybody any idea what is going wrong ?

I can also confirm that my dongle is a d-link dwa-140 [b1o8r71o4]Rev B2[/b1o8r71o4] that uses the rt3071 chipset.