DWORD WD_PcmciaGetCardInfo(
HANDLE hWD,
WD_PCMCIA_CARD_INFO *pPcmciaCard);
| Name | Type | Input/Output |
|---|---|---|
| hWD | HANDLE | Input |
| pPcmciaCard | WD_PCMCIA_CARD_INFO* | |
| • pcmciaSlot | WD_PCMCIA_SLOT | |
| * uBus | BYTE | Input |
| * uSocket | BYTE | Input |
| * uFunction | BYTE | Input |
| * uPadding | BYTE | N/A |
| • Card | WD_CARD | |
| * dwItems | DWORD | Output |
| * Item | WD_ITEMS[WD_CARD_ITEMS] | |
| • item | DWORD | Output |
| • fNotSharable | DWORD | Output |
| • dwReserved | DWORD | N/A |
| • dwOptions | DWORD | N/A |
| • I | union | |
| * Mem | struct | |
| • dwPhysicalAddr | DWORD | Output |
| • dwBytes | DWORD | Output |
| • dwTransAddr | DWORD | N/A |
| • dwUserDirectAddr | DWORD | N/A |
| • dwCpuPhysicalAddr | DWORD | N/A |
| • dwBar | DWORD | Output |
| * IO | struct | |
| • dwAddr | KPTR | Output |
| • dwBytes | DWORD | Output |
| • dwBar | DWORD | Output |
| * Int | struct | |
| • dwInterrupt | DWORD | Output |
| • dwOptions | DWORD | Output |
| • hInterrupt | DWORD | N/A |
| * Bus | WD_BUS | |
| • dwBusType | WD_BUS_TYPE | Output |
| • dwBusNum | DWORD | Output |
| • dwSlotFunc | DWORD | Output |
| * Val | struct | N/A |
| • cVersion | CHAR [WD_PCMCIA_VERSION_LEN] | Output |
| • cManufacturer | CHAR [WD_PCMCIA_ MANUFACTURER_LEN] | Output |
| • cProductName | CHAR[WD_PCMCIA_ PRODUCTNAME_LEN] | Output |
| • wManufacturerId | WORD | Input |
| • wCardId | WORD | Input |
| • wFuncId | WORD | Input |
| • dwOptions | DWORD | N/A |
| 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: |
| • PcmciaSlot | PCMCIA slot information structure: |
| * uBus | Bus number (0 based) |
| * uSocket | Socket number (0 based) |
| * uFunction | Function number (0 based) |
| • Card | Card information structure: |
| * dwItems | Number of items detected on the card |
| * Item | Card items information structure: |
| • item | Type of item. Can be ITEM_MEMORY, ITEM_IO,
ITEM_INTERRUPT or ITEM_BUS. |
| • fNotSharable | If TRUE, only one application at a time can access
the mapped memory range, or monitor this card's interrupts |
| • I | Specific data according to the item type: |
| * Mem | Describes a memory item (item = ITEM_MEMORY): |
| • dwPhysicalAddr | First address of the physical memory range |
| • dwBytes | Length of the memory range, in bytes |
| • dwBar | Base Address Register (BAR) number of the memory range |
| * IO | Describes an I/O item (item = ITEM_IO): |
| • dwAddr | First address of the I/O range |
| • dwBytes | Length of the I/O range, in bytes |
| • dwBar | Base Address Register (BAR) number for the I/O range |
| * Int | Describes an interrupt item (item = ITEM_INTERRUPT):
|
| • dwInterrupt | Physical interrupt request (IRQ) number |
| • dwOptions | Interrupt options bit-mask, which is set by the function to indicate
the interrupt types supported by the device. PCMCIA interrupts are edge
triggered, 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-triggered interrupts. |
| * Bus | Describes a bus item (item = ITEM_BUS): |
| • dwBusType | The card's bus type. For a PCMCIA card the bus type is
WD_BUS_PCMCIA |
| • dwBusNum | The card's bus number |
| • dwSlotFunc | 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). |
| • cVersion | Card version string |
| • cManufacturer | Card manufacturer string |
| • cProductName | Card product name string |
| • wManufacturerId | Card manufacturer ID |
| • wCardId | Card type and model ID |
| • wFuncId | Card function ID |
| • dwOptions | Should always be set to 0 (reserved for future use) |
WD_STATUS_SUCCESS(0) on success, or
an appropriate error code otherwise [A].
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");
}