Example #1
0
VOID
kmdf1394_BusResetRoutineWorkItem (
                                 IN WDFWORKITEM  WorkItem)
{
    WDFDEVICE Device= WdfWorkItemGetParentObject (WorkItem);

    kmdf1394_UpdateGenerationCount (Device);

    WdfObjectDelete (WorkItem);
}
Example #2
0
NTSTATUS
kmdf1394_EvtDeviceD0Entry (
                       IN  WDFDEVICE Device,
                       IN  WDF_POWER_DEVICE_STATE PreviousState)
/*++

Routine Description:

   EvtDeviceD0Entry event callback must perform any operations that are
   necessary before the specified device is used.  It will be called every
   time the hardware needs to be (re-)initialized.  This includes after
   IRP_MN_START_DEVICE, IRP_MN_CANCEL_STOP_DEVICE, IRP_MN_CANCEL_REMOVE_DEVICE,
   IRP_MN_SET_POWER-D0.

   This function runs at PASSIVE_LEVEL, though it is generally not paged.  A
   driver can optionally make this function pageable if DO_POWER_PAGABLE is set.

   Even if DO_POWER_PAGABLE isn't set, this function still runs at
   PASSIVE_LEVEL.  In this case, though, the function absolutely must not do
   anything that will cause a page fault.

Arguments:

    Device - Handle to a framework device object.

    PreviousState - Device power state which the device was in most recently.
        If the device is being newly started, this will be
        PowerDeviceUnspecified.

Return Value:

    NTSTATUS

--*/
{
    NTSTATUS   ntStatus = STATUS_SUCCESS;

    UNREFERENCED_PARAMETER(PreviousState);

    Enter();
    DoTraceLevelMessage(TRACE_LEVEL_INFORMATION, 
                        TRACE_FLAG_PNP,
                        "-->kmdf1394_EvtDeviceD0Entry - coming from %s\n",
                        DbgDevicePowerString(PreviousState));

    ntStatus = kmdf1394_UpdateGenerationCount (Device);

    Exit();

    return ntStatus;
}