git: ff76cbc81d57 - main - LinuxKPI: 802.11: implement ieee80211_is_pspoll()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Tue, 31 Jan 2023 16:38:08 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=ff76cbc81d57ffc4bbc9bc20fd22325b2a8c2028

commit ff76cbc81d57ffc4bbc9bc20fd22325b2a8c2028
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-01-31 16:36:24 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-01-31 16:36:24 +0000

    LinuxKPI: 802.11: implement ieee80211_is_pspoll()
    
    Implement ieee80211_is_pspoll() and move it up to the set of implemented
    ieee80211_is_*() functions.
    
    There are no further changes (git diff just looks weird).
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/include/net/mac80211.h | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index 93382a4bd424..9077a62c2ef5 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -1350,29 +1350,33 @@ ieee80211_is_any_nullfunc(__le16 fc)
 	return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc));
 }
 
-static __inline bool
-ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
+static bool
+ieee80211_is_pspoll(__le16 fc)
 {
-	TODO();
-	return (false);
+	__le16 v;
+
+	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
+	v = htole16(IEEE80211_FC0_SUBTYPE_PS_POLL | IEEE80211_FC0_TYPE_CTL);
+
+	return (fc == v);
 }
 
 static __inline bool
-ieee80211_is_frag(struct ieee80211_hdr *hdr)
+ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
 {
 	TODO();
 	return (false);
 }
 
 static __inline bool
-ieee80211_is_first_frag(__le16 fc)
+ieee80211_is_frag(struct ieee80211_hdr *hdr)
 {
 	TODO();
 	return (false);
 }
 
 static __inline bool
-ieee80211_is_pspoll(__le16 fc)
+ieee80211_is_first_frag(__le16 fc)
 {
 	TODO();
 	return (false);