Skip to contentSkip to conversation

rt2x00: Fix rt2800lib RF chip programming selection.

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2x00: Fix rt2800lib RF chip programming selection.

Mirror the legacy Ralink driver with respect to rt2800 RF register programming. Execute rt2800_config_channel_rt3x for all RF2020, RF3020, RF3021 & RF3022 chipsets when operating on RT3070 devices.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +7 -3
index 2c91c44..446087e 100644
@@ -806,10 +806,14 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 	unsigned int tx_pin;
 	u8 bbp;
 
-	if (rt2x00_rev(&rt2x00dev->chip) != RT3070_VERSION)
-		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
-	else
+	if (rt2x00_rt(&rt2x00dev->chip, RT3070) &&	
+           (rt2x00_rf(&rt2x00dev->chip, RF2020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3021) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3022)))
 		rt2800_config_channel_rt3x(rt2x00dev, conf, rf, info);
+	else
+		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
 
 	/*
 	 * Change BBP settings
Signature · 1 line
1.6.5.2
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Gertjan van Wingerde

Mirror the legacy Ralink driver with respect to rt2800 RF register programming. Execute rt2800_config_channel_rt3x for all RF2020, RF3020, RF3021 & RF3022 chipsets when operating on RT3070 devices.

Quoted 26 lines
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +7 -3
index 2c91c44..446087e 100644
@@ -806,10 +806,14 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 	unsigned int tx_pin;
 	u8 bbp;
 
-	if (rt2x00_rev(&rt2x00dev->chip) != RT3070_VERSION)
-		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
-	else
+	if (rt2x00_rt(&rt2x00dev->chip, RT3070) &&	
+           (rt2x00_rf(&rt2x00dev->chip, RF2020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3021) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3022)))
 		rt2800_config_channel_rt3x(rt2x00dev, conf, rf, info);
+	else
+		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
 
 	/*
 	 * Change BBP settings
#2 lore raw
In reply to Gertjan van Wingerde
Quoted 21 lines · Gertjan van Wingerde

Mirror the legacy Ralink driver with respect to rt2800 RF register programming. Execute rt2800_config_channel_rt3x for all RF2020, RF3020, RF3021 & RF3022 chipsets when operating on RT3070 devices.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +1 -3
index 2c91c44..446087e 100644
@@ -806,10 +806,14 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 	unsigned int tx_pin;
 	u8 bbp;
 
-	if (rt2x00_rev(&rt2x00dev->chip) != RT3070_VERSION)
-		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
-	else
+	if (rt2x00_rt(&rt2x00dev->chip, RT3070) &&	

drivers/net/wireless/rt2x00/rt2800lib.c static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, · line 819

Quoted 10 lines
drivers/net/wireless/rt2x00/rt2800lib.c +6 -0
+           (rt2x00_rf(&rt2x00dev->chip, RF2020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3021) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3022)))
 		rt2800_config_channel_rt3x(rt2x00dev, conf, rf, info);
+	else
+		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
 
 	/*
 	 * Change BBP settings

CC [M] drivers/net/wireless/rt2x00/rt2800lib.o
drivers/net/wireless/rt2x00/rt2800lib.c: In function ‘rt2800_config_channel’:
drivers/net/wireless/rt2x00/rt2800lib.c:809: error: ‘RF3070’ undeclared (first use in this function) drivers/net/wireless/rt2x00/rt2800lib.c:809: error: (Each undeclared identifier is reported only once drivers/net/wireless/rt2x00/rt2800lib.c:809: error: for each function it appears in.)

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

Mirror the legacy Ralink driver with respect to rt2800 RF register programming. Execute rt2800_config_channel_rt3x for all RF2020, RF3020, RF3021 & RF3022 chipsets when operating on RT3070 devices.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +7 -3
index 2c91c44..446087e 100644
@@ -806,10 +806,14 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 	unsigned int tx_pin;
 	u8 bbp;
 
-	if (rt2x00_rev(&rt2x00dev->chip) != RT3070_VERSION)
-		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
-	else
+	if (rt2x00_rt(&rt2x00dev->chip, RT3070) &&	
+           (rt2x00_rf(&rt2x00dev->chip, RF2020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3021) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3022)))
 		rt2800_config_channel_rt3x(rt2x00dev, conf, rf, info);
+	else
+		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
 
Quoted 9 lines

drivers/net/wireless/rt2x00/rt2800lib.c static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, · line 819

Quoted 2 lines
drivers/net/wireless/rt2x00/rt2800lib.c +0 -0
 	/*
 	 * Change BBP settings

CC [M] drivers/net/wireless/rt2x00/rt2800lib.o
drivers/net/wireless/rt2x00/rt2800lib.c: In function ‘rt2800_config_channel’:
drivers/net/wireless/rt2x00/rt2800lib.c:809: error: ‘RF3070’ undeclared (first use in this function) drivers/net/wireless/rt2x00/rt2800lib.c:809: error: (Each undeclared identifier is reported only once drivers/net/wireless/rt2x00/rt2800lib.c:809: error: for each function it appears in.)

Me very confused here. This patch doesn't even introduce the RF3070 symbol, nor can I see where it is used. It does use symbol RT3070 on line 809, but that one is introduced in an earlier patch.
Ah, did you apply the RT3070 USB chipset detection patch before this one?

Still wouldn't explain the compile error on symbol RF3070 though.

---
Gertjan.

#4 lore raw
Quoted 41 lines · Gertjan van Wingerde
Quoted 30 lines · John W. Linville
Quoted 29 lines · Gertjan van Wingerde

Mirror the legacy Ralink driver with respect to rt2800 RF register programming. Execute rt2800_config_channel_rt3x for all RF2020, RF3020, RF3021 & RF3022 chipsets when operating on RT3070 devices.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +7 -3
index 2c91c44..446087e 100644
@@ -806,10 +806,14 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 	unsigned int tx_pin;
 	u8 bbp;
 
-	if (rt2x00_rev(&rt2x00dev->chip) != RT3070_VERSION)
-		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
-	else
+	if (rt2x00_rt(&rt2x00dev->chip, RT3070) &&	
+           (rt2x00_rf(&rt2x00dev->chip, RF2020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3021) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3022)))
 		rt2800_config_channel_rt3x(rt2x00dev, conf, rf, info);
+	else
+		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
 
Quoted 9 lines

drivers/net/wireless/rt2x00/rt2800lib.c static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, · line 819

Quoted 2 lines
drivers/net/wireless/rt2x00/rt2800lib.c +0 -0
 	/*
 	 * Change BBP settings

CC [M] drivers/net/wireless/rt2x00/rt2800lib.o
drivers/net/wireless/rt2x00/rt2800lib.c: In function ‘rt2800_config_channel’:
drivers/net/wireless/rt2x00/rt2800lib.c:809: error: ‘RF3070’ undeclared (first use in this function) drivers/net/wireless/rt2x00/rt2800lib.c:809: error: (Each undeclared identifier is reported only once drivers/net/wireless/rt2x00/rt2800lib.c:809: error: for each function it appears in.)

Quoted 5 lines

Me very confused here. This patch doesn't even introduce the RF3070 symbol, nor can I see where it is used. It does use symbol RT3070 on line 809, but that one is introduced in an earlier patch.
Ah, did you apply the RT3070 USB chipset detection patch before this one?

Still wouldn't explain the compile error on symbol RF3070 though.

RF3070 is a copy-n-paste error, sorry...the symbol is RT3070.

What patch introduces it?

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#5 lore raw
Quoted 46 lines · John W. Linville
Quoted 45 lines · Gertjan van Wingerde
Quoted 30 lines · John W. Linville
Quoted 29 lines · Gertjan van Wingerde

Mirror the legacy Ralink driver with respect to rt2800 RF register programming. Execute rt2800_config_channel_rt3x for all RF2020, RF3020, RF3021 & RF3022 chipsets when operating on RT3070 devices.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +7 -3
index 2c91c44..446087e 100644
@@ -806,10 +806,14 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 	unsigned int tx_pin;
 	u8 bbp;
 
-	if (rt2x00_rev(&rt2x00dev->chip) != RT3070_VERSION)
-		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
-	else
+	if (rt2x00_rt(&rt2x00dev->chip, RT3070) &&	
+           (rt2x00_rf(&rt2x00dev->chip, RF2020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3020) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3021) ||
+	     rt2x00_rf(&rt2x00dev->chip, RF3022)))
 		rt2800_config_channel_rt3x(rt2x00dev, conf, rf, info);
+	else
+		rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info);
 
Quoted 9 lines

drivers/net/wireless/rt2x00/rt2800lib.c static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, · line 819

Quoted 2 lines
drivers/net/wireless/rt2x00/rt2800lib.c +0 -0
 	/*
 	 * Change BBP settings

CC [M] drivers/net/wireless/rt2x00/rt2800lib.o
drivers/net/wireless/rt2x00/rt2800lib.c: In function ‘rt2800_config_channel’:
drivers/net/wireless/rt2x00/rt2800lib.c:809: error: ‘RF3070’ undeclared (first use in this function) drivers/net/wireless/rt2x00/rt2800lib.c:809: error: (Each undeclared identifier is reported only once drivers/net/wireless/rt2x00/rt2800lib.c:809: error: for each function it appears in.)

Me very confused here. This patch doesn't even introduce the RF3070 symbol, nor can I see where it is used. It does use symbol RT3070 on line 809, but that one is introduced in an earlier patch.
Ah, did you apply the RT3070 USB chipset detection patch before this one?

Quoted 6 lines
Quoted 1 line

Still wouldn't explain the compile error on symbol RF3070 though.

RF3070 is a copy-n-paste error, sorry...the symbol is RT3070.

What patch introduces it?

The one I sent with subject: [PATCH v2] rt2x00: Properly detect Ralink RT3070 devices.

It can be found at:

http://marc.info/?l=linux-wireless&m=125788935007988&w=2

Sorry for not making these patch dependencies clear.

---
Gertjan.