diff options
author | sam <sam@FreeBSD.org> | 2008-04-20 20:35:46 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-04-20 20:35:46 +0000 |
commit | 3569e353ca63336d80ab0143dd9669b0b9e6b123 (patch) | |
tree | bc7985c57e7ecfa1ac03e48c406a25430dba634b /sys/net80211/ieee80211_amrr.h | |
parent | 682b4ae9be70192e298129ada878af3486683aaf (diff) | |
download | FreeBSD-src-3569e353ca63336d80ab0143dd9669b0b9e6b123.zip FreeBSD-src-3569e353ca63336d80ab0143dd9669b0b9e6b123.tar.gz |
Multi-bss (aka vap) support for 802.11 devices.
Note this includes changes to all drivers and moves some device firmware
loading to use firmware(9) and a separate module (e.g. ral). Also there
no longer are separate wlan_scan* modules; this functionality is now
bundled into the wlan module.
Supported by: Hobnob and Marvell
Reviewed by: many
Obtained from: Atheros (some bits)
Diffstat (limited to 'sys/net80211/ieee80211_amrr.h')
-rw-r--r-- | sys/net80211/ieee80211_amrr.h | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/sys/net80211/ieee80211_amrr.h b/sys/net80211/ieee80211_amrr.h index 947d617..c03f699 100644 --- a/sys/net80211/ieee80211_amrr.h +++ b/sys/net80211/ieee80211_amrr.h @@ -32,12 +32,12 @@ /* * Rate control settings. */ -struct ieee80211com; +struct ieee80211vap; struct ieee80211_amrr { u_int amrr_min_success_threshold; u_int amrr_max_success_threshold; - struct ieee80211com *amrr_ic; + int amrr_interval; /* update interval (ticks) */ }; #define IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD 1 @@ -47,18 +47,55 @@ struct ieee80211_amrr { * Rate control state for a given node. */ struct ieee80211_amrr_node { + struct ieee80211_amrr *amn_amrr;/* backpointer */ + int amn_rix; /* current rate index */ + int amn_ticks; /* time of last update */ + /* statistics */ + u_int amn_txcnt; u_int amn_success; - u_int amn_recovery; u_int amn_success_threshold; - u_int amn_txcnt; + u_int amn_recovery; u_int amn_retrycnt; }; -void ieee80211_amrr_init(struct ieee80211_amrr *, - struct ieee80211com *ic, int, int); +void ieee80211_amrr_init(struct ieee80211_amrr *, struct ieee80211vap *, + int, int, int); +void ieee80211_amrr_cleanup(struct ieee80211_amrr *); +void ieee80211_amrr_setinterval(struct ieee80211_amrr *, int); void ieee80211_amrr_node_init(struct ieee80211_amrr *, + struct ieee80211_amrr_node *, struct ieee80211_node *); +int ieee80211_amrr_choose(struct ieee80211_node *, struct ieee80211_amrr_node *); -void ieee80211_amrr_choose(struct ieee80211_amrr *, struct ieee80211_node *, - struct ieee80211_amrr_node *); +#define IEEE80211_AMRR_SUCCESS 1 +#define IEEE80211_AMRR_FAILURE 0 + +/* + * Update statistics with tx complete status. Ok is non-zero + * if the packet is known to be ACK'd. Retries has the number + * retransmissions (i.e. xmit attempts - 1). + */ +static __inline void +ieee80211_amrr_tx_complete(struct ieee80211_amrr_node *amn, + int ok, int retries) +{ + amn->amn_txcnt++; + if (ok) + amn->amn_success++; + amn->amn_retrycnt += retries; +} + +/* + * Set tx count/retry statistics explicitly. Intended for + * drivers that poll the device for statistics maintained + * in the device. + */ +static __inline void +ieee80211_amrr_tx_update(struct ieee80211_amrr_node *amn, + int txcnt, int success, int retrycnt) +{ + amn->amn_txcnt = txcnt; + amn->amn_success = success; + amn->amn_retrycnt = retrycnt; +} #endif /* _NET80211_IEEE80211_AMRR_H_ */ |