1

I have never compiled a driver before so I'm trying to figure out how to do this. I'm on kernel 3.14.1 by the way. I'm trying to build Ralink RT3573 drivers from github. I'm getting errors when I do sudo make. The build instructions are confusing. Can someone take me through them? Here's the github link: https://github.com/ashaffer/rt3573sta

Build Instructions:  
====================

1> $tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz
go to "./DPB_RT2870_Linux_STA_x.x.x.x" directory.

2> In Makefile
 set the "MODE = STA" in Makefile and chose the TARGET to Linux by set "TARGET =     LINUX"
 define the linux kernel source include file path LINUX_SRC
 modify to meet your need.

3> In os/linux/config.mk 
define the GCC and LD of the target machine
define the compiler flags CFLAGS
modify to meet your need.
** Build for being controlled by NetworkManager or wpa_supplicant wext functions
   Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y'.
   => #>cd wpa_supplicant-x.x
   => #>./wpa_supplicant -Dwext -ira0 -c wpa_supplicant.conf -d
** Build for being controlled by WpaSupplicant with Ralink Driver
   Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n'.
   => #>cd wpa_supplicant-0.5.7
   => #>./wpa_supplicant -Dralink -ira0 -c wpa_supplicant.conf -d

4> $make
# compile driver source code
# To fix "error: too few arguments to function ¡¥iwe_stream_add_event"
  => $patch -i os/linux/sta_ioctl.c.patch os/linux/sta_ioctl.c

5> $cp RT2870STA.dat  /etc/Wireless/RT2870STA/RT2870STA.dat

6> load driver, go to "os/linux/" directory.
#[kernel 2.4]
#    $/sbin/insmod rt2870sta.o
#    $/sbin/ifconfig ra0 inet YOUR_IP up

#[kernel 2.6]
#    $/sbin/insmod rt2870sta.ko
#    $/sbin/ifconfig ra0 inet YOUR_IP up

7> unload driver    
$/sbin/ifconfig ra0 down
$/sbin/rmmod rt2870sta
user302082
  • 11
  • 1
  • 2
  • The github version does not compile properly on my 3.13.0-xx system; I doubt it will on your 3.14 kernel, either. Please edit your question to add details of your device from: lsusb Thanks. – chili555 Jul 10 '14 at 11:38

1 Answers1

1
  1. Assuming you have downloaded the driver file somewhere (perhaps your home directory), untar it: tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz
    then change to the directory just created
    cd DPB_RT2870_Linux_STA_x.x.x.x
  2. This step asks you to edit the file Makefile:nano Makefile
    but as far as I can tell, the settings are already correct. Leave that until you find problems in a later step.
  3. The same for the file os/linux/config.mk. Again, the defaults look OK. The lines that explain whether to opt for "Native WPA Supplicant support" contain commands that you would use after the driver has been compiled. WPA Supplicant is the component that will use your driver to connect to a network.
  4. Go back to the top of the directory tree (i.e. ~/DPB_RT2870_Linux_STA_x.x.x.x) and execute the command make. Apparently, the "too few arguments" error is so common that RALINK have provided a workaround. If you get this error, enter the patch command provided and try make again.
  5. The driver needs a data file, so you copy this to /etc/Wireless (you will need sudo).
  6. You should now be able to load the driver module (i.e. place it in memory where the kernel can use it): cd os/linux sudo /sbin/insmod rt2870sta.ko sudo ifconfig ra0 inet YOUR_IP up
    This will load your module once. To have your module loaded after every reboot, you will need to take some additional actions.
  7. These are instructions for unloading your module.
Jos
  • 29,224