All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] rt2x00: Enable PA_PE bits in TX_PIN_CFG according to active band.
@ 2011-05-18 18:25 Ivo van Doorn
  2011-05-18 23:24 ` Julian Calaby
  0 siblings, 1 reply; 3+ messages in thread
From: Ivo van Doorn @ 2011-05-18 18:25 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, users

From: Gertjan van Wingerde <gwingerde@gmail.com>

(split off from the earlier RT35xx patch submitted by Shiang)

There's no point in enabling the PA_PE bits for the bands that we are
not active on.

Signed-off-by: Shiang Tu <shiang_tu@ralinktech.com>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 93fb674..1cad89e 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1795,8 +1795,10 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 
 	/* Turn on unused PA or LNA when not using 1T or 1R */
 	if (rt2x00dev->default_ant.tx_chain_num == 2) {
-		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 1);
-		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1);
+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
+				   rf->channel > 14);
+		rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
+				   rf->channel <= 14);
 	}
 
 	/* Turn on unused PA or LNA when not using 1T or 1R */
-- 
1.7.2.3


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

* Re: [PATCH 1/7] rt2x00: Enable PA_PE bits in TX_PIN_CFG according to active band.
  2011-05-18 18:25 [PATCH 1/7] rt2x00: Enable PA_PE bits in TX_PIN_CFG according to active band Ivo van Doorn
@ 2011-05-18 23:24 ` Julian Calaby
  2011-05-19 11:16   ` Ivo Van Doorn
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Calaby @ 2011-05-18 23:24 UTC (permalink / raw)
  To: Ivo van Doorn, Gertjan van Wingerde
  Cc: John W. Linville, linux-wireless, users

Gertjan, Ivo,

Minor nit

On Thu, May 19, 2011 at 04:25, Ivo van Doorn <ivdoorn@gmail.com> wrote:
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index 93fb674..1cad89e 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -1795,8 +1795,10 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
>
>        /* Turn on unused PA or LNA when not using 1T or 1R */
>        if (rt2x00dev->default_ant.tx_chain_num == 2) {
> -               rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 1);
> -               rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1);
> +               rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
> +                                  rf->channel > 14);
> +               rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
> +                                  rf->channel <= 14);

Aren't there better ways to determine the band from the channel?

I recall that there were some patches floating around relating to
supporting Japanese channels (802.11j ?) which (IIRC) use channel 14
in both bands - I'm not sure if this is applicable here, but would it
not be better to get the actual band from mac/cfg80211 and switch
based on that instead of on the channel number?

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

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

* Re: [PATCH 1/7] rt2x00: Enable PA_PE bits in TX_PIN_CFG according to active band.
  2011-05-18 23:24 ` Julian Calaby
@ 2011-05-19 11:16   ` Ivo Van Doorn
  0 siblings, 0 replies; 3+ messages in thread
From: Ivo Van Doorn @ 2011-05-19 11:16 UTC (permalink / raw)
  To: Julian Calaby
  Cc: Gertjan van Wingerde, John W. Linville, linux-wireless, users

Hi,

> On Thu, May 19, 2011 at 04:25, Ivo van Doorn <ivdoorn@gmail.com> wrote:
>> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
>> index 93fb674..1cad89e 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
>> @@ -1795,8 +1795,10 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
>>
>>        /* Turn on unused PA or LNA when not using 1T or 1R */
>>        if (rt2x00dev->default_ant.tx_chain_num == 2) {
>> -               rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 1);
>> -               rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1);
>> +               rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
>> +                                  rf->channel > 14);
>> +               rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
>> +                                  rf->channel <= 14);
>
> Aren't there better ways to determine the band from the channel?
>
> I recall that there were some patches floating around relating to
> supporting Japanese channels (802.11j ?) which (IIRC) use channel 14
> in both bands - I'm not sure if this is applicable here, but would it
> not be better to get the actual band from mac/cfg80211 and switch
> based on that instead of on the channel number?

True, but we have to review this for the entire driver, we have several places
where we check the channel rather then the band. And even then we have
a FIXME somewhere (not sure who added it), which states that our registrations
of the bands are also possibly incorrect.

On the other hand, it also depends on the Ralink chips as well, I am not
even sure they support this channel 14 on both bands feature.

Ivo

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

end of thread, other threads:[~2011-05-19 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 18:25 [PATCH 1/7] rt2x00: Enable PA_PE bits in TX_PIN_CFG according to active band Ivo van Doorn
2011-05-18 23:24 ` Julian Calaby
2011-05-19 11:16   ` Ivo Van Doorn

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.