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


2.7 WD_PcmciaConfigDump()


PURPOSE

$\bullet$Reads/writes from/to the PCMCIA attribute space of a selected PCMCIA card. The PCMCIA attribute space contains the Card Information Structure (CIS).


PROTOTYPE

DWORD WD_PcmciaConfigDump(
    HANDLE hWD,
    WD_PCMCIA_CONFIG_DUMP *pPcmciaConfig);


PARAMETERS

Name Type Input/Output
$\bullet$hWD HANDLE Input
$\bullet$pPcmciaConfig WD_PCMCIA_CONFIG_DUMP*  
$\gg$pcmciaSlot WD_PCMCIA_SLOT  
$\diamond$uBus BYTE Input
$\diamond$uSocket BYTE Input
$\diamond$uFunction BYTE Input
$\diamond$uPadding BYTE N/A
$\gg$pBuffer PVOID Input/Output
$\gg$dwOffset DWORD Input
$\gg$dwBytes DWORD Input
$\gg$fIsRead DWORD Input
$\gg$dwResult DWORD Output
$\gg$dwOptions DWORD Input


DESCRIPTION

Name Description
hWD Handle to WinDriver's kernel-mode driver as received from WD_Open() [5.2]
pPcmciaConfig Pointer to a PCMCIA attribute space information structure:
$\bullet$ pcmciaSlot PCMCIA slot information structure:
$\gg$ uBus PCMCIA bus number (0 based)
$\gg$ uSocket PCMCIA slot number (0 based)
$\gg$ uFunction PCMCIA function number (0 based)
$\gg$ uPadding Padding of 1 byte (reserved)
$\bullet$ pBuffer A pointer to the data that is read from the PCMCIA attribute space (if fIsRead is TRUE) or a pointer to the data to write to the PCMCIA attribute space (if fIsRead is FALSE)
$\bullet$ dwOffset The offset of the specific register(s) in the PCMCIA attribute space to read/write from/to
$\bullet$ dwBytes Number of bytes to read/write
$\bullet$ fIsRead If TRUE - read from the PCMCIA attribute space;
If FALSE - write to the PCMCIA attribute space
$\bullet$ dwResult Result of the PCMCIA attribute space read/write. Can be any of the following PCMCIA_ACCESS_RESULT enumeration values:
$\bullet$ PCMCIA_ACCESS_OK - read/write succeeded
$\bullet$PCMCIA_BAD_SOCKET - the specified socket or function does not exist
$\bullet$PCMCIA_BAD_OFFSET - the specified offset is incorrect
$\bullet$PCMCIA_ACCESS_ERROR - read/write failed
$\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_CONFIG_DUMP pcmciaConfig;
DWORD dwStatus;
WORD aBuffer[2];

BZERO(pcmciaConfig);
pcmciaConfig.pcmciaSlot.uBus = 0;
pcmciaConfig.pcmciaSlot.uSocket = 0;
pcmciaConfig.pcmciaSlot.uFunction = 0;
pcmciaConfig.pcmciaSlot.uPadding = 0;
pcmciaConfig.pBuffer = aBuffer;
pcmciaConfig.dwOffset = 0;
pcmciaConfig.dwBytes = sizeof(aBuffer);
pcmciaConfig.fIsRead = TRUE;

dwStatus = WD_PcmciaConfigDump(hWD, &pcmciaConfig);
if (dwStatus)
{
    printf("WD_PcmciaConfigDump failed: %s\n", Stat2Str(dwStatus));
}
else
{
    printf("Card in Bus 0, Socket 0: the code of the first tuple in"
        " the CIS is %x\n", (UINT32)aBuffer[0]);
}


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