Commit b2a5c3df authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by John W. Linville

ath9k_htc: make use common of function to update txpower

Signed-off-by: default avatarRajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5048e8c3
...@@ -460,7 +460,6 @@ void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv); ...@@ -460,7 +460,6 @@ void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv);
void ath9k_ps_work(struct work_struct *work); void ath9k_ps_work(struct work_struct *work);
bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
enum ath9k_power_mode mode); enum ath9k_power_mode mode);
void ath_update_txpow(struct ath9k_htc_priv *priv);
void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw); void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
......
...@@ -389,7 +389,8 @@ void ath9k_htc_radio_enable(struct ieee80211_hw *hw) ...@@ -389,7 +389,8 @@ void ath9k_htc_radio_enable(struct ieee80211_hw *hw)
ret, ah->curchan->channel); ret, ah->curchan->channel);
} }
ath_update_txpow(priv); ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
&priv->curtxpow);
/* Start RX */ /* Start RX */
WMI_CMD(WMI_START_RECV_CMDID); WMI_CMD(WMI_START_RECV_CMDID);
......
...@@ -24,17 +24,6 @@ static struct dentry *ath9k_debugfs_root; ...@@ -24,17 +24,6 @@ static struct dentry *ath9k_debugfs_root;
/* Utilities */ /* Utilities */
/*************/ /*************/
void ath_update_txpow(struct ath9k_htc_priv *priv)
{
struct ath_hw *ah = priv->ah;
if (priv->curtxpow != priv->txpowlimit) {
ath9k_hw_set_txpowerlimit(ah, priv->txpowlimit, false);
/* read back in case value is clamped */
priv->curtxpow = ath9k_hw_regulatory(ah)->power_limit;
}
}
/* HACK Alert: Use 11NG for 2.4, use 11NA for 5 */ /* HACK Alert: Use 11NG for 2.4, use 11NA for 5 */
static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv, static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv,
struct ath9k_channel *ichan) struct ath9k_channel *ichan)
...@@ -147,7 +136,8 @@ void ath9k_htc_reset(struct ath9k_htc_priv *priv) ...@@ -147,7 +136,8 @@ void ath9k_htc_reset(struct ath9k_htc_priv *priv)
channel->center_freq, ret); channel->center_freq, ret);
} }
ath_update_txpow(priv); ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
&priv->curtxpow);
WMI_CMD(WMI_START_RECV_CMDID); WMI_CMD(WMI_START_RECV_CMDID);
ath9k_host_rx_init(priv); ath9k_host_rx_init(priv);
...@@ -212,7 +202,8 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv, ...@@ -212,7 +202,8 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
goto err; goto err;
} }
ath_update_txpow(priv); ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
&priv->curtxpow);
WMI_CMD(WMI_START_RECV_CMDID); WMI_CMD(WMI_START_RECV_CMDID);
if (ret) if (ret)
...@@ -988,7 +979,8 @@ static int ath9k_htc_start(struct ieee80211_hw *hw) ...@@ -988,7 +979,8 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
return ret; return ret;
} }
ath_update_txpow(priv); ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
&priv->curtxpow);
mode = ath9k_htc_get_curmode(priv, init_channel); mode = ath9k_htc_get_curmode(priv, init_channel);
htc_mode = cpu_to_be16(mode); htc_mode = cpu_to_be16(mode);
...@@ -1254,7 +1246,8 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed) ...@@ -1254,7 +1246,8 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
if (changed & IEEE80211_CONF_CHANGE_POWER) { if (changed & IEEE80211_CONF_CHANGE_POWER) {
priv->txpowlimit = 2 * conf->power_level; priv->txpowlimit = 2 * conf->power_level;
ath_update_txpow(priv); ath9k_cmn_update_txpow(priv->ah, priv->curtxpow,
priv->txpowlimit, &priv->curtxpow);
} }
if (changed & IEEE80211_CONF_CHANGE_IDLE) { if (changed & IEEE80211_CONF_CHANGE_IDLE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment