All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Natalenko <oleksandr@natalenko.name>
To: Felix Fietkau <nbd@nbd.name>, MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
	Shayne Chen <shayne.chen@mediatek.com>,
	Evelyn Tsai <evelyn.tsai@mediatek.com>,
	Ryder Lee <ryder.lee@mediatek.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	MeiChia Chiu <MeiChia.Chiu@mediatek.com>,
	Money Wang <Money.Wang@mediatek.com>,
	Kalle Valo <kvalo@kernel.org>
Subject: Re: [PATCH v2] wifi: mt76: mt7915: remove BW160 and BW80+80 support
Date: Sat, 29 Apr 2023 13:18:19 +0200	[thread overview]
Message-ID: <2313900.mqelP9QxOF@natalenko.name> (raw)
In-Reply-To: <20230104090352.31938-1-MeiChia.Chiu@mediatek.com>

Hello.

On středa 4. ledna 2023 10:03:52 CEST MeiChia Chiu wrote:
> Remove BW160 and BW80+80 capability in mt7915.
> 
> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
> Reviewed-by: Shayne Chen <shayne.chen@mediatek.com>
> Signed-off-by: Money Wang<Money.Wang@mediatek.com>
> Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
> ---
> v2: update commit message and title
> ---
>  .../net/wireless/mediatek/mt76/mt7915/init.c  | 38 +++++--------------
>  1 file changed, 9 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> index 571c94835942..c72d673f02dd 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> @@ -38,8 +38,7 @@ static const struct ieee80211_iface_combination if_comb[] = {
>  				       BIT(NL80211_CHAN_WIDTH_20) |
>  				       BIT(NL80211_CHAN_WIDTH_40) |
>  				       BIT(NL80211_CHAN_WIDTH_80) |
> -				       BIT(NL80211_CHAN_WIDTH_160) |
> -				       BIT(NL80211_CHAN_WIDTH_80P80),
> +				       BIT(NL80211_CHAN_WIDTH_160),
>  	}
>  };
>  
> @@ -394,11 +393,6 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
>  			phy->mt76->sband_5g.sband.vht_cap.cap |=
>  				IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 |
>  				IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK;
> -
> -			if (!dev->dbdc_support)
> -				phy->mt76->sband_5g.sband.vht_cap.cap |=
> -					IEEE80211_VHT_CAP_SHORT_GI_160 |
> -					IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ;
>  		} else {
>  			phy->mt76->sband_5g.sband.vht_cap.cap |=
>  				IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |
> @@ -834,13 +828,9 @@ mt7915_set_stream_he_txbf_caps(struct mt7915_phy *phy,
>  	int sts = hweight8(phy->mt76->chainmask);
>  	u8 c, sts_160 = sts;
>  
> -	/* Can do 1/2 of STS in 160Mhz mode for mt7915 */
> -	if (is_mt7915(&dev->mt76)) {
> -		if (!dev->dbdc_support)
> -			sts_160 /= 2;
> -		else
> -			sts_160 = 0;
> -	}
> +	/* mt7915 doesn't support bw160 */
> +	if (is_mt7915(&dev->mt76))
> +		sts_160 = 0;
>  
>  #ifdef CONFIG_MAC80211_MESH
>  	if (vif == NL80211_IFTYPE_MESH_POINT)
> @@ -894,9 +884,6 @@ mt7915_set_stream_he_txbf_caps(struct mt7915_phy *phy,
>  	elem->phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER;
>  	elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER;
>  
> -	/* num_snd_dim
> -	 * for mt7915, max supported sts is 2 for bw > 80MHz and 0 if dbdc
> -	 */
>  	c = FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK,
>  		       sts - 1);
>  	if (sts_160)
> @@ -944,15 +931,10 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
>  	int i, idx = 0, nss = hweight8(phy->mt76->antenna_mask);
>  	u16 mcs_map = 0;
>  	u16 mcs_map_160 = 0;
> -	u8 nss_160;
> +	u8 nss_160 = nss;
>  
> -	if (!is_mt7915(&dev->mt76))
> -		nss_160 = nss;
> -	else if (!dev->dbdc_support)
> -		/* Can do 1/2 of NSS streams in 160Mhz mode for mt7915 */
> -		nss_160 = nss / 2;
> -	else
> -		/* Can't do 160MHz with mt7915 dbdc */
> +	/* Can't do 160MHz with mt7915 */
> +	if (is_mt7915(&dev->mt76))
>  		nss_160 = 0;
>  
>  	for (i = 0; i < 8; i++) {
> @@ -1002,8 +984,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
>  		else if (nss_160)
>  			he_cap_elem->phy_cap_info[0] =
>  				IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G |
> -				IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G |
> -				IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G;
> +				IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G;
>  		else
>  			he_cap_elem->phy_cap_info[0] =
>  				IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G;
> @@ -1075,12 +1056,11 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
>  			break;
>  		}
>  
> +		memset(he_mcs, 0, sizeof(*he_mcs));
>  		he_mcs->rx_mcs_80 = cpu_to_le16(mcs_map);
>  		he_mcs->tx_mcs_80 = cpu_to_le16(mcs_map);
>  		he_mcs->rx_mcs_160 = cpu_to_le16(mcs_map_160);
>  		he_mcs->tx_mcs_160 = cpu_to_le16(mcs_map_160);
> -		he_mcs->rx_mcs_80p80 = cpu_to_le16(mcs_map_160);
> -		he_mcs->tx_mcs_80p80 = cpu_to_le16(mcs_map_160);
>  
>  		mt7915_set_stream_he_txbf_caps(phy, he_cap, i);

I was negatively surprised by this as I had `VHT160-80PLUS80` in my hostapd config file, and the AP worked just fine, and stopped working after upgrading the machine to v6.3.

I do understand that the chip doesn't support 80+80, and my AP just works in VHT160 mode, so replacing `VHT160-80PLUS80` with `VHT160` in the config fixed the issue for me. Thanks for bringing BW160 back later in c2f73eacee3b.

But I do want to point out that the commit message should explain the reason for removal. Also, I'm one of those users of:

```
01:00.0 Unclassified device [0002]: MEDIATEK Corp. MT7915E 802.11ax PCI Express Wireless Network Adapter
```

for whom BW160 works just fine.

Thanks.

-- 
Oleksandr Natalenko (post-factum)




      parent reply	other threads:[~2023-04-29 11:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04  9:03 [PATCH v2] wifi: mt76: mt7915: remove BW160 and BW80+80 support MeiChia Chiu
2023-02-13 12:44 ` Kalle Valo
2023-04-29 11:18 ` Oleksandr Natalenko [this message]

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=2313900.mqelP9QxOF@natalenko.name \
    --to=oleksandr@natalenko.name \
    --cc=MeiChia.Chiu@mediatek.com \
    --cc=Money.Wang@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=evelyn.tsai@mediatek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@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 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.