linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: users@rt2x00.serialmonkey.com, linux-wireless@vger.kernel.org
Cc: Ivo van Doorn <IvDoorn@gmail.com>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>
Subject: [PATCH] rt2x00: Initialize rf302x RF values properly in rt2800pci.
Date: Mon,  9 Nov 2009 23:00:17 +0100	[thread overview]
Message-ID: <1257804017-5446-1-git-send-email-gwingerde@gmail.com> (raw)

Insert RF chipset values for the RF302x chipsets. Mirrored from the rt2800usb driver.
Also, ensure these RF chipsets are handled properly in rt2800lib for the rt3090 chipset.

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

This one clashes with the patch series sent by Bart. However, I believe that logically this patch
belongs before his patch series, as it makes the unification cleaner and clearer.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |    5 +++--
 drivers/net/wireless/rt2x00/rt2800pci.c |   31 +++++++++++++++++++++++++++----
 drivers/net/wireless/rt2x00/rt2800usb.c |    8 ++++----
 3 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 446087e..d41b3ca 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -806,8 +806,9 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 	unsigned int tx_pin;
 	u8 bbp;
 
-	if (rt2x00_rt(&rt2x00dev->chip, RT3070) &&	
-           (rt2x00_rf(&rt2x00dev->chip, RF2020) ||
+	if ((rt2x00_rt(&rt2x00dev->chip, RT3070) ||
+	     rt2x00_rt(&rt2x00dev->chip, RT3090)) &&
+            (rt2x00_rf(&rt2x00dev->chip, RF2020) ||
 	     rt2x00_rf(&rt2x00dev->chip, RF3020) ||
 	     rt2x00_rf(&rt2x00dev->chip, RF3021) ||
 	     rt2x00_rf(&rt2x00dev->chip, RF3022)))
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index ac7ac57..be42558 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -1362,6 +1362,27 @@ static const struct rf_channel rf_vals[] = {
 	{ 216, 0x15002ccc, 0x15004982, 0x1509be55, 0x150c0a23 },
 };
 
+/*
+ * RF value list for rt302x
+ * Supports: 2.4 GHz
+ */
+static const struct rf_channel rf_vals_302x[] = {
+	{1,  241, 2, 2 },
+	{2,  241, 2, 7 },
+	{3,  242, 2, 2 },
+	{4,  242, 2, 7 },
+	{5,  243, 2, 2 },
+	{6,  243, 2, 7 },
+	{7,  244, 2, 2 },
+	{8,  244, 2, 7 },
+	{9,  245, 2, 2 },
+	{10, 245, 2, 7 },
+	{11, 246, 2, 2 },
+	{12, 246, 2, 7 },
+	{13, 247, 2, 2 },
+	{14, 248, 2, 4 },
+};
+
 static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 {
 	struct hw_mode_spec *spec = &rt2x00dev->spec;
@@ -1396,10 +1417,6 @@ static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 
 	if (rt2x00_rf(&rt2x00dev->chip, RF2820) ||
 	    rt2x00_rf(&rt2x00dev->chip, RF2720) ||
-	    rt2x00_rf(&rt2x00dev->chip, RF3020) ||
-	    rt2x00_rf(&rt2x00dev->chip, RF3021) ||
-	    rt2x00_rf(&rt2x00dev->chip, RF3022) ||
-	    rt2x00_rf(&rt2x00dev->chip, RF2020) ||
 	    rt2x00_rf(&rt2x00dev->chip, RF3052)) {
 		spec->num_channels = 14;
 		spec->channels = rf_vals;
@@ -1408,6 +1425,12 @@ static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 		spec->supported_bands |= SUPPORT_BAND_5GHZ;
 		spec->num_channels = ARRAY_SIZE(rf_vals);
 		spec->channels = rf_vals;
+	} else if (rt2x00_rf(&rt2x00dev->chip, RF3020) ||
+		   rt2x00_rf(&rt2x00dev->chip, RF3021) ||
+		   rt2x00_rf(&rt2x00dev->chip, RF3022) ||
+		   rt2x00_rf(&rt2x00dev->chip, RF2020)) {
+		spec->num_channels = ARRAY_SIZE(rf_vals_302x);
+		spec->channels = rf_vals_302x;
 	}
 
 	/*
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index bd2f6e6..9aa2f7a 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -940,10 +940,10 @@ static const struct rf_channel rf_vals[] = {
 };
 
 /*
- * RF value list for rt3070
+ * RF value list for rf302x
  * Supports: 2.4 GHz
  */
-static const struct rf_channel rf_vals_3070[] = {
+static const struct rf_channel rf_vals_302x[] = {
 	{1,  241, 2, 2 },
 	{2,  241, 2, 7 },
 	{3,  242, 2, 2 },
@@ -1036,8 +1036,8 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 		   rt2x00_rf(&rt2x00dev->chip, RF2020) ||
 		   rt2x00_rf(&rt2x00dev->chip, RF3021) ||
 		   rt2x00_rf(&rt2x00dev->chip, RF3022)) {
-		spec->num_channels = ARRAY_SIZE(rf_vals_3070);
-		spec->channels = rf_vals_3070;
+		spec->num_channels = ARRAY_SIZE(rf_vals_302x);
+		spec->channels = rf_vals_302x;
 	}
 
 	/*
-- 
1.6.5.2


             reply	other threads:[~2009-11-09 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09 22:00 Gertjan van Wingerde [this message]
2009-11-10 18:33 ` [PATCH] rt2x00: Initialize rf302x RF values properly in rt2800pci Ivo van Doorn
2009-11-10 18:41 ` Bartlomiej Zolnierkiewicz
2009-11-10 21:40   ` Gertjan van Wingerde

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=1257804017-5446-1-git-send-email-gwingerde@gmail.com \
    --to=gwingerde@gmail.com \
    --cc=IvDoorn@gmail.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-wireless@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 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).