[ltp] Newbie's Guide to Wireless LAN on Thinkpad 42p with Atheros Chipset

James Ryan linux-thinkpad@linux-thinkpad.org
Mon, 21 Jun 2004 02:48:12 -0400


After MUCH frustration, I just managed to get wireless LAN working on my
new Thinkpad 42p with tri-band Atheros WLAN chipset.

Just to save anyone else the frustration, here's what I did:

1. Download the madwifi source.  Since it is not released, you need to
use the "cvs" command, as follows:

First, login to the madwifi CVS repository:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi login
When it asks you for a password just press Enter.

Next, download the source:
cvs -t -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi
checkout madwifi

IMPORTANT: this will download all the source and create all the
directories in the current directory.  Make sure you don't have any
spaces or other nonstandard characters anywhere in the path to your
current directory or cvs will fail.

Next, you need to compile.  If you want your WLAN LED to work properly,
before compiling, type this at the shell prompt:
export COPTS="$COPTS -DSOFTLED"

Next, type:
make

It will compile.  Don't worry about the "undefined module" errors.  Oh,
you need to have kernel source on your machine and kernel modules
enabled.  There are tons of sites that explain how to do both if you've
never done it before.

Next:
make install

This should copy the compiled modules to the proper directory for your
distribution, but if it doesn't just copy them manually.  The modules
are:
  wlan.o  ath_hal.o  ath_pci.o (for 2.4.x kernels) or
  wlan.ko  ath_hal.ko  ath_pci.ko (for 2.6.x kernels)

Next, type the following three lines at the shell prompt:
modprobe wlan
modprobe ath_hal
modprobe ath_pci

If all goes well, you should now have a new wireless network device
called "ath0".  To find out, type:
iwconfig

and it should list "ath0" as a wireless network device.

Now, configure it.  It's helpful to bring up the interface first, since
it will auto-configure a lot of settings.
ifconfig ath0 xxx.xxx.xxx.xxx netmask yyy.yyy.yyy.yyy up

Of course, you need to specify your ip address and netmask here.

Next, choose one of the following to set whether you want to use 802.11
a, b or g.

iwpriv ath0 mode 0
iwpriv ath0 mode 1
iwpriv ath0 mode 2
iwpriv ath0 mode 3

In the above, 0 is autoselect (the default), 1 is 802.11a only, 2 is
802.11b only and 3 is 802.11g only.

You may need to manually turn on the transmit power:

iwconfig ath0 txpower auto

Now try to scan for access points:

iwlist ath0 scan

If you don't find any, don't worry, you can manually config as follows:

iwconfig ath0 essid MyAPESSID
(sets the ESSID of the access point)

iwconfig ath0 ap xx:xx:xx:xx:xx:xx
(sets the mac address of the access point)

iwconfig ath0 enc XXXXXXXXXXXXXXXXXXXXXXX
(sets the WEP key, in hexadecimal)

There are lots more parameters you can set, type man iwconfig for help.

Finally, don't forget to set up a default gateway and domain name
servers.

route add default gw xxx.xxx.xxx.xxx ath0

To specify name servers, edit /etc/resolv.conf and add the line:
nameserver xxx.xxx.xxx.xxx

for all of your nameservers.

GOOD LUCK!