none
Can selective suspend be implemented for miniport adapter running with Windows 7, Vista and XP RRS feed

  • Question

  • I have 2 miniport drivers - one based on NDIS5 and one based on NDIS6. I have also simple mechanism of monitoring network activity - when network activity is absent, driver sends USB Idle Request Irp. Then, when i driver have some uplink packet from NDIS, for example initiated by ping, driver wakes up bus from suspend. On windows 8 all my selective suspend management mechanism works - I can wake up adapter from suspend using pings from command line, but on windows 7, Vista and XP, when bus is going to suspend, NDIS decides, that it is required to stop communication with my adapter - adapter becames "disabled" in network connections and from this time any pings are not coming to my driver, so I cannot wake up it from sleep.

    Is there some way to prevent NDIS from disabling my adapter when it is going to suspend on Windows 7, Vista and XP?

    Thursday, July 4, 2013 9:05 AM

Answers

  • The big rule here is that NDIS owns all the power transitions for the miniport's device stack. It is illegal to initiate a power transition on your own. Since the selective suspend irp requires you to request a D2 immediately when the callback fires, you cannot implement selective suspend without NDIS's knowledge.

    There are two things that change in Windows 8: NDIS (finally) has built-in support for selective suspend, and NDIS will proactively detect and circumvent miniports that illegally attempt to initiate their own power transitions.

    There are two legal ways to get selective suspend to work: on Windows 8 and later, just use the NDIS API. It is very simple, and takes only about an hour to get it working. Prior to Windows 8, you need to go through considerably more work. You need to build a bus driver that enumerates a fake miniport stack for NDIS to look at, then put your SS logic into your own driver for the "real" FDO. If you're serious about this approach, contact Microsoft DDK support to get the "ssndis" sample.

    Friday, July 5, 2013 3:25 PM

All replies

  • The big rule here is that NDIS owns all the power transitions for the miniport's device stack. It is illegal to initiate a power transition on your own. Since the selective suspend irp requires you to request a D2 immediately when the callback fires, you cannot implement selective suspend without NDIS's knowledge.

    There are two things that change in Windows 8: NDIS (finally) has built-in support for selective suspend, and NDIS will proactively detect and circumvent miniports that illegally attempt to initiate their own power transitions.

    There are two legal ways to get selective suspend to work: on Windows 8 and later, just use the NDIS API. It is very simple, and takes only about an hour to get it working. Prior to Windows 8, you need to go through considerably more work. You need to build a bus driver that enumerates a fake miniport stack for NDIS to look at, then put your SS logic into your own driver for the "real" FDO. If you're serious about this approach, contact Microsoft DDK support to get the "ssndis" sample.

    Friday, July 5, 2013 3:25 PM
  • Thank you very much for answer! Yes, I am serious about this approach, could you please give mail or some other contact of Microsoft DDK support to let me get the "ssndis" sample?
    Friday, July 5, 2013 5:07 PM
  • If your employer has a support contract with Microsoft, you should use your support channel.  Otherwise, you can go here, but there may be a fee for the support case.

    Monday, July 8, 2013 3:26 AM
  • Thank you!
    Monday, July 8, 2013 4:12 PM