Configuring Slackware to Work With Orinoco PCI-PCMCIA

The Situation

I have a Lucent Orinoco Silver card that works great in my Windows notebook. It has an external antenna connector that I use with a commercial magmount omni antenna, and also with a homemade omni and a cantenna. Now I wanted to use the card and a cantenna and AirSnort to try cracking the WEP on my home wireless network. I only have one notebook and I didn't want to tie it up for a week, so I decided to use an old desktop. I got a Dell 400MHz Celeron at the county surplus store, and an Orinoco PCI-to_CardBus card so I could use the Orinoco card in the PC. I began working with my install CDs for Slackware 8.0 and various versions of pcmcia drivers. I had some success, but could not get it working fully. I was just floundering around trying different things, but not really keeping any records. I decided to start again and write down what I was doing, so that I would be able to repeat it. I would start by just trying to get linux to recognize the card. I would worry later about patched drivers and promiscuous mode and AirSnort.

Step 1 - Start from scratch

Do a clean Slackware install. I'm using the Slackware 8.0 CDs. I only access the machine via the console or telnet, so I don't use any of the X stuff. The only packages I use are A, AP, D, F, K and N. I only install the 2.4.5 kernel, modules and source, not the 2.2.19. You might be able to skip this step, but I did it so I would know for sure what I was working with. I re-did the install a couple times while figuring all this out, when I felt like I had installed too many additional drivers and utilities while trying different things. It only takes 15 minutes or so for a complete install.

Step 2 - Modifications for the PCI Adapter

I installed the PCI-to_CardBus card, plugged the Orinoco card into it, and booted the PC. Lots of errors in /var/log/messages. With the cardctl ident command I could see that the system knew a card was present, but nothing else. Inserting a PCMCIA-Compact Flash card gave the same info as the Orinoco card. At least I could use cardctl eject and cardctl insert to get the card in and out.
Apparently the Orinoco PCI adapter is not quite standard. It uses the TI 1410 chip as a PCI-to-Cardbus bridge, which is compatible with the i82365 chip, which is the most common one, so no problem there. But it has some kind of non-standard high memory mapping. I'm assuming the memory mapping is for control registers or packet queues or something like that. In the /var/log/messages file the PCMCIA code generates a line that says:
TI 1410 rev 01 PCI-to-CardBus at slot 02:0a, mem 0xfb000000
I finally realized that I should use this info to change the high memory arguments in /etc/pcmcia/config.opts. At first I just used 0xfb000000-0xfbffffff, but after seeing some more errors in the message file I ended up changing it from:
include memory 0xa0000000-0xa0ffffff, memory 0x60000000-0x60ffffff
to
include memory 0xfb100000-0xfbffffff

In the same way I found I had to change the low memory from
include memory 0xc0000-0xfffff
to
include memory 0xc8000-0xcffff, memory 0xd8000-0xdffff

I also found I had to change the ports, again using error messages from /var/log/messages. I changed them from:
include port 0x100-0x4ff, port 0x800-0x8ff, port 0xc00-0xcff
to
include port 0x3e0-0x4cf, port 0x4d8-0x4ff, port 0x00-0xcff

Step 4 - The Wireless Tools

Now I could see the card using cardctl ident, and the wvlan_cs driver was automatically loading. I got error messages from somewhere (I forget where) suggesting that I use iwconfig instead ofifconfig to configure the card. So I did a google and found the Wireless Tools for Linux . I downloaded them and followed the instructions to make and install them, and found that with iwconfig I could see the wireless card and do some configuration to it. But I got a bunch of errors telling me I was using an out-of-date driver. It was time to get the right driver.

Step 5 - The Right Driver

I had seen references to an orinoco_cs driver while I was researching AirSnort. That seemed to be the one I needed. I knew I was going to have to patch the driver eventually, so AirSnort could put the card into promiscuous mode, but for now I just wanted the card to work normally. I looked in /lib/modules/2.4.5, but I didn't see an orinoco_cs driver there. It was understandable, I'm still using Slackware 8.0, and 8.1 has been out for a while.

Okay, where would I find the driver? AirSnort pointed me to the PCMCIA CS package. I pulled down the latest package and put it in /usr/src. Reading over the READMEs seemed to say the drivers would only be built if PCMCIA_CONFIG was defined in the kernel source. I looked and found references to PCMCIA_CONFIG in the kernel Config file, so it looked like it was defined. I did a make config in the pcmcia cs package directory, and accepted the defaults, except for no 32-bit (CardBus) support. Then a make all and make install. During the make install I was getting errors when the install script ran depmod against the parport_cs.o module. I'm not really sure what that means. So I moved parport_cs.o and parport_cs.o.gz to /tmp while I ran depmod, and then I moved them back. Is that so wrong?

Time for a reboot. I guess some of this stuff will start running without a reboot, but if the OS is already running and using drivers, I figure a reboot will make sure the old drivers are unloaded. I had been working out in the carport, where the PC was set up on a workbench, but by now I had moved inside. I had run an ethernet cable out to the carport, so I could log into the PC that way. I checked the /var/log/messages file. No errors there, but iwconfig showed that the wireless card was no longer configured as eth1. The cardctl command could still see the card, and the orinoco and orinoco_cs drivers were loaded when I checked with lsmod, but the card was not longer configured. What had happened? The syslog file had an error saying:
kernel: eth1: failed to reset hardware (err = -19) so maybe a power cycle would help. No, that didn't do it. I see, I got the part about PCMCIA_CONFIG backward. Okay, first try configuring the pcmcia-cs package to use the kernel source for configuration. That got it to build without the parport error. Maybe that should have been a clue.

Okay, keep reading the documentation. Wait, here's a question by a guywho can't get the wireless tools to work. Someone suggests using a new kernel, which gets me thinking. So I go to the Slackware site and look at the 8.1 release. The release notes says there is greatly improved support for PCMCIA, to the point where any card plugged in should work without configuration. Sounds good to me. I start downloading the CD ISO from SourceForge and take a shower.

Long story short, I end up downloading ISOs for both Slackware 8.1 and for the previous nights version of Slackware. The second came from this site, which seems to make a nightly ISO available. Very cool. The next morning I burned a CD of Slackware 8.1 and left it installing while we went out to read the paper at by the beach. Came back, same basic problems. Fine, burn a CD of the latest and install it. Same basic problems. Hmmm. Now what?

Now we go down to the Renaissance Fair and spend the afternoon there, and then I go to a friend's house for a barbecue, then come back here. Well, the best I did before was to actually get things working to the point where the iwconfig command would see the card, and be able to change some things on it. I haven't been able to do that since I started writing this page. I think I may have gotten that working after I stated using the standalone pcmcia modules. With my current install I am think I am still using the kernel modules. Let's try installing the standalone pcmcia modules.

Step 6 - The Right Kernel

I have the very latest Slackware kernel installed. This is my baseline so far. I put on 3.2.3 pcmcia-cs source and run make config again, selecting the option of taking kernel configuration from the running kernel. I get an output message saying thatthe running kernel has PCMCIA driver support compiled in, so make all will make the utilities but not the drivers. Okay, try it taking configuration from the kernel source. Same result. Guess I'll have to configure and build my own kernel. I always hate doing that because there are so many config questions. There must be a way to change just one param without going through the whole script. Okay, I have disabled ISA support, which I better remember if I add an ISA-PCMCIA card. More importantly, for the PCMCIA/CardBus support option I answer 'm', which should enable loadable modules. Not sure if I should be saying 'm', or 'n', to disable PCMCIA altogether. We'll see. I also answer 'n' to CardBus support, because that's for 32-bit PCMCIA, and I am just using 16-bit. I answer 'n' to bridge support for i82365 as well. For everything else I just take the defaults. Run make config in the pcmcia directory again, and it still says it won't build the drivers. Go back and configure the kernel again, explicitly answering 'n' to the PCMCIA support, and at last the pcmcia code says it will build the drivers. Now build the kernel. Argh, now I'm getting include file errors when I run make dep. Reboot off the install CD and reinstall the kernel source. Try running make dep. No go. This sucks. Okay, let's reinstall the latest Slackware ISO, and see if I can build a kernel off a clean install.

I did do one thing different on this install, I included the new L package of libraries, which are needed by gnome and kde. Probably doesn't make a difference, but I will try it. If this doesn't work I guess I am going back to the Slackware 8.1 release. While this install is running I have found a new web page with a lot of info on running the Orinoco card and the TI 1440 chip with linux. Okay, fresh install finished. Let's run make dep in the linux source directory and see what happens. Works. Now a kernel build and install and boot. I'm wondering now if configuring the standalone pcmcia-cs source is what screwed things up? That took a while. First I had to keep unconfiguring things in the kernel so it would all fit in bzImage (never seen that problem before). Then I had to figure out that /etc/lilo.conf was looking for vmlinuz in the boot directory, not in /. Then I configured and make and installed the standalone pcmcia package, but it failed during the install on depmod in some of the kernel modules in /lib/modules/2.4.5/. Maybe this is because those modules are left over from the original install, and the kernel that I built has them deconfigured. So I deleted everything in the module directory and did a make modules in /usr/src/linux. When that finishes I will make and install the standalone pcmcia stuff again and see if it succeeds.

Still fighting with it. Installed the kernel modules, installed the standalone pcmcia modules, rebooted, still don't have an eth1 device. I can't recall how I got that far way back when I started this. I bought an ISA-PCMCIA card on eBay tonight, so I am thinking about taking a break from this until it gets here. Maybe it will fix all my problem. And maybe not. I copied the /etc/rc.d/rc.pcmcia.N file that the standalone pcmcia stuff installs, into /etc/rc.d/rc.pcmcia, and rebooted. Let's see what happens... Failed again. "eth1: failed to reset hardware (err = -19)". Darn.

I was reading over the PCMCIA man page for the umpteenth time, when I re-read the part about needing to pass the "irq_mode=0" argument to the i82365 module, and I realized that setting the PCIC_OPTS variable in /etc/pcmcia/config.opts wat not the way to do it. Instead I looked around for a while and found I had to add a line to the /etc/pcmcia/config.opts file:
module "i82365" opts "irq_mode=0". Reboot and let's see what happens... No, that wasn't it. On closer reading of the doc, it is the PCIC_OPTS line. But it may that I didn't have the argument in quotes. Now I'm grasping at straws. Reboot and let's see... Nope.

Step 7 - Set The Wayback Machine

Well, this worked when I first started. Or at least it worked to the point where I could see the card with iwconfig. How can I get back to that point? I'm starting to suspect that I haven't been setting the PCIC_OPTS since I had it "working". So tomorrow I will re-install Slackware 8.0, modify the config.opts and rc.pcmcia files, and see if that gets me back to where I was. If that doesn't do it, I'll install the standalone pcmcia stuff. If that doesn't work, I'm quitting until the ISA-PCMCIA card arrives.

Did some serious hacking, with no luck. The reason that things sort of worked when I first tried this may be because I was using a 2.2x kernel from Slackware 8.0. Things might have been different back then. And the iwconfig didn't really work, it just let me set some of the parameters on the card. I have done a bunch more installs and builds with no luck. So now I'm just waiting on the ISA-PCMCIA card.

Step 8 - Semi-Breakthrough

When I first tried the card/adapter combo I tested it by putting it in a Windows XP machine. Worked fine. Then I started using it in this linux box. So last night I put the card/adapter back in the Windows XP machine, and swapped an old 4Gb drive into the XP machine so I could do a quick Slackware install. When I booted into Slackware, it recognized the card! Woo hoo! My ISA-PCMCIA adapter should arive today, so first I will try it in the surplus linux box. If that works, fine. Otherwise I will have to juggle some machines. The Windows XP machine's only purpose in life is to act as a print server for my HP deskjet. So I guess I will install XP on the linux box, and swap the two machines.

Step 9 - When All Else Fails, Try Different Hardware

I got the ISA-PCMCIA card Friday, and just had time to play with it for a short time. I installed it and booted it with the standard Slackware 8.1 install, and linux recognized the card and let me access it with iwconfig. I was able to set the essid, hit my AP, and get an IP address via DHCP. When I get back I will start over at step one of this saga, by recompiling the kernel without PCMCIA support, adding in the pcmcia-cs standalone package, adding in the latest wireless tools. At that point I should be able to configure the card. Then add in the orinoco driver patches for promiscuous mode, and then, finally, start working with Airsnort. I think I'll start a new page for that. See if this link works yet.

Anybody want to buy a PCI-PCMCIA adapter cheap?

Update: I was in the BIOS of the Dell, and I noticed a configuration option for APCI, and that it was set to OFF. I have read during my googling for answers that the PCI-PCMCIA card problems may be related to APCI. It might be worth a try to turn on APCI and put the PCI-PCMCIA card back in, and see if it works. But I have the ISA-PCMCIA card now, so that is not a priority.