[rt2x00-users] Support for Ralink 5370 WiFi USB dongle

Ingvar Hagelund ingvar at redpill-linpro.com
Sun Oct 30 01:22:59 AEDT 2011


Hello, list. This is my first post :-)

I recently bought a cheap "Ultra-Mini Nano USB 2.0 150Mbps 802.11b/g/n Wifi/WLAN Wireless Network Adapter" dongle, $8.10 on DealExtreme*, and plugged it into my fedora-almost-16 laptop, running some linux-3.1.0

The dongle presents itself to lsusb** as "ID 148f:5370 Ralink Technology, Corp."

As more or less expected, the included Linux driver did not work, so I tried the standard kernel driver rt2x00. It loaded, but was unable to detect what chip this was. After a bit of googling around, I tried the latest compat-wireless (that was compat-wireless-2011-10-28), but with similar results. A list post from april claimed that the 5370 was more or less the same as 5390, so I hacked the header files. Now the chip was detected, but it could not find correct RF ID, and bailed out with "Invalid RF chipset 0x105 detected". Looking a bit more closely on the driver, I found that 5370 support had been added, but had another RF ID.

So I did a small patch (attached), stubbed some missing headers in rfkill-gpio.h (see https://lkml.org/lkml/2011/9/29/141 , I did only the headers, the driver compiled fine without the rest. I guess linux-3.1.0 is not new enough for latest compat-wireless), and voila, the driver worked with no problems, and there was a lot of rejoicing. 

NetworkManager manages it fine, and WPA encryption works fine, and the diode blinks happily. Seems like the NetworkManager applet signal level meter may be broken, but I don't know how this is related. With some light testing, I manage to get about 6-8Mbps through on WPA. I have not tested without encryption, and it might just be that the old USB port slows it down. I find this quite satisfactory, though a bit less than the claimed 150MBps :-)

Regarding the RF ID code in the patch, I would like to know if the original code, 0x5370, was just a guess, or if there do exist at least to versions of this chip. If so, the someone has to hack a bit to support both versions.

Bonus hacking points: This was done on an Apple G3 iBook, that is 32bit ppc from 2002 :-)

Best regards,
Ingvar Hagelund


* The dongle may be found here:
http://www.dealextreme.com/p/ultra-mini-nano-usb-2-0-150mbps-802-11b-g-n-wifi-wlan-wireless-network-adapter-white-67532

** Output of lsusb -vvv


Bus 002 Device 006: ID 148f:5370 Ralink Technology, Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x148f Ralink Technology, Corp.
  idProduct          0x5370 
  bcdDevice            1.01
  iManufacturer           1 Ralink
  iProduct                2 802.11 n WLAN
  iSerial                 3 1.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           67
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              450mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           7
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 1.0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: RT5370.patch
Type: text/x-patch
Size: 1103 bytes
Desc: not available
URL: <http://rt2x00.serialmonkey.com/pipermail/users_rt2x00.serialmonkey.com/attachments/20111029/21f1fce4/attachment.bin>


More information about the users mailing list