linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: <linux-wireless@vger.kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>
Cc: <users@rt2x00.serialmonkey.com>,
	Ivo van Doorn <IvDoorn@gmail.com>,
	Helmut Schaa <helmut.schaa@googlemail.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>
Subject: [PATCH 2/5] rt2x00: rt2800 - Fix default vgc values for RT3572
Date: Sun, 16 Sep 2012 22:29:50 +0200	[thread overview]
Message-ID: <1347827393-26948-3-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1347827393-26948-2-git-send-email-gwingerde@gmail.com>

Align with the values used by the RT3572 Ralink vendor driver v2.5.0.0.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index cec4a99..17b8a28 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2904,16 +2904,21 @@ static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev)
 		    rt2x00_rt(rt2x00dev, RT3090) ||
 		    rt2x00_rt(rt2x00dev, RT3290) ||
 		    rt2x00_rt(rt2x00dev, RT3390) ||
+		    rt2x00_rt(rt2x00dev, RT3572) ||
 		    rt2x00_rt(rt2x00dev, RT5390) ||
 		    rt2x00_rt(rt2x00dev, RT5392))
 			vgc = 0x1c + (2 * rt2x00dev->lna_gain);
 		else
 			vgc = 0x2e + rt2x00dev->lna_gain;
 	} else { /* 5GHZ band */
-		if (!test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags))
-			vgc = 0x32 + (rt2x00dev->lna_gain * 5) / 3;
-		else
-			vgc = 0x3a + (rt2x00dev->lna_gain * 5) / 3;
+		if (rt2x00_rt(rt2x00dev, RT3572))
+			vgc = 0x22 + (rt2x00dev->lna_gain * 5) / 3;
+		else {
+			if (!test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags))
+				vgc = 0x32 + (rt2x00dev->lna_gain * 5) / 3;
+			else
+				vgc = 0x3a + (rt2x00dev->lna_gain * 5) / 3;
+		}
 	}
 
 	return vgc;
-- 
1.7.11.1


  reply	other threads:[~2012-09-16 20:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-16 20:29 [PATCH 0/5] Assorted clean ups and a fix Gertjan van Wingerde
2012-09-16 20:29 ` [PATCH 1/5] rt2x00: Code clean up in rt2800lib Gertjan van Wingerde
2012-09-16 20:29   ` Gertjan van Wingerde [this message]
2012-09-16 20:29     ` [PATCH 3/5] rt2x00: rt2800lib - code cleanup Gertjan van Wingerde
2012-09-16 20:29       ` [PATCH 4/5] rt2x00: Code style cleanup in rt2800lib.c Gertjan van Wingerde
2012-09-16 20:29         ` [PATCH 5/5] rt2x00: Clean up RFCSR1 programming in rt2800_config_channel_rf3xxx Gertjan van Wingerde
2012-09-17 15:28           ` Ivo Van Doorn
2012-09-17 15:28         ` [PATCH 4/5] rt2x00: Code style cleanup in rt2800lib.c Ivo Van Doorn
2012-09-17 15:28       ` [PATCH 3/5] rt2x00: rt2800lib - code cleanup Ivo Van Doorn
2012-09-17 15:27     ` [PATCH 2/5] rt2x00: rt2800 - Fix default vgc values for RT3572 Ivo Van Doorn
2012-09-17 15:27   ` [PATCH 1/5] rt2x00: Code clean up in rt2800lib Ivo Van Doorn

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=1347827393-26948-3-git-send-email-gwingerde@gmail.com \
    --to=gwingerde@gmail.com \
    --cc=IvDoorn@gmail.com \
    --cc=helmut.schaa@googlemail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).