All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: Gabor Juhos <juhosg@openwrt.org>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: Re: [PATCH 2/3] rt2x00: rt2800lib: fix VGC level adjustment for RT3572 and RT3593
Date: Thu, 03 Oct 2013 18:40:16 +0200	[thread overview]
Message-ID: <524D9DF0.7030209@openwrt.org> (raw)
In-Reply-To: <1380650596-18659-2-git-send-email-juhosg@openwrt.org>

2013.10.01. 20:03 keltezéssel, Gabor Juhos írta:
> The Ralink DPO_RT5572_LinuxSTA_2.6.1.3_20121022
> reference driver uses different RSSI threshold
> and VGC adjustment values for the RT3572 and for
> the RT3593 chipsets.
> 
> Update the rt2800_link_tuner function to use the
> same values. Also change the comment in the function
> to make it more generic.
> 
> References:
> 
>   RT35xx_ChipAGCAdjust function in chips/rt35xx.c
>   RSSI_FOR_MID_LOW_SENSIBILITY constant in include/chip/rtmp_phy.h
>   RT3593_R66_MID_LOW_SENS_GET macro in include/chip/rt3593.h
>   RT3593_R66_NON_MID_LOW_SEMS_GET macro in include/chips/rt3593.h
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> ---
>  drivers/net/wireless/rt2x00/rt2800lib.c |   18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index 25c550a..0dd15b2 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -4465,17 +4465,25 @@ void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual,
>  
>  	if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C))
>  		return;
> -	/*
> -	 * When RSSI is better then -80 increase VGC level with 0x10, except
> -	 * for rt5592 chip.
> +
> +	/* When RSSI is better than a certain threshold, increase VGC
> +	 * with a chip specific value in order to improve the balance
> +	 * between sensibility and noise isolation.
>  	 */
>  
>  	vgc = rt2800_get_default_vgc(rt2x00dev);
>  
> -	if (rt2x00_rt(rt2x00dev, RT5592) && qual->rssi > -65)
> +	if ((rt2x00_rt(rt2x00dev, RT3572) ||
> +	     rt2x00_rt(rt2x00dev, RT3593)) && qual->rssi > -65) {
> +		if (rt2x00dev->curr_band == IEEE80211_BAND_2GHZ)
> +			vgc += 0x20;
> +		else
> +			vgc += 0x10;
> +	} else if (rt2x00_rt(rt2x00dev, RT5592) && qual->rssi > -65) {
>  		vgc += 0x20;
> -	else if (qual->rssi > -80)
> +	} else if (qual->rssi > -80) {
>  		vgc += 0x10;
> +	}

Erm, this seems broken even in the original code. If the rssi value is between
-65 and -80, vgc will be increased by 0x10 regardless of the actual chipset.

John, please skip this patch set. I will send a modified version.

-Gabor


  reply	other threads:[~2013-10-03 16:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01 18:03 [PATCH 1/3] rt2x00: rt2800lib: fix default VGC values for RT3593 Gabor Juhos
2013-10-01 18:03 ` [PATCH 2/3] rt2x00: rt2800lib: fix VGC level adjustment for RT3572 and RT3593 Gabor Juhos
2013-10-03 16:40   ` Gabor Juhos [this message]
2013-10-01 18:03 ` [PATCH 3/3] rt2x00: rt2800lib: fix VGC programming " Gabor Juhos

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=524D9DF0.7030209@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --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.