The following sections outlines what happens in your Linux system when a PCMCIA device is plugged into your machine. Components interact with each other and many requirements need to be met to support a PCMCIA device.
The following is a very rough outline of the PCMCIA initialization process in Linux:
The PCMCIA bridge (or socket) must be set up properly as described in Section 31.2.1, “Bridge Initialization”. Prerequisites are:
an appropriate driver for the bridge
additional I/O and memory ranges for PC cards
After the bridge is properly set up, the bridge driver detects the presence of a card and triggers its initialization as described in Section 31.2.2, “Card Initialization”:
Determine the card type.
Supply the proper voltage.
Assign I/O and memory ranges and IRQ lines to the card.
Trigger the card or device initialization by binding the appropriate card driver.
For some cards, the Card Information Structure (CIS) needs to be uploaded.
Finally, the interface itself is set up and ready for use. See Section 31.2.3, “Interface Setup” for details on this.
Most PCMCIA bridges are PCI devices and are treated as such. The bridge initialization process can be summarized as follows:
Hotplug creates a PCI event.
udev calls /sbin/hwup to load the driver.
/etc/sysconfig/hardware for an existing
device configuration. If an appropriate configuration is found,
that configuration is used. Otherwise
/sbin/hwup calls modprobe
modalias string provided by the kernel
to load the driver module.
New hotplug events are sent (one per PCMCIA socket).
The following steps are omitted if only CardBus cards are used:
pcmcia_socket events trigger udev to
call /sbin/hwup and load the
pcmcia kernel module.
All I/O and memory ranges specified in
/etc/pcmcia/config.opts are added to the
The card services in the kernel check these ranges. If the memory
/etc/pcmcia/config.opts are wrong, this
step may crash your machine. See Section 31.3.1, “Machine Crashes on PCMCIA” for information about how to
debug and fix this issue.
After these steps have been successfully completed, the bridge is fully initialized. After this, the card itself is initialized as described in the following section.
The events caused by plugging in a PCMCIA card can be summarized as follows:
A hotplug event occurs. For PC cards, this is a
pcmcia event. For CardBus cards, this is a
For any events, udev calls /sbin/hwup to
load a driver module.
The module name is either specified in a
hwcfg* file under
/etc/sysconfig/hardware or via
If needed, device initialization triggers a firmware hotplug event. This searches for firmware and loads it.
The device driver registers the interfaces.
After these steps have been completed, the system proceeds with interface setup as described in the next section.
If your card is a PC card, you might need some of the following
/etc/sysconfig/pcmcia to get it
fully supported and working flawlessly:
A PC card's firmware is referred to as
CIS (Card Information Structure). It provides
additional implementation details of the card. hwup
checks the integrity of the card's built-in CIS and tries to load another
CIS from disk if the card's CIS proves to be defective. The default
yes. To disable CIS loading from disk, set
this variable to
Linux device drivers contain a device ID table that tells
drivers which devices to handle. This means that only those devices
whose IDs are known to the kernel are supported. To support those cards
whose ID is not listed, you can use function matching. This means that
the driver is not selected by ID, but by the function of the card (such
as a network card) and would be responsible for any PC card inserted
with that function (such as network cards). The default setting is
yes. To disable function matching, set this variable
Cards that have been inserted before booting sometimes fail to be
detected. To prevent that, cause a soft eject and a soft insert of the
card by setting
yes. The default setting is
Depending on the card type, different interfaces are registered after initialization has been successfully completed. Interface registration is handled by udev's hotplug. For details on udev and hotplug, refer to Chapter 12, Dynamic Kernel Device Management with udev.