Skip to contentSkip to conversation

rt2x00: Initialize rf302x RF values properly for rt2800pci.

PATCH In review Gertjan van Wingerde 5 participants 6 messages Nov 10, 2009 – Nov 12, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rt2x00: Initialize rf302x RF values properly for rt2800pci.

Ensure RF302x and RF2020 chipsets are handled properly in rt2800lib for the rt3090 chipset.

---

Rebased to apply on top of Bart's second series of unification patches.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |   31 +++++++++++++------------------
 1 files changed, 13 insertions(+), 18 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +13 -18
index a848cf5..75d3d00 100644
@@ -1,5 +1,6 @@
 /*
 	Copyright (C) 2009 Bartlomiej Zolnierkiewicz <[email protected]>
+	Copyright (C) 2009 Gertjan van Wingerde <[email protected]>
 
 	Based on the original rt2800pci.c and rt2800usb.c.
 	  Copyright (C) 2009 Ivo van Doorn <[email protected]>
@@ -806,8 +807,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)))
@@ -1989,7 +1991,7 @@ static const struct rf_channel rf_vals[] = {
  * RF value list for rt3070
  * 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 },
@@ -2046,26 +2048,19 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 
 	if (rt2x00_rf(chip, RF2820) ||
 	    rt2x00_rf(chip, RF2720) ||
-	    (rt2x00_intf_is_pci(rt2x00dev) &&
-	     (rt2x00_rf(chip, RF3020) ||
-	      rt2x00_rf(chip, RF3021) ||
-	      rt2x00_rf(chip, RF3022) ||
-	      rt2x00_rf(chip, RF2020) ||
-	      rt2x00_rf(chip, RF3052)))) {
+	    (rt2x00_intf_is_pci(rt2x00dev) && rt2x00_rf(chip, RF3052))) {
 		spec->num_channels = 14;
 		spec->channels = rf_vals;
-	} else if (rt2x00_rf(chip, RF2850) ||
-		   rt2x00_rf(chip, RF2750)) {
+	} else if (rt2x00_rf(chip, RF2850) || rt2x00_rf(chip, RF2750)) {
 		spec->supported_bands |= SUPPORT_BAND_5GHZ;
 		spec->num_channels = ARRAY_SIZE(rf_vals);
 		spec->channels = rf_vals;
-	} else if (rt2x00_intf_is_usb(rt2x00dev) &&
-		    (rt2x00_rf(chip, RF3020) ||
-		     rt2x00_rf(chip, RF2020) ||
-		     rt2x00_rf(chip, RF3021) ||
-		     rt2x00_rf(chip, RF3022))) {
-		spec->num_channels = ARRAY_SIZE(rf_vals_3070);
-		spec->channels = rf_vals_3070;
+	} else if (rt2x00_rf(chip, RF3020) ||
+		   rt2x00_rf(chip, RF2020) ||
+		   rt2x00_rf(chip, RF3021) ||
+		   rt2x00_rf(chip, RF3022)) {
+		spec->num_channels = ARRAY_SIZE(rf_vals_302x);
+		spec->channels = rf_vals_302x;
 	}
 
 	/*
Signature · 1 line
1.6.5.2
Acked-by on v2 1/1
#1 lore raw
Quoted 3 lines · Gertjan van Wingerde

Ensure RF302x and RF2020 chipsets are handled properly in rt2800lib for the rt3090 chipset.

Quoted 75 lines

---

Rebased to apply on top of Bart's second series of unification patches.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |   31 +++++++++++++------------------
 1 files changed, 13 insertions(+), 18 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +13 -18
index a848cf5..75d3d00 100644
@@ -1,5 +1,6 @@
 /*
 	Copyright (C) 2009 Bartlomiej Zolnierkiewicz <[email protected]>
+	Copyright (C) 2009 Gertjan van Wingerde <[email protected]>
 
 	Based on the original rt2800pci.c and rt2800usb.c.
 	  Copyright (C) 2009 Ivo van Doorn <[email protected]>
@@ -806,8 +807,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)))
@@ -1989,7 +1991,7 @@ static const struct rf_channel rf_vals[] = {
  * RF value list for rt3070
  * 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 },
@@ -2046,26 +2048,19 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 
 	if (rt2x00_rf(chip, RF2820) ||
 	    rt2x00_rf(chip, RF2720) ||
-	    (rt2x00_intf_is_pci(rt2x00dev) &&
-	     (rt2x00_rf(chip, RF3020) ||
-	      rt2x00_rf(chip, RF3021) ||
-	      rt2x00_rf(chip, RF3022) ||
-	      rt2x00_rf(chip, RF2020) ||
-	      rt2x00_rf(chip, RF3052)))) {
+	    (rt2x00_intf_is_pci(rt2x00dev) && rt2x00_rf(chip, RF3052))) {
 		spec->num_channels = 14;
 		spec->channels = rf_vals;
-	} else if (rt2x00_rf(chip, RF2850) ||
-		   rt2x00_rf(chip, RF2750)) {
+	} else if (rt2x00_rf(chip, RF2850) || rt2x00_rf(chip, RF2750)) {
 		spec->supported_bands |= SUPPORT_BAND_5GHZ;
 		spec->num_channels = ARRAY_SIZE(rf_vals);
 		spec->channels = rf_vals;
-	} else if (rt2x00_intf_is_usb(rt2x00dev) &&
-		    (rt2x00_rf(chip, RF3020) ||
-		     rt2x00_rf(chip, RF2020) ||
-		     rt2x00_rf(chip, RF3021) ||
-		     rt2x00_rf(chip, RF3022))) {
-		spec->num_channels = ARRAY_SIZE(rf_vals_3070);
-		spec->channels = rf_vals_3070;
+	} else if (rt2x00_rf(chip, RF3020) ||
+		   rt2x00_rf(chip, RF2020) ||
+		   rt2x00_rf(chip, RF3021) ||
+		   rt2x00_rf(chip, RF3022)) {
+		spec->num_channels = ARRAY_SIZE(rf_vals_302x);
+		spec->channels = rf_vals_302x;
 	}
 
 	/*
#3 lore raw
Quoted 8 lines · Kalle Valo
Quoted 3 lines · Gertjan van Wingerde

Ensure RF302x and RF2020 chipsets are handled properly in rt2800lib for the rt3090 chipset.

Please line wrap commit logs. 72 characters or so per line is a good limit.

Yes, ACK.

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#4 lore raw
Quoted 12 lines · John W. Linville
Quoted 8 lines · Kalle Valo
Quoted 3 lines · Gertjan van Wingerde

Ensure RF302x and RF2020 chipsets are handled properly in rt2800lib for the rt3090 chipset.

Please line wrap commit logs. 72 characters or so per line is a good limit.

Yes, ACK.

I'm terribly sorry about that. I still have to get used to my new big wide-screen monitor, and the windows of wider than 80 characters :-(

I'll keep it in mind for my next patch submissions.

---
Gertjan.

#5 lore raw
Quoted 11 lines · On Wednesday 11 November 2009 21:16:49 Gertjan van Wingerde wrote:
Quoted 10 lines · John W. Linville
Quoted 8 lines · Kalle Valo
Quoted 3 lines · Gertjan van Wingerde

Ensure RF302x and RF2020 chipsets are handled properly in rt2800lib for the rt3090 chipset.

Please line wrap commit logs. 72 characters or so per line is a good limit.

Quoted 6 lines
Quoted 2 lines

Yes, ACK.

I'm terribly sorry about that. I still have to get used to my new big wide-screen monitor, and the windows of wider than 80 characters :-(

I'll keep it in mind for my next patch submissions.

I've been fixing this in rt2800 tree for all patches.. ;)

Signature · 1 line
Bartlomiej Zolnierkiewicz