From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 01:27:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A463106564A; Fri, 20 Jul 2012 01:27:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F04418FC0C; Fri, 20 Jul 2012 01:27:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K1RKXL041910; Fri, 20 Jul 2012 01:27:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K1RKca041907; Fri, 20 Jul 2012 01:27:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200127.q6K1RKca041907@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 01:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238632 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 20 Jul 2012 01:27:21 -0000 Author: adrian Date: Fri Jul 20 01:27:20 2012 New Revision: 238632 URL: http://svn.freebsd.org/changeset/base/238632 Log: Create an ioctl API for fetching the current rate control information. Modified: head/sys/dev/ath/if_athioctl.h head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Fri Jul 20 01:11:53 2012 (r238631) +++ head/sys/dev/ath/if_athioctl.h Fri Jul 20 01:27:20 2012 (r238632) @@ -186,6 +186,40 @@ struct ath_diag { #define SIOCGATHDIAG _IOWR('i', 138, struct ath_diag) #define SIOCGATHPHYERR _IOWR('i', 140, struct ath_diag) + +/* + * The rate control ioctl has to support multiple potential rate + * control classes. For now, instead of trying to support an + * abstraction for this in the API, let's just use a TLV + * representation for the payload and let userspace sort it out. + */ +struct ath_rateioctl_tlv { + uint16_t tlv_id; + uint16_t tlv_len; /* length excluding TLV header */ +}; + +/* + * This is purely the six byte MAC address. + */ +#define ATH_RATE_TLV_MACADDR 0xaab0 + +/* + * This is the sample node statistics structure. + * More in ath_rate/sample/sample.h. + */ +#define ATH_RATE_TLV_SAMPLENODE 0xaab2 + +struct ath_rateioctl { + char if_name[IFNAMSIZ]; /* if name */ + union { + uint8_t macaddr[IEEE80211_ADDR_LEN]; + uint64_t pad; + } is_u; + uint32_t len; + caddr_t buf; +}; +#define SIOCGATHNODERATESTATS _IOWR('i', 149, struct ath_rateioctl) + /* * Radio capture format. */ Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Fri Jul 20 01:11:53 2012 (r238631) +++ head/sys/dev/ath/if_athrate.h Fri Jul 20 01:27:20 2012 (r238632) @@ -150,4 +150,16 @@ struct ath_buf; void ath_rate_tx_complete(struct ath_softc *, struct ath_node *, const struct ath_rc_series *, const struct ath_tx_status *, int pktlen, int nframes, int nbad); + +/* + * Fetch the global rate control statistics. + */ +int ath_rate_fetch_stats(struct ath_softc *sc, struct ath_rateioctl *rs); + +/* + * Fetch the per-node statistics. + */ +int ath_rate_fetch_node_stats(struct ath_softc *sc, struct ath_node *an, + struct ath_rateioctl *rs); + #endif /* _ATH_RATECTRL_H_ */