diff mbox

[v2,3/4] rt2x00: rt2800lib: fix default VGC values for RT3593

Message ID 1380823243-11149-3-git-send-email-juhosg@openwrt.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Gabor Juhos Oct. 3, 2013, 6 p.m. UTC
Update the rt2800_get_default_vgc function to use the same VGC
values that the DPO_RT5572_LinuxSTA_2.6.1.3_20121022 reference
driver uses.

References:
  RT35xx_ChipAGCAdjust in chips/rt35xx.c
  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 |    3 +++
 1 file changed, 3 insertions(+)

Comments

Stanislaw Gruszka Oct. 4, 2013, 2:38 p.m. UTC | #1
On Thu, Oct 03, 2013 at 08:00:42PM +0200, Gabor Juhos wrote:
> Update the rt2800_get_default_vgc function to use the same VGC
> values that the DPO_RT5572_LinuxSTA_2.6.1.3_20121022 reference
> driver uses.
> 
> References:
>   RT35xx_ChipAGCAdjust in chips/rt35xx.c
>   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>

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

> @@ -4422,6 +4423,8 @@ static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev)
>  	} else { /* 5GHZ band */
>  		if (rt2x00_rt(rt2x00dev, RT3572))
>  			vgc = 0x22 + (rt2x00dev->lna_gain * 5) / 3;

Looks RT3572 values should be also changed ? According to:

                if (pAd->CommonCfg.BBPCurrentBW == BW_20)
                {
                        R66 = 0x32 + (lanGain*5) / 3;
                        if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
                                R66 += 0x10;
                }
                else
                {
                        R66 = 0x3A + (lanGain*5)/3;
                        if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
                                R66 += 0x10;
                }       

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gabor Juhos Oct. 4, 2013, 7:59 p.m. UTC | #2
2013.10.04. 16:38 keltezéssel, Stanislaw Gruszka írta:
> On Thu, Oct 03, 2013 at 08:00:42PM +0200, Gabor Juhos wrote:
>> Update the rt2800_get_default_vgc function to use the same VGC
>> values that the DPO_RT5572_LinuxSTA_2.6.1.3_20121022 reference
>> driver uses.
>>
>> References:
>>   RT35xx_ChipAGCAdjust in chips/rt35xx.c
>>   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>
> 
> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
> 
>> @@ -4422,6 +4423,8 @@ static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev)
>>  	} else { /* 5GHZ band */
>>  		if (rt2x00_rt(rt2x00dev, RT3572))
>>  			vgc = 0x22 + (rt2x00dev->lna_gain * 5) / 3;
> 
> Looks RT3572 values should be also changed ? According to:
> 
>                 if (pAd->CommonCfg.BBPCurrentBW == BW_20)
>                 {
>                         R66 = 0x32 + (lanGain*5) / 3;
>                         if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
>                                 R66 += 0x10;
>                 }
>                 else
>                 {
>                         R66 = 0x3A + (lanGain*5)/3;
>                         if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
>                                 R66 += 0x10;
>                 }       

Yes. I even created a patch for that, but I forgot to add that into the series.
Will send that separately.

-Gabor
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index a619f2c..55b421f 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4413,6 +4413,7 @@  static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev)
 		    rt2x00_rt(rt2x00dev, RT3290) ||
 		    rt2x00_rt(rt2x00dev, RT3390) ||
 		    rt2x00_rt(rt2x00dev, RT3572) ||
+		    rt2x00_rt(rt2x00dev, RT3593) ||
 		    rt2x00_rt(rt2x00dev, RT5390) ||
 		    rt2x00_rt(rt2x00dev, RT5392) ||
 		    rt2x00_rt(rt2x00dev, RT5592))
@@ -4422,6 +4423,8 @@  static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev)
 	} else { /* 5GHZ band */
 		if (rt2x00_rt(rt2x00dev, RT3572))
 			vgc = 0x22 + (rt2x00dev->lna_gain * 5) / 3;
+		else if (rt2x00_rt(rt2x00dev, RT3593))
+			vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3;
 		else if (rt2x00_rt(rt2x00dev, RT5592))
 			vgc = 0x24 + (2 * rt2x00dev->lna_gain);
 		else {