Installing the Linksys Wireless-G PCI Adapter (WMP54G) under Linux

(Last update: 15 Sep 2006)

The hardware

The Linksys WMP54G is an IEEE 802.11g (54Mbps) wireless PCI card. It is backward-compatible with 802.11b (11Mbps). It does not have the Linksys-proprietary "SpeedBooster" feature.

You can get one at amazon.com or many other places.

Linksys has sold several versions of this card. This page will be most useful to you if you have version 4.1:

The instructions that follow should be useful on most Linux distributions, but the one I used is Fedora Core 5.

Other online references

If you can't find exactly what you need here, try these other pages:

Step-by-step instructions

These instructions assume that:

Further, you should be using a recent 2.6 kernel (I used Fedora's most recent 2.6.17). Again, keep in mind that the shell examples below are from FC5.

1. Download and install the driver.

  1. Download the RT61 driver from Ralink. As of this writing, the most recent version is 1.0.4.0, available here. Copy it to somewhere reasonable, like /usr/src.
  2. Untar it, and compile the module:
    # cd /usr/src
    # tar xf RT61_Linux_STA_Drv1.0.4.0.tar.gz
    # cd RT61_Linux_STA_Drv1.0.4.0/Module
    # dos2unix Configure
    # sh Configure
    # make
    # cp rt61.ko /lib/modules/`uname -r`/kernel/drivers/net
    
    That dos2unix command is necessary because Ralink's script contains embedded ^M characters. If you don't have dos2unix, install the dos2unix package:
    # yum install dos2unix
    
  3. Add the following line to /etc/modprobe.conf
    alias ra0 rt61
    
  4. Run depmod -a

2. Download, install, and configure wpa_supplicant

  1. If you haven't already, install the wpa_supplicant package:
    # yum install wpa_supplicant
    
    This step is not strictly necessary, but it will make your life easier.
  2. Now (this is where it gets a bit strange), download the wpa_supplicant sources, available here.
  3. Copy them somewhere reasonable (for example, /usr/src) and untar:
    # cd /usr/src
    # tar xf wpa_supplicant-0.4.9.tar.gz
    
  4. Extend wpa_supplicant to support the Ralink driver:
    • Copy the Ralink driver sources to the wpa_supplicant directory:
      # cp /usr/src/RT61_Linux_STA_Drv1.0.4.0/WPA_Supplicant/driver_ralink.[ch] \
           /usr/src/wpa_supplicant-0.4.9
      
    • Apply this wpa.patch, which I created based on the instructions in /usr/src/RT61_Linux_STA_Drv1.0.4.0/WPA_Supplicant/README:
      # cd /usr/src/wpa_supplicant-0.4.9
      # patch -p0 -b < wpa.patch
      
    • Build:
      # cp defconfig .config
      # make
      
    • Replace the original wpa_supplicant with the one you just built:
      # cd /usr/sbin
      # mv wpa_supplicant wpa_supplicant.orig
      # cp /usr/src/wpa_supplicant-0.4.9/wpa_supplicant .
      
    • Prevent yum from changing your new wpa_supplicant (unless you really want it to) by adding a line like this to /etc/yum.conf:
      exclude=wpa_supplicant
      
  5. Now edit /etc/wpa_supplicant.conf to match the configuration on your wireless router. Excellent documentation on how to do this is available online, and via man 5 wpa_supplicant.conf. In my case, I have a Linksys Wireless-G broadband router (WRT54GL), which I configured to support WPA2 with TKIP and AES cyphers. As a result, my wpa_supplicant.conf looks like this:
    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=wheel
    network={
            ssid="any"
            key_mgmt=NONE
    }
    network={
            ssid="my-ssid"
            proto=WPA2
            key_mgmt=WPA-PSK
            psk=some-long-string
            priority=1000
    }
    
    The "some-long-string" is obtained by running:
    # wpa_passphrase my-ssid my-password
    
    where "my-password" is the WPA shared key you entered when you configured the wireless router.

3. Configure the init scripts

  1. Edit /etc/sysconfig/network-scripts/ifcfg-ra0 to control the new Ralink interface, ra0. For example:
    DEVICE=ra0
    BOOTPROTO=dhcp
    ONBOOT=yes
    
  2. Edit /etc/sysconfig/wpa_supplicant with information about ra0:
    INTERFACES="-ira0"
    DRIVERS="-Dralink"
    
  3. Ensure that the wpa_supplicant service runs at the run levels you care about. For example:
    # chkconfig  --level 35 wpa_supplicant on
    # chkconfig  --list wpa_supplicant
    wpa_supplicant  0:off   1:off   2:off   3:on    4:off   5:on    6:off
    

4. Test things out

  1. Stop services:
    # service wpa_supplicant stop
    Stopping wpa_supplicant:                                   [  OK  ]
    # service network stop
    Shutting down loopback interface:                          [  OK  ]
    [root@home wpa_supplicant]# ifconfig
    
  2. Restart them:
    # service network start
    Bringing up loopback interface:                            [  OK  ]
    Bringing up interface ra0:                                 [  OK  ]
    # service wpa_supplicant start
    Starting wpa_supplicant: ioctl[SIOCGIWAP]: Transport endpoint is not connected
    ioctl[SIOCGIWAP]: Transport endpoint is not connected
    ioctl[SIOCGIWAP]: Transport endpoint is not connected
    ioctl[SIOCGIWAP]: Transport endpoint is not connected
                                                               [  OK  ]
    
    The errors appear to be transient. I don't know what causes them.
  3. Look around:
    # ifconfig ra0
    ra0       Link encap:Ethernet  HWaddr 00:18:39:06:7F:38
              inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::218:39ff:fe06:7f38/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:140167 errors:0 dropped:0 overruns:0 frame:0
              TX packets:89614 errors:14 dropped:14 overruns:0 carrier:0
              collisions:14747 txqueuelen:1000
              RX bytes:19385867 (18.4 MiB)  TX bytes:127430668 (121.5 MiB)
              Interrupt:209
    # ping 192.168.1.1
    PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=3.59 ms
    64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.803 ms
    
    --- 192.168.1.1 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1001ms
    rtt min/avg/max/mdev = 0.803/2.196/3.590/1.394 ms
    

Outstanding issues