aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRaja Mani <rmani@qca.qualcomm.com>2011-11-07 15:52:46 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 06:00:00 -0500
commitd7c44e0ba5003c22a9ff3545fc2f51eaca8a95b1 (patch)
treee9ca5bfa99970e3e0457d133b7ce145e1152913c /drivers/net
parent524441e3a7cadf12acbb409ad733d783ba1da459 (diff)
ath6kl: Invoke WOW suspend/resume calls during PM operation
Link ath6kl's wow suspend/resume functions with the actual suspend/resume path. WOW mode is selected when the host sdio controller supports both MMC_PM_KEEP_POWER and MMC_PM_WAKE_SDIO_IRQ capabilities. kvalo: also adds a missing break in ath6kl_cfg80211_resume(), luckily it didn't have any effect on functionality. Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c28
-rw-r--r--drivers/net/wireless/ath/ath6kl/sdio.c20
2 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 8249a8c76df3..0e3ecf814635 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1760,6 +1760,21 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
1760 int ret; 1760 int ret;
1761 1761
1762 switch (mode) { 1762 switch (mode) {
1763 case ATH6KL_CFG_SUSPEND_WOW:
1764
1765 ath6kl_dbg(ATH6KL_DBG_SUSPEND, "wow mode suspend\n");
1766
1767 /* Flush all non control pkts in TX path */
1768 ath6kl_tx_data_cleanup(ar);
1769
1770 ret = ath6kl_wow_suspend(ar, wow);
1771 if (ret) {
1772 ath6kl_err("wow suspend failed: %d\n", ret);
1773 return ret;
1774 }
1775 ar->state = ATH6KL_STATE_WOW;
1776 break;
1777
1763 case ATH6KL_CFG_SUSPEND_DEEPSLEEP: 1778 case ATH6KL_CFG_SUSPEND_DEEPSLEEP:
1764 1779
1765 ath6kl_cfg80211_stop(ar); 1780 ath6kl_cfg80211_stop(ar);
@@ -1811,6 +1826,18 @@ int ath6kl_cfg80211_resume(struct ath6kl *ar)
1811 int ret; 1826 int ret;
1812 1827
1813 switch (ar->state) { 1828 switch (ar->state) {
1829 case ATH6KL_STATE_WOW:
1830 ath6kl_dbg(ATH6KL_DBG_SUSPEND, "wow mode resume\n");
1831
1832 ret = ath6kl_wow_resume(ar);
1833 if (ret) {
1834 ath6kl_warn("wow mode resume failed: %d\n", ret);
1835 return ret;
1836 }
1837
1838 ar->state = ATH6KL_STATE_ON;
1839 break;
1840
1814 case ATH6KL_STATE_DEEPSLEEP: 1841 case ATH6KL_STATE_DEEPSLEEP:
1815 if (ar->wmi->pwr_mode != ar->wmi->saved_pwr_mode) { 1842 if (ar->wmi->pwr_mode != ar->wmi->saved_pwr_mode) {
1816 ret = ath6kl_wmi_powermode_cmd(ar->wmi, 0, 1843 ret = ath6kl_wmi_powermode_cmd(ar->wmi, 0,
@@ -1833,6 +1860,7 @@ int ath6kl_cfg80211_resume(struct ath6kl *ar)
1833 ath6kl_warn("Failed to boot hw in resume: %d\n", ret); 1860 ath6kl_warn("Failed to boot hw in resume: %d\n", ret);
1834 return ret; 1861 return ret;
1835 } 1862 }
1863 break;
1836 1864
1837 default: 1865 default:
1838 break; 1866 break;
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index b576b7667b6d..0586b3b3ab54 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -798,6 +798,23 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow)
798 return ret; 798 return ret;
799 } 799 }
800 800
801 if ((flags & MMC_PM_WAKE_SDIO_IRQ) && wow) {
802 /*
803 * The host sdio controller is capable of keep power and
804 * sdio irq wake up at this point. It's fine to continue
805 * wow suspend operation.
806 */
807 ret = ath6kl_cfg80211_suspend(ar, ATH6KL_CFG_SUSPEND_WOW, wow);
808 if (ret)
809 return ret;
810
811 ret = sdio_set_host_pm_flags(func, MMC_PM_WAKE_SDIO_IRQ);
812 if (ret)
813 ath6kl_err("set sdio wake irq flag failed: %d\n", ret);
814
815 return ret;
816 }
817
801 return ath6kl_cfg80211_suspend(ar, ATH6KL_CFG_SUSPEND_DEEPSLEEP, NULL); 818 return ath6kl_cfg80211_suspend(ar, ATH6KL_CFG_SUSPEND_DEEPSLEEP, NULL);
802} 819}
803 820
@@ -820,6 +837,9 @@ static int ath6kl_sdio_resume(struct ath6kl *ar)
820 837
821 case ATH6KL_STATE_DEEPSLEEP: 838 case ATH6KL_STATE_DEEPSLEEP:
822 break; 839 break;
840
841 case ATH6KL_STATE_WOW:
842 break;
823 } 843 }
824 844
825 ath6kl_cfg80211_resume(ar); 845 ath6kl_cfg80211_resume(ar);