man Pages(9F): DDI and DKI Kernel Functions
  Rechercher uniquement dans ce livre
Télécharger cet ouvrage au format PDF

NAME

csx_GetStatus - return the current status of a PC Card and its socket

SYNOPSIS

#include <sys/pccard.h>
int32_t csx_GetStatus(client_handle_t ch, get_status_t * gs);

INTERFACE LEVEL

Solaris DDI Specific (Solaris DDI)

ARGUMENTS

ch
Client handle returned from csx_RegisterClient(9F).
gs
Pointer to a get_status_t structure.

DESCRIPTION

This function returns the current status of a PC Card and its socket.

STRUCTURE MEMBERS

The structure members of get_status_t are:
uint32_t   Socket;            /* socket number * /
uint32_t   CardState;         /* "live" card status for this client * /
uint32_t   SocketState;       /* latched socket values * /
uint32_t   raw_CardState;     /* raw live card status * /

The fields are defined as follows:
Socket
Not used in Solaris, but for portability with other Card Services implementations, it should be set to the logical socket number.
CardState
The CardState field is the bit-mapped output data returned from Card Services. The bits identify what Card Services thinks the current state of the installed PC Card is. The bits are:
CS_STATUS_WRITE_PROTECTEDCard is write protected
CS_STATUS_CARD_LOCKEDCard is locked
CS_STATUS_EJECTION_REQUESTEjection request in progress
CS_STATUS_INSERTION_REQUESTInsertion request in progress
CS_STATUS_BATTERY_DEADCard battery is dead (BVD1)
CS_STATUS_BATTERY_LOWCard battery is low (BVD2)
CS_STATUS_CARD_READYCard is READY
CS_STATUS_CARD_INSERTEDCard is inserted
CS_STATUS_REQ_ATTNExtended status attention request
CS_STATUS_RES_EVT1
CS_STATUS_RES_EVT2
CS_STATUS_RES_EVT3
Extended status reserved
event status
CS_STATUS_VCC_505.0 Volts Vcc Indicated
CS_STATUS_VCC_333.3 Volts Vcc Indicated
CS_STATUS_VCC_XXX.X Volts Vcc Indicated
Note: the state of the CS_STATUS_CARD_INSERTED bit indicates whether the PC Card associated with this driver instance, not just any card, is inserted in the socket.
If an I/O card is installed in the specified socket, card state is returned from the PRR (Pin Replacement Register) and the ESR (Extended Status Register) (if present). If certain state bits are not present in the PRR or ESR ,a simulated state bit value is returned as defined below:
CS_STATUS_WRITE_PROTECTEDNot write protected
CS_STATUS_BATTERY_DEADPower Good
CS_STATUS_BATTERY_LOWPower Good
CS_STATUS_CARD_READYReady
CS_STATUS_REQ_ATTNNot set
CS_STATUS_RES_EVT1Not set
CS_STATUS_RES_EVT2Not set
CS_STATUS_RES_EVT3Not set
SocketState
The SocketState field is a bit-map of the current card and socket state. The bits are:
CS_SOCK_STATUS_WRITE_PROTECT_CHANGEWrite Protect
CS_SOCK_STATUS_CARD_LOCK_CHANGECard Lock Change
CS_SOCK_STATUS_EJECTION_PENDINGEjection Request
CS_SOCK_STATUS_INSERTION_PENDINGInsertion Request
CS_SOCK_STATUS_BATTERY_DEAD_CHANGEBattery Dead
CS_SOCK_STATUS_BATTERY_LOW_CHANGEBattery Low
CS_SOCK_STATUS_CARD_READY_CHANGEReady Change
CS_SOCK_STATUS_CARD_INSERTION_CHANGECard is inserted
The state reported in the SocketState field may be different from the state reported in the CardState field.
Clients should normally depend only on the state reported in the CardState field.
raw_CardState The raw_CardState field is a Solaris-specific extension that allows the
client to determine if any card is inserted in the socket. The bit definitions in the raw_CardState field are identical to those in the CardState field with the exception that the CS_STATUS_CARD_INSERTED bit in the raw_CardState field is set whenever any card is inserted into the socket.

RETURN VALUES

CS_SUCCESS
Successful operation.
CS_BAD_HANDLE
Client handle is invalid.
CS_BAD_SOCKET
Error getting socket state.
CS_UNSUPPORTED_FUNCTION
No PCMCIA hardware installed.
Note that CS_NO_CARD will not be returned if there is no PC Card present in the socket.

CONTEXT

This function may be called from user or kernel context.

SEE ALSO

csx_RegisterClient(9F)
PC Card 95 Standard, PCMCIA/JEIDA