This section described the WDC types and preprocessor definitions defined in the WinDriver/include/wdc_defs.h header file.
WDC device ID information union (used for PCI and PCMCIA devices).
PCI/PCMCIA/ISA device memory or I/O address space information structure.
| Field | Type | Description |
|---|---|---|
| dwAddrSpace | DWORD | The address space number |
| fIsMemory | BOOL |
• TRUE: memory address space.• FALSE: I/O address space.
|
| dwItemIndex | DWORD |
The index of the WD_ITEMS structureWDC_xxxDeviceOpen() in
the cardReg.Card.Item array of the relevant WDC device
information structure |
| dwBytes | DWORD | The address space's size (in bytes) |
| kptAddr | KPTR |
The kernel-mode mapping of the address space's physical base address. This address is used by the WDC API for accessing a memory or I/O region using the low-level WD_Transfer() or
WD_MultiTransfer() APIs (described in the WinDriver PCI Low-Level API Reference),
or when accessing memory address directly in the kernel.
|
| dwUserDirectMemAddr | UPTR |
The user-mode mapping of a memory address space's physical base address.
This address is used for accessing memory addresses directly from the user mode. |
PCI/PCMCIA/ISA device information structure.
The WDC_xxxDeviceOpen() functions (PCI
| Field | Type | Description |
|---|---|---|
| id | WDC_ID_U |
Device ID information union (relevant for PCI and PCMCIA devices) —
see |
| slot | WDC_SLOT_U |
Device location information structure — see description of
WDC_SLOT_U in |
| dwNumAddrSpaces | DWORD | Number of address spaces found on the device |
| pAddrDesc | WDC_ADDR_DESC* |
Array of memory and I/IO address spaces information structures |
| cardReg | WD_CARD_REGISTER |
WD_CardRegister() function (see the WinDriver PCI Low-Level API Reference), which
is called by the WDC_xxxDeviceOpen() functions
|
| kerPlug | WD_KERNEL_PLUGIN |
Kernel PlugIn driver information structure This structure is filled by the functions used to open a handle to a Kernel PlugIn for a WDC_DEVICEWDC_KernelPlugInOpen()WDC_xxxDeviceOpen() functions (PCIIf no Kernel PlugIn handle was opened for the device, this structure is not used. |
| Int | WD_INTERRUPT |
Interrupt information structure. This structure is filled by the WDC_xxxDeviceOpen() functions
for devices that have interrupts, and is maintained by the WDC library.
|
| hIntThread | DWORD |
Handle to the interrupt thread that is spawn when interrupts are
enabled. This handle is passed by WDC to the low-level WinDriver interrupt APIs. When using the WDC API you do not need to access this handle directly. |
| Event | WD_EVENT |
WinDriver Plug-and-Play and power management events information structure —
see EventRegister() description in the WinDriver PCI Low-Level API Reference for
details.
|
| hEvent | HANDLE |
Handle used by the WinDriver EventRegister() /
EventUnregister() functions (see the WinDriver PCI Low-Level API Reference)When using the WDC API you do not need to access this handle directly. |
| pCtx | PVOID |
Device context information. This information is received as a parameter by the WDC_xxxDeviceOpen() functions and stored in the device
structure for future use by the calling application (optional)
|
Pointer to a WDC_DEVICE structure
typedef WDC_DEVICE *PWDC_DEVICE
![]() | |
The wdc_defs.h macros cast WDC device pointer
parameters (pDev) to PWDC_DEVICE. You may also pass
WDC_DEVICE_HANDLE |
Utility macro that returns a pointer that can be used for direct access to a specified memory address space from the context of the calling process.
WDC_MEM_DIRECT_ADDR(pAddrDesc)
| Name | Type | Input/Output |
|---|---|---|
| pAddrDesc | WDC_ADDR_DESC* | Input |
| Name | Description |
|---|---|
| pAddrDesc |
Pointer to a WDC memory address space information structure |
When called from the user mode, returns the user-mode mapping of the physical
memory address (pAddrDesc->dwUserDirectMemAddr);
When called from the kernel mode, returns the kernel-mode mapping of the
physical memory address (pAddrDesc->kptAddr).
The returned pointer can be used for accessing the memory directly from the
user mode or kernel mode, respectively.
Utility macro that checks if a given address space is a memory or I/O address space.
WDC_ADDR_IS_MEM(pAddrDesc)
| Name | Type | Input/Output |
|---|---|---|
| pAddrDesc | WDC_ADDR_DESC* | Input |
| Name | Description |
|---|---|
| pAddrDesc |
Pointer to a WDC memory address space information structure |
Returns pAddrDesc->fIsMemory, which is set to
TRUE for a memory address space and to FALSE
otherwise.
Utility macro that retrieves a WDC address space information structure
(WDC_ADDR_DESC
WDC_GET_ADDR_DESC(
pDev,
dwAddrSpace)
| Name | Type | Input/Output |
|---|---|---|
| pDev | PWDC_DEVICE | Input |
| dwAddrSpace | DWORD | Input |
| Name | Description |
|---|---|
| pDev |
Pointer to a WDC device information structure |
| dwAddrSpace | Address space number |
Returns a pointer to the device's address information structure
(WDC_ADDR_DESCpDev->pAddrDesc[dwAddrSpace].
Utility macro for retrieving the value of a WDC device's
dwEnabledIntType WD_INTERRUPT field. This field is
updated by WDC_IntEnable()
WDC_GET_ENABLED_INT_TYPE(pDev)
| Name | Type | Input/Output |
|---|---|---|
| pDev | PWDC_DEVICE | Input |
| Name | Description |
|---|---|
| pDev |
Pointer to a WDC device information structure |
Returns the interrupt type enabled for the device:
INTERRUPT_MESSAGE_X — Extended Message-Signaled Interrupts (MSI-X)
INTERRUPT_MESSAGE — Message-Signaled Interrupts (MSI)
INTERRUPT_LEVEL_SENSITIVE — Legacy level-sensitive
interrupts
INTERRUPT_LATCHED — Legacy edge-triggered interrupts.
INTERRUPT_MESSAGE flag for both MSI and
MSI-X.
WDC_IntEnable()WDC_INT_IS_MSI macro to
check if MSI or MSI-X was enabledUtility macro for retrieving the value of a WDC device's interrupt options, which indicate the types of interrupts supported by the device, as detailed in the description of the macro's return value below.
WDC_GET_INT_OPTIONS(pDev)
| Name | Type | Input/Output |
|---|---|---|
| pDev | PWDC_DEVICE | Input |
| Name | Description |
|---|---|
| pDev |
Pointer to a WDC device information structure |
Returns a bit-mask indicating the types of interrupts supported by the device:
INTERRUPT_MESSAGE_X: Extended Message-Signaled Interrupts (MSI-X).
INTERRUPT_MESSAGE: Message-Signaled Interrupts (MSI).
INTERRUPT_LEVEL_SENSITIVE: Legacy level-sensitive
interrupts.INTERRUPT_LATCHED: Legacy edge-triggered interrupts.
WDC_INT_IS_MSI macro
to check whether they include the INTERRUPT_MESSAGE (MSI)
and/or INTERRUPT_MESSAGE_X (MSI-X) flagsUtility macro that checks whether a given interrupt type bit-mask contains the Message-Signaled Interrupts (MSI) or Extended Message-Signaled Interrupts (MSI-X) interrupt type flags.
WDC_INT_IS_MSI(dwIntType)
| Name | Type | Input/Output |
|---|---|---|
| dwIntType | DWORD | Input |
| Name | Description |
|---|---|
| dwIntType | Interrupt types bit-mask |
Returns TRUE if the provided interrupt type bit-mask includes the
INTERRUPT_MESSAGE (MSI) and/or
INTERRUPT_MESSAGE_X (MSI-X) flags; otherwise returns
FALSE.
Utility macro that retrieves the message data of the last received interrupt for the Message-Signaled Interrupts (MSI) / Extended Message-Signaled Interrupts (MSI-X) enabled for the device (on Linux and Windows Vista and higher).
WDC_GET_ENABLED_INT_LAST_MSG(pDev)
| Name | Type | Input/Output |
|---|---|---|
| pDev | PWDC_DEVICE | Input |
| Name | Description |
|---|---|
| pDev |
Pointer to a WDC device information structure |
If MSI or MSI-X was enabled for the given device, the macro returns the message data of the last message received for the device's interrupt; otherwise returns zero.
Utility macro that checks whether a WDC device uses a Kernel PlugIn driver.
WDC_IS_KP(pDev)
| Name | Type | Input/Output |
|---|---|---|
| pDev | PWDC_DEVICE | Input |
| Name | Description |
|---|---|
| pDev |
Pointer to a WDC device information structure |
Returns TRUE if the device uses a Kernel PlugIn driver; otherwise
returns FALSE.