All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stf_xl@wp.pl>
To: minimumlaw@rambler.ru
Cc: linux-wireless@vger.kernel.org, stable@vger.kernel.org,
	users@rt2x00.serialmonkey.com
Subject: Re: [PATCH] Fix transmit power troubles on some Ralink RT30xx cards
Date: Sun, 14 Apr 2013 15:53:16 +0200	[thread overview]
Message-ID: <20130414135316.GA14248@localhost.localdomain> (raw)
In-Reply-To: <1365936883-19033-1-git-send-email-minimumlaw@rambler.ru>

On Sun, Apr 14, 2013 at 02:54:43PM +0400, minimumlaw@rambler.ru wrote:
> From: "Alex A. Mihaylov" <minimumlaw@rambler.ru>
> 
> Some cards on Ralink RT30xx chipset not have correctly TX_MIXER_GAIN
> value in them EEPROM/EFUSE. In this case, we must use default value,
> but always used EEPROM/EFUSE value. As result we have tranmitt power
> range from -10dBm to +6dBm instead 0dBm to +16dBm.

Thanks for great work on debugging this!
> Correctly value in EEPROM/EFUSE is one or more for RT3070 and two or
> more for other RT30xx chips.
>
> Testen on Canyon CNP-WF518N1 usb Wi-Fi dongle and Jorjin WN8020 usb
> embedded Wi-Fi module.

Signed-off-by: "Alex A. Mihaylov" <minimumlaw@rambler.ru>
Cc: stable@vger.kernel.org

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

> ---
>  drivers/net/wireless/rt2x00/rt2800lib.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index a658b4b..92849e5 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -4436,6 +4436,8 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
>  
>  	if (!rt2x00_rt(rt2x00dev, RT5390) &&
>  	    !rt2x00_rt(rt2x00dev, RT5392)) {
> +		u8 min_gain = rt2x00_rt(rt2x00dev, RT3070) ? 1 : 2;
> +
>  		rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr);
>  		rt2x00_set_field8(&rfcsr, RFCSR17_TX_LO1_EN, 0);
>  		if (rt2x00_rt(rt2x00dev, RT3070) ||
> @@ -4446,8 +4448,10 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
>  				      &rt2x00dev->cap_flags))
>  				rt2x00_set_field8(&rfcsr, RFCSR17_R, 1);
>  		}
> -		rt2x00_set_field8(&rfcsr, RFCSR17_TXMIXER_GAIN,
> -				  drv_data->txmixer_gain_24g);
> +		if (drv_data->txmixer_gain_24g >= min_gain) {
> +			rt2x00_set_field8(&rfcsr, RFCSR17_TXMIXER_GAIN,
> +					  drv_data->txmixer_gain_24g);
> +		}
>  		rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
>  	}
>  
> -- 
> 1.8.1.5
> 
> 

  parent reply	other threads:[~2013-04-14 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-14 10:54 [PATCH] Fix transmit power troubles on some Ralink RT30xx cards minimumlaw
2013-04-14 13:32 ` Greg KH
2013-04-14 13:53 ` Stanislaw Gruszka [this message]
2013-04-14 13:58   ` Greg KH
2013-04-15 17:08 ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130414135316.GA14248@localhost.localdomain \
    --to=stf_xl@wp.pl \
    --cc=linux-wireless@vger.kernel.org \
    --cc=minimumlaw@rambler.ru \
    --cc=stable@vger.kernel.org \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.