All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 1/2] ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower
@ 2012-04-14 15:32 ` Gabor Juhos
  0 siblings, 0 replies; 12+ messages in thread
From: Gabor Juhos @ 2012-04-14 15:32 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless, ath9k-devel@lists.ath9k.org, Gabor Juhos, Felix Fietkau

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>
Cc: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ar5008_phy.c   |    2 +-
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c |    2 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c   |    2 +-
 drivers/net/wireless/ath/ath9k/hw.c           |    9 +++++----
 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 de30cb3..8753e38 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -868,7 +868,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
 	ar5008_hw_set_channel_regs(ah, chan);
 	ar5008_hw_init_chain_masks(ah);
 	ath9k_olc_init(ah);
-	ath9k_hw_apply_txpower(ah, chan);
+	ath9k_hw_apply_txpower(ah, chan, false);
 
 	/* Write analog registers */
 	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 59647a3..3d400e8 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)
 
 	if (val) {
 		ah->paprd_table_write_done = true;
-		ath9k_hw_apply_txpower(ah, chan);
+		ath9k_hw_apply_txpower(ah, chan, false);
 	}
 
 	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 4c9bc9f..5d2b584 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -690,7 +690,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
 	ar9003_hw_override_ini(ah);
 	ar9003_hw_set_channel_regs(ah, chan);
 	ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
-	ath9k_hw_apply_txpower(ah, chan);
+	ath9k_hw_apply_txpower(ah, chan, false);
 
 	if (AR_SREV_9462(ah)) {
 		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 6fa8128..480e8f8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1453,7 +1453,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
 		return false;
 	}
 	ath9k_hw_set_clockrate(ah);
-	ath9k_hw_apply_txpower(ah, chan);
+	ath9k_hw_apply_txpower(ah, chan, false);
 	ath9k_hw_rfbus_done(ah);
 
 	if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
@@ -2724,7 +2724,8 @@ static int get_antenna_gain(struct ath_hw *ah, struct ath9k_channel *chan)
 	return ah->eep_ops->get_eeprom(ah, gain_param);
 }
 
-void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan)
+void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
+			    bool test)
 {
 	struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
 	struct ieee80211_channel *channel;
@@ -2745,7 +2746,7 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan)
 
 	ah->eep_ops->set_txpower(ah, chan,
 				 ath9k_regd_get_ctl(reg, chan),
-				 ant_reduction, new_pwr, false);
+				 ant_reduction, new_pwr, test);
 }
 
 void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
@@ -2758,7 +2759,7 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
 	if (test)
 		channel->max_power = MAX_RATE_POWER / 2;
 
-	ath9k_hw_apply_txpower(ah, chan);
+	ath9k_hw_apply_txpower(ah, chan, test);
 
 	if (test)
 		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 1d4b983..99b57bd 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -976,7 +976,8 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len);
 /* PHY */
 void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
 				   u32 *coef_mantissa, u32 *coef_exponent);
-void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan);
+void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
+			    bool test);
 
 /*
  * Code Specific to AR5008, AR9001 or AR9002,
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [ath9k-devel] [RFC 1/2] ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower
@ 2012-04-14 15:32 ` Gabor Juhos
  0 siblings, 0 replies; 12+ messages in thread
From: Gabor Juhos @ 2012-04-14 15:32 UTC (permalink / raw)
  To: ath9k-devel

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>
Cc: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ar5008_phy.c   |    2 +-
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c |    2 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c   |    2 +-
 drivers/net/wireless/ath/ath9k/hw.c           |    9 +++++----
 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 de30cb3..8753e38 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -868,7 +868,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
 	ar5008_hw_set_channel_regs(ah, chan);
 	ar5008_hw_init_chain_masks(ah);
 	ath9k_olc_init(ah);
-	ath9k_hw_apply_txpower(ah, chan);
+	ath9k_hw_apply_txpower(ah, chan, false);
 
 	/* Write analog registers */
 	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 59647a3..3d400e8 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)
 
 	if (val) {
 		ah->paprd_table_write_done = true;
-		ath9k_hw_apply_txpower(ah, chan);
+		ath9k_hw_apply_txpower(ah, chan, false);
 	}
 
 	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 4c9bc9f..5d2b584 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -690,7 +690,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
 	ar9003_hw_override_ini(ah);
 	ar9003_hw_set_channel_regs(ah, chan);
 	ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
-	ath9k_hw_apply_txpower(ah, chan);
+	ath9k_hw_apply_txpower(ah, chan, false);
 
 	if (AR_SREV_9462(ah)) {
 		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 6fa8128..480e8f8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1453,7 +1453,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
 		return false;
 	}
 	ath9k_hw_set_clockrate(ah);
-	ath9k_hw_apply_txpower(ah, chan);
+	ath9k_hw_apply_txpower(ah, chan, false);
 	ath9k_hw_rfbus_done(ah);
 
 	if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
@@ -2724,7 +2724,8 @@ static int get_antenna_gain(struct ath_hw *ah, struct ath9k_channel *chan)
 	return ah->eep_ops->get_eeprom(ah, gain_param);
 }
 
-void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan)
+void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
+			    bool test)
 {
 	struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
 	struct ieee80211_channel *channel;
@@ -2745,7 +2746,7 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan)
 
 	ah->eep_ops->set_txpower(ah, chan,
 				 ath9k_regd_get_ctl(reg, chan),
-				 ant_reduction, new_pwr, false);
+				 ant_reduction, new_pwr, test);
 }
 
 void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
@@ -2758,7 +2759,7 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
 	if (test)
 		channel->max_power = MAX_RATE_POWER / 2;
 
-	ath9k_hw_apply_txpower(ah, chan);
+	ath9k_hw_apply_txpower(ah, chan, test);
 
 	if (test)
 		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 1d4b983..99b57bd 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -976,7 +976,8 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len);
 /* PHY */
 void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
 				   u32 *coef_mantissa, u32 *coef_exponent);
-void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan);
+void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
+			    bool test);
 
 /*
  * Code Specific to AR5008, AR9001 or AR9002,
-- 
1.7.2.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [RFC 2/2] ath9k: fix tx power settings for AR9287
  2012-04-14 15:32 ` [ath9k-devel] " Gabor Juhos
@ 2012-04-14 15:32   ` Gabor Juhos
  -1 siblings, 0 replies; 12+ messages in thread
From: Gabor Juhos @ 2012-04-14 15:32 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless, ath9k-devel@lists.ath9k.org, Gabor Juhos,
	Sujith Manoharan

The 'ath9k_hw_update_regulatory_maxpower'
helper function has been introduced by
commit a55f858852e4345d0a31af593c46738ca8614bff
(ath9k_hw: Cleanup TX power calculation for AR9287).

Updating of the max_power_level value has been moved
into the helper function in that change, however the
removed code from 'ath9k_hw_ar9287_set_txpower' has
not been replaced with a call of the new helper
function.

Due to that missing call, retrieving tx power for 2x2
and 3x3 chainmask is not handled properly. During the
calculation of the tx power for 2x2 and 3x3 chainmasks
the values are reduced. Those reductions must be
compensated during retrieving.

Fix this by adding the missing call of the helper
function.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/eeprom_9287.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index f272236..b34e8b2 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
 			regulatory->max_power_level = ratesArray[i];
 	}
 
+	ath9k_hw_update_regulatory_maxpower(ah);
+
 	if (test)
 		return;
 
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [ath9k-devel] [RFC 2/2] ath9k: fix tx power settings for AR9287
@ 2012-04-14 15:32   ` Gabor Juhos
  0 siblings, 0 replies; 12+ messages in thread
From: Gabor Juhos @ 2012-04-14 15:32 UTC (permalink / raw)
  To: ath9k-devel

The 'ath9k_hw_update_regulatory_maxpower'
helper function has been introduced by
commit a55f858852e4345d0a31af593c46738ca8614bff
(ath9k_hw: Cleanup TX power calculation for AR9287).

Updating of the max_power_level value has been moved
into the helper function in that change, however the
removed code from 'ath9k_hw_ar9287_set_txpower' has
not been replaced with a call of the new helper
function.

Due to that missing call, retrieving tx power for 2x2
and 3x3 chainmask is not handled properly. During the
calculation of the tx power for 2x2 and 3x3 chainmasks
the values are reduced. Those reductions must be
compensated during retrieving.

Fix this by adding the missing call of the helper
function.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/eeprom_9287.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index f272236..b34e8b2 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
 			regulatory->max_power_level = ratesArray[i];
 	}
 
+	ath9k_hw_update_regulatory_maxpower(ah);
+
 	if (test)
 		return;
 
-- 
1.7.2.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [RFC 2/2] ath9k: fix tx power settings for AR9287
  2012-04-14 15:32   ` [ath9k-devel] " Gabor Juhos
@ 2012-04-15  1:59     ` Sujith Manoharan
  -1 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2012-04-15  1:59 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: John W. Linville, linux-wireless, ath9k-devel@lists.ath9k.org

Gabor Juhos wrote:
> The 'ath9k_hw_update_regulatory_maxpower'
> helper function has been introduced by
> commit a55f858852e4345d0a31af593c46738ca8614bff
> (ath9k_hw: Cleanup TX power calculation for AR9287).
> 
> Updating of the max_power_level value has been moved
> into the helper function in that change, however the
> removed code from 'ath9k_hw_ar9287_set_txpower' has
> not been replaced with a call of the new helper
> function.
> 
> Due to that missing call, retrieving tx power for 2x2
> and 3x3 chainmask is not handled properly. During the
> calculation of the tx power for 2x2 and 3x3 chainmasks
> the values are reduced. Those reductions must be
> compensated during retrieving.
> 
> Fix this by adding the missing call of the helper
> function.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath9k/eeprom_9287.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
> index f272236..b34e8b2 100644
> --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
> +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
> @@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
>  			regulatory->max_power_level = ratesArray[i];
>  	}
>  
> +	ath9k_hw_update_regulatory_maxpower(ah);
> +

Looks like I got confused between 4K-based cards and AR9287.
Thanks for catching this.

Acked-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Sujith

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [ath9k-devel] [RFC 2/2] ath9k: fix tx power settings for AR9287
@ 2012-04-15  1:59     ` Sujith Manoharan
  0 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2012-04-15  1:59 UTC (permalink / raw)
  To: ath9k-devel

Gabor Juhos wrote:
> The 'ath9k_hw_update_regulatory_maxpower'
> helper function has been introduced by
> commit a55f858852e4345d0a31af593c46738ca8614bff
> (ath9k_hw: Cleanup TX power calculation for AR9287).
> 
> Updating of the max_power_level value has been moved
> into the helper function in that change, however the
> removed code from 'ath9k_hw_ar9287_set_txpower' has
> not been replaced with a call of the new helper
> function.
> 
> Due to that missing call, retrieving tx power for 2x2
> and 3x3 chainmask is not handled properly. During the
> calculation of the tx power for 2x2 and 3x3 chainmasks
> the values are reduced. Those reductions must be
> compensated during retrieving.
> 
> Fix this by adding the missing call of the helper
> function.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath9k/eeprom_9287.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
> index f272236..b34e8b2 100644
> --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
> +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
> @@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
>  			regulatory->max_power_level = ratesArray[i];
>  	}
>  
> +	ath9k_hw_update_regulatory_maxpower(ah);
> +

Looks like I got confused between 4K-based cards and AR9287.
Thanks for catching this.

Acked-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Sujith

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC 1/2] ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower
  2012-04-14 15:32 ` [ath9k-devel] " Gabor Juhos
@ 2012-04-15 10:24   ` Felix Fietkau
  -1 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2012-04-15 10:24 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: John W. Linville, linux-wireless, ath9k-devel@lists.ath9k.org

On 2012-04-14 5:32 PM, Gabor Juhos wrote:
> 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>
> Cc: Felix Fietkau <nbd@openwrt.org>
Acked-by: Felix Fietkau <nbd@openwrt.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [ath9k-devel] [RFC 1/2] ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower
@ 2012-04-15 10:24   ` Felix Fietkau
  0 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2012-04-15 10:24 UTC (permalink / raw)
  To: ath9k-devel

On 2012-04-14 5:32 PM, Gabor Juhos wrote:
> 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>
> Cc: Felix Fietkau <nbd@openwrt.org>
Acked-by: Felix Fietkau <nbd@openwrt.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC 1/2] ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower
  2012-04-15 10:24   ` [ath9k-devel] " Felix Fietkau
@ 2012-04-15 17:23     ` Gabor Juhos
  -1 siblings, 0 replies; 12+ messages in thread
From: Gabor Juhos @ 2012-04-15 17:23 UTC (permalink / raw)
  To: Felix Fietkau
  Cc: John W. Linville, linux-wireless, ath9k-devel@lists.ath9k.org

2012.04.15. 12:24 keltezéssel, Felix Fietkau írta:
> On 2012-04-14 5:32 PM, Gabor Juhos wrote:
>> 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>
>> Cc: Felix Fietkau <nbd@openwrt.org>
> Acked-by: Felix Fietkau <nbd@openwrt.org>
> 

Thanks, I will resend this as a regular patch.

-Gabor

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [ath9k-devel] [RFC 1/2] ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower
@ 2012-04-15 17:23     ` Gabor Juhos
  0 siblings, 0 replies; 12+ messages in thread
From: Gabor Juhos @ 2012-04-15 17:23 UTC (permalink / raw)
  To: ath9k-devel

2012.04.15. 12:24 keltez?ssel, Felix Fietkau ?rta:
> On 2012-04-14 5:32 PM, Gabor Juhos wrote:
>> 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>
>> Cc: Felix Fietkau <nbd@openwrt.org>
> Acked-by: Felix Fietkau <nbd@openwrt.org>
> 

Thanks, I will resend this as a regular patch.

-Gabor

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC 2/2] ath9k: fix tx power settings for AR9287
  2012-04-15  1:59     ` [ath9k-devel] " Sujith Manoharan
@ 2012-04-15 17:23       ` Gabor Juhos
  -1 siblings, 0 replies; 12+ messages in thread
From: Gabor Juhos @ 2012-04-15 17:23 UTC (permalink / raw)
  To: Sujith Manoharan
  Cc: John W. Linville, linux-wireless, ath9k-devel@lists.ath9k.org

2012.04.15. 3:59 keltezéssel, Sujith Manoharan írta:
> Gabor Juhos wrote:
>> The 'ath9k_hw_update_regulatory_maxpower'
>> helper function has been introduced by
>> commit a55f858852e4345d0a31af593c46738ca8614bff
>> (ath9k_hw: Cleanup TX power calculation for AR9287).
>>
>> Updating of the max_power_level value has been moved
>> into the helper function in that change, however the
>> removed code from 'ath9k_hw_ar9287_set_txpower' has
>> not been replaced with a call of the new helper
>> function.
>>
>> Due to that missing call, retrieving tx power for 2x2
>> and 3x3 chainmask is not handled properly. During the
>> calculation of the tx power for 2x2 and 3x3 chainmasks
>> the values are reduced. Those reductions must be
>> compensated during retrieving.
>>
>> Fix this by adding the missing call of the helper
>> function.
>>
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>> Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
>> ---
>>  drivers/net/wireless/ath/ath9k/eeprom_9287.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
>> index f272236..b34e8b2 100644
>> --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
>> +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
>> @@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
>>  			regulatory->max_power_level = ratesArray[i];
>>  	}
>>  
>> +	ath9k_hw_update_regulatory_maxpower(ah);
>> +
> 
> Looks like I got confused between 4K-based cards and AR9287.
> Thanks for catching this.
> 
> Acked-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>


Thanks, I will resend this as a regular patch.

-Gabor

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [ath9k-devel] [RFC 2/2] ath9k: fix tx power settings for AR9287
@ 2012-04-15 17:23       ` Gabor Juhos
  0 siblings, 0 replies; 12+ messages in thread
From: Gabor Juhos @ 2012-04-15 17:23 UTC (permalink / raw)
  To: ath9k-devel

2012.04.15. 3:59 keltez?ssel, Sujith Manoharan ?rta:
> Gabor Juhos wrote:
>> The 'ath9k_hw_update_regulatory_maxpower'
>> helper function has been introduced by
>> commit a55f858852e4345d0a31af593c46738ca8614bff
>> (ath9k_hw: Cleanup TX power calculation for AR9287).
>>
>> Updating of the max_power_level value has been moved
>> into the helper function in that change, however the
>> removed code from 'ath9k_hw_ar9287_set_txpower' has
>> not been replaced with a call of the new helper
>> function.
>>
>> Due to that missing call, retrieving tx power for 2x2
>> and 3x3 chainmask is not handled properly. During the
>> calculation of the tx power for 2x2 and 3x3 chainmasks
>> the values are reduced. Those reductions must be
>> compensated during retrieving.
>>
>> Fix this by adding the missing call of the helper
>> function.
>>
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>> Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
>> ---
>>  drivers/net/wireless/ath/ath9k/eeprom_9287.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
>> index f272236..b34e8b2 100644
>> --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
>> +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
>> @@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
>>  			regulatory->max_power_level = ratesArray[i];
>>  	}
>>  
>> +	ath9k_hw_update_regulatory_maxpower(ah);
>> +
> 
> Looks like I got confused between 4K-based cards and AR9287.
> Thanks for catching this.
> 
> Acked-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>


Thanks, I will resend this as a regular patch.

-Gabor

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-04-15 17:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-14 15:32 [RFC 1/2] ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower Gabor Juhos
2012-04-14 15:32 ` [ath9k-devel] " Gabor Juhos
2012-04-14 15:32 ` [RFC 2/2] ath9k: fix tx power settings for AR9287 Gabor Juhos
2012-04-14 15:32   ` [ath9k-devel] " Gabor Juhos
2012-04-15  1:59   ` Sujith Manoharan
2012-04-15  1:59     ` [ath9k-devel] " Sujith Manoharan
2012-04-15 17:23     ` Gabor Juhos
2012-04-15 17:23       ` [ath9k-devel] " Gabor Juhos
2012-04-15 10:24 ` [RFC 1/2] ath9k: add an extra boolean parameter to ath9k_hw_apply_txpower Felix Fietkau
2012-04-15 10:24   ` [ath9k-devel] " Felix Fietkau
2012-04-15 17:23   ` Gabor Juhos
2012-04-15 17:23     ` [ath9k-devel] " Gabor Juhos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.