linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ryder Lee <ryder.lee@mediatek.com>
To: Deren Wu <deren.wu@mediatek.com>, Felix Fietkau <nbd@nbd.name>,
	"Lorenzo Bianconi" <lorenzo.bianconi@redhat.com>
Cc: Sean Wang <sean.wang@mediatek.com>,
	Soul Huang <Soul.Huang@mediatek.com>,
	YN Chen <YN.Chen@mediatek.com>, Leon Yen <Leon.Yen@mediatek.com>,
	Eric-SY Chang <Eric-SY.Chang@mediatek.com>,
	KM Lin <km.lin@mediatek.com>,
	Robin Chiu <robin.chiu@mediatek.com>,
	CH Yeh <ch.yeh@mediatek.com>, Posh Sun <posh.sun@mediatek.com>,
	Eric Liang <Eric.Liang@mediatek.com>,
	Stella Chang <Stella.Chang@mediatek.com>,
	"Evelyn Tsai" <evelyn.tsai@mediatek.com>,
	Shayne Chen <shayne.chen@mediatek.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	linux-mediatek <linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v2] mt76: mt7921: introduce 160 MHz channel bandwidth support
Date: Sat, 13 Nov 2021 12:08:07 +0800	[thread overview]
Message-ID: <ee169af76f1d45b6178204585489c187dae97757.camel@mediatek.com> (raw)
In-Reply-To: <6978659235747261d652379d7d1a823f6b2f6505.camel@mediatek.com>

On Sat, 2021-11-13 at 11:39 +0800, Deren Wu wrote:
> On Sat, 2021-11-13 at 03:12 +0800, Ryder Lee wrote:
> > On Mon, 2021-11-08 at 22:41 +0800, Deren Wu wrote:
> > > From: Deren Wu <deren.wu@mediatek.com>
> > > 
> > > Introduce the basic configuration for chips with BW160 capability
> > > 
> > > Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> > > ---
> > >  drivers/net/wireless/mediatek/mt76/mt76.h            |  1 +
> > >  drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c |  1 +
> > >  drivers/net/wireless/mediatek/mt76/mt7921/init.c     |  4 ++++
> > >  drivers/net/wireless/mediatek/mt76/mt7921/main.c     | 12
> > > ++++++++++++
> > >  4 files changed, 18 insertions(+)
> > > 
> > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h
> > > b/drivers/net/wireless/mediatek/mt76/mt76.h
> > > index e2da720a91b6..babca8086027 100644
> > > --- a/drivers/net/wireless/mediatek/mt76/mt76.h
> > > +++ b/drivers/net/wireless/mediatek/mt76/mt76.h
> > > @@ -346,6 +346,7 @@ struct mt76_hw_cap {
> > >  	bool has_2ghz;
> > >  	bool has_5ghz;
> > >  	bool has_6ghz;
> > > +	bool has_bw160;
> > >  };
> > >  
> > >  #define MT_DRV_TXWI_NO_FREE		BIT(0)
> > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > > b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > > index 26b4b875dcc0..3b42e1e8e970 100644
> > > --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > > +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > > @@ -1775,6 +1775,7 @@ static void
> > > mt76_connac_mcu_parse_phy_cap(struct mt76_dev *dev,
> > >  	dev->phy.chainmask = dev->phy.antenna_mask;
> > >  	dev->phy.cap.has_2ghz = cap->hw_path & BIT(WF0_24G);
> > >  	dev->phy.cap.has_5ghz = cap->hw_path & BIT(WF0_5G);
> > > +	dev->phy.cap.has_bw160 = cap->max_bw ==
> > > IEEE80211_STA_RX_BW_160;
> > >  }
> > >  
> > >  int mt76_connac_mcu_get_nic_capability(struct mt76_phy *phy)
> > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> > > b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> > > index 210998f086ab..30c0246fba3a 100644
> > > --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> > > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> > > @@ -264,6 +264,10 @@ int mt7921_register_device(struct mt7921_dev
> > > *dev)
> > >  			IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
> > >  			IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |
> > >  			(3 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT);
> > > +	if (dev->mt76.phy.cap.has_bw160)
> > > +		dev->mphy.sband_5g.sband.vht_cap.cap |=
> > > +			IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ |
> > > +			IEEE80211_VHT_CAP_SHORT_GI_160;
> > >  
> > >  	dev->mphy.hw->wiphy->available_antennas_rx = dev-
> > > > mphy.chainmask;
> > > 
> > >  	dev->mphy.hw->wiphy->available_antennas_tx = dev-
> > > > mphy.chainmask;
> > > 
> > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> > > b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> > > index 633c6d2a57ac..af8c675f909f 100644
> > > --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> > > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> > > @@ -128,11 +128,23 @@ mt7921_init_he_caps(struct mt7921_phy *phy,
> > > enum nl80211_band band,
> > >  				IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_
> > > THAN_242_TONE_RU |
> > >  				IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USI
> > > NG_MU_WITH_COMP_SIGB |
> > >  				IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USI
> > > NG_MU_WITH_NON_COMP_SIGB;
> > > +
> > > +			if (phy->mt76->cap.has_bw160) {
> > > +				he_cap_elem->phy_cap_info[0] |=
> > > +					IEEE80211_HE_PHY_CAP0_CHANNEL_W
> > > IDTH_SET_160MHZ_IN_5G;
> > > +				he_cap_elem->phy_cap_info[8] |=
> > > +					IEEE80211_HE_PHY_CAP8_20MHZ_IN_
> > > 160MHZ_HE_PPDU |
> > > +					IEEE80211_HE_PHY_CAP8_80MHZ_IN_
> > > 160MHZ_HE_PPDU;
> > > +			}
> > >  			break;
> > >  		}
> > >  
> > >  		he_mcs->rx_mcs_80 = cpu_to_le16(mcs_map);
> > >  		he_mcs->tx_mcs_80 = cpu_to_le16(mcs_map);
> > > +		if (phy->mt76->cap.has_bw160) {
> > > +			he_mcs->rx_mcs_160 = cpu_to_le16(mcs_map);
> > > +			he_mcs->tx_mcs_160 = cpu_to_le16(mcs_map);
> > > +		}
> > >  
> > 
> > But what about 80p80Mhz case?
> > 
> > Ryder
> > 
> 
> Since 80p80MHz is not supprted in mt7921, we should not register this
> capability to mac80211. When the feature coming, we may have a new
> config cap.has_bw80p80 to adapte the new flow.
> 
Then, how to tell 80p80M and 160M apart with only checking
IEEE80211_STA_RX_BW_160? 

 * @IEEE80211_STA_RX_BW_160: station can receive up to 160 MHz
 *	(including 80+80 MHz)

Maybe move has_bw80p80 into mt7921_dev as it is not generic to me?


  reply	other threads:[~2021-11-13  4:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 14:41 [PATCH v2] mt76: mt7921: introduce 160 MHz channel bandwidth support Deren Wu
2021-11-12 19:12 ` Ryder Lee
2021-11-13  3:39   ` Deren Wu
2021-11-13  4:08     ` Ryder Lee [this message]
2021-11-14  2:34       ` Deren Wu
2021-11-14  5:34         ` Ryder Lee

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=ee169af76f1d45b6178204585489c187dae97757.camel@mediatek.com \
    --to=ryder.lee@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=deren.wu@mediatek.com \
    --cc=evelyn.tsai@mediatek.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.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;
as well as URLs for NNTP newsgroup(s).