Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

SUSE Linux Enterprise Desktop Deployment Guide
Previous Page Home Next Page

25.2 PCMCIA in Detail

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:

  1. The PCMCIA bridge (or socket) must be set up properly as described in Section 25.2.1, Bridge Initialization. Prerequisites are:

    • an appropriate driver for the bridge

    • additional I/O and memory ranges for PC cards

  2. After the bridge is properly set up, the bridge driver detects the presence of a card and triggers its initialization as described in Section 25.2.2, Card Initialization:

    1. Determine the card type.

    2. Supply the proper voltage.

    3. Assign I/O and memory ranges and IRQ lines to the card.

    4. Trigger the card or device initialization by binding the appropriate card driver.

    5. For some cards, the Card Information Structure (CIS) needs to be uploaded.

  3. Finally, the interface itself is set up and ready for use. See Section 25.2.3, Interface Setup for details on this.

25.2.1 Bridge Initialization

Most PCMCIA bridges are PCI devices and are treated as such. The bridge initialization process can be summarized as follows:

  1. Hotplug creates a PCI event.

  2. udev calls /sbin/hwup to load the driver. /sbin/hwup checks /etc/sysconfig/hardware for an existing device configuration. If an appropriate configuration is found, that configuration is used. Otherwise /sbin/hwup calls modprobe with the modalias string provided by the kernel to load the driver module.

  3. New hotplug events are sent (one per PCMCIA socket).

  4. The following steps are omitted if only CardBus cards are used:

    1. The pcmcia_socket events trigger udev to call /sbin/hwup and load the pcmcia kernel module.

    2. All I/O and memory ranges specified in /etc/pcmcia/config.opts are added to the socket.

    3. The card services in the kernel check these ranges. If the memory ranges in /etc/pcmcia/config.opts are wrong, this step may crash your machine. See Section 25.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.

25.2.2 Card Initialization

The events caused by plugging in a PCMCIA card can be summarized as follows:

  1. A hotplug event occurs. For PC cards, this is a pcmcia event. For CardBus cards, this is a pci event.

  2. 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 modprobe modalias.

  3. If needed, device initialization triggers a firmware hotplug event. This searches for firmware and loads it.

  4. 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 parameters in /etc/sysconfig/pcmcia to get it fully supported and working flawlessly:

PCMCIA_LOAD_CIS

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 setting is yes. To disable CIS loading from disk, set this variable to no.

PCMCIA_ALLOW_FUNC_MATCH

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 to no.

PCMCIA_COLDPLUG_REINSERT

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 PCMCIA_COLDPLUG_REINSERT to yes. The default setting is no.

25.2.3 Interface Setup

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 Section 20.0, Dynamic Kernel Device Management with udev.

SUSE Linux Enterprise Desktop Deployment Guide
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire