next up previous contents
Next: 2.7 WD_PcmciaConfigDump() Up: 2. WD_xxx PCI/PCMCIA/ISA Functions Previous: 2.5 WD_PcmciaScanCards()   Contents


2.6 WD_PcmciaGetCardInfo()


PURPOSE

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


next up previous contents
Next: 2.7 WD_PcmciaConfigDump() Up: 2. WD_xxx PCI/PCMCIA/ISA Functions Previous: 2.5 WD_PcmciaScanCards()   Contents