All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] ath5k: Always write tx powertable on hw
@ 2010-12-03  4:03 Nick Kossifidis
  2010-12-03  6:34 ` Sedat Dilek
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Nick Kossifidis @ 2010-12-03  4:03 UTC (permalink / raw)
  To: ath5k-devel, linux-wireless
  Cc: linville, me, mcgrof, jirislaby, nbd, br1, sedat.dilek

 * By skipping tx power table calibration we also skip setting
 tx power table on hw. Make sure we always write tx power table
 on hw since it gets cleared on reset.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

---
 drivers/net/wireless/ath/ath5k/phy.c |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index df5cd0f..f84afb4 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -2742,10 +2742,12 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah,
 
 /* Write PDADC values on hw */
 static void
-ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah,
-			u8 pdcurves, u8 *pdg_to_idx)
+ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah, u8 ee_mode)
 {
+	struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
 	u8 *pdadc_out = ah->ah_txpower.txp_pd_table;
+	u8 *pdg_to_idx = ee->ee_pdc_to_idx[ee_mode];
+	u8 pdcurves = ee->ee_pd_gains[ee_mode];
 	u32 reg;
 	u8 i;
 
@@ -2992,7 +2994,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
 						ee->ee_pd_gains[ee_mode]);
 
 		/* Write settings on hw */
-		ath5k_setup_pwr_to_pdadc_table(ah, pdg, pdg_curve_to_idx);
+		ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
 
 		/* Set txp.offset, note that table_min
 		 * can be negative */
@@ -3114,12 +3116,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
 		return -EINVAL;
 	}
 
-	/* Reset TX power values */
-	memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
-	ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
-	ah->ah_txpower.txp_min_pwr = 0;
-	ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
-
 	/* Initialize TX power table */
 	switch (ah->ah_radio) {
 	case AR5K_RF5110:
@@ -3146,11 +3142,24 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
 	 * so there is no need to recalculate the powertable, we 'll
 	 * just use the cached one */
 	if (!fast) {
+		/* Reset TX power values */
+		memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
+		ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
+		ah->ah_txpower.txp_min_pwr = 0;
+		ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
+
+		/* Calculate the powertable */
 		ret = ath5k_setup_channel_powertable(ah, channel,
 							ee_mode, type);
-			if (ret)
-				return ret;
-	}
+		if (ret)
+			return ret;
+	/* Write cached table on hw */
+	} else if (type == AR5K_PWRTABLE_PWR_TO_PDADC)
+		ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
+	else
+		ath5k_setup_pcdac_table(ah);
+
+
 
 	/* Limit max power if we have a CTL available */
 	ath5k_get_max_ctl_power(ah, channel);

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

* Re: [PATCH 1/6] ath5k: Always write tx powertable on hw
  2010-12-03  4:03 [PATCH 1/6] ath5k: Always write tx powertable on hw Nick Kossifidis
@ 2010-12-03  6:34 ` Sedat Dilek
  2010-12-03 14:55 ` John W. Linville
  2010-12-29 21:02 ` [ath5k-devel] " Bob Copeland
  2 siblings, 0 replies; 8+ messages in thread
From: Sedat Dilek @ 2010-12-03  6:34 UTC (permalink / raw)
  To: ath5k-devel, linux-wireless, linville, me, mcgrof, jirislaby,
	nbd, br1, sedat.dilek

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>

On Fri, Dec 3, 2010 at 5:03 AM, Nick Kossifidis <mickflemm@gmail.com> wrote:
>  * By skipping tx power table calibration we also skip setting
>  tx power table on hw. Make sure we always write tx power table
>  on hw since it gets cleared on reset.
>
>  Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
>
> ---
>  drivers/net/wireless/ath/ath5k/phy.c |   33 +++++++++++++++++++++------------
>  1 files changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index df5cd0f..f84afb4 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -2742,10 +2742,12 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah,
>
>  /* Write PDADC values on hw */
>  static void
> -ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah,
> -                       u8 pdcurves, u8 *pdg_to_idx)
> +ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah, u8 ee_mode)
>  {
> +       struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
>        u8 *pdadc_out = ah->ah_txpower.txp_pd_table;
> +       u8 *pdg_to_idx = ee->ee_pdc_to_idx[ee_mode];
> +       u8 pdcurves = ee->ee_pd_gains[ee_mode];
>        u32 reg;
>        u8 i;
>
> @@ -2992,7 +2994,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
>                                                ee->ee_pd_gains[ee_mode]);
>
>                /* Write settings on hw */
> -               ath5k_setup_pwr_to_pdadc_table(ah, pdg, pdg_curve_to_idx);
> +               ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
>
>                /* Set txp.offset, note that table_min
>                 * can be negative */
> @@ -3114,12 +3116,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
>                return -EINVAL;
>        }
>
> -       /* Reset TX power values */
> -       memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
> -       ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
> -       ah->ah_txpower.txp_min_pwr = 0;
> -       ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
> -
>        /* Initialize TX power table */
>        switch (ah->ah_radio) {
>        case AR5K_RF5110:
> @@ -3146,11 +3142,24 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
>         * so there is no need to recalculate the powertable, we 'll
>         * just use the cached one */
>        if (!fast) {
> +               /* Reset TX power values */
> +               memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
> +               ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
> +               ah->ah_txpower.txp_min_pwr = 0;
> +               ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
> +
> +               /* Calculate the powertable */
>                ret = ath5k_setup_channel_powertable(ah, channel,
>                                                        ee_mode, type);
> -                       if (ret)
> -                               return ret;
> -       }
> +               if (ret)
> +                       return ret;
> +       /* Write cached table on hw */
> +       } else if (type == AR5K_PWRTABLE_PWR_TO_PDADC)
> +               ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
> +       else
> +               ath5k_setup_pcdac_table(ah);
> +
> +
>
>        /* Limit max power if we have a CTL available */
>        ath5k_get_max_ctl_power(ah, channel);
>

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

* Re: [PATCH 1/6] ath5k: Always write tx powertable on hw
  2010-12-03  4:03 [PATCH 1/6] ath5k: Always write tx powertable on hw Nick Kossifidis
  2010-12-03  6:34 ` Sedat Dilek
@ 2010-12-03 14:55 ` John W. Linville
  2010-12-03 22:23   ` Bob Copeland
  2010-12-29 21:02 ` [ath5k-devel] " Bob Copeland
  2 siblings, 1 reply; 8+ messages in thread
From: John W. Linville @ 2010-12-03 14:55 UTC (permalink / raw)
  To: ath5k-devel, linux-wireless, me, mcgrof, jirislaby, nbd, br1,
	sedat.dilek

On Fri, Dec 03, 2010 at 06:03:00AM +0200, Nick Kossifidis wrote:
>  * By skipping tx power table calibration we also skip setting
>  tx power table on hw. Make sure we always write tx power table
>  on hw since it gets cleared on reset.
> 
>  Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Hey, Nick -- just a process note...

All your patches have " Signed-off-by..." (notice the leading space),
which looks a bit funny.  Could you figure-out why this is happening
and change it to remove the leading space?

Thanks,

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* Re: [PATCH 1/6] ath5k: Always write tx powertable on hw
  2010-12-03 14:55 ` John W. Linville
@ 2010-12-03 22:23   ` Bob Copeland
  2010-12-04 21:37     ` Nick Kossifidis
  0 siblings, 1 reply; 8+ messages in thread
From: Bob Copeland @ 2010-12-03 22:23 UTC (permalink / raw)
  To: John W. Linville
  Cc: ath5k-devel, linux-wireless, mcgrof, jirislaby, nbd, br1, sedat.dilek

On Fri, Dec 3, 2010 at 9:55 AM, John W. Linville <linville@tuxdriver.com> wrote:
> On Fri, Dec 03, 2010 at 06:03:00AM +0200, Nick Kossifidis wrote:
>>  * By skipping tx power table calibration we also skip setting
>>  tx power table on hw. Make sure we always write tx power table
>>  on hw since it gets cleared on reset.
>>
>>  Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
>
> Hey, Nick -- just a process note...
>
> All your patches have " Signed-off-by..." (notice the leading space),
> which looks a bit funny.  Could you figure-out why this is happening
> and change it to remove the leading space?

Also the "*" thing is a bit weird as kernel commit messages go.

-- 
Bob Copeland %% www.bobcopeland.com

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

* Re: [PATCH 1/6] ath5k: Always write tx powertable on hw
  2010-12-03 22:23   ` Bob Copeland
@ 2010-12-04 21:37     ` Nick Kossifidis
  0 siblings, 0 replies; 8+ messages in thread
From: Nick Kossifidis @ 2010-12-04 21:37 UTC (permalink / raw)
  To: Bob Copeland
  Cc: John W. Linville, ath5k-devel, linux-wireless, mcgrof, jirislaby,
	nbd, br1, sedat.dilek

2010/12/4 Bob Copeland <me@bobcopeland.com>:
> On Fri, Dec 3, 2010 at 9:55 AM, John W. Linville <linville@tuxdriver.com> wrote:
>> On Fri, Dec 03, 2010 at 06:03:00AM +0200, Nick Kossifidis wrote:
>>>  * By skipping tx power table calibration we also skip setting
>>>  tx power table on hw. Make sure we always write tx power table
>>>  on hw since it gets cleared on reset.
>>>
>>>  Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
>>
>> Hey, Nick -- just a process note...
>>
>> All your patches have " Signed-off-by..." (notice the leading space),
>> which looks a bit funny.  Could you figure-out why this is happening
>> and change it to remove the leading space?
>
> Also the "*" thing is a bit weird as kernel commit messages go.
>

Sorry, bad habits, will change that next time ;-)


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

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

* Re: [ath5k-devel] [PATCH 1/6] ath5k: Always write tx powertable on hw
  2010-12-03  4:03 [PATCH 1/6] ath5k: Always write tx powertable on hw Nick Kossifidis
  2010-12-03  6:34 ` Sedat Dilek
  2010-12-03 14:55 ` John W. Linville
@ 2010-12-29 21:02 ` Bob Copeland
  2011-01-01 14:51   ` Bruno Randolf
  2 siblings, 1 reply; 8+ messages in thread
From: Bob Copeland @ 2010-12-29 21:02 UTC (permalink / raw)
  To: ath5k-devel, linux-wireless, linville, me, mcgrof, jirislaby,
	nbd, br1, sedat.dilek

On Thu, Dec 2, 2010 at 11:03 PM, Nick Kossifidis <mickflemm@gmail.com> wrote:
>  * By skipping tx power table calibration we also skip setting
>  tx power table on hw. Make sure we always write tx power table
>  on hw since it gets cleared on reset.
>
>  Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Just a very late heads-up, this patch seems to be causing problems
for me.

Seems a bit weird given the content, but the symptom is that
when I bring up the device none of my probe requests are actually
getting sent, according to wireshark captures from another device.
Reverting just this patch helps, so my power table must be broken
at start up.

I saw that Bruno had a later series that touched this area, so I'll
try them next.

-- 
Bob Copeland %% www.bobcopeland.com

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

* Re: [ath5k-devel] [PATCH 1/6] ath5k: Always write tx powertable on hw
  2010-12-29 21:02 ` [ath5k-devel] " Bob Copeland
@ 2011-01-01 14:51   ` Bruno Randolf
  2011-01-02 18:23     ` Bob Copeland
  0 siblings, 1 reply; 8+ messages in thread
From: Bruno Randolf @ 2011-01-01 14:51 UTC (permalink / raw)
  To: Bob Copeland
  Cc: ath5k-devel, linux-wireless, linville, mcgrof, jirislaby, nbd,
	sedat.dilek

On Thursday 30 December 2010 06:02:29 Bob Copeland wrote:
> On Thu, Dec 2, 2010 at 11:03 PM, Nick Kossifidis <mickflemm@gmail.com> 
wrote:
> >  * By skipping tx power table calibration we also skip setting
> >  tx power table on hw. Make sure we always write tx power table
> >  on hw since it gets cleared on reset.
> > 
> >  Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
> 
> Just a very late heads-up, this patch seems to be causing problems
> for me.
> 
> Seems a bit weird given the content, but the symptom is that
> when I bring up the device none of my probe requests are actually
> getting sent, according to wireshark captures from another device.
> Reverting just this patch helps, so my power table must be broken
> at start up.
> 
> I saw that Bruno had a later series that touched this area, so I'll
> try them next.

Yep, they should fix that problem. Please try them and report if they don't.

Bruno

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

* Re: [ath5k-devel] [PATCH 1/6] ath5k: Always write tx powertable on hw
  2011-01-01 14:51   ` Bruno Randolf
@ 2011-01-02 18:23     ` Bob Copeland
  0 siblings, 0 replies; 8+ messages in thread
From: Bob Copeland @ 2011-01-02 18:23 UTC (permalink / raw)
  To: Bruno Randolf
  Cc: ath5k-devel, linux-wireless, linville, mcgrof, jirislaby, nbd,
	sedat.dilek

On Sat, Jan 01, 2011 at 11:51:07PM +0900, Bruno Randolf wrote:
> > Reverting just this patch helps, so my power table must be broken
> > at start up.
> > 
> > I saw that Bruno had a later series that touched this area, so I'll
> > try them next.
> 
> Yep, they should fix that problem. Please try them and report if they don't.

Indeed, applied first 3 patches and problem is resolved (and now I see
you pointed it out in patch 3).  Thanks!

-- 
Bob Copeland %% www.bobcopeland.com


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

end of thread, other threads:[~2011-01-02 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03  4:03 [PATCH 1/6] ath5k: Always write tx powertable on hw Nick Kossifidis
2010-12-03  6:34 ` Sedat Dilek
2010-12-03 14:55 ` John W. Linville
2010-12-03 22:23   ` Bob Copeland
2010-12-04 21:37     ` Nick Kossifidis
2010-12-29 21:02 ` [ath5k-devel] " Bob Copeland
2011-01-01 14:51   ` Bruno Randolf
2011-01-02 18:23     ` Bob Copeland

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.