next up previous contents
Next: 2.6 WD_PcmciaGetCardInfo() Up: 2. WD_xxx PCI/PCMCIA/ISA Functions Previous: 2.4 WD_PciConfigDump()   Contents


2.5 WD_PcmciaScanCards()


PURPOSE

$\bullet$Detects PCMCIA devices attached to PCMCIA sockets, which conform to the input criteria (manufacturer ID and/or card ID), and returns the number and location (bus, socket and function) of the detected devices.


PROTOTYPE

DWORD WD_PcmciaScanCards(
    HANDLE hWD,
    WD_PCMCIA_SCAN_CARDS *pPcmciaScan);


PARAMETERS

Name Type Input/Output
$\bullet$hWD HANDLE Input
$\bullet$pPcmciaScan WD_PCMCIA_SCAN_CARDS*  
$\gg$searchId WD_PCMCIA_ID  
$\diamond$wManufacturerId WORD Input
$\diamond$wCardId WORD Input
$\gg$dwCards DWORD Output
$\gg$cardId WD_PCMCIA_ID[WD_PCMCIA_CARDS]  
$\diamond$wManufacturerId DWORD Output
$\diamond$wCardId DWORD Output
$\gg$cardSlot WD_PCMCIA_SLOT[WD_PCMCIA_CARDS]  
$\diamond$uBus BYTE Output
$\diamond$uSocket BYTE Output
$\diamond$uFunction BYTE Output
$\diamond$uPadding BYTE N/A
$\gg$dwOptions DWORD Input


DESCRIPTION

Name Description
hWD Handle to WinDriver's kernel-mode driver as received from WD_Open() [5.2]
pPcmciaScan Pointer to a PCMCIA bus scan information structure:
$\bullet$ searchId PCMCIA card ID information structure:
$\gg$ wManufacturerId The manufacturer ID of the PCMCIA cards to detect. If 0, the function will search for all PCMCIA manufacturer IDs.
$\gg$ wCardId The card ID of the PCMCIA cards to detect. If 0, the function will search for all PCMCIA card IDs.
If both wManufacturerId and wCardId are set to 0 the function will return information regarding all connected PCMCIA cards.
$\bullet$ dwCards Number of cards detected for the specified search criteria set in the searchId field
$\bullet$ cardId Array of PCMCIA card ID information structures for the detected PCMCIA cards that match the search criteria set in the searchId field:
$\gg$ wManufacturerId Manufacturer ID
$\gg$ wCardId Card ID
$\bullet$ cardSlot Array of PCMCIA slot information structures for the detected PCMCIA cards that match the search criteria set in the searchId field:
$\gg$ uBus Bus number (0 based)
$\gg$ uSocket Socket number (0 based)
$\gg$ uFunction Function number (0 based)
$\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].


EXAMPLE

WD_PCMCIA_SCAN_CARDS pcmciaScan;
DWORD cards_found;
WD_PCMCIA_SLOT pcmciaSlot;

BZERO(pcmciaScan);
pcmciaScan.searchId.wManufacturerId = 0x1234;
pcmciaScan.searchId.wCardId = 0x5678;
WD_PcmciaScanCards(hWD, &pcmciaScan);
if (pcmciaScan.dwCards>0) /* Found at least one device */
{
    /* Use the first card found */
    pcmciaSlot = pcmciaScan.cardSlot[0];
}
else
{
    printf("No matching PCMCIA devices found\n");
}


next up previous contents
Next: 2.6 WD_PcmciaGetCardInfo() Up: 2. WD_xxx PCI/PCMCIA/ISA Functions Previous: 2.4 WD_PciConfigDump()   Contents