diff options
-rw-r--r-- | sys/dev/ath/if_athioctl.h | 34 | ||||
-rw-r--r-- | sys/dev/ath/if_athrate.h | 12 |
2 files changed, 46 insertions, 0 deletions
diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index f40e1be..b8199cd 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -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. */ diff --git a/sys/dev/ath/if_athrate.h b/sys/dev/ath/if_athrate.h index 10f6040..d07c9ca 100644 --- a/sys/dev/ath/if_athrate.h +++ b/sys/dev/ath/if_athrate.h @@ -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_ */ |