Don't customize the EXTRAVERSION in the Makefile as suggested in the Kernel 2.6 Howto — if you change the kernel version parameters the compiled driver won't install, instead you'll get a version magic error out of insmod(8).
RaLink 2400 Wireless LAN Card Linux Installation
<srackham@methods.co.nz>
October 2004
Debian 2.6 kernel RaLink 2400 Wireless LAN card installation. The installation works for me but you will note a number of questions along the way — let me know if you know the answers.
Introduction
The RaLink 2400 chipset is used to implement 802.11b Wireless LAN NICs. These notes describe how I installed a RaLink based NIC (the Dick Smith XH8135 Wireless LAN PCI card) under MEPIS Linux 2004.2 (which is a Debian based Linux distribution based on the Linux 2.6.7 kernel).
NOTE:
-
I used version 1.2.1 of the RT2400 open source driver.
-
My LAN WAP (Wireless Access Point) that I'm connecting to from the MEPIS based workstation has 64 bit WEP encryption and has a MAC based access control list.
The installation involves:
-
Intalling kernel source.
-
Downloading, compiling and installing the RaLink 2400 Open Source driver.
-
Configuring a TCP/IP connection to the LAN wireless access point (WAP).
-
Configuring NFS mounts from the LAN NFS server.
Performance for file transfers to DWL_1000AP access point was around 300KB/s.
Before you Start
Install the NIC and check it has been detected on the PCI bus:
$ lspci | grep RaLink 0000:00:0d.0 Network controller: RaLink Wireless PCI Adpator RT2400 / RT2460
Installing the Kernel Souce Code
The kernel source code needs to be installed as it is used when compiling the RT2400 driver.
These notes relate to MEPIS 2004.2 and were based on the Debian Kernel 2.6 HowTo:
-
Install the following packages (I found the KPackage GUI installer which is installed as part of the MEPIS desktop is by far the easiest way to find and install packages):
kernel-source-2.6.7 kernel-package kernel-tree-2.6.7 (not sure this package was necessary)
-
Before unpacking the .bz2 source archive move the existing source directory which contains MEPIS kernel patches):
# cd /usr/src # mv linux-2.6.7 linux-2.6.7.ORIG
-
Unpack the source (as per Debian Kernel Howto) and apply all the patch files in the linux-2.6.7.ORIG.
# tar -xjf kernel-source-2.6.7.tar.bz2 # ln -s kernel-source-2.6.7 linux-2.6.7 # ln -s kernel-source-2.6.7 linux # cd linux # patch -p1 < ../linux-2.6.7.ORIG/Win4Lin3-2.6.7.patch # patch -p1 < ../linux-2.6.7.ORIG/linux-2.6.4-mppe-20040216.patch # patch -p1 < ../linux-2.6.7.ORIG/bootsplash-3.1.4-sp3-2.6.7.diff # patch -p1 < ../linux-2.6.7.ORIG/mki-adapter26_1_3_6.patch
Copy the MEPIS .config file to the sources folder:
# cp ../linux-2.6.7.ORIG/.config .
At this point I thought that the sources should be installed but found that the driver did not compile until I had (at least started) to build the kernel:
# make-kpkg buildpackage --revision Custom.1 kernel_image
If you don't want to wait for the kernel to build Ctrl+C after a minute or so to abort.
What was it that make built over and above the sources that the driver make requires? Have read that make config is what's needed-- need to check this out.
Now you can go ahead and compile the driver.
NOTE:
Compiling the Driver Module
The rt2400 driver source code project can be found at http://rt2400.sourceforge.net/.
Download the driver and compile the driver module:
$ cd ~/tmp $ tar -xzf rt2400-1.2.1.tar.gz $ cd rt2400-1.2.1/Module/ $ make
Install the Driver Module
Run make again:
$ su # make install
The rt2400.ko driver is installed in /lib/modules/2.6.7/kernel/drivers/net/wireless/. It's interesting to note that there are also wireless driver modules in /lib/modules/2.6.7/wireless (what's the significance of the two locations?).
Although the module Makefile appends the ra0 module alias to /etc/modules.conf this is not where it's meant to go in Debian — manually add the following line to the end of the `/etc/modprobe.d/aliases' file:
alias ra0 rt2400
You should now find two RT2400 related aliases in the modprobe(8) configuration:
$ modprobe -c|grep rt2400 alias ra0 rt2400 alias pci:v00001814d00000101sv*sd*bc*sc*i* rt2400
Now logon as root and check the driver loads:
$ su # ifconfig ra0 ra0 Link encap:Ethernet HWaddr 00:08:A1:77:13:08 :
Executing ifconfig(8) will automatically load the rt2400 driver (aliased to ra0 for convenience). Note down the HWaddr (MAC address) you'll need this to add to your WAP's (Wireless Access Point's) access control list.
You can check the driver has loaded with:
$ lsmod | grep rt2400 rt2400 58656 0
Configuring the TCP/IP Wireless Connection
Add something like the following the /etc/network/interfaces file (change the :
auto ra0
iface ra0 inet static
address 192.168.1.14
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
up \
/sbin/iwconfig ra0 mode Managed && \
/sbin/iwconfig ra0 enc restricted && \
/sbin/iwconfig ra0 key 0123456789 && \
/sbin/iwconfig ra0 ap 01:23:45:67:89:0a && \
/sbin/iwconfig ra0 essid Flophouse
Although I would have prefered to dynamically set the IP address using DHCP the pump -i ra0 command seems to upset the ra0 driver (why?).
key is the 64 bit access point WEP, ap is the MAC of the WAP (not the ra0 interface). Checkout the ./Modules/docs/iwconfig_usage.txt file in the RT2400 driver distribution for wireless configuration examples.
I do not use any wireless-tools wireless_<function> <value>' type directive because they are executed before the interface comes up by /etc/network/if-pre-up/wireless-tools` but the driver prefers the iwconfig(8) commands after the interface is up — hence the up directive commands.
Now check the inteface configuration by taking ra0 down and up:
# ifdown ra0
# ifup ra0
# ifconfig ra0
ra0 Link encap:Ethernet HWaddr 00:08:A1:77:13:08
inet addr:192.168.1.14 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
:
The ra0 auto directive ensure the wireless interface is brought up automatically by /etc/init.d/networking at system boot.
See also:
interfaces(5), wireless(7), ifup(8), iwconfig(8).
Performance
I've run NFS and printing quiet heavily over the interface and not experienced any problems.
The rt2400 driver appears not to fully support Linux Wireless Tools extensions — I was unable to use the wavemon wireless monitor, it failed at startup unable to get range information).
See ralink-wavemon-problem.txt.
rt2x00 1.1 beta Driver Notes
Overview
Building and installing the rt2500 driver for Debian unstable (Sid) This worked with a 2.6.9 kernel on 27.Jan.2005 with driver 1.1 beta
If you are running a standard Debian kernel you don't need to download all 35MB of the source because Debian kindly provide a kernel-headers package to match each stock kernel. Install the correct headers, download and untar the rt2500 driver, cd to the Module directory, make. You now have a kernel module. insmod the module and configure the network interface. Done.
Details
-
Plug in the card and check lspci to see that it is recognised (Listed as Network controller: Ralink)
-
Check uname -a to see which kernel version you are running
-
Install the kernel-headers package that exactly matches your kernel (about 3MB)
-
Download and extract (tar -xzf) the ralink driver
-
cd to the Modules subdirectory
-
(For version 1.1 of the driver just make - no need for steps 6-8) cp 2.6.x/Makefile . (the supplied Makefile for the 1.0 driver is for 2.4.x)
-
cat Makefile (to see the make instructions at the end of that file)
-
Make using the kernel-headers (eg make -C /usr/src/kernel-headers-2.6.9-2-686 SUBDIRS=~PWD modules)
-
insmod rt2500.ko
-
Set up /etc/network/interfaces similar to this (note you can't use wireless- extensions as the rt2500 needs the interface up before it can be configured):
iface ra0 inet static address 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 up iwconfig ra0 essid MYAP && iwconfig ra0 key restricted 1234567890 gateway 192.168.1.1
You can use dhcp instead of (static, address, netmask) for a dynamic IP in which case you will get the warning sit0: unknown hardware address type 776 which doesn't seem to matter.
-
ifup ra0 and look for pretty flashing lights
-
ping www.bbc.co.uk to check all is well
-
It may just be my wireless router but I had a few problems with the link breaking and my router locking up. I solved this by setting the fragmentation threshold at the router to 1000 (default is 2346 = off). It slows down throughput if the signal is very good (by about 40%) but improves it when there is lots of noise. With the lower threshold I was able to transfer a 48MB file in 68 seconds with WEP enabled, this came down to about 40 seconds with 2346 threshold (wavemon reported link quality at 97%).
Installing and tidying up
-
Don't use make install as it modifies /etc/modules.conf which is not the Debian Way
-
Copy the rt2500.ko module into the modules tree for your kernel (eg /lib/modules/2.6.9-2-686/kernel/drivers/net/wireless)
-
Put in an alias to associate that module with the Ralink card. All the files in /etc/modprobe.d are read by modprobe so just create a new file with the alias:
echo "alias ra0 rt2500" >/etc/modprobe.d/rt2500
-
Check it's working by doing rmmod rt2500; depmod -a; modprobe ra0 - it should load the rt2500 module
-
In future you can simply plug in the card and say ifup ra0 to activate the link.
-
You can automate this if you want by creating a file with execute permission called /etc/hotplug/pci/rt2500 with these 3 lines:
#!/bin/bash # This file is executed by hotplug when the rt2500 card is inserted /sbin/ifup ra0