aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2022-08-31 23:01:36 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2022-08-31 23:01:36 +0000
commit26a36948331bd08d9afaddfc0da724eacdb953dd (patch)
treecf7ddcd4f6d5876aff247c079aa859d13d249975 /sys/contrib
parent4012ef7754cf29ce27d6fd728437830dea9915fd (diff)
downloadsrc-26a36948331bd08d9afaddfc0da724eacdb953dd.tar.gz
src-26a36948331bd08d9afaddfc0da724eacdb953dd.zip
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
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/dev/iwlwifi/mvm/rxmq.c7
1 files changed, 7 insertions, 0 deletions
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,