From: Anisse Astier <anisse@astier.eu>
To: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"users@rt2x00.serialmonkey.com" <users@rt2x00.serialmonkey.com>,
Julian Calaby <julian.calaby@gmail.com>,
"linville@tuxdriver.com" <linville@tuxdriver.com>,
RA-ShiangTu <Shiang_Tu@ralinktech.com>,
Ivo van Doorn <IvDoorn@gmail.com>,
Helmut Schaa <helmut.schaa@googlemail.com>,
Kevin Chou <kevin.chou@mediatek.com>,
John Li <chen-yang.li@mediatek.com>,
RA-Jay Hung <Jay_Hung@ralinktech.com>
Subject: Re: [PATCH] rt2800: add chipset revision RT5390R support
Date: Mon, 23 Apr 2012 09:50:01 +0200 [thread overview]
Message-ID: <20120423095001.50af46cf@destiny.ordissimo> (raw)
In-Reply-To: <BD323515-0FC1-4A0C-A5EC-92DBC75153CB@gmail.com>
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
next prev parent reply other threads:[~2012-04-23 7:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=20120423095001.50af46cf@destiny.ordissimo \
--to=anisse@astier.eu \
--cc=IvDoorn@gmail.com \
--cc=Jay_Hung@ralinktech.com \
--cc=Shiang_Tu@ralinktech.com \
--cc=chen-yang.li@mediatek.com \
--cc=gwingerde@gmail.com \
--cc=helmut.schaa@googlemail.com \
--cc=julian.calaby@gmail.com \
--cc=kevin.chou@mediatek.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