next up previous contents
Next: 4.3 PcmciaEventCreate() Up: 4. Plug and Play Previous: 4.1 Calling Sequence   Contents


4.2 PciEventCreate()


PURPOSE

$\bullet$Convenience function for allocating and initializing a PCI Plug and Play and power management event structure.


PROTOTYPE

WD_EVENT * DLLCALLCONV PciEventCreate(
    WD_PCI_ID cardId,
    WD_PCI_SLOT pciSlot,
    DWORD dwOptions,
    DWORD dwAction);


PARAMETERS

Name Type Input/Output
$\bullet$cardId WD_PCI_ID  
$\gg$dwVendorId DWORD Input
$\gg$dwDeviceId DWORD Input
$\bullet$pciSlot WD_PCI_SLOT  
$\gg$dwBus DWORD Input
$\gg$dwSlot DWORD Input
$\gg$dwFunction DWORD Input
$\bullet$dwOptions DWORD Input
$\bullet$dwAction DWORD Input


DESCRIPTION

Name Description
cardId PCI card information structure:
dwVendorId PCI vendor ID to register to. If zero, register to all PCI vendor IDs.
dwDeviceId PCI card ID to register to. If zero, register to all PCI device IDs.
pciSlot PCI slot information:
dwBus PCI bus number to register to. If zero, register to all PCI buses.
dwSlot PCI slot to register to. If zero, register to all slots.
dwFunction PCI function to register to. If zero, register to all functions.
dwOptions Can be either zero or:
$\bullet$WD_ACKNOWLEDGE - If set, the user can perform actions on the requested event before acknowledging it. The OS waits on the event until the user calls WD_EventSend(). If EventRegister() [4.4] is called, WD_EventSend() will be called automatically after the callback function exits.
dwAction A bit-mask indicating which events to register to:
Plug and Play events:
$\bullet$WD_INSERT - Device was attached and configured by the operating system's Plug and Play manager
$\bullet$WD_REMOVE - Device was un-configured and detached by the operating system's Plug and Play manager
Device power state:
$\bullet$WD_POWER_CHANGED_D0 - Full power
$\bullet$WD_POWER_CHANGED_D1 - Low sleep
$\bullet$WD_POWER_CHANGED_D2 - Medium sleep
$\bullet$WD_POWER_CHANGED_D3 - Full sleep
$\bullet$WD_POWER_SYSTEM_WORKING - Fully on
Systems power state:
$\bullet$WD_POWER_SYSTEM_SLEEPING1 - Fully on but sleeping
$\bullet$WD_POWER_SYSTEM_SLEEPING2 - CPU off, memory on, PCI on
$\bullet$WD_POWER_SYSTEM_SLEEPING3 - CPU off, memory is in refresh, PCI on aux power
$\bullet$WD_POWER_SYSTEM_HIBERNATE - OS saves context before shutdown
$\bullet$WD_POWER_SYSTEM_SHUTDOWN - No context saved


RETURN VALUE

Returns a new structure for handling PCI Plug and Plug and power management events, or NULL if the allocation failed.


REMARKS


EXAMPLE

EventUnregister(event_handle);
PciEventCreate(cardId, pciSlot, WD_ACKNOWLEDGE, WD_INSERT | WD_REMOVE);


next up previous contents
Next: 4.3 PcmciaEventCreate() Up: 4. Plug and Play Previous: 4.1 Calling Sequence   Contents