# Ralink USB -- which driver? [SOLVED]

## koopdi

I am about to recompile my kernel with support for my ralink card. I am not sure which driver to use though.

```

  │ │                                                --- Ralink driver support                                                                                             │ │  

  │ │                                                < >   Ralink rt2400 (PCI/PCMCIA) support (NEW)                                                                        │ │  

  │ │                                                < >   Ralink rt2500 (PCI/PCMCIA) support (NEW)                                                                        │ │  

  │ │                                                < >   Ralink rt2501/rt61 (PCI/PCMCIA) support (NEW)                                                                   │ │  

  │ │                                                < >   Ralink rt28xx/rt30xx/rt35xx (PCI/PCIe/PCMCIA) support (EXPERIMENTAL) (NEW)                                      │ │  

  │ │                                                < >   Ralink rt2500 (USB) support (NEW)                                                                               │ │  

  │ │                                                < >   Ralink rt2501/rt73 (USB) support (NEW)                                                                          │ │  

  │ │                                                < >   Ralink rt2800 (USB) support (EXPERIMENTAL) (NEW)       
```

# lsusb

```
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 003 Device 002: ID 5332:1300  

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 002: ID 058f:6362 Alcor Micro Corp. Hi-Speed 21-in-1 Flash Card Reader/Writer (Internal/External)

Bus 001 Device 003: ID 148f:3070 Ralink Technology, Corp. 

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
```

Last edited by koopdi on Sun Mar 13, 2011 4:38 am; edited 1 time in total

----------

## cach0rr0

two suggestions for ideas come to mind

-boot up with sysrescuecd, see if anything exists in /proc/net/wireless, if so the module has already been loaded for you by sysrescuecd, so now all you have to do is see what modules are loaded (e.g. lsmod), see which one fits. 

-see if lshw or usbview show you any further information on the card. namely, the exact model number. 

as we dont know the model number, we cant really tell you what you should select  :Smile: 

----------

## koopdi

It looks like it's the 3070 chip set.

Ralink rt2800 (USB) support (EXPERIMENTAL):

 *Quote:*   

> - support for RT3070 chips is non-functional at the moment

 

Is it worth trying this module or some other option perhaps?

It is this card from amazon:

 *Quote:*   

> Technical Details
> 
>     * Brand New Generic Product BULK PACKAGE
> 
>     * Specifications:Wireless LAN 11g USB Adapter, IEEE 802.11g, USB1.1/2.0, 2.4GHz-2.4835GHz
> ...

 

Someone did get it working in Ubuntu:

 *Quote:*   

> Bought this to try out on a headless, command-prompt only, Ubuntu Server. Eventually got it running well by downloading and compiling the newest drivers from RALink but it was not plug-and-play. It may work plug-and-play if you use Network Manager but be prepared for some work if you don't. I also had to make some tweaks to my RT3070STA.dat file to prevent speed drops during heavy loads.
> 
> But, I did receive it on time and it is working on a 802.11g network. 

 

//usbview

```
802.11 n WLAN

Manufacturer: Ralink

Speed: 480Mb/s (high)

USB Version:  2.00

Device Class: 00(>ifc )

Device Subclass: 00

Device Protocol: 00

Maximum Default Endpoint Size: 64

Number of Configurations: 1

Vendor Id: 148f

Product Id: 3070

Revision Number:  1.01
```

----------

## cach0rr0

hrmm..usbview confirms that's the driver

(from grepping through kernel sources)

```

rt2x00/rt2800usb.c:     { USB_DEVICE(0x148f, 0x3070), USB_DEVICE_DATA(&rt2800usb_ops) },

```

my uneducated estimation would be that the prognosis looks grim. I don't know that there's any harm in trying the module out, but I'd wager you're likely going to end up having to download the driver code from the ralink website, build it by hand

...unless someone else has any ideas.

----------

## koopdi

 *cach0rr0 wrote:*   

> 
> 
> my uneducated estimation would be that the prognosis looks grim. I don't know that there's any harm in trying the module out, but I'd wager you're likely going to end up having to download the driver code from the ralink website, build it by hand
> 
> 

 

I'm not afraid of a little compiling. This is new to me though, so any advice or links to relevant info & howtos is very appreciated.

Edit:

Not being sure how to proceed with finding sources from ralink, I'm going to recompile the kernel with the experimental support already in the sources...perhaps I'll get lucky.

Will report back either tonight or tomorrow morning.

----------

## koopdi

So I compiled Ralink rt2800 (USB) support (EXPERIMENTAL) into the kernel. I also included the debugging support, just in case.

Running ifconfig wlan0 up gives:

SIOCSIFFLAGS: No such file or directory

I was hoping for it to at least be detected now.

Oh well. More tomorrow.

Goodnight Gentoo land.

----------

## cach0rr0

did you insmod ('insmod /path/to/file.ko' or 'modprobe <modulename>'  it first? Device won't show up til you do

once you've done so, cat /proc/net/wireless

if nothing is there, check dmesg for errors 

all i can think of at the moment, time to hit the pub - good luck!

----------

## seqizz

what about staging drivers?

  -> Device Drivers                                                         

         -> Staging drivers (STAGING [=y])    

                  < >     Ralink 2870/3070 wireless support

----------

## NeddySeagoon

koopdi,

To give yourself the best chance with an in kernel driver, use the testing gentoo-sources (2.6.37-r1 as I write) and the staging driver.

If you want to be more adventerous still, try the latest 2.6.38-rc from kernel.org too.

Quotes like - "support for RT3070 chips is non-functional at the moment" become out of date very rapidly and they are not always removed when the fix is applied.

Sometimes older kernels work and newer ones dont.  I recall 2.6.23-rc6 worked with my rt73 USB device but it wan't until 2.6.26 that another kernel worked for me with that device.

----------

## Etal

It looks like it will be supported in the the upcoming 2.6.38 kernel, which will probably be out in a week or two, judging by the latest release message:

```
 .config - Linux/x86_64 2.6.38-rc7 Kernel Configuration

 ─────────────────────────────────────────────────────────────────────────────

  ┌─────────────── Ralink rt27xx/rt28xx/rt30xx (USB) support ───────────────┐

  │ CONFIG_RT2800USB:                                                       │  

  │                                                                         │  

  │ This adds support for rt27xx/rt28xx/rt30xx wireless chipset family.     │  

  │ Supported chips: RT2770, RT2870 & RT3070, RT3071 & RT3072               │  

  │                                                                         │  

  │ When compiled as a module, this driver will be called "rt2800usb.ko".   │  

  │                                                                         │  

  │ Symbol: RT2800USB [=n]                                                  │  

  │ Type  : tristate                                                        │  

  │ Prompt: Ralink rt27xx/rt28xx/rt30xx (USB) support                       │  

  │   Defined at drivers/net/wireless/rt2x00/Kconfig:126                    │  

  │   Depends on: NETDEVICES [=y] && WLAN [=y] && RT2X00 [=y] && USB [=y]   │  

  │   Location:                                                             │  

  │     -> Device Drivers                                                   │  

  │       -> Network device support (NETDEVICES [=y])                       │  

  │         -> Wireless LAN (WLAN [=y])                                     │  

  │           -> Ralink driver support (RT2X00 [=y])                        │  

  ├─────────────────────────────────────────────────────────────────( 79%)──┤  

  │                                < Exit >                                 │  

  └─────────────────────────────────────────────────────────────────────────┘
```

----------

## koopdi

Tried the staging driver using linux-2.6.36-gentoo-r5:

dmesg:

```
[  131.538543] usb 1-2: firmware file rt3070.bin request failed (-2)

[  131.538548] ERROR! NICLoadFirmware failed, Status[=0x00000001]

[  131.538555] rt28xx Initialized fail!
```

Any thoughts?

I didn't compile the driver as a module. Would that fact have much significance?

Next up - 2.6.38...

----------

## Gusar

 *koopdi wrote:*   

> I didn't compile the driver as a module. Would that fact have much significance?

 

Yes. If you compile it into the kernel, you need to also put the firmware into the kernel. If you compile it as a module, it'll read the firmware from /lib/firmware

----------

## koopdi

Oh, I see.

Where do I find this firmware stuff? How do I choose to have it inside the kernel?

I checked lib to see if anything was there but there isn't even a firmware directory.

----------

## NeddySeagoon

koopdi,

Check to see you have a file called rt3070.bin in /lib/firmware

Now rebuild your kernel with the rt3070 module as a module.

For debugging, modules are preferred as they can be added and removed from the kernel without a reboot and you can play with any module parameters the module supports - also without a reboot.

Get the firmware from the ralink website.  from memory, ralink.com.tw

----------

## koopdi

I do not have that file.

I do not even have a /lib/firmware directory.

I did download rt2870.bin from ralinktech.com last night.

I think that the site said this was the firmware for the 3070 chipset.

For some reason the page doesn't load for me anymore though.

Is it worth renaming rt2870.bin to rt3070.bin and copying it to /lib/firmware, then recompiling support for the staging driver as a module?

Would it be better to copy rt2870.bin to /lib/firmware and then make a symbolic link called rt3070.bin?

Thank you everyone for your help thus far. I am doing my best to become an advanced beginner in these subjects.

----------

## Gusar

Install the linux-firmware package. It has, among many others, firmware for all ralink cards.

----------

## NeddySeagoon

koopdi,

If Ralink provide a firmware file called rt3070.bin thats what you need. 

Renaming won't work.

----------

## koopdi

So a power outage exactly at the moment I hit save in menuconfig destroyed my config file.

Can I somehow extract the old config from my current kernel?

----------

## cach0rr0

 *koopdi wrote:*   

> So a power outage exactly at the moment I hit save in menuconfig destroyed my config file.
> 
> Can I somehow extract the old config from my current kernel?

 

```

zcat /proc/config.gz 

```

or more specifically

```

zcat /proc/config.gz > /usr/src/linux/.config

```

or

```

cd /usr/src/linux

./scripts/extract-ikconfig /boot/kernelfilename

```

either one should work

----------

## koopdi

Looks like I didn't enable that...

```
extract-ikconfig: Cannot find kernel config.
```

----------

## cach0rr0

 *Etal wrote:*   

> It looks like it will be supported in the the upcoming 2.6.38 kernel, which will probably be out in a week or two, judging by the latest release message:
> 
> <snip>

 

hrmm...if that's the case, i wonder if maybe it will be available in compat-wireless? 

There is a compat-wireless ebuild in the 'pentoo' overlay. It also pulls in the latest firmware if memory serves correcly

----------

## cach0rr0

 *koopdi wrote:*   

> Looks like I didn't enable that...
> 
> ```
> extract-ikconfig: Cannot find kernel config.
> ```
> ...

 

is there nothing at /proc/config.gz ?

----------

## koopdi

There is nothing at /proc/config.gz, sadly my latest attempts at configuring a new kernel have not been viable.

Something about a kernel picnic.

```
VFS: Cannot open root device "sda3" or unknown-block(0,0)

Please append a correct "root=" boot option; here are the available partitions:

Kernel panic -not syncing:VFS:Unable to mount root fs on unknown -block(0,0)

...
```

I will be back to test more things later tonight.

Now, I must take some time for homework and chilling.

----------

## cach0rr0

 *koopdi wrote:*   

> There is nothing at /proc/config.gz, sadly my latest attempts at configuring a new kernel have not been viable.
> 
> Something about a kernel picnic.
> 
> ```
> ...

 

0,0 == you're missing support in the kernel for your hard drive controller

most likely if it's a somewhat recent motherboard, all you will need is CONFIG_SATA_AHCI

and of course you will need to build support for the file system you use for your root partition *into* the kernel, and not as a module, else you'll get something like 'unknown block(8,3)'

highly recommend using one of pappy's kernel seeds for this. See my signature for a link and HOWTO. If you get stuck, post your lspci -n and dump your kernel config onto pastebin.com, we should be able to tell you anything you're missing.

----------

## koopdi

Ok, I've got a bit of time from schoolwork for important stuff like configuring the kernel!

Here's my kernel config (non working):

http://pastebin.com/ALcWABmR

I do have a PCI-->SATA card but my gentoo installation is on just an old fashioned IDE PATA drive, connected to the motherboard.

//lspci -n

```

00:00.0 0600: 1022:7454 (rev 13)

00:01.0 0604: 1022:7455 (rev 13)

00:06.0 0604: 1022:7460 (rev 07)

00:07.0 0601: 1022:7468 (rev 05)

00:07.1 0101: 1022:7469 (rev 03)

00:07.2 0c05: 1022:746a (rev 02)

00:07.3 0680: 1022:746b (rev 05)

00:07.5 0401: 1022:746d (rev 03)

00:18.0 0600: 1022:1100

00:18.1 0600: 1022:1101

00:18.2 0600: 1022:1102

00:18.3 0600: 1022:1103

00:19.0 0600: 1022:1100

00:19.1 0600: 1022:1101

00:19.2 0600: 1022:1102

00:19.3 0600: 1022:1103

01:00.0 0c03: 1022:7464 (rev 0b)

01:00.1 0c03: 1022:7464 (rev 0b)

01:03.0 0200: 8086:1013

01:05.0 0180: 1095:3114 (rev 02)

01:09.0 0401: 1102:0002 (rev 06)

01:09.1 0980: 1102:7002 (rev 06)

01:0a.0 0c00: 1106:3044 (rev 80)

01:0b.0 0c03: 1106:3038 (rev 61)

01:0b.1 0c03: 1106:3038 (rev 61)

01:0b.2 0c03: 1106:3104 (rev 62)

02:00.0 0300: 1002:5961 (rev 01)

```

Does anyone know of a backup of pappy's guide? His website has been down for a while now.

----------

## cach0rr0

he has failover sites actually, try this:

http://kernel-seeds.bloodnoc.org/

----------

## koopdi

Awesome. Sweet. Tubular. Rad.

Gracias.

I got it to work in 2.36.6-r5 gentoo-sources using the staging driver.

Following pappy's guide was very helpful. 

A big thank you to everyone who has given me hints!

Now, if I ever do this again, it'll only take like 20 min.

----------

## cach0rr0

 *koopdi wrote:*   

> 
> 
> Now, if I ever do this again, it'll only take like 20 min.

 

True story, thanks largely to Pappy's seeds, you really only have to know what drivers your hardware needs, have a general idea where to find them, tick the box, and you're on your way. 

You get that memorized, building a kernel goes from probably the most difficult install task, to a half hour (config + compiling) every so often when you feel like updating. 

It *will* become second nature, and quick. No worries.

----------

