Skip to content

Commit

Permalink
mt76: mt7915: fix he_mcs capabilities for 160mhz
Browse files Browse the repository at this point in the history
At 160, this chip can only do 2x2 NSS.  Fix the features
accordingly, verified it shows up properly in iw phy foo info
now.

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
greearb authored and nbd168 committed Sep 24, 2021
1 parent 8044311 commit 28da4ba
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions mt7915/init.c
Original file line number Diff line number Diff line change
@@ -649,12 +649,19 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
{
int i, idx = 0, nss = hweight8(phy->mt76->chainmask);
u16 mcs_map = 0;
u16 mcs_map_160 = 0;

for (i = 0; i < 8; i++) {
if (i < nss)
mcs_map |= (IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2));
else
mcs_map |= (IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2));

/* Can do 1/2 of NSS streams in 160Mhz mode. */
if (i < nss / 2)
mcs_map_160 |= (IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2));
else
mcs_map_160 |= (IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2));
}

for (i = 0; i < NUM_NL80211_IFTYPES; i++) {
@@ -756,10 +763,10 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,

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);
he_mcs->tx_mcs_160 = cpu_to_le16(mcs_map);
he_mcs->rx_mcs_80p80 = cpu_to_le16(mcs_map);
he_mcs->tx_mcs_80p80 = 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(he_cap, i, nss);

0 comments on commit 28da4ba

Please sign in to comment.