aboutsummaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2017-12-09 23:16:02 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2017-12-09 23:16:02 +0000
commit0c6960361bdcbfd5ba282ad78c464a2e5ce76643 (patch)
tree3292ee38cad9370d571af27fd087ae63f9eb5229 /sys/net80211
parentde1430411de6780e91445ae5c8f6d93efb9a0360 (diff)
downloadsrc-0c6960361bdcbfd5ba282ad78c464a2e5ce76643.tar.gz
src-0c6960361bdcbfd5ba282ad78c464a2e5ce76643.zip
[net80211] add a method for checking if a VAP WME AC has a NOACK policy or not.
A subsequent set of commits will introduce this instead of a whole lot of gymnastics to check the WME category.
Notes
Notes: svn path=/head/; revision=326737
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_proto.c32
-rw-r--r--sys/net80211/ieee80211_proto.h1
2 files changed, 33 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 1a30e0de08ec..c4a6c4ccac71 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1308,6 +1308,12 @@ ieee80211_wme_updateparams(struct ieee80211vap *vap)
}
}
+/*
+ * Fetch the WME parameters for the given VAP.
+ *
+ * When net80211 grows p2p, etc support, this may return different
+ * parameters for each VAP.
+ */
void
ieee80211_wme_vap_getparams(struct ieee80211vap *vap, struct chanAccParams *wp)
{
@@ -1315,6 +1321,12 @@ ieee80211_wme_vap_getparams(struct ieee80211vap *vap, struct chanAccParams *wp)
memcpy(wp, &vap->iv_ic->ic_wme.wme_chanParams, sizeof(*wp));
}
+/*
+ * For NICs which only support one set of WME paramaters (ie, softmac NICs)
+ * there may be different VAP WME parameters but only one is "active".
+ * This returns the "NIC" WME parameters for the currently active
+ * context.
+ */
void
ieee80211_wme_ic_getparams(struct ieee80211com *ic, struct chanAccParams *wp)
{
@@ -1322,6 +1334,26 @@ ieee80211_wme_ic_getparams(struct ieee80211com *ic, struct chanAccParams *wp)
memcpy(wp, &ic->ic_wme.wme_chanParams, sizeof(*wp));
}
+/*
+ * Return whether to use QoS on a given WME queue.
+ *
+ * This is intended to be called from the transmit path of softmac drivers
+ * which are setting NoAck bits in transmit descriptors.
+ *
+ * Ideally this would be set in some transmit field before the packet is
+ * queued to the driver but net80211 isn't quite there yet.
+ */
+int
+ieee80211_wme_vap_ac_is_noack(struct ieee80211vap *vap, int ac)
+{
+ /* Bounds/sanity check */
+ if (ac < 0 || ac >= WME_NUM_AC)
+ return (0);
+
+ /* Again, there's only one global context for now */
+ return (!! vap->iv_ic->ic_wme.wme_chanParams.cap_wmeParams[ac].wmep_noackPolicy);
+}
+
static void
parent_updown(void *arg, int npending)
{
diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h
index 187f7018b06a..28238ce86eea 100644
--- a/sys/net80211/ieee80211_proto.h
+++ b/sys/net80211/ieee80211_proto.h
@@ -298,6 +298,7 @@ void ieee80211_wme_vap_getparams(struct ieee80211vap *vap,
struct chanAccParams *);
void ieee80211_wme_ic_getparams(struct ieee80211com *ic,
struct chanAccParams *);
+int ieee80211_wme_vap_ac_is_noack(struct ieee80211vap *vap, int ac);
/*
* Return the WME TID from a QoS frame. If no TID