From 275b79bd9b0f5eccd911116392799059a22c4860 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Wed, 30 Mar 2016 00:42:18 +0000 Subject: [PATCH] [net80211] Add fields to decode uAPSD fields. It turns out that madwifi actually has the basics for uAPSD implemented but it was never ported to FreeBSD. I may eventually port most of the pieces; I'll see how it goes! Obtained from: Madwifi --- sys/net80211/ieee80211.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index 7ace97e9c77d..f5fdd5a63d49 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -316,6 +316,27 @@ struct ieee80211_wme_param { struct ieee80211_wme_acparams params_acParams[WME_NUM_AC]; } __packed; +/* + * WME U-APSD qos info field defines + */ +#define WME_CAPINFO_UAPSD_EN 0x00000080 +#define WME_CAPINFO_UAPSD_VO 0x00000001 +#define WME_CAPINFO_UAPSD_VI 0x00000002 +#define WME_CAPINFO_UAPSD_BK 0x00000004 +#define WME_CAPINFO_UAPSD_BE 0x00000008 +#define WME_CAPINFO_UAPSD_ACFLAGS_SHIFT 0 +#define WME_CAPINFO_UAPSD_ACFLAGS_MASK 0xF +#define WME_CAPINFO_UAPSD_MAXSP_SHIFT 5 +#define WME_CAPINFO_UAPSD_MAXSP_MASK 0x3 +#define WME_CAPINFO_IE_OFFSET 8 +#define WME_UAPSD_MAXSP(_qosinfo) \ + (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & \ + WME_CAPINFO_UAPSD_MAXSP_MASK) +#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) \ + ((1 << (3 - (_ac))) & ( \ + ((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & \ + WME_CAPINFO_UAPSD_ACFLAGS_MASK)) + /* * Management Notification Frame */