aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanoharan@atheros.com>2011-01-31 13:17:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-03 16:44:43 -0500
commitb2a5c3dfecf3d0e1db08ac7cd94ee4c1cf9bc998 (patch)
treee4c078aaba6c40ab795fd97c318ba8bf744e0e3e /drivers
parent5048e8c378d095a548fe8a6ecd2f07d277ac5be2 (diff)
ath9k_htc: make use common of function to update txpower
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_gpio.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c23
3 files changed, 10 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 63549868e686..0cb504d7b8c4 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -460,7 +460,6 @@ void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv);
460void ath9k_ps_work(struct work_struct *work); 460void ath9k_ps_work(struct work_struct *work);
461bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, 461bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
462 enum ath9k_power_mode mode); 462 enum ath9k_power_mode mode);
463void ath_update_txpow(struct ath9k_htc_priv *priv);
464 463
465void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); 464void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
466void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw); 465void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
index fe70f67aa088..7e630a81b453 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
@@ -389,7 +389,8 @@ void ath9k_htc_radio_enable(struct ieee80211_hw *hw)
389 ret, ah->curchan->channel); 389 ret, ah->curchan->channel);
390 } 390 }
391 391
392 ath_update_txpow(priv); 392 ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
393 &priv->curtxpow);
393 394
394 /* Start RX */ 395 /* Start RX */
395 WMI_CMD(WMI_START_RECV_CMDID); 396 WMI_CMD(WMI_START_RECV_CMDID);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 0526c259a634..953036a4ed53 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -24,17 +24,6 @@ static struct dentry *ath9k_debugfs_root;
24/* Utilities */ 24/* Utilities */
25/*************/ 25/*************/
26 26
27void ath_update_txpow(struct ath9k_htc_priv *priv)
28{
29 struct ath_hw *ah = priv->ah;
30
31 if (priv->curtxpow != priv->txpowlimit) {
32 ath9k_hw_set_txpowerlimit(ah, priv->txpowlimit, false);
33 /* read back in case value is clamped */
34 priv->curtxpow = ath9k_hw_regulatory(ah)->power_limit;
35 }
36}
37
38/* HACK Alert: Use 11NG for 2.4, use 11NA for 5 */ 27/* HACK Alert: Use 11NG for 2.4, use 11NA for 5 */
39static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv, 28static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv,
40 struct ath9k_channel *ichan) 29 struct ath9k_channel *ichan)
@@ -147,7 +136,8 @@ void ath9k_htc_reset(struct ath9k_htc_priv *priv)
147 channel->center_freq, ret); 136 channel->center_freq, ret);
148 } 137 }
149 138
150 ath_update_txpow(priv); 139 ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
140 &priv->curtxpow);
151 141
152 WMI_CMD(WMI_START_RECV_CMDID); 142 WMI_CMD(WMI_START_RECV_CMDID);
153 ath9k_host_rx_init(priv); 143 ath9k_host_rx_init(priv);
@@ -212,7 +202,8 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
212 goto err; 202 goto err;
213 } 203 }
214 204
215 ath_update_txpow(priv); 205 ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
206 &priv->curtxpow);
216 207
217 WMI_CMD(WMI_START_RECV_CMDID); 208 WMI_CMD(WMI_START_RECV_CMDID);
218 if (ret) 209 if (ret)
@@ -988,7 +979,8 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
988 return ret; 979 return ret;
989 } 980 }
990 981
991 ath_update_txpow(priv); 982 ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
983 &priv->curtxpow);
992 984
993 mode = ath9k_htc_get_curmode(priv, init_channel); 985 mode = ath9k_htc_get_curmode(priv, init_channel);
994 htc_mode = cpu_to_be16(mode); 986 htc_mode = cpu_to_be16(mode);
@@ -1254,7 +1246,8 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1254 1246
1255 if (changed & IEEE80211_CONF_CHANGE_POWER) { 1247 if (changed & IEEE80211_CONF_CHANGE_POWER) {
1256 priv->txpowlimit = 2 * conf->power_level; 1248 priv->txpowlimit = 2 * conf->power_level;
1257 ath_update_txpow(priv); 1249 ath9k_cmn_update_txpow(priv->ah, priv->curtxpow,
1250 priv->txpowlimit, &priv->curtxpow);
1258 } 1251 }
1259 1252
1260 if (changed & IEEE80211_CONF_CHANGE_IDLE) { 1253 if (changed & IEEE80211_CONF_CHANGE_IDLE) {