- When device comes out of Standby, IO board is disabled at PCI level
- Posted by QuasiCodo on March 3rd, 2004
I'm developing a new driver for a PCI board. I used Walter Oney's PTMWDM2
book with his WDM Driver Wizard to generate the skeleton code.
The PCI board has one I/O port. When the driver loads and gets to the
StartDevice() code, the !PCI debugger command shows that I have an I/O port
and the resource list tells me that the I/O port assigned is C400. At that
point I can talk to the device.
However, when I go into standby and then come out of stand by, I cannot
access the I/O anymore. !PCI shows that the I/O port is not enabled for the
device.
So what do I call to get the PCI bus driver to re-enable my I/O port?
((&-<
- Posted by QuasiCodo on March 4th, 2004
I found the problem.
I added the two lines to GetLowestDevicePowerState() at the TODO comment:
// TODO choose a different ...
if (sysstate == PowerSystemWorking)
dstate = PowerDeviceD0;
Everything works great!
((&->
- Posted by Eliyas Yakub [MSFT] on March 4th, 2004
Please note that for a PCI device to work properly, somebody in the driver
stack must act as a power policy owner and do the S-D conversion. Based on
my discussion with the developer of PCI bus driver: PCI will reprogram the
BARs and decodes of the device when it gets the D0 IRP coming out of
standby. So the driver can't do anything until it gets that IRP. Also, if
PCI never sees a D3 IRP going into standby, it will think that even after
coming out of standby the device is in D0 and doesn't need reprogramming.
So you need to make sure that you are converting the S3 IRP into a D3 IRP
and passing it down the stack going into standby.
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx