xxxxx@hotmail.com wrote:
So, power mappings. Filled in by the bus driver, but based on what information? How does it decide the mappings, and what, and where from, is the information it uses?
Some buses get this information from the device itself. USB and
PCIExpress devices both have information in their configuration spaces
that describe their power behavior. The bus driver maps this to the
Windows power states. The power policy owner (usually the function
driver) can override all of that.
What I would like to be able to do is change this to D0 for all states so the device is powered up during suspend and hibernate.
It’s not that simple. When your system goes into hibernate, power is
physically removed. Your driver can claim it is in D0, but unless you
are self-powered, if your bus loses power, you lose power.
These power states are a software convention. They are not instructions
to the hardware. When the system wants to go to S3, it asks each
device’s driver to figure out what it needs to do. The driver then says
“well, for S3, I need to go to D2”. It then does what it needs to do to
transition to D2. But you can’t really ask the PCI driver “put me into
D2”. If all of the drivers have agreed to transition to S3, then the
system will transition to S3.
And changing that state table doesn’t change the behavior of the
function driver. Even if you change all of the S mappings to D0, the
function driver can still say “well, for S3 I need to go to D2”.
Do you control the function driver for this device?
So far from looking at an enumeration there is only ‘self powered’ and ‘remote wakeup’ which seem to have anything to do with power, and changing these so the device declares itself as ‘not self powered’ and ‘can wake’ hasn’t made any difference to the power mappings.
Are you talking about a USB device? The mention of “self powered” makes
me think you might be. If so, then you have even less flexibility. The
USB spec doesn’t have very many externally visible power states. You
have selective suspend, and you have off. The operating system doesn’t
really care about “self powered” vs “not self powered”; all that means
is that your device will still have power when the bus turns off.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.