Configuring Slackware to Work With Orinoco ISA-PCMCIA

The Situation

You may have read my other page, where I talk about all the difficulty I had trying to get my Orinoco Silver PC card to work with the Orinoco PCI-PCMCIA adapter under linux. I finally decided that was a dead end, and sourced an ISA-PCMCIA adapter from eBay. On this page I will discuss how I configured Slackware linux to work with the card and adapter, so that I could run Airsnort for breaking WEP. You can either follow along and see all my mistakes, or jump straight to the exact steps I came up with here.

Getting Started

Time for a clean install. For the umpteenth time I boot from the Slackware 8.1 boot CD, and run setup. To make things faster I only have two partitions: a 512Mb swap partition, and a root partions that takes up the rest of the 8Gb disk. The swap partition has already had mkswap run on it, so I skip that portion of the setup, and just add the swap partition to the /etc/fstab file (which is in /mnt/etc/fstab when you boot off the CD). I reformat the root partition and install the packages I want: A, AP, D, F, K, L and N. The L package is libraries, and it is new for 8.1. After some experimentation I realized that the L package is required to build the kernel, so I make sure it is installed. I go through all the other Slackware install stuff, and then remove the CD and boot off the hard drive. Then I stick in my Orninoco PCMCIA card, just to make sure the the hardware and the OS can recognize it and communicate with it. Next step is to remove all support for the card from the kernel.

Time To Make The Kernel

Now it's time to build a kernel. We pretty much want a standard kernel, except we do not want support for PCMCIA. We don't want any pcmcia code as part of the kernel, or in a loadable module. Instead we want to use the pcmcia-cs standalone pcmcia code. For some reason the default config file does has PCMCIA_CONFIG=n, so I don't even bother doing a make config, and instead just run make bzImage to make a kernel. After the kernel builds, run make install, and then reboot. Stick in the Orinoco card to make sure the kernel doesn't recognize it.

Adding in External Standalone PCMCIA Support

We download the latest pcmcia-cs tar file from sourceforge, and install it in the /usr/src directory. Delete the modules from /lib/modules/2.*/pcmcia. Run make config, make all, make install. Remember that (why?) pcmcia-cs installs rc.pcmcia as /etc/rc.pcmcia.N, so rename it without the .N. Reboot. Darn. I can see the card with "cardctl ident", but iwconfig can't see it at all. And there's no error messages in /var/log/messages. And there is no orinoco module loaded when I do a lsmodules. Hmmm. Okay, do a cardctl eject and cardctl insert. I hear the high beep, low beep as the card is recognized. Now there are error messages in /var/log/messages, saying that there are unresolved symbols in orinoco_cs.o after a modprobe orinoco_cs . Okay, now I have a test command to run to try and load the right modules. When I run it, I get the same errors as the log file. Try running depmod to resolve the dependencies. It fails in the pcmcia modules directory. All the problems seem to be with the modules created by the standalone pcmcia-cs code. Let's remake and reinstall, and reboot the pcmcia-cs code. Bleah, it fails the same way when it runs depmod. Well, there seems to be a problem with the modules, so make all the modules for the kernel. (cd to /usr/src/linux, make modules). Wait, as I watch it compile, I see that we're compiling modules for networking cards! Why are we doing that, if we want to use the external standalong pcmcia-cs networking modules? In the kernel configuration I have networking turned on, but maybe I need to explicitly deconfigure all the support for specific ethernet cards. I'll come back to this, but first I do the make modules_install, and watch it fail depmod on four modules. They're modules I'll never use, so for now I just delete them, and rerun depmod. I have to remove one more module, kernel/drivers/net/wan/wanpipe.o, and then depmod works. Four of the five problem modules are *_cs.o modules, so I wonder if that's a clue... Wow, now I can run modprobe orinoco_cs successfully, and I can run cardctl eject and cardctl insert, and then I can see the card with ifconfig, but not iwconfig. Almost there. Let's reboot, just for fun. This time when the booting kernel finds the card it gives high beep, high beep, which I have have not heard before. It has always been high beep, low beep. And I still can't see the card with iwconfig, but I can see (and modify) it with ifconfig. Time to pull down the latest wireless tools? Doesn't seem to help.

Now What?

This is odd. I can set the IP address of the card with ifconfig, but I can't use iwconfig to set its essid (or anything else). Maybe I'll do a little research, just to be absolutely sure that the promiscuous mode I want is only available in the standalone driver, and not in the standard one.

I've been looking at a writeup by blackwave on Kismet with Slackware 8.1 which talks about getting Kismet to work with Slackware and an Orinoco card. It's pretty close to what I want to do. One of the things he points out is that the patches to put the Orinoco card into promiscuous mode are for version 3.2.1 of pcmcia-cs, so I need to back up to that version anyway. It's almost time for lunch, so I will start a fresh install on the test machine, and it let it crank away. I'll also create a small partition on the test machine to store the files that I have to add to the distribution, like pcmcia-cs and config files.

I came back after lunch and booted my clean install. Plugged the Orinoco card in and heard two high beeps. Everything worked just fine with the standard system. Then I started hacking on it afresh. Here is a much-simplified version (minus the mistakes) of what I did.

The Straightest Path to Monitor Mode With An Orinoco Card

Get the 2.4.20 kernel

As blackwave suggests, you can get the source for the 2.4.20 kernel here. Pull the source down, untar it, do make mrproper, and configure it. The configuration is what gave me lots of trouble. I use make config, but I guess there are a lot of gui-type alternatives out there. The critical things seem to be:
CONFIG_PCMCIA=n
CONFIG_NET_RADIO=y
CONFIG_WAVELAN=y
CONFIG_HERMES=y
CONFIG_PCI_HERMES=y
CONFIG_NET_WIRELESS=y

Once you've done the configuration, do your
make dep
make clean
make bzImage
make modules
make modules_install

Blackwave gives some excellent instructions on how to install the kernel, which I won't repeat here.

Get the 3.2.1 pcmcia-cs Code and Patch It

The standalone pcmcia-cs code is available on sourceforge. Pull it down, unzip it, and untar it in the /usr/src directory. Now patch it with the promiscuous mode code changes. Get the patch from shmoo. Copy it into the /usr/src/pcmcia directory and run patch .p0 < pcmcia-cs-3.2.1-orinoco-patch.diff
Now build and install with:
make config
make all
make install

The pcmcia-cs install does not install the startup script directly; instead it puts it as /etc/rc.d/rc.pcmcia.N. Move it to /etc/rc.d/rc.pcmcia.

One last step, and I'm not really sure why this is necessary. Edit the /etc/pcmcia/config file, and look for the line:
device "orinoco_cs"
Make sure that the next line includes the hermes and orinoco_cs modules, like so:
class "network" module "hermes", "orinoco", "orinoco_cs"
At this point you should be able to reboot, and have the card recognized by the kernel. The "high beep, low beep" sound is bad, the "high beep, high beep" sound is good.

Now run iwpriv to make sure you see "monitor" as the last line, which proves that you have successfully patched your Orinoco driver to add a monitor ioctl. Yay.

On to the next portion of our project, which is getting Airsnort running, so we can see just how hard it is to crack WEP. Details here.