Skip to content

Commit da11854

Browse files
committed
wifi: iwlwifi: mvm: fix EOF bit reporting
In monitor mode, we try to report the EOF bit on the first MPDU of an A-MPDU (hardware duplicates this bit over all MPDUs, so it's only trustable on the first). However, due to reshuffling in an ealier commit, the toggle_bit != mvm->ampdu_toggle logic can no longer work since mvm->ampdu_toggle is now set before this code runs. Fix this by tracking the first_subframe status in the phy data struct and using that instead of checking. Fixes: f149054 ("wifi: iwlwifi: mvm: rxmq: refactor mac80211 rx_status setting") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230305124407.e273aa0d3fdc.I77db4cc247898eae8a98b80659386d6737052b95@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent b55c1f4 commit da11854

File tree

1 file changed

+10
-18
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+10
-18
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ struct iwl_mvm_rx_phy_data {
11801180
__le32 d0, d1, d2, d3, eht_d4, d5;
11811181
__le16 d4;
11821182
bool with_data;
1183+
bool first_subframe;
11831184
__le32 rx_vec[4];
11841185

11851186
u32 rate_n_flags;
@@ -1885,15 +1886,10 @@ static void iwl_mvm_rx_eht(struct iwl_mvm *mvm, struct sk_buff *skb,
18851886

18861887
/* update aggregation data for monitor sake on default queue */
18871888
if (!queue && (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) &&
1888-
(phy_info & IWL_RX_MPDU_PHY_AMPDU)) {
1889-
bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE;
1890-
1891-
/* toggle is switched whenever new aggregation starts */
1892-
if (toggle_bit != mvm->ampdu_toggle) {
1893-
rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN;
1894-
if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_EHT_DELIM_EOF))
1895-
rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT;
1896-
}
1889+
(phy_info & IWL_RX_MPDU_PHY_AMPDU) && phy_data->first_subframe) {
1890+
rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN;
1891+
if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_EHT_DELIM_EOF))
1892+
rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT;
18971893
}
18981894

18991895
if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD)
@@ -2036,15 +2032,10 @@ static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb,
20362032

20372033
/* update aggregation data for monitor sake on default queue */
20382034
if (!queue && (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) &&
2039-
(phy_info & IWL_RX_MPDU_PHY_AMPDU)) {
2040-
bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE;
2041-
2042-
/* toggle is switched whenever new aggregation starts */
2043-
if (toggle_bit != mvm->ampdu_toggle) {
2044-
rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN;
2045-
if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF))
2046-
rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT;
2047-
}
2035+
(phy_info & IWL_RX_MPDU_PHY_AMPDU) && phy_data->first_subframe) {
2036+
rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN;
2037+
if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_EHT_DELIM_EOF))
2038+
rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT;
20482039
}
20492040

20502041
if (he_type == RATE_MCS_HE_TYPE_EXT_SU &&
@@ -2447,6 +2438,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
24472438
if (mvm->ampdu_ref == 0)
24482439
mvm->ampdu_ref++;
24492440
mvm->ampdu_toggle = toggle_bit;
2441+
phy_data.first_subframe = true;
24502442
}
24512443
rx_status->ampdu_reference = mvm->ampdu_ref;
24522444
}

0 commit comments

Comments
 (0)