Message ID | 20221229021131.9361-1-MeiChia.Chiu@mediatek.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Felix Fietkau |
Headers | show |
Series | wifi: mt76: mt7915: remove BW80+80 support | expand |
On 12/28/22 6:11 PM, MeiChia Chiu wrote: > mt7915 doesn't support bw80+80. You are removing a bunch of 160Mhz support flags as well, was that on purpose? From what I can tell, 7915 does support 160Mhz in 2x2 mode. Thanks, Ben > > 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> > --- > .../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); > >
Il 29/12/22 03:11, MeiChia Chiu ha scritto: > mt7915 doesn't support bw80+80. > > 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> On AW7915-NP1 mPCIe: Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
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);