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:21:47 +0200 [thread overview]
Message-ID: <20181018092146.GC2190@redhat.com> (raw)
In-Reply-To: <20181018091335.GB4938@localhost.localdomain>
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:
> > + if (dev->mt76.cap.has_5ghz) {
> > + coex3 |= BIT(3) | BIT(4);
> > + } else {
> > + wlan |= BIT(6);
> > + coex3 |= BIT(1);
> > + }
Thanks
Stanislaw
next prev parent reply other threads:[~2018-10-18 9:21 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 [this message]
2018-10-18 9:28 ` Lorenzo Bianconi
2018-10-18 9:40 ` Stanislaw Gruszka
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=20181018092146.GC2190@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).