git: 00614c9c2ddc - main - LinuxKPI: 802.11: fill in two more TODOs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 30 Apr 2022 08:03:29 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=00614c9c2ddc34f3f9061e87542efb4edbd936a9
commit 00614c9c2ddc34f3f9061e87542efb4edbd936a9
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-04-30 08:00:04 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-04-30 08:00:04 +0000
LinuxKPI: 802.11: fill in two more TODOs
Implement ieee80211_is_data_present() and a subset of
ieee80211_is_bufferable_mmpdu() which hopefully is good enough in
the compat code for now.
This is partly in preparation for some TXQ changes coming up soon.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
---
sys/compat/linuxkpi/common/include/net/mac80211.h | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index b1ce4c2ff2b9..7a8306919194 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -1102,8 +1102,13 @@ ieee80211_is_disassoc(__le16 fc)
static __inline bool
ieee80211_is_data_present(__le16 fc)
{
- TODO();
- return (false);
+ __le16 v;
+
+ /* If it is a data frame and NODATA is not present. */
+ fc &= htole16(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_NODATA);
+ v = htole16(IEEE80211_FC0_TYPE_DATA);
+
+ return (fc == v);
}
static __inline bool
@@ -1166,7 +1171,19 @@ ieee80211_is_back_req(__le16 fc)
static __inline bool
ieee80211_is_bufferable_mmpdu(__le16 fc)
{
- TODO();
+
+ /* 11.2.2 Bufferable MMPDUs, 80211-2020. */
+ /* XXX we do not care about IBSS yet. */
+
+ if (!ieee80211_is_mgmt(fc))
+ return (false);
+ if (ieee80211_is_action(fc)) /* XXX FTM? */
+ return (true);
+ if (ieee80211_is_disassoc(fc))
+ return (true);
+ if (ieee80211_is_deauth(fc))
+ return (true);
+
return (false);
}