VxWorks Reference Manual : Libraries
pcmciaLib - generic PCMCIA event-handling facilities
pcmciaInit( ) - initialize the PCMCIA event-handling package
pcmciad( ) - handle task-level PCMCIA events
This library provides generic facilities for handling PCMCIA events.
Before the driver can be used, it must be initialized by calling pcmciaInit( ). This routine should be called exactly once, before any PC card device driver is used. Normally, it is called from usrRoot( ) in usrConfig.c.
The pcmciaInit( ) routine performs the following actions:
- Creates a message queue.
- Spawns a PCMCIA daemon, which handles jobs in the message queue.
- Finds out which PCMCIA chip is installed and fills out the PCMCIA_CHIP structure.
- Connects the CSC (Card Status Change) interrupt handler.
- Searches all sockets for a PC card. If a card is found, it:
gets CIS (Card Information Structure) information from a card
determines what type of PC card is in the socket
allocates a resource for the card if the card is supported
enables the card
- Enables the CSC interrupt.
The CSC interrupt handler performs the following actions:
- Searches all sockets for CSC events.
- Calls the PC card's CSC interrupt handler, if there is a PC card in the socket.
- If the CSC event is a hot insertion, it asks the PCMCIA daemon to call cisGet( ) at task level. This call reads the CIS, determines the type of PC card, and initializes a device driver for the card.
- If the CSC event is a hot removal, it asks the PCMCIA daemon to call cisFree( ) at task level. This call de-allocates resources.
pcmciaInit( ) - initialize the PCMCIA event-handling package
STATUS pcmciaInit (void)
This routine installs the PCMCIA event-handling facilities and spawns pcmciad( ), which performs special PCMCIA event-handling functions that need to be done at task level. It also creates the message queue used to communicate with pcmciad( ).
OK, or ERROR if a message queue cannot be created or pcmciad( ) cannot be spawned.
pcmciad( ) - handle task-level PCMCIA events
void pcmciad (void)
This routine is spawned as a task by pcmciaInit( ) to perform functions that cannot be performed at interrupt or trap level. It has a priority of 0. Do not suspend, delete, or change the priority of this task.
N/A
pcmciaLib, pcmciaInit( )