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_ */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to