Esempio n. 1
0
static int ar6000_pm_suspend(struct platform_device *dev, pm_message_t state)
{
    int i;
    for (i = 0; i < MAX_AR6000; i++) {
        AR_SOFTC_T *ar;

        if (ar6000_devices[i] == NULL)
            continue;
        ar = (AR_SOFTC_T*)netdev_priv(ar6000_devices[i]);
        AR_DEBUG_PRINTF(ATH_DEBUG_SUSPEND,("%s: enter status %d\n", __func__, ar->arOsPowerCtrl));
        switch (ar->arOsPowerCtrl) {
        case WLAN_PWR_CTRL_CUT_PWR:
            ar6000_pwr_down(ar);
            break;
        case WLAN_PWR_CTRL_WOW:
            if (ar->arTxPending[ar->arControlEp]) {
                AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup WoW. Pending wmi control data %d\n", ar->arTxPending[ar->arControlEp]));
                ar->arWowState = WOW_STATE_NONE;
            } else {
                ar->arWowState = WOW_STATE_SUSPENDED;
                AR_DEBUG_PRINTF(ATH_DEBUG_SUSPEND,("Setup WoW successfully\n"));
            }
            break;
        case WLAN_PWR_CTRL_DEEP_SLEEP:
            /* fall through */
        case WLAN_PWR_CTRL_DEEP_SLEEP_DISABLED:
            /* nothing to do. keep the power on */
            break;
        default:
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Something is strange for ar6000_pm_suspend %d\n", ar->arOsPowerCtrl));
            break;
       }
    }
    return 0;
}
Esempio n. 2
0
static int ar6000_pm_remove(struct platform_device *pdev)
{
    ar6000_pwr_down(NULL);
    return 0;
}