@@ -316,8 +316,13 @@ struct mt76_wcid {
struct ewma_signal rssi;
int inactive_count;
+ /* cached rate, updated from mac_sta_poll() and from TXS callback logic,
+ * in 7915 at least.
+ */
struct rate_info rate;
unsigned long ampdu_state;
+ bool rate_short_gi; /* cached HT/VHT short_gi, from mac_sta_poll() */
+ u8 rate_he_gi; /* cached HE GI, from mac_sta_poll() */
u16 idx;
u8 hw_key_idx;
@@ -657,7 +657,7 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
return false;
rate.flags = RATE_INFO_FLAGS_MCS;
- if (wcid->rate.flags & RATE_INFO_FLAGS_SHORT_GI)
+ if (wcid->rate_short_gi)
rate.flags |= RATE_INFO_FLAGS_SHORT_GI;
break;
case MT_PHY_TYPE_VHT:
@@ -665,6 +665,8 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
return false;
rate.flags = RATE_INFO_FLAGS_VHT_MCS;
+ if (wcid->rate_short_gi)
+ rate.flags |= RATE_INFO_FLAGS_SHORT_GI;
break;
case MT_PHY_TYPE_HE_SU:
case MT_PHY_TYPE_HE_EXT_SU:
@@ -673,7 +675,7 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
if (rate.mcs > 11)
return false;
- rate.he_gi = wcid->rate.he_gi;
+ rate.he_gi = wcid->rate_he_gi;
rate.he_dcm = FIELD_GET(MT_TX_RATE_DCM, txrate);
rate.flags = RATE_INFO_FLAGS_HE_MCS;
break;
@@ -202,12 +202,16 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev)
u8 offs = 24 + 2 * bw;
rate->he_gi = (val & (0x3 << offs)) >> offs;
+ msta->wcid.rate_he_gi = rate->he_gi; /* cache for later */
} else if (rate->flags &
(RATE_INFO_FLAGS_VHT_MCS | RATE_INFO_FLAGS_MCS)) {
- if (val & BIT(12 + bw))
+ if (val & BIT(12 + bw)) {
rate->flags |= RATE_INFO_FLAGS_SHORT_GI;
- else
+ msta->wcid.rate_short_gi = 1;
+ } else {
rate->flags &= ~RATE_INFO_FLAGS_SHORT_GI;
+ msta->wcid.rate_short_gi = 0;
+ }
}
/* get signal strength of resp frames (CTS/BA/ACK) */
@@ -2115,6 +2119,7 @@ mt7915_dfs_init_radar_specs(struct mt7915_phy *phy)
radar_specs = &jp_radar_specs;
break;
default:
+ WARN_ON_ONCE(true);
return -EINVAL;
}
@@ -137,12 +137,17 @@ static void mt7921_mac_sta_poll(struct mt792x_dev *dev)
u8 offs = MT_WTBL_TXRX_RATE_G2_HE + 2 * bw;
rate->he_gi = (val & (0x3 << offs)) >> offs;
+ msta->wcid.rate_he_gi = rate->he_gi; /* cache for later */
} else if (rate->flags &
(RATE_INFO_FLAGS_VHT_MCS | RATE_INFO_FLAGS_MCS)) {
- if (val & BIT(MT_WTBL_TXRX_RATE_G2 + bw))
+ if (val & BIT(MT_WTBL_TXRX_RATE_G2 + bw)) {
rate->flags |= RATE_INFO_FLAGS_SHORT_GI;
- else
+ msta->wcid.rate_short_gi = 1;
+ }
+ else {
rate->flags &= ~RATE_INFO_FLAGS_SHORT_GI;
+ msta->wcid.rate_short_gi = 0;
+ }
}
/* get signal strength of resp frames (CTS/BA/ACK) */