2.7. WD_PcmciaConfigDump()

Purpose

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
NameTypeInput/Output
hWDHANDLEInput
pPcmciaConfigWD_PCMCIA_CONFIG_DUMP* 
• pcmciaSlotWD_PCMCIA_SLOT 
 * uBusBYTEInput
 * uSocketBYTEInput
 * uFunctionBYTEInput
 * uPaddingBYTEN/A
• pBufferPVOIDInput/Output
• dwOffsetDWORDInput
• dwBytesDWORDInput
• fIsReadDWORDInput
• dwResultDWORDOutput
• dwOptionsDWORDInput
Description
NameDescription
hWDHandle to WinDriver's kernel-mode driver as received from WD_Open() [5.2]
pPcmciaConfigPointer to a PCMCIA attribute space information structure:
• pcmciaSlotPCMCIA slot information structure:
 * uBusPCMCIA bus number (0 based)
 * uSocketPCMCIA slot number (0 based)
 * uFunctionPCMCIA function number (0 based)
 * uPaddingPadding of 1 byte (reserved)
• 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)
• dwOffset The offset of the specific register(s) in the PCMCIA attribute space to read/write from/to
• dwBytesNumber of bytes to read/write
• fIsRead If TRUE — read from the PCMCIA attribute space;
If FALSE — write to the PCMCIA attribute space.
• dwResult Result of the PCMCIA attribute space read/write. Can be any of the following PCMCIA_ACCESS_RESULT enumeration values:
PCMCIA_ACCESS_OK — read/write succeeded
PCMCIA_BAD_SOCKET — the specified socket or function does not exist
PCMCIA_BAD_OFFSET — the specified offset is incorrect
PCMCIA_ACCESS_ERROR — read/write failed
• dwOptionsShould 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]);
}