Linux WL3501 Driver Installation Guide v.2 -------------------------------------- **************************** * 1. Introduction * **************************** This document describes how to install PLANET WL3501 series PCMCIA Wireless LAN Card on your Linux system. For ISA versions, please skip this file and refer README.TXT instead. In addition to this document, you may need some other documentations from Linux. In the following chapter, I'll point them out. **************************** * 2. Before starting * **************************** What you should prepare: 1. A well installed Linux system (version 1.3.44 or above), contains kernel source code, and compiler. 2. A (or some) WL3501 Wireless LAN card(s). 3. WL3501 Wireless LAN card's Use's Manual. 4. The utilities come with the card. You may need additional documents available from Linux packages: 1. /usr/src/linux/README 2. /usr/doc/faq/howto/mini/Multiple-Ethernet.gz 3. /usr/doc/faq/howto/Ethernet-HOWTO.gz 4. /usr/doc/faq/howto/BootPrompt-HOWTO.gz 5. lilo, lilo.conf man pages 6. /usr/doc/faq/howto/PCMCIA-HOWTO.gz **************************** * 3. Hardware installation.* **************************** First of all, you should install your WL3501 card properly in your notebook. I suggest you to read the User's Manual first, and make something clear. (e.g. What's Ad-Hoc and Infrastructure mode, what's radio channel, and if you use Roaming or not...) If you think you have made everything ok, try to boot MS-DOS and run WLU.EXE to check if peer notebooks could communicate with each other (through Link Quality Test). Cannot you run WLU.EXE? Maybe you hadn't run Card Service driver in MS-DOS. Please check if your notebook beeps when inserting a PCMCIA card. Now, two notebooks may communicate with each other, hardware installation is completed. Note that: Link Quality Test does not activate IRQ, so even it works fine, it cannot approve IRQ is set correctly. **************************** * 4. Software installation.* **************************** (In the following text, I use Slackware as examples) Currently PCMCIA support is not a standard part of Linux kernel. It is an additional package supported by David A. Hinds (dhinds@hyper.stanford.edu). So, adding a WL3501 PCMCIA card's driver is more complex within Linux. Please read /usr/doc/faq/howto/PCMCIA-HOWTO.gz if you are not familiar with Linux PCMCIA support. Due to the implementation of the PCMCIA package, it checks loadable module's version strictly. That's, we couldn't only provide you a loadable module. You must compile the driver again by yourself to make it comply with other modules installed on your system. So, I hope you have installed the kernel source code in your system. (Of course, you should have. After installing the Linux package such as Slackware or RedHat, the first thing is to re-complie the kernel to remove unnecessary drivers and make the kernel compact). If you hadn't installed the kernel source, try to find one, and read the document in /usr/src/linux/README. It describes the procedure of making a new kernel very clearly. Let's make a kernel with loadable module support first. If success, run lilo to install the new kernel (or if you use other loaders then do it by your ways) and reboot to make sure the new kernel works fine. It is for insurance. From now one, we try to make a WL3501 loadable module driver for the kernel. Please refer the documentation PCMCIA-HOWTO.gz to understand how to get the sources pcmcia-cs*.tar.gz, and how to make it. Here is a simple example describes the rough steps... 1. Un-tar pcmcia-cs*.tar.gz in /usr/src, e.g. cd /usr/src tar xvfz /tmp/pcmcia-cs-2.9.12.tar.gz 2. Change directory to sources, and 'make config', e.g. cd /usr/src/pcmcia-cs-2.9.12 make config 3. Copy wl*.* on the supply floppies into /usr/src/pcmcia-cs-2.9.12/modules, e.g. mcopy a:wl*.* /usr/src/pcmcia-cs-2.9.12/modules 4. Patch /usr/src/pcmcia-cs-2.9.12/modules/Makefile, to add WL3501 support. You may see a lot of statements like this: ------------------------------------------------------------------- ifdef CONFIG_INET MODULES := ${MODULES} \ pcnet_cs.o 3c589_cs.o nmclan_cs.o fmvj18x_cs.o smc91c92_cs.o \ netwave_cs.o wavelan_cs.o xirc2ps_cs.o SRCS := ${SRCS} \ pcnet_cs.c 3c589_cs.c nmclan_cs.c fmvj18x_cs.c smc91c92_cs.c \ netwave_cs.c wavelan_cs.c xirc2ps_cs.c EXTRA := ${EXTRA} 8390.o ... ------------------------------------------------------------------- Append 'wl24_cs.o' at the end of MODULES and 'wl24_cs.c' at the end of SRCS. Add the rule for 'wl24_cs.o' too. ------------------------------------------------------------------- ifdef CONFIG_INET MODULES := ${MODULES} \ pcnet_cs.o 3c589_cs.o nmclan_cs.o fmvj18x_cs.o smc91c92_cs.o \ netwave_cs.o wavelan_cs.o xirc2ps_cs.o wl24_cs.o SRCS := ${SRCS} \ pcnet_cs.c 3c589_cs.c nmclan_cs.c fmvj18x_cs.c smc91c92_cs.c \ netwave_cs.c wavelan_cs.c xirc2ps_cs.c wl24_cs.c wl24_cs.o: wl24_cs.c wl24.o wlapi.o wlpnp.o wlioctl.o $(CC) -c $(CFLAGS) $(CPPFLAGS) -DWL_PCMCIA -DWL_SLOWDOWN $< -o pre_$@ $(LD) -r -o $@ pre_$@ wl24.o wlapi.o wlpnp.o wlioctl.o rm -f pre_$@ chmod -x $@ EXTRA := ${EXTRA} 8390.o ... ------------------------------------------------------------------- 5. Compile all files, e.g. cd /usr/src/pcmcia-cs-2.9.12 make all 6. Edit /usr/src/pcmcia-cs-2.9.12/etc/config add the following lines, please refer PCMCIA-HOWTO for details. This file will be installed to /etc/pcmcia/config. device "wl24_cs" class "network" module "wl24_cs" card "OEM WPCMCIA" version "OEM", "WPCMCIA" bind "wl24_cs" CAUTION: All strings must be the same exactly, otherwise WL3501 cards would not been probed. To simply it, You may use config.WPCMCIA on the supply floppy to replace the file directly. 7. Install the package. e.g. cd /usr/src/pcmcia-cs-2.9.12 make install 8. Edit /etc/pcmcia/network.opts and /etc/rc.d/rc.inet1. Read PCMCIA-HOWTO carefully to see how to assign IP for each card. You must modify network.opts according your environment. Remember to turn OFF network related setup in /etc/rc.d/rc.inet1. 9. Reboot your notebook, and check if /etc/rc.d/rc.pcmcia could start cardmgr and probe your WL3501 correctly. **************************** * 5. Debugging * **************************** 1. Check if the cardmgr had been executed by /etc/rc.d/rc.pcmcia... root@linux:/# ps aux | grep cardmgr 2. Check if WL3501 had been probed... cardmgr[xx]: socket 0: OEM WPCMCIA cardmgr[xx]: executing: 'insmod /lib/modules/2.0.30/pcmcia/wl24_cs.o' 3. Check if the card is beening opened... ... eth0: WPCMCIA opened **************************** * 6. For Linux Hackers * **************************** Design Issues: The driver had been carefully designed with the following approachs to provide high performance and low overload in parallel tasking environment. 1. Prevent using cli() and sti() functions to slove critical section problem as possible. 2. Not doing busy waiting. 3. Only block the corresponded card's interrupt instead of sti() in ISR and related routines. 4. Lock the SUTRO (O/S within card) as short as possible if necessary. 5. Fully utilize Rx/Tx queueing buffer in card. (Rx/Tx is about 12K/12K) 6. Avoid additional memcpy between O/S and card. The object files are compiled with the following arguments: gcc -O2 -Wall -Wstrict-prototypes -Winline -pipe -D__KERNEL__ -I../include \ -I/usr/src/linux/include -I/usr/src/linux -DWL_PCMCIA -DWL_SLOWDOWN \ -D__NO_VERSION__ -c wlapi.c It should work for almost all configurations even if you use 486 CPU. Specification: 1. Fully function driver, multicast and promiscuous filter supported. 2. Ad-hoc, infrastructure, and roaming algorithm supported. 3. Error recovery function supported.