From owner-svn-src-all@freebsd.org Sun Oct 23 08:21:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14534C1E90F; Sun, 23 Oct 2016 08:21:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D80A4AE0; Sun, 23 Oct 2016 08:21:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9N8LZU6073283; Sun, 23 Oct 2016 08:21:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9N8LZe1073281; Sun, 23 Oct 2016 08:21:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201610230821.u9N8LZe1073281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 23 Oct 2016 08:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307819 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Oct 2016 08:21:37 -0000 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;