Ndistest 6.5 Wake on Link Change.

Hi folks,

I’m having an issue with getting our drivers to pass the Ndistest 6.5
wake on link change tests. Our drivers consist of a WDF bus driver which
handles our PCI device, and creates PDO’s for (possibly virtual) Ndis
miniports with a WDF top (bottom?) edge. However, it looks like we’re
not advertising something right for the bus, because the WoLC test fails
with the message:

114934818 StartTime: 18:30:55.990
Verifying that the machine and DUT’s bus can also support WOLC
functionality
Open::GetDeviceBusPmeSupport

  • Name: WakeOnLinkChange DUT Open

The bus the DUT is enumerated on does not support propagating PME#
signals while the machine is in S0. This support is necessary for WOLC
to function and for any test device supporting WOLC (D3 on Disconnect)
to pass logo tests.

Any ideas?

MH.

I look at what power characteristics you’re reporting to the NIC FDO from
your virtual bus PDO’s. You might need to pass up the tree some of the
power characteristics from your bus FDO (which get’s them from the physical
device stack).

Jan

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Martin Harvey
Sent: Tuesday, June 08, 2010 7:11 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Ndistest 6.5 Wake on Link Change.

Hi folks,

I’m having an issue with getting our drivers to pass the Ndistest 6.5 wake
on link change tests. Our drivers consist of a WDF bus driver which handles
our PCI device, and creates PDO’s for (possibly virtual) Ndis miniports with
a WDF top (bottom?) edge. However, it looks like we’re not advertising
something right for the bus, because the WoLC test fails with the message:

114934818

StartTime:

18:30:55.990

Verifying that the machine and DUT’s bus can also support WOLC functionality

Open::GetDeviceBusPmeSupport

  • Name: WakeOnLinkChange DUT Open

The bus the DUT is enumerated on does not support propagating PME# signals
while the machine is in S0. This support is necessary for WOLC to function
and for any test device supporting WOLC (D3 on Disconnect) to pass logo
tests.

Any ideas?

MH.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I appreciate random questions with little info are not useful, so I’ll
provide some more precise information on what I have done when creating
the PDO’s, and what I haven’t. I’m wondering whether this might be a
problem with me doing the wrong WDF things, but I can’t see what.

Things that have been done to the PDO Init:

WdfDeviceInitSetDeviceType
WdfPdoInitAssignDeviceID
WdfPdoInitAddHardwareID
WdfPdoInitAddCompatibleID
WdfPdoInitAssignInstanceID
WdfPdoInitAddDeviceText
WdfPdoInitSetDefaultLocale

WdfDeviceInitSetPnpPowerEventCallbacks (D0Entry and Exit)
WdfPdoInitSetEventCallbacks (Enable and disable wake at bus)

Things that have been done to the PDO after creation:

WdfDeviceAddQueryInterface (For our own interfaces)
WdfDeviceSetPnpCapabilities (Details at end)
WdfDeviceSetPowerCapabilities(Details at end)
WdfDeviceSetSpecialFileSupport (Paging, hibernation & crashdump)

Things that have not been done:

WdfDeviceInitRegisterPnpStateChangeCallback
WdfDeviceInitRegisterPowerStateChangeCallback
WdfDeviceInitRegisterPowerPolicyStateChangeCallback
WdfDeviceInitSetPowerInrush
WdfDeviceInitSetPowerNotPageable
WdfDeviceInitSetPowerPageable
WdfDeviceInitSetPowerPolicyEventCallbacks
WdfDeviceInitSetPowerPolicyOwnership

PnP and power capabilities:

WDF_DEVICE_PNP_CAPABILITIES_INIT(&PnpCaps);
PnpCaps.Removable = WdfFalse;
PnpCaps.EjectSupported = WdfFalse;
PnpCaps.SurpriseRemovalOK = WdfTrue;
PnpCaps.SilentInstall = WdfTrue;
PnpCaps.UniqueID = WdfTrue;

PnpCaps.Address = -1;
PnpCaps.UINumber = -1;

WDF_DEVICE_POWER_CAPABILITIES_INIT(&PowerCaps);
PowerCaps->WakeFromD0 = WdfTrue;
PowerCaps->WakeFromD3 = WdfTrue;
PowerCaps->DeviceWake = PowerDeviceD3;
PowerCaps->SystemWake = PowerSystemHibernate;
PowerCaps->DeviceState[PowerSystemWorking] = PowerDeviceD0;
PowerCaps->DeviceState[PowerSystemSleeping1] = PowerDeviceD3;
// PowerCaps->DeviceState[PowerSystemSleeping2] = PowerDeviceD3;
PowerCaps->DeviceState[PowerSystemSleeping3] = PowerDeviceD3;
PowerCaps->DeviceState[PowerSystemHibernate] = PowerDeviceD3;
PowerCaps->DeviceState[PowerSystemShutdown] = PowerDeviceD3;

Have you tried not specifying the powwe caps? Kmdf will use the parent’s caps. These 2 lines are wrong iirc

PowerCaps->SystemWake = PowerSystemHibernate;
PowerCaps->DeviceState[PowerSystemWorking] = PowerDeviceD0;

System wake is the lightest state you can wake from. For the nic to turn off while the system is running, report PowerSystemWorking. The associated d state needs to be < D0

d

dent from a phpne with no keynoard

-----Original Message-----
From: Martin Harvey
Sent: June 09, 2010 3:21 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Ndistest 6.5 Wake on Link Change.

I appreciate random questions with little info are not useful, so I’ll
provide some more precise information on what I have done when creating
the PDO’s, and what I haven’t. I’m wondering whether this might be a
problem with me doing the wrong WDF things, but I can’t see what.

Things that have been done to the PDO Init:

WdfDeviceInitSetDeviceType
WdfPdoInitAssignDeviceID
WdfPdoInitAddHardwareID
WdfPdoInitAddCompatibleID
WdfPdoInitAssignInstanceID
WdfPdoInitAddDeviceText
WdfPdoInitSetDefaultLocale

WdfDeviceInitSetPnpPowerEventCallbacks (D0Entry and Exit)
WdfPdoInitSetEventCallbacks (Enable and disable wake at bus)

Things that have been done to the PDO after creation:

WdfDeviceAddQueryInterface (For our own interfaces)
WdfDeviceSetPnpCapabilities (Details at end)
WdfDeviceSetPowerCapabilities(Details at end)
WdfDeviceSetSpecialFileSupport (Paging, hibernation & crashdump)

Things that have not been done:

WdfDeviceInitRegisterPnpStateChangeCallback
WdfDeviceInitRegisterPowerStateChangeCallback
WdfDeviceInitRegisterPowerPolicyStateChangeCallback
WdfDeviceInitSetPowerInrush
WdfDeviceInitSetPowerNotPageable
WdfDeviceInitSetPowerPageable
WdfDeviceInitSetPowerPolicyEventCallbacks
WdfDeviceInitSetPowerPolicyOwnership

PnP and power capabilities:

WDF_DEVICE_PNP_CAPABILITIES_INIT(&PnpCaps);
PnpCaps.Removable = WdfFalse;
PnpCaps.EjectSupported = WdfFalse;
PnpCaps.SurpriseRemovalOK = WdfTrue;
PnpCaps.SilentInstall = WdfTrue;
PnpCaps.UniqueID = WdfTrue;

PnpCaps.Address = -1;
PnpCaps.UINumber = -1;

WDF_DEVICE_POWER_CAPABILITIES_INIT(&PowerCaps);
PowerCaps->WakeFromD0 = WdfTrue;
PowerCaps->WakeFromD3 = WdfTrue;
PowerCaps->DeviceWake = PowerDeviceD3;
PowerCaps->SystemWake = PowerSystemHibernate;
PowerCaps->DeviceState[PowerSystemWorking] = PowerDeviceD0;
PowerCaps->DeviceState[PowerSystemSleeping1] = PowerDeviceD3;
// PowerCaps->DeviceState[PowerSystemSleeping2] = PowerDeviceD3;
PowerCaps->DeviceState[PowerSystemSleeping3] = PowerDeviceD3;
PowerCaps->DeviceState[PowerSystemHibernate] = PowerDeviceD3;
PowerCaps->DeviceState[PowerSystemShutdown] = PowerDeviceD3;


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

On 09/06/2010 15:26, Doron Holan wrote:

Have you tried not specifying the powwe caps? Kmdf will use the parent’s caps.

Thank you for your help,

The parent for these devices is variable. It may be a PCI device, or it
may be a “Singleton” Root device created in the coinstaller via
SetupDiCreateDeviceInfo / SetupDiCallClassInstaller etc etc, so I was
hoping not to always rely on capabilities being proxied up the stack.
Generally, we internally proxy the wake OID requests from the NDIS
miniports to the appropriate PCI device(s) via an internal arbitration
layer, so the child devices are pretty much virtual.

Having said that, for the purposes of passing WHQL, I’m happy for this
to work with just the PCI device as parent.

These 2 lines are wrong iirc

PowerCaps->SystemWake = PowerSystemHibernate;
PowerCaps->DeviceState[PowerSystemWorking] = PowerDeviceD0;

System wake is the lightest state you can wake from. For the nic to turn off while the system is running, report PowerSystemWorking. The associated d state needs to be< D0

Apologies for querying further, maybe I misunderstood the documentation,
but I read:

*SystemWake*

A SYSTEM_POWER_STATE-typed value that indicates the lowest system
power state from which the device can send a wake signal to the
system. If this value is *PowerSystemMaximum*, the framework uses
whatever value is currently stored in the system for this member.
SYSTEM_POWER_STATE values are defined in /wdm.h/.

I thought this meant “lowest system power state” = “least powered system
state”, which in our case is hibernate - to set this at
PowerSystemWorking would mean that D0 idle would work, but then other
tests (Wake on Magic packet etc etc) would not be able to wake the
system from S3 / D3.

However, on DeviceState[PowerSystemWorking], I agree this should be set
to PowerDeviceD3. However since the device is virtual, it makes few odds
for our driver - we end up having to arbitrate on which miniports need
which PCI devices and then arbitrating, resulting in calls to
WdfDeviceStopIdle etc on the PCI devices.

MH.

Problem now solved.

IoGetPropertyDeviceData / IoSetPropertyDeviceData and
DEVPKEY_PciDevice_S0WakeupSupported did what I wanted.

MH.