svn commit: r307819 - head/sys/net80211

Adrian Chadd adrian at FreeBSD.org
Sun Oct 23 08:21:37 UTC 2016


Author: adrian
Date: Sun Oct 23 08:21:35 2016
New Revision: 307819
URL: https://svnweb.freebsd.org/changeset/base/307819

Log:
  [net80211] Add a variant on ieee80211_get_rx_params() that returns a pointer.
  
  Be careful when calling this, as the underlying mbuf may change
  afterwards - common in the RX path.

Modified:
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_freebsd.h

Modified: head/sys/net80211/ieee80211_freebsd.c
==============================================================================
--- head/sys/net80211/ieee80211_freebsd.c	Sun Oct 23 08:19:43 2016	(r307818)
+++ head/sys/net80211/ieee80211_freebsd.c	Sun Oct 23 08:21:35 2016	(r307819)
@@ -529,6 +529,21 @@ ieee80211_get_rx_params(struct mbuf *m, 
 	return (0);
 }
 
+const struct ieee80211_rx_stats *
+ieee80211_get_rx_params_ptr(struct mbuf *m)
+{
+	struct m_tag *mtag;
+	struct ieee80211_rx_params *rx;
+
+	mtag = m_tag_locate(m, MTAG_ABI_NET80211, NET80211_TAG_RECV_PARAMS,
+	    NULL);
+	if (mtag == NULL)
+		return (NULL);
+	rx = (struct ieee80211_rx_params *)(mtag + 1);
+	return (&rx->params);
+}
+
+
 /*
  * Add TOA parameters to the given mbuf.
  */

Modified: head/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- head/sys/net80211/ieee80211_freebsd.h	Sun Oct 23 08:19:43 2016	(r307818)
+++ head/sys/net80211/ieee80211_freebsd.h	Sun Oct 23 08:21:35 2016	(r307819)
@@ -713,6 +713,7 @@ int	ieee80211_add_rx_params(struct mbuf 
 	    const struct ieee80211_rx_stats *rxs);
 int	ieee80211_get_rx_params(struct mbuf *m,
 	    struct ieee80211_rx_stats *rxs);
+const struct ieee80211_rx_stats * ieee80211_get_rx_params_ptr(struct mbuf *m);
 
 struct ieee80211_toa_params {
 	int request_id;


More information about the svn-src-head mailing list