![]() |
Jungo WinDriver
Official Documentation
|
#define WD_CardRegister | ( | h, | |
pCard | |||
) |
Card registration function.
The function: Maps the physical memory ranges to be accessed by kernel-mode processes and user-mode applications.
Verifies that none of the registered device resources (set in pCardReg->Card.Item) are already locked for exclusive use. A resource can be locked for exclusive use by setting the fNotSharable field of its WD_ITEMS structure (pCardReg->Card.Item[i]) to 1, before calling WD_CardRegister().
Saves data regarding the interrupt request (IRQ) number and the interrupt type in internal data structures; this data will later be used by InterruptEnable() and/or WD_IntEnable()
[in] | h | Handle to WinDriver's kernel-mode driver as received from WD_Open() |
[in,out] | pCard | Pointer to a card registration information structure |
If your card has a large memory range that cannot be fully mapped to the kernel address space, you can set the WD_ITEM_MEM_DO_NOT_MAP_KERNEL flag in the I.Mem.dwOptions field of the relevant WD_ITEMS memory resource structure that you pass to the card registration function (pCardReg->Card.Item[i].I.Mem.dwOptions). This flag instructs the function to map the memory range only to the user-mode virtual address space, and not to the kernel address space. (For PCI devices, you can modify the relevant item in the card information structure (pCard) that you received from WD_PciGetCardInfo() before passing this structure to WD_CardRegister().)
Note that if you select to set the WD_ITEM_MEM_DO_NOT_MAP_KERNEL flag, WD_CardRegister() will not update the item's pTransAddr field with a kernel mapping of the memory's base address, and you will therefore not be able to rely on this mapping in calls to WinDriver APIs namely interrupt handling APIs or any API called from a Kernel PlugIn driver