xref: /freebsd/sys/net80211/ieee80211_amrr.h (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
1 /*	$OpenBSD: ieee80211_amrr.h,v 1.3 2006/06/17 19:34:31 damien Exp $	*/
2 
3 /*-
4  * Copyright (c) 2006
5  *	Damien Bergamini <damien.bergamini@free.fr>
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 #ifndef _NET80211_IEEE80211_AMRR_H_
20 #define _NET80211_IEEE80211_AMRR_H_
21 
22 /*-
23  * Naive implementation of the Adaptive Multi Rate Retry algorithm:
24  *
25  * "IEEE 802.11 Rate Adaptation: A Practical Approach"
26  *  Mathieu Lacage, Hossein Manshaei, Thierry Turletti
27  *  INRIA Sophia - Projet Planete
28  *  http://www-sop.inria.fr/rapports/sophia/RR-5208.html
29  */
30 
31 /*
32  * Rate control settings.
33  */
34 struct ieee80211vap;
35 
36 struct ieee80211_amrr {
37 	u_int	amrr_min_success_threshold;
38 	u_int	amrr_max_success_threshold;
39 	int	amrr_interval;		/* update interval (ticks) */
40 };
41 
42 #define IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD	 1
43 #define IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD	15
44 
45 /*
46  * Rate control state for a given node.
47  */
48 struct ieee80211_amrr_node {
49 	struct ieee80211_amrr *amn_amrr;/* backpointer */
50 	int	amn_rix;		/* current rate index */
51 	int	amn_ticks;		/* time of last update */
52 	/* statistics */
53 	u_int	amn_txcnt;
54 	u_int	amn_success;
55 	u_int	amn_success_threshold;
56 	u_int	amn_recovery;
57 	u_int	amn_retrycnt;
58 };
59 
60 #endif /* _NET80211_IEEE80211_AMRR_H_ */
61