From owner-svn-src-all@FreeBSD.ORG Mon Mar 11 06:54:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34F764B3; Mon, 11 Mar 2013 06:54:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04E0994B; Mon, 11 Mar 2013 06:54:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2B6swMZ026248; Mon, 11 Mar 2013 06:54:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2B6swnJ026246; Mon, 11 Mar 2013 06:54:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303110654.r2B6swnJ026246@svn.freebsd.org> From: Adrian Chadd Date: Mon, 11 Mar 2013 06:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248146 - head/sys/dev/ath 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.14 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: Mon, 11 Mar 2013 06:54:59 -0000 Author: adrian Date: Mon Mar 11 06:54:58 2013 New Revision: 248146 URL: http://svnweb.freebsd.org/changeset/base/248146 Log: Add a few new fields to the RX vendor radiotap header: * a flags field that lets me know what's going on; * the hardware ratecode, unmolested by conversion to a bitrate; * the HAL rs_flags field, useful for debugging; * specifically mark aggregate sub-frames. This stuff sorely needs tidying up - it's missing some important stuff (eg numdelims) and it would be nice to put the flags at the beginning rather than at the end. Tested: * AR9380, STA mode, 2x2 HT40, monitoring RSSI and EVM values Modified: head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Mon Mar 11 06:17:46 2013 (r248145) +++ head/sys/dev/ath/if_ath_rx.c Mon Mar 11 06:54:58 2013 (r248146) @@ -403,11 +403,27 @@ ath_rx_tap_vendor(struct ifnet *ifp, str sc->sc_rx_th.wr_v.evm[3] = rs->rs_evm3; sc->sc_rx_th.wr_v.evm[4] = rs->rs_evm4; + /* direction */ + sc->sc_rx_th.wr_v.vh_flags = ATH_VENDOR_PKT_RX; + + /* RX rate */ + sc->sc_rx_th.wr_v.vh_rx_hwrate = rs->rs_rate; + + /* RX flags */ + sc->sc_rx_th.wr_v.vh_rs_flags = rs->rs_flags; + + if (rs->rs_isaggr) + sc->sc_rx_th.wr_v.vh_flags |= ATH_VENDOR_PKT_ISAGGR; + if (rs->rs_moreaggr) + sc->sc_rx_th.wr_v.vh_flags |= ATH_VENDOR_PKT_MOREAGGR; + /* phyerr info */ - if (rs->rs_status & HAL_RXERR_PHY) + if (rs->rs_status & HAL_RXERR_PHY) { sc->sc_rx_th.wr_v.vh_phyerr_code = rs->rs_phyerr; - else + sc->sc_rx_th.wr_v.vh_flags |= ATH_VENDOR_PKT_RXPHYERR; + } else { sc->sc_rx_th.wr_v.vh_phyerr_code = 0xff; + } sc->sc_rx_th.wr_v.vh_rs_status = rs->rs_status; sc->sc_rx_th.wr_v.vh_rssi = rs->rs_rssi; } Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Mon Mar 11 06:17:46 2013 (r248145) +++ head/sys/dev/ath/if_athioctl.h Mon Mar 11 06:54:58 2013 (r248146) @@ -305,7 +305,16 @@ struct ath_radiotap_vendor_hdr { /* 30 uint8_t vh_phyerr_code; /* Phy error code, or 0xff */ uint8_t vh_rs_status; /* RX status */ uint8_t vh_rssi; /* Raw RSSI */ - uint8_t vh_pad1[1]; /* Pad to 4 byte boundary */ + uint8_t vh_flags; /* General flags */ +#define ATH_VENDOR_PKT_RX 0x01 +#define ATH_VENDOR_PKT_TX 0x02 +#define ATH_VENDOR_PKT_RXPHYERR 0x04 +#define ATH_VENDOR_PKT_ISAGGR 0x08 +#define ATH_VENDOR_PKT_MOREAGGR 0x10 + + uint8_t vh_rx_hwrate; /* hardware RX ratecode */ + uint8_t vh_rs_flags; /* RX HAL flags */ + uint8_t vh_pad[2]; /* pad to DWORD boundary */ } __packed; #endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */