PCMCIA Card Services for Linux


PCMCIA Card Services for Linux

The standardization of PC Cards means Linux developers can get their hands on the programming information they need to write device drivers for PC Cards. In particular, the Card Services Specification provides an application programming interface (API) that's independent of the hardware that controls the PC Card sockets-the receptacles or slots for PC Cards.

The Socket Services Specification, a related specification, also provides an API that enables software applications to access the hardware that controls the sockets for PC Cards.

You do not have to learn about the PC Card and Socket Services APIs. David Hinds has already done the work in his PCMCIA Card Services for Linux, a software package that you can use to access PC Card devices under Linux. All you need to do is turn on the PCMCIA support when you need it.

Activating Card Services

PCMCIA Card Services software will be installed on your system if you select the Laptop Support package group when you install Red Hat Linux following the steps outlined in Chapter 2. If you have not installed the Laptop Support package group, you can install the PCMCIA software by installing the kernel-pcmcia-cs RPM from the first CD-ROM (see Chapter 21 for information on how to install RPMs).

Assuming that PCMCIA support is installed, the following files control the activation of the Card Services:

  • /etc/init.d/pcmcia is the shell script that starts the PCMCIA Card Services. Essentially, the command /etc/init.d/pcmcia start (or service pcmcia start) activates the Card Services when you boot the system. The script loads the appropriate PCMCIA driver modules by using the modprobe command. Then the script runs the /sbin/cardmgr program, which handles all card-insertion and card-removal events. Running the cardmgr program enables you to hot-swap PC Cards so that you can insert or eject a card at any time. To stop Card Services, type /etc/init.d/pcmcia stop or service pcmcia stop.

  • /etc/sysconfig/pcmcia contains a number of variables the /etc/init.d/ pcmcia script uses. In particular, the Card Services are not activated unless the line PCMCIA=yes appears in the /etc/sysconfig/pcmcia file. Lines such as the following specifies the name of the PC Card Interface Controller (PCIC) as well as any options that the PCIC may need:

    PCIC=yenta_socket
    PCIC_OPTS=

    If your system does not have any PCMCIA interface, you will find the line PCMCIA=no in the /etc/sysconfig/pcmcia file.

You can activate the Card Services at system startup by ensuring that the line PCMCIA=yes appears in the /etc/sysconfig/pcmcia file. Of course, you want to do this only if your PC has a PCMCIA slot (most laptop PCs do).

Using the cardctl Program

If you have PCMCIA Card Services running, you can use the /sbin/cardctl program to monitor and control a PCMCIA socket. To view the status of a PCMCIA slot, type:

/sbin/cardctl status

The output should show the current socket-status flags.

The cardctl program takes many more arguments. With different arguments, you can suspend a card, resume it, or view the configuration parameters, such as interrupts and configuration registers. To learn more about cardctl from the online manual, type man cardctl to view the manual page.

Using Supported PC Cards

In the PCMCIA Card Services documentation directory, you'll find a file named SUPPORTED .CARDS. (You can change to that directory by typing cd /usr/share/doc/kernel-pcmcia*.) That file lists some of the PCMCIA Cards that are known to work with at least one system. Unfortunately, that list is somewhat dated by now. To search for specific types of PC Card, visit the PC Card Resource Directory at http://www.pc-card.com/.

The list of supported cards has become too numerous to include here. The categories of cards supported by the Card Services are as follows:

  • Ethernet cards-Close to a hundred different models of Ethernet cards are supported, including popular models such as 3Com 3c589, 3c589B, 3c589C, and 3c589D; Megahertz XJ10BT, and CC10BT; and Xircom CreditCard CE2.

  • Fast Ethernet (10/100BASET) cards-Over 20 cards are supported, including 3Com 3c574TX, 3c575TX, 3CCFE575B, and 3CXFE575B; Linksys EtherFast 10/100; NetGear FA410TXC and FA411; and Xircom CreditCard CE3-100, CE3B, RE-100, R2E-100BTX, and XE2000.

  • Token Ring cards-IBM Token Ring Adapter and 3Com 3c689 TokenLink III cards are supported.

  • Wireless network cards-Lucent Orinoco WaveLAN/IEEE 802.11b, Dell TrueMobile 1150 Series, Linksys WPC11, and Xircom CreditCard Netwave are supported.

  • Modem and serial cards-All modem and serial-port cards should work. The only exceptions are modems such as Compaq 192, New Media WinSurfer, Megahertz XJ/CC2560, 3Com 3CXM356/3CCM356 and 3CXM656/3CCM656, and other WinModems that require special Windows drivers. The Trimble Mobile GPS card is supported through the serial/modem driver.

  • Memory cards-All static RAM (SRAM) memory cards should work.

  • SCSI adapter cards-Over 30 different models of SCSI cards are supported, including models such as Adaptec APA-1460, APA-1460A, APA-1450A, and APA-1460B SlimSCSI; IBM SCSI; Iomega Zip and Jaz Cards; NEC PC-9801N-J03R; and Toshiba NWB0107ABK and SCSC200B.

  • ATA/IDE disk drive cards-All ATA/IDE disk-drive PC Cards are supported.

  • ATA/IDE CD-ROM adapter cards-Many ATA/IDE CD-ROM adapters are supported, including Argosy EIDE CD-ROM, Caravelle CD-36N, Creative Technology CD-ROM, IBM Max 20X CD-ROM, Sony PCGA-CD5 CD-ROM, Digital Mobile Media CD-ROM, some EXP models, and several IO-DATA models.

  • Multifunction cards-Several multifunction Ethernet/Modem cards are supported, including 3Com 3c562, 3c562B/C/D, and 3c563B/C/D; IBM Home and Away Card; Linksys LANmodem 28.8, 33.6; Megahertz EM1144, EM3288, and EM3336; Motorola Mariner and Marquis; Ositech Jack of Diamonds; and Xircom CreditCard CEM28, CEM33, CEM56 models.

Further Reading

To learn more about the PCMCIA Card Services software, consult the PCMCIA-HOWTO. To read this HOWTO document, type cd /usr/share/doc/kernel-pcmcia* to change to the directory where that HOWTO file is located (if you cannot find the file, type locate PCMCIA-HOWTO to find the file). Then, type more PCMCIA-HOWTO to view the PCMCIA-HOWTO file. This file contains the latest information about the Card Services software, including common problems and suggested fixes.

In particular, you should look through the PCMCIA-HOWTO file for any information that applies to your specific PC Card.