ath9k: Check WOW triggers properly

This patch makes sure that valid WOW triggers
are present before trying to suspend the device.
Also, introduce and use ATH_OP_WOW_ENABLED to
bypass PCI suspend and clear it in resume().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Sujith Manoharan
2015-01-30 19:05:27 +05:30
committed by Kalle Valo
parent 661d25815e
commit 249943a221
3 changed files with 29 additions and 30 deletions

View File

@@ -998,9 +998,12 @@ static int ath_pci_suspend(struct device *device)
struct pci_dev *pdev = to_pci_dev(device);
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath_softc *sc = hw->priv;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
if (sc->wow_enabled)
if (test_bit(ATH_OP_WOW_ENABLED, &common->op_flags)) {
dev_info(&pdev->dev, "WOW is enabled, bypassing PCI suspend\n");
return 0;
}
/* The device has to be moved to FULLSLEEP forcibly.
* Otherwise the chip never moved to full sleep,