Power management question

  • Thread starter Thread starter AGG
  • Start date Start date
A

AGG

I have bus driver for a usb network device. This bus driver exposes 2 PDO.I
also have a ndis-wdm miniport driver which communicates with this bus driver
and exposes the device as 802.3 device. I also have a serial driver which
communicates with the bus driver.

Question is Will the bus driver directly receive power related IRPs from OS
when I am trying to suspend?
Or
will it be the case that NDIS will send power oids like OID_PNP_SET_POWER
and then I should send IRP to bus driver. Similarly when serial driver
receives OS power oids, I should send power IRP to the bus driver and then
once the bus driver has received the 2 IRPs from both drivers it will
actually put the device to D3.

Thanks!
AGG
 
for the NDIS-WDM driver, NDIS will send a Dx (where x is 1-3) to the PDO
during power down and a D0 irp during power up. for the serial driver, the
FDO driver will do the same. When your bus driver gets a device power irp
on the PDO, do the appropriate action for the child but not for the parent.
i am guessing that these are pseudo virtual functions, so the bus driver
would do nothing for the PDO power management other then to complet the
power irp.

when the bus parent FDO gets a system irp, it is your driver's
responsibility as the power policy owner for this part of the stack to
translate the system power irp into the device power irp and do the right
thing. busenum in the DDK demonstrates this. better yet, use KMDF to write
your bus driver and all these issues are taken care of for you by KMDF
itself. power issues are just the tip of the iceburg. getting pnp correct
on a bus driver and to interact properly with power can be quite difficult.
again, KMDF takes care of all that for you. you can download KMDF from
http://www.microsoft.com/whdc/driver/wdf/KMDF_pkg.mspx

d
 
Back
Top