none
USB selective suspend for UMDF RRS feed

  • Question

  • Hi all, I'm writing a WBF driver by using UMDF. Now I need support selective suspend. 
    Firstly I use non_ppo mode, I added the registry key in INF but I got nothing , device cann't go to low-power mode even system sleep. Then I used PPO mode for my device. The device can go to D3 automatically. But when I need wake up the device , I will get a new DeviceAdd, it looks like the driver had been unload/load.

    I used the following code to enable ss.
    hr = m_FxDevice->AssignS0IdleSettings(IdleUsbSelectiveSuspend,
    PowerDeviceMaximum,
    WBDI_SUSPEND_DELAY,
    IdleAllowUserControl,
    WdfTrue);

    if (FAILED(hr))
    {
    TraceEvents(TRACE_LEVEL_ERROR,
                     BIOMETRIC_TRACE_DEVICE, 
                     "%!FUNC! Unable to set power policy (SUSPEND_DELAY) for the device %!HRESULT!",
                     hr
                     );
    if (hr == HRESULT_FROM_NT(STATUS_POWER_STATE_INVALID)) {
    //
    // The device probably does not support wake. 
    // It might support idle without wake.
    //
    hr = m_FxDevice->AssignS0IdleSettings(IdleCannotWakeFromS0,
    PowerDeviceMaximum,
    WBDI_SUSPEND_DELAY,
    IdleAllowUserControl,
    WdfTrue);
    if (!SUCCEEDED(hr))
    {
    int ttt;
    }
    }
    }
    The first AssignS0IdleSettings always get fail, I can only set IdleCannotWakeFromS0 for my device, is that OK?
    So am I missing something in my driver or my device need change some capabilities?
    Thanks

    Tuesday, July 19, 2016 7:20 AM

All replies

  • Does your hardware actually support USB suspend correctly?

    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Thursday, July 21, 2016 7:46 AM