diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-04-15 14:38:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-23 14:56:11 -0400 |
commit | 64ea57d0c77bd85003b63c6090ddfae114ef6508 (patch) | |
tree | 2a9560c250ef52d0908251321cd8393e68a6461b /drivers/net | |
parent | fd09c85fe15aa66a69f091ba178817d5ef82476d (diff) |
ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower
In order to unifying regulatory limit handling
commit ca2c68cc7bc80fc4504fb420df04cce99c9ee6ec
(ath9k_hw: clean up tx power handling) introduced
a new helper function 'ath9k_hw_apply_txpower',
and the direct calls of 'ah->eep_ops->set_txpower'
has been replaced by a call of the helper function.
This caused a change in the behaviour of the
'ath9k_hw_set_txpowerlimit' function. The purpose
of that function is to calculate and store the
rate txpower table and the regulatory limit without
touching the hardware registers. Before the commit,
the 'test' parameter of the function was passed to
the 'ah->eep_ops->set_txpower'. Now the calling of
the 'set_txpower' function happens indirectly through
'ath9k_hw_apply_txpower', so the 'test' argument of
the 'set_txpower' is always 'false'.
This patch restores the original behaviour of
'ath9k_hw_set_txpowerlimit' by adding a new
argument to 'ath9k_hw_apply_txpower.'
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar5008_phy.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_paprd.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 3 |
5 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c index d7d8e9199140..aba088005b22 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c | |||
@@ -869,7 +869,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah, | |||
869 | ar5008_hw_set_channel_regs(ah, chan); | 869 | ar5008_hw_set_channel_regs(ah, chan); |
870 | ar5008_hw_init_chain_masks(ah); | 870 | ar5008_hw_init_chain_masks(ah); |
871 | ath9k_olc_init(ah); | 871 | ath9k_olc_init(ah); |
872 | ath9k_hw_apply_txpower(ah, chan); | 872 | ath9k_hw_apply_txpower(ah, chan, false); |
873 | 873 | ||
874 | /* Write analog registers */ | 874 | /* Write analog registers */ |
875 | if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) { | 875 | if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) { |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c index 59647a3ceb7f..3d400e8d6535 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c | |||
@@ -54,7 +54,7 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val) | |||
54 | 54 | ||
55 | if (val) { | 55 | if (val) { |
56 | ah->paprd_table_write_done = true; | 56 | ah->paprd_table_write_done = true; |
57 | ath9k_hw_apply_txpower(ah, chan); | 57 | ath9k_hw_apply_txpower(ah, chan, false); |
58 | } | 58 | } |
59 | 59 | ||
60 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0, | 60 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index bc992b237ae5..deb6cfb2959a 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -694,7 +694,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah, | |||
694 | ar9003_hw_override_ini(ah); | 694 | ar9003_hw_override_ini(ah); |
695 | ar9003_hw_set_channel_regs(ah, chan); | 695 | ar9003_hw_set_channel_regs(ah, chan); |
696 | ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); | 696 | ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); |
697 | ath9k_hw_apply_txpower(ah, chan); | 697 | ath9k_hw_apply_txpower(ah, chan, false); |
698 | 698 | ||
699 | if (AR_SREV_9462(ah)) { | 699 | if (AR_SREV_9462(ah)) { |
700 | if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0, | 700 | if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0, |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 6c69e4e8b1cb..fa84e37bf091 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1454,7 +1454,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, | |||
1454 | return false; | 1454 | return false; |
1455 | } | 1455 | } |
1456 | ath9k_hw_set_clockrate(ah); | 1456 | ath9k_hw_set_clockrate(ah); |
1457 | ath9k_hw_apply_txpower(ah, chan); | 1457 | ath9k_hw_apply_txpower(ah, chan, false); |
1458 | ath9k_hw_rfbus_done(ah); | 1458 | ath9k_hw_rfbus_done(ah); |
1459 | 1459 | ||
1460 | if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) | 1460 | if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) |
@@ -2652,7 +2652,8 @@ static int get_antenna_gain(struct ath_hw *ah, struct ath9k_channel *chan) | |||
2652 | return ah->eep_ops->get_eeprom(ah, gain_param); | 2652 | return ah->eep_ops->get_eeprom(ah, gain_param); |
2653 | } | 2653 | } |
2654 | 2654 | ||
2655 | void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan) | 2655 | void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan, |
2656 | bool test) | ||
2656 | { | 2657 | { |
2657 | struct ath_regulatory *reg = ath9k_hw_regulatory(ah); | 2658 | struct ath_regulatory *reg = ath9k_hw_regulatory(ah); |
2658 | struct ieee80211_channel *channel; | 2659 | struct ieee80211_channel *channel; |
@@ -2673,7 +2674,7 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan) | |||
2673 | 2674 | ||
2674 | ah->eep_ops->set_txpower(ah, chan, | 2675 | ah->eep_ops->set_txpower(ah, chan, |
2675 | ath9k_regd_get_ctl(reg, chan), | 2676 | ath9k_regd_get_ctl(reg, chan), |
2676 | ant_reduction, new_pwr, false); | 2677 | ant_reduction, new_pwr, test); |
2677 | } | 2678 | } |
2678 | 2679 | ||
2679 | void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) | 2680 | void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) |
@@ -2686,7 +2687,7 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) | |||
2686 | if (test) | 2687 | if (test) |
2687 | channel->max_power = MAX_RATE_POWER / 2; | 2688 | channel->max_power = MAX_RATE_POWER / 2; |
2688 | 2689 | ||
2689 | ath9k_hw_apply_txpower(ah, chan); | 2690 | ath9k_hw_apply_txpower(ah, chan, test); |
2690 | 2691 | ||
2691 | if (test) | 2692 | if (test) |
2692 | channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2); | 2693 | channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index aa1680a0c7fd..e88f182ff45c 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -985,7 +985,8 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len); | |||
985 | /* PHY */ | 985 | /* PHY */ |
986 | void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, | 986 | void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, |
987 | u32 *coef_mantissa, u32 *coef_exponent); | 987 | u32 *coef_mantissa, u32 *coef_exponent); |
988 | void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan); | 988 | void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan, |
989 | bool test); | ||
989 | 990 | ||
990 | /* | 991 | /* |
991 | * Code Specific to AR5008, AR9001 or AR9002, | 992 | * Code Specific to AR5008, AR9001 or AR9002, |