Date: Sun, 23 Oct 2016 08:21:35 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307819 - head/sys/net80211 Message-ID: <201610230821.u9N8LZe1073281@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610230821.u9N8LZe1073281>