Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2012 01:27:20 +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: r238632 - head/sys/dev/ath
Message-ID:  <201207200127.q6K1RKca041907@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207200127.q6K1RKca041907>