个人工具

UbuntuHelp:WifiDocs/Driver/RalinkRT73

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月24日 (四) 14:19的版本 (新页面: {{From|https://help.ubuntu.com/community/WifiDocs/Driver/RalinkRT73}} {{Languages|UbuntuHelp:WifiDocs/Driver/RalinkRT73}} == Driver Information == ** Driver Name: RT73_Linux_STA_Drv1...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索



Driver Information

    • Driver Name: RT73_Linux_STA_Drv1.0.3.0
    • Module Name: rt73.ko

Support Channels

Enter general help that will work at anytime with the driver. See section below if it's release specific

Ubuntu Release Specific Info

Under the correct section enter anything that is specifc to the release only. See above general section if it is not release specific

Dapper 6.06

To see if your USB device would be supported by this driver, have a look at the information printed on the device. In my case, the model information reads "Model No.: DWL-G122 H/W Ver.:C1 F/W Ver.:3.00" What's important here is that the hardware version is C1 - earlier models are covered by different drivers.

Also note the output of the lsusb command, which, in my case, produces the following line: Anchor(lsusb_id)

Bus 003 Device 002: ID 07d1:3c03 D-Link System

Note the two hexadecimal ID numbers (07d1:3c03), as they'll be used later when compiling the driver source.

Compile Newer Driver

Ralink driver

To compile the driver, I first downloaded the source from the Ralink support page, found at this link. The source can be found in the Linux table, in the section headed 'RT73 (RT2571W)', and from the link marked USB The current driver version is 1.0.3.6 - 2007/01/05.

You can download and unpack the sources with the following commands:

wget http://www.ralinktech.com/ralink/data/RT73_Linux_STA_Drv1.0.3.6.tar.gz
tar -xvf RT73_Linux_STA_Drv1.0.3.6.tar.gz

(There is also a firmware archive available from the same page, but the md5sum of the firmware contained therein is the same as that of the firmware in the sources archive, so it's only necessary for you to download the sources archive. This might change as time progresses, however, so it might be worthwhile to check yourself)

Once the source files were unpacked, I followed the advice in this forum posting to edit the source files. What you have to do is edit the file named 'Module/rtmp_def.h'. Find the section headed by the comment `// VENDOR ID` and add the IDs that were reported by the `lsusb` command lsusb_id earlier.

In my case, I added the lines:

#define DLVID1              0x07d1      // D-Link DWL-G122 rev C1
#define DLPID1              0x3c03

In the line starting with `#define RT73_USB_DEVICES`, just lower down, I then added the two IDs I had just defined, like so:

{USB_DEVICE(DLVID1,DLPID1)}, \

To compile, first make sure that you have the essential build tools and the kernel headers matching your kernel version, as described in KernelSource Driver. Then, it was a case of following the instructions given in the README that came with the sources.

cp -v Makefile.6 ./Makefile      # Because we are using kernel v2.**6**
make all

(When building, I get a lot of errors of the form `warning: "DBG" is not defined`. This is no cause for concern, and these warnings can be supressed by uncommenting the line `#CFLAGS += -DDBG` in the Makefile)

Now copy the newly created kernel module, and the provided firmware, into their correct directories:

sudo cp -v rt73.ko /lib/modules/`uname -r`/kernel/drivers/usb/net/
sudo mkdir -pv /etc/Wireless/RT73STA
sudo cp -v rt73.bin /etc/Wireless/RT73STA/
dos2unix rt73sta.dat
sudo cp -v rt73sta.dat /etc/Wireless/RT73STA/rt73sta.dat

(These locations don't seem to fit in with Dapper's filesystem, but we'll leave them in for the moment, anyway. What looks more logical to me is to create the RT73STA directory in /lib/firmware/`uname -r`, and place all the files in this directory. In this case, one would also have to edit the paths to the files in 'rt_config.h')

Initialising Device

Once the files had been copied to their correct locations, all I had to do was insert the module, and plug in my device, and the network was up and running!

$ sudo insmod /lib/modules/`uname -r`/kernel/drivers/usb/net/rt73.ko
$ dmesg
[ nnn.nnnnn] rtusb init ====>
[ nnn.nnnnn] usbcore: registered new driver rt73
$ # Plug in wireless adapter here
$ dmesg
[ nnn.nnnnn] usb 1-1: new full speed USB device using uhci_hcd and address 2
[ nnn.nnnnn] idVendor == 0x7d1, idProduct == 0x3c03
[ nnn.nnnnn] rausb0 (WE) : Driver using old /proc/net/wireless support, please fix driver !
[ nnn.nnnnn] rt73 driver version - 1.0.3.0
[ nnn.nnnnn] rausb0: no IPv6 routers present

To load this module automatically on boot, first you have to update the module dependency information file to include that in the rt73 module. Do this with the command

sudo depmod -a

Secondly, edit your /etc/modules file, and add the line rt73.

You can check if the module is loaded on the next boot by entering the command modprobe -l rt73, and the output should be the directory to which you copied the .ko file to earlier.

For completeness, I am including the changes I made to my rt73sta.dat file below. Unsurprisingly, wireless support is quite sensitive to the settings in this file. For instance, if I change `NetworkType` from `Infra` to `Adhoc`, as suggested in the driver source README, I am no longer able to get wireless access. The settings below are a minumum (but perhaps not the absolute minimun)

[Default]
SSID=<my essid>
NetworkType=Infra
Channel=6
AuthMode=OPEN
EncrypType=NONE

With the settings defined as above in the .dat file, I only need to include the following lines in my `/etc/network/interfaces` file to complete the configuration:

auto rausb0
iface rausb0 inet dhcp

WEP info

The above description is all it took to connect to my OPEN wireless connection point. Connecting with WEP is another story. At the moment, if I try and set a WEP key with the GNOME network manager, my entire system hangs. I'll carry on playing around, and post any further results here. Some open questions:

  • Is it easy to fix the driver so it doesn't use old /proc/net/wireless support?
  • Which is more relevant to the config - the /etc/network/interfaces file, or the rt73sta.dat file?

I found that to connect with wep I needed to make some additional changes to the /etc/Wireless/RT73STA/rt73sta.dat file. There is quit good documentation in the read me file. I set the values as follows:

SSID=mynetworkname
NetworkType=Infra
Channel=Mychannel (for example 6)
AuthMode=WEPAUTO
EncrypType=WEP
DefaultKeyID=1
Key1Type=1
Key1Str=MyWirlesspassword

For other encryption types changed AuthMode and EncrypType. You may also need to set WPAPSK to your wireless password. (I did anyway just in case.

You can then connect using the standard System --> Administration --> Networking tool. Just add your ssid into the box, no need to enter a password. ( I did this cause I use static IP address which is easy to enter in the dialog box and know you will have the right info in the right place in /etc/network/interfaces and I can never get the gateway to work if I use DHCP. Think my router might be routed!)

I was not able to get this working with gnome network manager. No wireless device could be found. I think this is because the device will not "activate" till you bring up a connection and once you do that wireless manager will ignore it cause it is referred to in /etc/network/interfaces. I'm sure there is a way round it but this is a desktop machine so I don't need to connect to multiple random networks.

Also when the device is up and connected the link light is on (Not flashing on and off). If you have network monitor in your panel change the device to rausb0,(Or as appropriate for you) just right click -->properties then typing it (rausb0) in (I never got it in the drop down box). When the device is detected but not connecting to the network there will be a small yellow bar next to the normal "two tellys" icon. Once the connection is up and running it gets longer and turns green!.

WPA info

Enter anything related to getting WPA to work (see WEP above)

References

Here are a list of the postings and webpages I consulted while trying to get this device to work:

Reader Comments

Tried to help a friend install this on his Ubuntu 6.06 today, found one gotcha (the driver file from RAlink had all source files read-only, so we needed to do chmod u+w * while in the Module directory before making the edit). Also in our source file the DEFINE statements were a single line with each device ID, so I added to that rather than defining separate values {USB_DEVICE(0x07d1,0x3c03)}, \

But regardless, the kernel module wouldn't build; it wanted to be linked into the kernel tree somehow (a symlink from /lib/modules/x.x.x/build to ~/Desktop/Ralink-Driver-x.x.x/Module ??) and we couldn't get it to go. A pointer to documentation for the slightly more ignorant would be MARVELLOUS :)

Xurizaemon, 04/08/06

Xurizaemon, I had the same problem. You have to have the kernel headers in place, and linked correctly. For instance, for kernel 2.6.15-26-386, you should have the following link: /lib/modules/2.6.15-26-386/build -> /usr/src/linux-headers-2.6.15-26-386

This should be done automagicly when you install the linux-headers package. The link is essential since the makefile calls another makefile in the directory above. If no link exists, and you are sure that you have the headers package, try the following steps from the RT73 module source directory (and replacing "2.3.15-26-386" with the result of "uname -r"):

sudo make clean
sudo ln -s /usr/src/linux-headers-2.6.15-26-386 /lib/modules/2.6.15-26-386/build
sudo make all
sudo make install

Make sure beforehand that you haven't already created the build directory, or put some symlink there in the process of trying to get it to work.

Incidentally, I managed to get WPA working by including the following lines:

SSID=mySSID
NetworkType=Infra
AuthMode=WPAPSK
EncrypType=TKIP
WPAPSK=myPassword

Where mySSID and myPassword are the SSID and WPA passkey that I chose for my wireless router.

I am using a D-Link DWL-G122 Rev. C1 USB adapter on Ubuntu Dapper.

Beldaz, 18/08/06


I was able to get WEP working with my Wireless Access Point. It was just a matter of tinkering with the /etc/Wireless/RT73STA/rt73sta.dat file, after doing some more research. It seems that the Country, Channel, DefaultKeyID should be one less than what your router says. So, if you're using Channel 11, you should use Channel=10 in your rt73sta.dat file. It worked after rebooting my system this last time (ifup was hanging my system, but I haven't retried it yet).

[Default]
CountryRegion=0 #Translates to 1, USA, I think
CountryRegionABand=7 #Whatever, it works
WirelessMode=0
SSID=MySSIDname #Your wireless network name
NetworkType=Infra
Channel=10 #This is translates to 11
AuthMode=OPEN
EncrypType=WEP
DefaultKeyID=0 #This translates to 1
Key1Type=0 #Translates to 1, Hex, I guess
Key1Str=55A966F515 #Enter your HEX key here.

Wankelrx8, 8/30/2006


It seems there is a bug in a RT73 driver. When I, with the module rt73.ko loaded, do sudo ifdown rausb0 and next sudo ifup rausb0 Ubuntu Dapper freezes. Because most graphical administration tools perform these commands in the background, we have to use iwpriv commands or edit the rt73sta.dat file and do a reboot. This is the only way to confiure WEP or WPA I found so far

cropr 8-Sep-2006


For the users of a Sitecom WL-113 v1.002 usb wireless-network adapter, this is the right driver. It works with WEP. WPA and WPA2 I have not tested yet. Before compiling the drivers, edit the file named 'Module/rtmp_def.h' and add your device ID as described above. It took me days to figure out which driver to use for this device since the WL-113 v1.001 is equiped with a zydas1211 chip (module zd1211.ko).

Xueg0i, 9/13/2006

This is the right driver for the Canyon CN-WF518 Wireless USB adapter with the Ralink chipset (September 2006). Do a 'lsusb' to find out - if it shows 'Ralink Technology, Corp.' it should work. Otherwise the chipset is zd1211-based, and you'll have to use the ZD1211 driver.

Gendor, 3 October 2006

There is a newer driver available from Ralink at USB

Documentation in the 'Module\rtemp.h' has changed: no VENDOR ID lists, just the USB_DEVICE(0x0000,0x0000)

Forums links on this page are broken.

List of Packages/Apps needed to compile/install the driver:

      • make
      • gcc
      • gcc-4.0 (not sure if this is required, but I used it)
      • g++
      • linux-headers-2.6.15-27-386 (or whatever your current kernel version is)
      • tofrodos

Works with CompuUSA 54Mbps WirelessG Mini USB Adapter, 802.11g, b (Product Number: 333626, Mfr. Part #: 140758) which uses the RT73 core. I was able to get it working with WEP on Dapper Drake.

Skywalkin1138, 2006OCT04

GPL RT73 driver

i just found that the http://rt2x00.serialmonkey.com/wiki/index.php/Downloads site have GPL drivers for the RT73 and i made then work without much trouble...

I downloaded the latest cvs driver, uncompressed it in /usr/src, entered the Modules dir and made the make and make install (having of course the gcc, correct kernel headers, etc to build it). I then added in /etc/modules the line "rt73" and in /etc/modprobe.d/rt73 "alias rausb0 rt73" and removed the obsolete /etc/modprobe.conf created by make install.

Finally i add in /etc/network/interface this:

auto rausb0
iface rausb0 inet dhcp
pre-up ifconfig rausb0 up
pre-up ifconfig rausb0 down
pre-up ifconfig rausb0 up
pre-up iwconfig rausb0 essid "MYESSID"
pre-up iwconfig rausb0 mode Managed
pre-up iwpriv rausb0 set AuthMode=WPAPSK
pre-up iwpriv rausb0 set EncrypType=TKIP
pre-up iwpriv rausb0 set WPAPSK="YOUR KEY"
pre-up ifconfig rausb0 up

i just copied this from other RT2x00 howto, don't know for sure if its really needed to push up and down the interface before configuring, must test later. i didn't edit nor need anything else for this to work.

With this i can use the usb wireless card with a shared WPA-TKIP network, probably works also with WEP. For WPA-AES, at least in teory, one should change the Encryptype to AES and should work (but didn't test it).

i can plug and unplug the usb device and the network respond as aspected, and using for some time to web and data transfer seems to be working fine.

So i think there should be no problem for most people and with luck the next release will already have this drivers.

higuita 09/10/2006