git: 26a36948331b - main - iwlwifi: move an ieee80211_get_tid() call
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 31 Aug 2022 23:09:21 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=26a36948331bd08d9afaddfc0da724eacdb953dd
commit 26a36948331bd08d9afaddfc0da724eacdb953dd
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-08-31 23:01:36 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-08-31 23:01:36 +0000
iwlwifi: move an ieee80211_get_tid() call
Introduce a local change. It seems ieee80211_get_tid() does not deal
with non-dataqos packets unlike net80211's ieee80211_gettid().
Gernally all calls in Linux drivers to ieee80211_get_tid() seem to
be proceeded by an ieee80211_is_data_qos() check.
Moving the ieee80211_get_tid() has no difference in the result, but
(a) saves us the call if we do not need it due to an earlier return,
and (b) allows us to put an assert into the LinuxKPI ieee80211_get_tid()
implementation to avoid accidentally returning random frame header data
in case of a missing earlier ieee80211_is_data_qos() check in (future/
other) drivers.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
---
sys/contrib/dev/iwlwifi/mvm/rxmq.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sys/contrib/dev/iwlwifi/mvm/rxmq.c b/sys/contrib/dev/iwlwifi/mvm/rxmq.c
index 1e8a5611b9f2..7325e9d44273 100644
--- a/sys/contrib/dev/iwlwifi/mvm/rxmq.c
+++ b/sys/contrib/dev/iwlwifi/mvm/rxmq.c
@@ -963,7 +963,11 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
bool amsdu = desc->mac_flags2 & IWL_RX_MPDU_MFLG2_AMSDU;
bool last_subframe =
desc->amsdu_info & IWL_RX_MPDU_AMSDU_LAST_SUBFRAME;
+#if defined(__linux__)
u8 tid = ieee80211_get_tid(hdr);
+#elif defined(__FreeBSD__)
+ u8 tid;
+#endif
u8 sub_frame_idx = desc->amsdu_info &
IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK;
struct iwl_mvm_reorder_buf_entry *entries;
@@ -1008,6 +1012,9 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
return false;
}
+#if defined(__FreeBSD__)
+ tid = ieee80211_get_tid(hdr);
+#endif
if (WARN(tid != baid_data->tid || mvm_sta->sta_id != baid_data->sta_id,
"baid 0x%x is mapped to sta:%d tid:%d, but was received for sta:%d tid:%d\n",
baid, baid_data->sta_id, baid_data->tid, mvm_sta->sta_id,