RE: Hibernation problem for USB device without ROM firmware
- From: aes <aes@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 21 Nov 2005 10:48:30 -0800
After posting this I noticed the drivers involved are confusing so for
clarification:
> The firmware is downloaded on start IRP during enumeration and the device is
> functional at this time. The problem starts after returning from hibernation.
This is related to bus driver.
> I tried to download the firmware during power-up after hibernation. I have
> attached a code snippet to help explain.
This is related to lower filter driver.
"aes" wrote:
> The firmware is downloaded on start IRP during enumeration and the device is
> functional at this time. The problem starts after returning from hibernation.
> I tried to download the firmware during power-up after hibernation. I have
> attached a code snippet to help explain.
>
> -- start of snippet --
> switch (IrpStack->MinorFunction)
> {
> case IRP_MN_SET_POWER:
> switch (powerType)
> {
> case DevicePowerState:
>
> switch
> (IrpStack->Parameters.Power.State.DeviceState)
> {
> case
> PowerDeviceD0:
>
>
> return WHSetPowerD0(DeviceObject, fdoDeviceData, Irp);
>
> ..............................................
>
> NTSTATUS WHSetPowerD0 (
> IN PDEVICE_OBJECT PDevObj,
> IN PBUS_FDO_EXT pDevExt,
> IN PIRP PIrp)
> {
> NTSTATUS status;
> PIO_STACK_LOCATION pIrpStack = IoGetCurrentIrpStackLocation
> (PIrp);
>
> // Set up completion to init device when it is on
> KeClearEvent (&pDevExt->PowerD0Event);
>
> IoCopyCurrentIrpStackLocationToNext (PIrp);
> IoSetCompletionRoutine (PIrp, WHSyncCompletion,
> &pDevExt->PowerD0Event,
> TRUE, TRUE, TRUE);
>
> /*****************************************************/
> // I did experiment (just to see the behavior of USB stack)
> downloading
> // of firmware here
> // I get STATUS_DEVICE_POWERED_OFF and this is expected to happen
> here
>
> status = PoCallDriver (pDevExt->NextLowerDO, PIrp);
>
> if (status == STATUS_PENDING) {
>
> KeWaitForSingleObject (&pDevExt->PowerD0Event,
> Executive, KernelMode,
> FALSE, NULL);
> }
> else {
> if (!NT_SUCCESS (status)) {
> PIrp->IoStatus.Status = status;
> PoStartNextPowerIrp (PIrp);
> IoCompleteRequest (PIrp, IO_NO_INCREMENT);
> return (status);
> }
> }
>
> if (!NT_SUCCESS (PIrp->IoStatus.Status)) {
> status = PIrp->IoStatus.Status;
> PoStartNextPowerIrp (PIrp);
> IoCompleteRequest (PIrp, IO_NO_INCREMENT);
> return (status);
> }
>
> pDevExt->DevicePowerState = PowerDeviceD0;
>
>
> if (pDevExt->WentToHibernate)
> {
> //download firmware
> /*****************************/
> // this is the actual place for firmware download and
> // I get STATUS_DEVICE_NOT_CONNECTED for
> // IOCTL_INTERNAL_USB_SUBMIT_URB with
> // URB_FUNCTION_VENDOR_DEVICE
> // this IOCTL is central to firmware download
> }
>
> // Now that we are powered up, call PoSetPowerState
> PoSetPowerState (PDevObj, pIrpStack->Parameters.Power.Type,
> pIrpStack->Parameters.Power.State);
>
> PoStartNextPowerIrp (PIrp);
> IoCompleteRequest (PIrp, IO_NO_INCREMENT);
>
> return (status);
> }
>
> -- end of snippets --
>
> Thanks
> Al
>
>
> ""Martin Borve [MSFT]"" wrote:
>
> > Could you provide a more detailed explanation of what you are doing? Are
> > you downloading the firmware when handing a power IRP, or the start IRP as
> > mentioned in the workaround you attached?
> >
> > Martin Borve
> > Windows DDK Support
> > This posting is provided "AS IS" with no warranties, and confers no rights
.
- Follow-Ups:
- RE: Hibernation problem for USB device without ROM firmware
- From: "Martin Borve [MSFT]"
- RE: Hibernation problem for USB device without ROM firmware
- References:
- Hibernation problem for USB device without ROM firmware
- From: aes
- RE: Hibernation problem for USB device without ROM firmware
- From: "Martin Borve [MSFT]"
- RE: Hibernation problem for USB device without ROM firmware
- From: aes
- Hibernation problem for USB device without ROM firmware
- Prev by Date: Re: Alternative for Microsofts DDK...
- Next by Date: Re: how do i: import from another loaded driver
- Previous by thread: RE: Hibernation problem for USB device without ROM firmware
- Next by thread: RE: Hibernation problem for USB device without ROM firmware
- Index(es):
Relevant Pages
|