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 CentOS Linux following the steps outlined in . 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 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 .

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

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.