Getting a PCMCIA Wireless Network Card to Work under Gentoo Linux on an IBM ThinkPad T21 Laptop -- by Kris Kelley Introduction This document is a brain dump of the process I went through to get my IBM ThinkPad T21 laptop on my wireless network, using a Xircom CWE1100 PCMCIA wireless network card and the Gentoo Linux operating system. I hope my experiences will help others in the linux community. You are probably not reading this if you are not familiar with Gentoo Linux, but just in case, Gentoo is a relatively new distribution that aims at striking a compromise between the convenience and compatibility of a linux installation based on ready-made software packages, and the power and configurability of a linux installation built from source. For more details, visit Gentoo's website (http://www.gentoo.org). Gentoo's promise of being able to tailor software exactly to my system's specifications, while at the same time having a package manager easily keep track of it all, was what attracted me to this operating system, to say nothing of the recommendations I received from friends and coworkers. So, after acquiring a CD of Gentoo 1.4rc2 and building a system completely from scratch (or "Stage 1" as the Gentoo people call it), I eventually had a new linux environment with support for my T21's built-in 100Mb ethernet port. So far so good, but I wanted to use my wireless network card, so I wouldn't be tethered to a network cable. First Attempt I knew I would need PCMCIA support, so when I built the linux kernel for my system, I enabled PCMCIA support along with the driver that would run my card. I also installed ("emerged" in Gentoo terminology) the pcmcia-cs and wireless-tools packages. Several file copies and configuration changes later, I wasn't getting what I expected. The PCMCIA code seemed to work, but I could never get any communication from the wireless network, not even an IP address from the DHCP server. After some further research, I got the idea that the PCMCIA code supplied by the kernel sources might not be entirely up to snuff. I decided I should try again without kernel PCMCIA support, this time letting the pcmcia-cs package supply all the necessary PCMCIA support... Second Attempt ...which is what I did. I reversed all my configuration, uninstalled (or "unmerged") the pcmcia-cs and wireless-tools packages, and recompiled my kernel. Starting from this point, I eventually got it to work. Steps Here are the steps I took during my second, successful attempt. (NOTE: These instructions assume you have a network connection already available, such as that provided by the T21's built-in ethernet port.) * Start with a kernel that does not have any PCMCIA support enabled. You will need to enable wireless networking support, though you will not be enabling drivers for specific wireless networking hardware. You will need module support as well. Also, make sure you do *not* enable support for ACPI power management. I found out the hard way that this seemingly unrelated feature interferes with PCMCIA functionality on the T21. After discovering this, I was told by a moderator of the Gentoo forums that he does not know anybody who has ever had success using ACPI on an IBM ThinkPad T series laptop anyway. I use a kernel compiled from a package provided by Gentoo, gentoo-sources version 2.4.19-r10. * Once you are running with a kernel that satisfies the above requirements, use emerge to install the pcmcia-cs package. The authors of Gentoo recommend that you always run emerge with the "pretend" flag prior to installing any new packages, so that you know for certain what is about to be installed on your system. # emerge -p pcmcia-cs These are the packages that I would merge... # emerge pcmcia-cs I use Gentoo's release of pcmcia-cs 3.2.4. * Earlier versions of pcmcia-cs would require additional packages, such as linux-wlan or linux-wlan-ng, to provide support for PCMCIA wireless network cards. However, current versions of pcmcia-cs provide their own support for these cards, making additional packages almost unnecessary. I say "almost" because, while the pcmcia-cs package provides drivers for PCMCIA wireless network cards, along with the ability to configure them, additional tools are necessary to perform the actual configuration. These tools are provided by a package called wireless-tools, and it is available as a Gentoo "ebuild": # emerge -p wireless-tools These are the packages that I would merge... # emerge wireless-tools I use Gentoo's release of wireless-tools 25-r1. * You now have all the right software, however, some configuration is necessary before your wireless network card will function properly. There are two files you will need to edit: /etc/pcmcia/wireless.opts and /etc/pcmcia/network.opts. (NOTE: You may also need to edit /etc/pcmcia/config, depending on whether or not the version of pcmcia-cs you are using supports your card. If you go through these instructions and still cannot get your card to work, try performing a web search on your card's name and model number, to see if any changes to /etc/pcmcia/config, or perhaps a newer version of pcmcia-cs, is necessary.) /etc/pcmcia/wireless.opts contains configuration that is specific to wireless network cards, such as the infrastructure mode and the SSID. (NOTE: If you've made it this far and discovered you are unfamiliar with wireless networking terminology and standards, http://80211-planet.webopedia.com/ provides everything you need to know. Also, if you are unfamiliar with how your wireless network is set up, ask your network administrator for the correct settings to use.). This file contains extensive comments on how to set things up, and I recommend reading through it to get an idea of how you can edit the file. wireless.opts also provides several example configurations, and you may get lucky and find you can modify one of these entries to suit your needs, instead of creating a new entry from scratch. My card is the Xircom CWE1100. I found that the example entry provided for the Cisco/Aironet 4800/340 series matches my card, because the hardware is similar. Therefore, I modified this entry to match the requirements of my wireless network: # Cisco/Aironet 4800/340 # Note : MPL driver only (airo/airo_cs), version 1.3 or later *,*,*,00:40:96:*) INFO="MyWireless" ESSID="mySSIDword" MODE="Ad-Hoc" ;; /etc/pcmcia/network.opts contains configuration relevant to all PCMCIA network cards (not just wireless cards), such as IP settings, and any special commands that need to be executed when the network interface provided by a PCMCIA network card is created or removed. Again, this file contains comments that explain how to set things up, and I recommend reading these comments. You may find the section on PCMCIA network adapters within the PCMCIA HOWTO (http://pcmcia-cs.sourceforge.net/ftp/doc/PCMCIA-HOWTO.html) useful as well. I use DHCP to assign IP addresses on my wireless network, and I do not require any special treatment during the creation or removal of this network interface. Also, because I have only one PCMCIA network card, I created a simple catch-all entry in this file: *,*,*,*) INFO="MyWireless" # The IF_PORT variable does not apply to my network card. IF_PORT="" # I do not use the BOOTP protocol. BOOTP="n" # I do use the DHCP protocol. DHCP="y" # I do not require an explicit hostname when making DHCP requests. DHCP_HOSTNAME="" # I do not require special treatment when creating this interface. start_fn () { return; } # I do not require special treatment when removing this interface. stop_fn () { return; } # If the card is ejected, check for open connections before # removing the network interface. NO_CHECK=n # If the card is ejected, check for active NFS mounts, and kill any # processes using thos emounts, before removing the network # interface. NO_FUSER=n ;; * That's it for configuration. Give your system a trial run by loading the necessary kernel modules and starting the PCMCIA card manager. # modprobe i82365 # modprobe ds # cardmgr -f (NOTE: The i82365 module drives the T21's PCMCIA hardware and slots. All T21 laptops will use this driver, however, other machines with PCMCIA slots may use other modules for this purpose. The ds module works with the PCMCIA card manager to automatically add and remove the appropriate kernel modules when a PCMCIA card is inserted or ejected.) Now, insert your card. If you hear two high-pitch beeps, you have achieved success! Run ifconfig to make sure the network is the way you expect it to be. Then, run something that requires a network connection, such as an FTP client or a web browser, to make sure you have a live connection. If you hear a high-pitch beep followed by a lower-pitch beep, the PCMCIA card manager acknowledged the card insertion, however, something went wrong when your system tried to utilize the card. Double check your configuration files, and also have a look at the system logs in /var/log/messages, to find out where the problem is. If you don't hear any beeps at all, something *really* went wrong. Make sure the PCMCIA card manager (cardmgr) is actually running, then look over your configuration files, and the system logs, to find out where the problem is. * At this point you will probably want to set up PCMCIA services to start automatically when your laptop is booting up. First, you will need to ensure that the pcmcia init script, installed as part of the pcmcia-cs package, will run when starting up, or when switching to a runlevel where you expect PCMCIA support. The easiest way to do this on a Gentoo system is to use rc-update. Assuming you want PCMCIA support in the "default" runlevel, use this command: # rc-update add pcmcia default Next, make sure the appropriate kernel modules will load during system start-up by adding their names to /etc/modules.autoload. Add these two lines to that file: i82365 ds (NOTE: If you set up the T21's built-in ethernet port to be enabled automatically during start-up, you may want to disable that feature now, unless you plan on using a wired connection more often or as often as a wireless connection.) Conclusion That's it! Remember that the providers of Gentoo Linux pride themselves on keeping their software packages up to date, so you should check daily for updates to the packages mentioned in this document, as well all other packages you have added to your system. If you have any questions, suggestions, or comments about this document, feel free to email me at skunkworx@kingwoodcable.com. Guide Revision History 3/10/03 - First release. 4/26/03 - Updated the guide to reflect the most recent (unmasked) release of pcmcia-cs by Gentoo, version 3.2.4. Also tidied up some formatting.