aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
authorSujith Manoharan <Sujith.Manoharan@atheros.com>2011-04-20 01:31:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-25 14:50:14 -0400
commitc58ca5b5083befda31009a64abd95ae6ac315265 (patch)
tree151ec0d5fb1e936d32e684627739c6fbe9d4c8bd /drivers/net/wireless/ath/ath9k
parentf0dd49803b0c0f3a002f073ec1a82cac5795af2d (diff)
ath9k_htc: Use power save wrappers when accessing HW
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_debug.c24
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c2
2 files changed, 23 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index eca777497fe5..894e5ef3f8d1 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
@@ -33,9 +33,15 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
33 33
34 memset(&cmd_rsp, 0, sizeof(cmd_rsp)); 34 memset(&cmd_rsp, 0, sizeof(cmd_rsp));
35 35
36 ath9k_htc_ps_wakeup(priv);
37
36 WMI_CMD(WMI_INT_STATS_CMDID); 38 WMI_CMD(WMI_INT_STATS_CMDID);
37 if (ret) 39 if (ret) {
40 ath9k_htc_ps_restore(priv);
38 return -EINVAL; 41 return -EINVAL;
42 }
43
44 ath9k_htc_ps_restore(priv);
39 45
40 len += snprintf(buf + len, sizeof(buf) - len, 46 len += snprintf(buf + len, sizeof(buf) - len,
41 "%20s : %10u\n", "RX", 47 "%20s : %10u\n", "RX",
@@ -85,9 +91,15 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf,
85 91
86 memset(&cmd_rsp, 0, sizeof(cmd_rsp)); 92 memset(&cmd_rsp, 0, sizeof(cmd_rsp));
87 93
94 ath9k_htc_ps_wakeup(priv);
95
88 WMI_CMD(WMI_TX_STATS_CMDID); 96 WMI_CMD(WMI_TX_STATS_CMDID);
89 if (ret) 97 if (ret) {
98 ath9k_htc_ps_restore(priv);
90 return -EINVAL; 99 return -EINVAL;
100 }
101
102 ath9k_htc_ps_restore(priv);
91 103
92 len += snprintf(buf + len, sizeof(buf) - len, 104 len += snprintf(buf + len, sizeof(buf) - len,
93 "%20s : %10u\n", "Xretries", 105 "%20s : %10u\n", "Xretries",
@@ -149,9 +161,15 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf,
149 161
150 memset(&cmd_rsp, 0, sizeof(cmd_rsp)); 162 memset(&cmd_rsp, 0, sizeof(cmd_rsp));
151 163
164 ath9k_htc_ps_wakeup(priv);
165
152 WMI_CMD(WMI_RX_STATS_CMDID); 166 WMI_CMD(WMI_RX_STATS_CMDID);
153 if (ret) 167 if (ret) {
168 ath9k_htc_ps_restore(priv);
154 return -EINVAL; 169 return -EINVAL;
170 }
171
172 ath9k_htc_ps_restore(priv);
155 173
156 len += snprintf(buf + len, sizeof(buf) - len, 174 len += snprintf(buf + len, sizeof(buf) - len,
157 "%20s : %10u\n", "NoBuf", 175 "%20s : %10u\n", "NoBuf",
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index fbc238a0b203..c8577d5cd0f7 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1582,6 +1582,7 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
1582 int ret = 0; 1582 int ret = 0;
1583 1583
1584 mutex_lock(&priv->mutex); 1584 mutex_lock(&priv->mutex);
1585 ath9k_htc_ps_wakeup(priv);
1585 1586
1586 switch (action) { 1587 switch (action) {
1587 case IEEE80211_AMPDU_RX_START: 1588 case IEEE80211_AMPDU_RX_START:
@@ -1607,6 +1608,7 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
1607 ath_err(ath9k_hw_common(priv->ah), "Unknown AMPDU action\n"); 1608 ath_err(ath9k_hw_common(priv->ah), "Unknown AMPDU action\n");
1608 } 1609 }
1609 1610
1611 ath9k_htc_ps_restore(priv);
1610 mutex_unlock(&priv->mutex); 1612 mutex_unlock(&priv->mutex);
1611 1613
1612 return ret; 1614 return ret;