All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rt2800: add chipset revision RT5390R support
@ 2012-04-18 14:23 Anisse Astier
  2012-04-20 17:07 ` Gertjan van Wingerde
  0 siblings, 1 reply; 8+ messages in thread
From: Anisse Astier @ 2012-04-18 14:23 UTC (permalink / raw)
  To: linux-wireless, users
  Cc: Julian Calaby, linville, RA-Shiang Tu, Ivo van Doorn,
	Gertjan van Wingerde, Helmut Schaa, Kevin Chou, John Li,
	RA-Jay Hung, Anisse Astier

About 70% of the chips with revision RT5390R initialize incorrectly, using
the auxiliary antenna instead of the main one. The net result is that
signal reception is very poor (no AP further than 1M).

This chipset differs from RT5390 and RT5390F by its support of hardware
antenna diversity. Therefore antenna selection should be done
differently, by disabling software features and previously selected
antenna.

This changeset does just that, and makes all RT5390R work properly.

This is based on Ralink's 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO
driver.

Signed-off-by: Anisse Astier <anisse@astier.eu>
---
 drivers/net/wireless/rt2x00/rt2800.h    |    1 +
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 063bfa8..1ce2634 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -83,6 +83,7 @@
 #define REV_RT3090E			0x0211
 #define REV_RT3390E			0x0211
 #define REV_RT5390F			0x0502
+#define REV_RT5390R			0x1502
 
 /*
  * Signal information.
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index bd19802..6c95101 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3356,6 +3356,16 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
 			rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
 		}
 
+		/* This chip has hardware antenna diversity*/
+		if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
+			rt2x00dev->default_ant.tx = ANTENNA_HW_DIVERSITY; /* Unused */
+			rt2x00dev->default_ant.rx = ANTENNA_HW_DIVERSITY; /* Unused */
+
+			rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
+			rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
+			rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
+		}
+
 		rt2800_bbp_read(rt2x00dev, 152, &value);
 		if (ant == 0)
 			rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);
-- 
1.7.9.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] rt2800: add chipset revision RT5390R support
  2012-04-18 14:23 [PATCH] rt2800: add chipset revision RT5390R support Anisse Astier
@ 2012-04-20 17:07 ` Gertjan van Wingerde
  2012-04-23  7:50   ` Anisse Astier
  0 siblings, 1 reply; 8+ messages in thread
From: Gertjan van Wingerde @ 2012-04-20 17:07 UTC (permalink / raw)
  To: Anisse Astier
  Cc: linux-wireless, users, Julian Calaby, linville, RA-ShiangTu,
	Ivo van Doorn, Helmut Schaa, Kevin Chou, John Li, RA-Jay Hung,
	Anisse Astier

Hi Anisse,


On 18 apr. 2012, at 16:23, Anisse Astier <anisse@astier.eu> wrote:

> About 70% of the chips with revision RT5390R initialize incorrectly, using
> the auxiliary antenna instead of the main one. The net result is that
> signal reception is very poor (no AP further than 1M).
> 
> This chipset differs from RT5390 and RT5390F by its support of hardware
> antenna diversity. Therefore antenna selection should be done
> differently, by disabling software features and previously selected
> antenna.
> 
> This changeset does just that, and makes all RT5390R work properly.
> 
> This is based on Ralink's 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO
> driver.
> 
> Signed-off-by: Anisse Astier <anisse@astier.eu>
> ---
> drivers/net/wireless/rt2x00/rt2800.h    |    1 +
> drivers/net/wireless/rt2x00/rt2800lib.c |   10 ++++++++++
> 2 files changed, 11 insertions(+)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
> index 063bfa8..1ce2634 100644
> --- a/drivers/net/wireless/rt2x00/rt2800.h
> +++ b/drivers/net/wireless/rt2x00/rt2800.h
> @@ -83,6 +83,7 @@
> #define REV_RT3090E            0x0211
> #define REV_RT3390E            0x0211
> #define REV_RT5390F            0x0502
> +#define REV_RT5390R            0x1502
> 
> /*
>  * Signal information.
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index bd19802..6c95101 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -3356,6 +3356,16 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
>            rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
>        }
> 
> +        /* This chip has hardware antenna diversity*/
> +        if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
> +            rt2x00dev->default_ant.tx = ANTENNA_HW_DIVERSITY; /* Unused */
> +            rt2x00dev->default_ant.rx = ANTENNA_HW_DIVERSITY; /* Unused */
> +
> +            rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
> +            rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
> +            rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
> +        }
> +
>        rt2800_bbp_read(rt2x00dev, 152, &value);
>        if (ant == 0)
>            rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);

Thanks for figuring this out. However, I think the default_ant initializations should be put at the place where the other initializations for the same field are (I believe that is somewhere in the rt2800_init_eeprom function (or a function with a similar name).
The BBP CSR writes are in the right place.

---
Gertjan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] rt2800: add chipset revision RT5390R support
  2012-04-20 17:07 ` Gertjan van Wingerde
@ 2012-04-23  7:50   ` Anisse Astier
  2012-04-23  9:56     ` Gertjan van Wingerde
  0 siblings, 1 reply; 8+ messages in thread
From: Anisse Astier @ 2012-04-23  7:50 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: linux-wireless, users, Julian Calaby, linville, RA-ShiangTu,
	Ivo van Doorn, Helmut Schaa, Kevin Chou, John Li, RA-Jay Hung

On Fri, 20 Apr 2012 19:07:38 +0200, Gertjan van Wingerde <gwingerde@gmail.com> wrote :

> Hi Anisse,
> 
> 
> On 18 apr. 2012, at 16:23, Anisse Astier <anisse@astier.eu> wrote:
> 
> > About 70% of the chips with revision RT5390R initialize incorrectly, using
> > the auxiliary antenna instead of the main one. The net result is that
> > signal reception is very poor (no AP further than 1M).
> > 
> > This chipset differs from RT5390 and RT5390F by its support of hardware
> > antenna diversity. Therefore antenna selection should be done
> > differently, by disabling software features and previously selected
> > antenna.
> > 
> > This changeset does just that, and makes all RT5390R work properly.
> > 
> > This is based on Ralink's 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO
> > driver.
> > 
> > Signed-off-by: Anisse Astier <anisse@astier.eu>
> > ---
> > drivers/net/wireless/rt2x00/rt2800.h    |    1 +
> > drivers/net/wireless/rt2x00/rt2800lib.c |   10 ++++++++++
> > 2 files changed, 11 insertions(+)
> > 
> > diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
> > index 063bfa8..1ce2634 100644
> > --- a/drivers/net/wireless/rt2x00/rt2800.h
> > +++ b/drivers/net/wireless/rt2x00/rt2800.h
> > @@ -83,6 +83,7 @@
> > #define REV_RT3090E            0x0211
> > #define REV_RT3390E            0x0211
> > #define REV_RT5390F            0x0502
> > +#define REV_RT5390R            0x1502
> > 
> > /*
> >  * Signal information.
> > diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> > index bd19802..6c95101 100644
> > --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> > +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> > @@ -3356,6 +3356,16 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
> >            rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
> >        }
> > 
> > +        /* This chip has hardware antenna diversity*/
> > +        if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
> > +            rt2x00dev->default_ant.tx = ANTENNA_HW_DIVERSITY; /* Unused */
> > +            rt2x00dev->default_ant.rx = ANTENNA_HW_DIVERSITY; /* Unused */
> > +
> > +            rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
> > +            rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
> > +            rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
> > +        }
> > +
> >        rt2800_bbp_read(rt2x00dev, 152, &value);
> >        if (ant == 0)
> >            rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);
> 
> Thanks for figuring this out. However, I think the default_ant initializations should be put at the place where the other initializations for the same field are (I believe that is somewhere in the rt2800_init_eeprom function (or a function with a similar name).

I'm not even sure those are needed. I put them there in case someone
would want to use them in the future. What do you think ?


> The BBP CSR writes are in the right place.
> 
> ---
> Gertjan

--
Anisse

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] rt2800: add chipset revision RT5390R support
  2012-04-23  7:50   ` Anisse Astier
@ 2012-04-23  9:56     ` Gertjan van Wingerde
  2012-04-23 10:33       ` [PATCH v2] " Anisse Astier
  0 siblings, 1 reply; 8+ messages in thread
From: Gertjan van Wingerde @ 2012-04-23  9:56 UTC (permalink / raw)
  To: Anisse Astier
  Cc: linux-wireless, users, Julian Calaby, linville, RA-ShiangTu,
	Ivo van Doorn, Helmut Schaa, Kevin Chou, John Li, RA-Jay Hung

On Mon, Apr 23, 2012 at 9:50 AM, Anisse Astier <anisse@astier.eu> wrote:
> On Fri, 20 Apr 2012 19:07:38 +0200, Gertjan van Wingerde <gwingerde@gmail.com> wrote :
>
>> Hi Anisse,
>>
>>
>> On 18 apr. 2012, at 16:23, Anisse Astier <anisse@astier.eu> wrote:
>>
>> > About 70% of the chips with revision RT5390R initialize incorrectly, using
>> > the auxiliary antenna instead of the main one. The net result is that
>> > signal reception is very poor (no AP further than 1M).
>> >
>> > This chipset differs from RT5390 and RT5390F by its support of hardware
>> > antenna diversity. Therefore antenna selection should be done
>> > differently, by disabling software features and previously selected
>> > antenna.
>> >
>> > This changeset does just that, and makes all RT5390R work properly.
>> >
>> > This is based on Ralink's 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO
>> > driver.
>> >
>> > Signed-off-by: Anisse Astier <anisse@astier.eu>
>> > ---
>> > drivers/net/wireless/rt2x00/rt2800.h    |    1 +
>> > drivers/net/wireless/rt2x00/rt2800lib.c |   10 ++++++++++
>> > 2 files changed, 11 insertions(+)
>> >
>> > diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
>> > index 063bfa8..1ce2634 100644
>> > --- a/drivers/net/wireless/rt2x00/rt2800.h
>> > +++ b/drivers/net/wireless/rt2x00/rt2800.h
>> > @@ -83,6 +83,7 @@
>> > #define REV_RT3090E            0x0211
>> > #define REV_RT3390E            0x0211
>> > #define REV_RT5390F            0x0502
>> > +#define REV_RT5390R            0x1502
>> >
>> > /*
>> >  * Signal information.
>> > diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
>> > index bd19802..6c95101 100644
>> > --- a/drivers/net/wireless/rt2x00/rt2800lib.c
>> > +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
>> > @@ -3356,6 +3356,16 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
>> >            rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
>> >        }
>> >
>> > +        /* This chip has hardware antenna diversity*/
>> > +        if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
>> > +            rt2x00dev->default_ant.tx = ANTENNA_HW_DIVERSITY; /* Unused */
>> > +            rt2x00dev->default_ant.rx = ANTENNA_HW_DIVERSITY; /* Unused */
>> > +
>> > +            rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
>> > +            rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
>> > +            rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
>> > +        }
>> > +
>> >        rt2800_bbp_read(rt2x00dev, 152, &value);
>> >        if (ant == 0)
>> >            rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);
>>
>> Thanks for figuring this out. However, I think the default_ant initializations should be put at the place where the other initializations for the same field are (I believe that is somewhere in the rt2800_init_eeprom function (or a function with a similar name).
>
> I'm not even sure those are needed. I put them there in case someone
> would want to use them in the future. What do you think ?
>

I would still include them, if only to signal that for these devices
we are using HW antenna diversity. However, as indicated, please put
them at the right spot in the code.

---
Gertjan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] rt2800: add chipset revision RT5390R support
  2012-04-23  9:56     ` Gertjan van Wingerde
@ 2012-04-23 10:33       ` Anisse Astier
  2012-05-03 16:10         ` Anisse Astier
  0 siblings, 1 reply; 8+ messages in thread
From: Anisse Astier @ 2012-04-23 10:33 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: linux-wireless, users, Julian Calaby, linville, Ivo van Doorn,
	Helmut Schaa, RA-ShiangTu, RA-Jay Hung, John Li, Kevin Chou,
	Anisse Astier

About 70% of the chips with revision RT5390R initialize incorrectly, using
the auxiliary antenna instead of the main one. The net result is that
signal reception is very poor (no AP further than 1M).

This chipset differs from RT5390 and RT5390F by its support of hardware
antenna diversity. Therefore antenna selection should be done
differently, by disabling software features and previously selected
antenna.

This changeset does just that, and makes all RT5390R work properly.

This is based on Ralink's 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO
driver.

Signed-off-by: Anisse Astier <anisse@astier.eu>
---
Changes since v1:
 - moved default_ant inits to proper function, thanks to Gertjan van Wingerde !

---
 drivers/net/wireless/rt2x00/rt2800.h    |    1 +
 drivers/net/wireless/rt2x00/rt2800lib.c |   12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 063bfa8..1ce2634 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -83,6 +83,7 @@
 #define REV_RT3090E			0x0211
 #define REV_RT3390E			0x0211
 #define REV_RT5390F			0x0502
+#define REV_RT5390R			0x1502
 
 /*
  * Signal information.
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index bd19802..1cd16b4 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3356,6 +3356,13 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
 			rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
 		}
 
+		/* This chip has hardware antenna diversity*/
+		if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
+			rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
+			rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
+			rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
+		}
+
 		rt2800_bbp_read(rt2x00dev, 152, &value);
 		if (ant == 0)
 			rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);
@@ -4291,6 +4298,11 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
 		rt2x00dev->default_ant.rx = ANTENNA_A;
 	}
 
+	if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
+		rt2x00dev->default_ant.tx = ANTENNA_HW_DIVERSITY; /* Unused */
+		rt2x00dev->default_ant.rx = ANTENNA_HW_DIVERSITY; /* Unused */
+	}
+
 	/*
 	 * Determine external LNA informations.
 	 */
-- 
1.7.9.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] rt2800: add chipset revision RT5390R support
  2012-04-23 10:33       ` [PATCH v2] " Anisse Astier
@ 2012-05-03 16:10         ` Anisse Astier
  2012-05-03 16:15           ` Gertjan van Wingerde
  0 siblings, 1 reply; 8+ messages in thread
From: Anisse Astier @ 2012-05-03 16:10 UTC (permalink / raw)
  To: Gertjan van Wingerde, linux-wireless, users
  Cc: Julian Calaby, linville, Ivo van Doorn, Helmut Schaa,
	RA-ShiangTu, RA-Jay Hung, John Li, Kevin Chou

Hi,

Any opinon on the patch below ?

On Mon, 23 Apr 2012 12:33:11 +0200, Anisse Astier <anisse@astier.eu> wrote :

> About 70% of the chips with revision RT5390R initialize incorrectly, using
> the auxiliary antenna instead of the main one. The net result is that
> signal reception is very poor (no AP further than 1M).
> 
> This chipset differs from RT5390 and RT5390F by its support of hardware
> antenna diversity. Therefore antenna selection should be done
> differently, by disabling software features and previously selected
> antenna.
> 
> This changeset does just that, and makes all RT5390R work properly.
> 
> This is based on Ralink's 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO
> driver.
> 
> Signed-off-by: Anisse Astier <anisse@astier.eu>
> ---
> Changes since v1:
>  - moved default_ant inits to proper function, thanks to Gertjan van Wingerde !
> 
> ---
>  drivers/net/wireless/rt2x00/rt2800.h    |    1 +
>  drivers/net/wireless/rt2x00/rt2800lib.c |   12 ++++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
> index 063bfa8..1ce2634 100644
> --- a/drivers/net/wireless/rt2x00/rt2800.h
> +++ b/drivers/net/wireless/rt2x00/rt2800.h
> @@ -83,6 +83,7 @@
>  #define REV_RT3090E			0x0211
>  #define REV_RT3390E			0x0211
>  #define REV_RT5390F			0x0502
> +#define REV_RT5390R			0x1502
>  
>  /*
>   * Signal information.
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index bd19802..1cd16b4 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -3356,6 +3356,13 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
>  			rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
>  		}
>  
> +		/* This chip has hardware antenna diversity*/
> +		if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
> +			rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
> +			rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
> +			rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
> +		}
> +
>  		rt2800_bbp_read(rt2x00dev, 152, &value);
>  		if (ant == 0)
>  			rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);
> @@ -4291,6 +4298,11 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
>  		rt2x00dev->default_ant.rx = ANTENNA_A;
>  	}
>  
> +	if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
> +		rt2x00dev->default_ant.tx = ANTENNA_HW_DIVERSITY; /* Unused */
> +		rt2x00dev->default_ant.rx = ANTENNA_HW_DIVERSITY; /* Unused */
> +	}
> +
>  	/*
>  	 * Determine external LNA informations.
>  	 */


Regards,

Anisse

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] rt2800: add chipset revision RT5390R support
  2012-05-03 16:10         ` Anisse Astier
@ 2012-05-03 16:15           ` Gertjan van Wingerde
  2012-05-03 16:23             ` Anisse Astier
  0 siblings, 1 reply; 8+ messages in thread
From: Gertjan van Wingerde @ 2012-05-03 16:15 UTC (permalink / raw)
  To: Anisse Astier
  Cc: linux-wireless, users, Julian Calaby, linville, Ivo van Doorn,
	Helmut Schaa, RA-ShiangTu, RA-Jay Hung, John Li, Kevin Chou

Hi Anisse,

On 05/03/12 18:10, Anisse Astier wrote:
> Hi,
> 
> Any opinon on the patch below ?
> 

Since the patch has already been merged by John I didn't think it was
necessary anymore to comment, as I has no issues with the patch anymore.

> On Mon, 23 Apr 2012 12:33:11 +0200, Anisse Astier <anisse@astier.eu> wrote :
> 
>> About 70% of the chips with revision RT5390R initialize incorrectly, using
>> the auxiliary antenna instead of the main one. The net result is that
>> signal reception is very poor (no AP further than 1M).
>>
>> This chipset differs from RT5390 and RT5390F by its support of hardware
>> antenna diversity. Therefore antenna selection should be done
>> differently, by disabling software features and previously selected
>> antenna.
>>
>> This changeset does just that, and makes all RT5390R work properly.
>>
>> This is based on Ralink's 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO
>> driver.
>>
>> Signed-off-by: Anisse Astier <anisse@astier.eu>
>> ---
>> Changes since v1:
>>  - moved default_ant inits to proper function, thanks to Gertjan van Wingerde !
>>
>> ---
>>  drivers/net/wireless/rt2x00/rt2800.h    |    1 +
>>  drivers/net/wireless/rt2x00/rt2800lib.c |   12 ++++++++++++
>>  2 files changed, 13 insertions(+)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
>> index 063bfa8..1ce2634 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800.h
>> +++ b/drivers/net/wireless/rt2x00/rt2800.h
>> @@ -83,6 +83,7 @@
>>  #define REV_RT3090E			0x0211
>>  #define REV_RT3390E			0x0211
>>  #define REV_RT5390F			0x0502
>> +#define REV_RT5390R			0x1502
>>  
>>  /*
>>   * Signal information.
>> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
>> index bd19802..1cd16b4 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
>> @@ -3356,6 +3356,13 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
>>  			rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
>>  		}
>>  
>> +		/* This chip has hardware antenna diversity*/
>> +		if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
>> +			rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
>> +			rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
>> +			rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
>> +		}
>> +
>>  		rt2800_bbp_read(rt2x00dev, 152, &value);
>>  		if (ant == 0)
>>  			rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);
>> @@ -4291,6 +4298,11 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
>>  		rt2x00dev->default_ant.rx = ANTENNA_A;
>>  	}
>>  
>> +	if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
>> +		rt2x00dev->default_ant.tx = ANTENNA_HW_DIVERSITY; /* Unused */
>> +		rt2x00dev->default_ant.rx = ANTENNA_HW_DIVERSITY; /* Unused */
>> +	}
>> +
>>  	/*
>>  	 * Determine external LNA informations.
>>  	 */
> 
> 
> Regards,
> 
> Anisse


-- 
---
Gertjan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] rt2800: add chipset revision RT5390R support
  2012-05-03 16:15           ` Gertjan van Wingerde
@ 2012-05-03 16:23             ` Anisse Astier
  0 siblings, 0 replies; 8+ messages in thread
From: Anisse Astier @ 2012-05-03 16:23 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: linux-wireless, users, Julian Calaby, linville, Ivo van Doorn,
	Helmut Schaa, RA-ShiangTu, RA-Jay Hung, John Li, Kevin Chou

On Thu, 03 May 2012 18:15:00 +0200, Gertjan van Wingerde <gwingerde@gmail.com> wrote :

> Hi Anisse,
> 
> On 05/03/12 18:10, Anisse Astier wrote:
> > Hi,
> > 
> > Any opinon on the patch below ?
> > 
> 
> Since the patch has already been merged by John I didn't think it was
> necessary anymore to comment, as I has no issues with the patch anymore.
> 

Oh, sorry, I was expecting an "Applied" email.

I should have checked if it was merged first, mea culpa.


Anisse

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-03 16:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-18 14:23 [PATCH] rt2800: add chipset revision RT5390R support Anisse Astier
2012-04-20 17:07 ` Gertjan van Wingerde
2012-04-23  7:50   ` Anisse Astier
2012-04-23  9:56     ` Gertjan van Wingerde
2012-04-23 10:33       ` [PATCH v2] " Anisse Astier
2012-05-03 16:10         ` Anisse Astier
2012-05-03 16:15           ` Gertjan van Wingerde
2012-05-03 16:23             ` Anisse Astier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.