PURPOSE
Retrieves PCMCIA device's resource information (i.e. memory
ranges, version, manufacturer and model strings, type of device, interrupt
information).
PROTOTYPE
DWORD WD_PcmciaGetCardInfo(
HANDLE hWD,
WD_PCMCIA_CARD_INFO *pPcmciaCard);
PARAMETERS
| Name | Type | Input/Output |
|---|---|---|
| HANDLE | Input | |
| WD_PCMCIA_CARD_INFO* | ||
| WD_PCMCIA_SLOT | ||
| BYTE | Input | |
| BYTE | Input | |
| BYTE | Input | |
| BYTE | N/A | |
| WD_CARD | ||
| DWORD | Output | |
| WD_ITEMS[WD_CARD_ITEMS] | ||
|
|
DWORD | Output |
|
|
DWORD | Output |
|
|
DWORD | N/A |
|
|
DWORD | N/A |
|
|
union | |
| struct | ||
| DWORD | Output | |
| DWORD | Output | |
| DWORD | N/A | |
| DWORD | N/A | |
| DWORD | N/A | |
| DWORD | Output | |
| struct | ||
| KPTR | Output | |
| DWORD | Output | |
| DWORD | Output | |
| struct | ||
| DWORD | Output | |
| DWORD | Output | |
| DWORD | N/A | |
| WD_BUS | ||
| WD_BUS_TYPE | Output | |
| DWORD | Output | |
| DWORD | Output | |
| struct | N/A | |
| CHAR |
Output | |
| CHAR [WD_PCMCIA_ MANUFACTURER_LEN] |
Output | |
| CHAR[WD_PCMCIA_ PRODUCTNAME_LEN] |
Output | |
| WORD | Input | |
| WORD | Input | |
| WORD | Input | |
| DWORD | N/A |
DESCRIPTION
| Name | Description |
|---|---|
| hWD | Handle to WinDriver's kernel-mode driver as received from WD_Open() [5.2] |
| pPcmciaCard | Pointer to a PCMCIA card information structure: |
| PCMCIA slot information structure: | |
| Bus number (0 based) | |
| Socket number (0 based) | |
| Function number (0 based) | |
| Card information structure: | |
| Number of items detected on the card | |
| Card items information structure: | |
| Type of item. Can be ITEM_MEMORY, ITEM_IO, ITEM_INTERRUPT or ITEM_BUS. | |
| If TRUE, only one application at a time can access the mapped memory range, or monitor this card's interrupts | |
| Specific data according to the item type: | |
|
|
Describes a memory item (item = ITEM_MEMORY): |
| First address of the physical memory range | |
| Length of the memory range, in bytes | |
| Base Address Register (BAR) number of the memory range | |
|
|
Describes an I/O item (item = ITEM_IO): |
| First address of the I/O range | |
| Length of the I/O range, in bytes | |
| Base Address Register (BAR) number for the I/O range | |
|
|
Describes an interrupt item (item = ITEM_INTERRUPT): |
| Physical interrupt request (IRQ) number | |
| Interrupt options bit-mask, which is set by the function to indicate the interupt types supported by the device. PCMCIA interrupts are edge trigerred, therefore the function sets the INTERRUPT_LATCHED flag (value zero), which when used alone (i.e. when no other flag is set) indicates that the hardware uses legacy edge trigerred interrupts. | |
|
|
Describes a bus item (item = ITEM_BUS): |
| The card's bus type. For a PCMCIA card the bus type is WD_BUS_PCMCIA | |
| The card's bus number | |
| A combination of the card's bus socket and function numbers: the lower three bits represent the function number and the remaining bits represent the socket number. For example: a value of 0x80 (<=> 10000000 binary) corresponds to a function number of 0 (lower 3 bits: 000) and a socket number of 0x10 (remaining bits: 10000). | |
| Card version string | |
| Card manufacturer string | |
| Card product name string | |
| Card manufacturer ID | |
| Card type and model ID | |
| Card function ID | |
| Should always be set to 0 (reserved for future use) |
RETURN VALUE
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise [A].
REMARKS
EXAMPLE
WD_PCMCIA_CARD_INFO pcmciaCardInfo;
WD_CARD Card;
BZERO(pcmciaCardInfo);
pcmciaCardInfo.pcmciaSlot = pcmciaSlot;
WD_PcmciaGetCardInfo(hWD, &pcmciaCardInfo);
if (pcmciaCardInfo.Card.dwItems!=0) /* At least one item was found */
{
Card = pcmciaCardInfo.Card;
}
else
{
printf("Failed fetching PCMCIA card information\n");
}