# [SOLVED] compiling rt2870 drivers fails

## tjekke dine lommer

everything goes fine until at the file "sta_ioctl.c":

```
/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c: In function 'rt_ioctl_siwencode':

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:1479: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~'

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c: At top level:

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2986: error: unknown field 'private' specified in initializer

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2986: warning: initialization from incompatible pointer type

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2987: error: unknown field 'num_private' specified in initializer

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2987: warning: excess elements in struct initializer

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2987: warning: (near initialization for 'rt28xx_iw_handler_def')

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2988: error: unknown field 'private_args' specified in initializer

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2988: warning: excess elements in struct initializer

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2988: warning: (near initialization for 'rt28xx_iw_handler_def')

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2989: error: unknown field 'num_private_args' specified in initializer

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2989: warning: excess elements in struct initializer

/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:2989: warning: (near initialization for 'rt28xx_iw_handler_def')

make[2]: *** [/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.o] Error 1

make[1]: *** [_module_/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux] Error 2

make: *** [LINUX] Error 2

```

some interesting stuff from dmesg:

```

[  355.462590] rt2870sta: version magic '2.6.32-5-686 SMP mod_unload modversions 686 ' should be '2.6.37 SMP mod_unload PENTIUM4 '

[  359.008904] rt3070sta: version magic '2.6.33.4-smp SMP mod_unload 686 ' should be '2.6.37 SMP mod_unload PENTIUM4 '
```

Kernel is 2.6.37-gentoo-r4

all help appreciated.Last edited by tjekke dine lommer on Tue May 31, 2011 8:01 pm; edited 1 time in total

----------

## NeddySeagoon

tjekke dine lommer,

```
[  355.462590] rt2870sta: version magic '2.6.32-5-686 SMP mod_unload modversions 686 ' should be '2.6.37 SMP mod_unload PENTIUM4 '

[  359.008904] rt3070sta: version magic '2.6.33.4-smp SMP mod_unload 686 ' should be '2.6.37 SMP mod_unload PENTIUM4 '
```

You appear to have several binary versions of rt2870sta made for different kernela and different CPUs than your current kernel and selected CPU options.

Rebuild and reinstall your kernel and modules starting with a make clean.  Until you get rid of the version magic issues, none of the other error messages will be useful.

----------

## chithanh

Don't use the driver from Ralink. Use the in-kernel rt2800pci/rt2800usb driver instead. You need to install firmware, e.g. through the linux-firmware package. For RT3070 or newer, kernel 2.6.38 is recommended.

----------

## tjekke dine lommer

 *chithanh wrote:*   

> Don't use the driver from Ralink. Use the in-kernel rt2800pci/rt2800usb driver instead. You need to install firmware, e.g. through the linux-firmware package. For RT3070 or newer, kernel 2.6.38 is recommended.

 

that was my initial plan, but I put rt2870.bin in /lib/firmware and there is still no interface for my adapter.

----------

## tjekke dine lommer

 *NeddySeagoon wrote:*   

> 
> 
> You appear to have several binary versions of rt2870sta made for different kernela .

 

if binary versions of rt2870sta are modules then I do not have any.

----------

## tjekke dine lommer

Now I tried using a kernel that is a bit different. Result: there's nothing in dmesg and the error output in the compilation process is the same.

----------

## chithanh

I don't think you will have any success with out-of-tree rt2870sta build and a recent kernel.

----------

## tjekke dine lommer

 *chithanh wrote:*   

> I don't think you will have any success with out-of-tree rt2870sta build and a recent kernel.

 

I'm still a nub at this stuff so could you tell me where can I get an in in-the-tree build (if such a thing exists) or what should I do to make this work?

----------

## chithanh

You need to use the in-kernel rt2800pci or rt2800usb driver. The kernel must be recent enough (2.6.37 supports only older devices), and the firmware must be installed.

----------

## tjekke dine lommer

 *chithanh wrote:*   

> You need to use the in-kernel rt2800pci or rt2800usb driver. The kernel must be recent enough (2.6.37 supports only older devices), and the firmware must be installed.

 

okay, the firmware is in /lib/firmware (that should mean installed, correct?). how do I go about 'using' the in-kernel driver? how do I 'use' it?

----------

## chithanh

You go to kernel menuconfig and enable the option for the driver.

If it is a PCI device, on next reboot you can run "lspci -k" to see if the driver is actually used.

----------

## tjekke dine lommer

where exactly in menuconfig can I find it? I went through networks->wireless & device drivers and did not find it.

----------

## s4e8

The in-kernel staging ralink drivers removed completely in 3.0-rc1, and replaced by a new one.

Both 2.6.39 and 3.0-rc1 ralink driver work fine here, but 3.0-rc1 seems cleanly, and NON-staging.

----------

## chithanh

While in menuconfig, you can press / to search for RT2800

It will show you the location and any dependency that you need to enable first, before that option is shown.

----------

