From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Cc: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mt76x0: antenna select corrections
Date: Thu, 18 Oct 2018 11:40:59 +0200 [thread overview]
Message-ID: <20181018094055.GA6294@redhat.com> (raw)
In-Reply-To: <20181018092819.GC4938@localhost.localdomain>
On Thu, Oct 18, 2018 at 11:28:19AM +0200, Lorenzo Bianconi wrote:
> > On Thu, Oct 18, 2018 at 11:13:36AM +0200, Lorenzo Bianconi wrote:
> > > > static void mt76x0_phy_ant_select(struct mt76x02_dev *dev)
> > > > {
> > > > - struct ieee80211_channel *chan = dev->mt76.chandef.chan;
> > > > -
> > > > - /* single antenna mode */
> > > > - if (chan->band == NL80211_BAND_2GHZ) {
> > > > - mt76_rmw(dev, MT_COEXCFG3,
> > > > - BIT(5) | BIT(4) | BIT(3) | BIT(2), BIT(1));
> > > > - mt76_rmw(dev, MT_WLAN_FUN_CTRL, BIT(5), BIT(6));
> > > > + u16 ee_ant = mt76x02_eeprom_get(dev, MT_EE_ANTENNA);
> > > > + u16 nic_conf2 = mt76x02_eeprom_get(dev, MT_EE_NIC_CONF_2);
> > > > + u32 wlan, coex3, cmb;
> > > > + bool ant_div;
> > > > +
> > > > + wlan = mt76_rr(dev, MT_WLAN_FUN_CTRL);
> > > > + cmb = mt76_rr(dev, MT_CMB_CTRL);
> > > > + coex3 = mt76_rr(dev, MT_COEXCFG3);
> > > > +
> > > > + cmb &= ~(BIT(15) | BIT(12));
> > >
> > > I guess should be BIT(14) here (at least for single antenna mode)
> >
> > Yes , I will fix it.
> >
> > > > + coex3 &= ~GENMASK(5, 1);
> > >
> > > according to vendor sdk BIT(1) should not cleared if device supports 5GHz band
> > > (signle antenna mode)
> >
> > It is set below for that case:
>
> it is set just if the device does not support 5GHz band but it is cleared in
> the other case (and sdk driver does not clear it in that case, do not know if
> it does a real difference)
On GPL realeased driver for MT7610U ( mt7610u_wifi_sta_v3002_dpo_2013091 )
it's like this:
CoexCfg3 &= ~(BIT5 | BIT4 | BIT3 | BIT2 | BIT1);
<snip>
{
if (WMODE_CAP_5G(pAd->CommonCfg.PhyMode))
{
CoexCfg3 |= (BIT3 | BIT4); /* 0x4C[3]=1, 0x4C[4]=1 */
}
else
{
WlanFunCtrl |= BIT6; /* 0x80[6]=1 */
CoexCfg3 |= BIT1; /* 0x4C[1]=1 */
}
DBGPRINT(RT_DEBUG_ERROR, ("%s - Single antenna mode\n", __FUNCTION__));
}
Which I belive is reflected in my patch in this parts:
coex3 &= ~GENMASK(5, 1);
<snip>
if (dev->mt76.cap.has_5ghz) {
coex3 |= BIT(3) | BIT(4);
} else {
wlan |= BIT(6);
coex3 |= BIT(1);
}
Does your SDK do something diffrent ?
Thanks
Stanislaw
next prev parent reply other threads:[~2018-10-18 9:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-18 8:07 [PATCH] mt76x0: antenna select corrections Stanislaw Gruszka
2018-10-18 9:13 ` Lorenzo Bianconi
2018-10-18 9:21 ` Stanislaw Gruszka
2018-10-18 9:28 ` Lorenzo Bianconi
2018-10-18 9:40 ` Stanislaw Gruszka [this message]
2018-10-18 9:45 ` Lorenzo Bianconi
2018-10-18 9:53 ` Stanislaw Gruszka
2018-10-18 9:54 ` Lorenzo Bianconi
2018-10-18 10:02 ` Lorenzo Bianconi
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=20181018094055.GA6294@redhat.com \
--to=sgruszka@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
/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).