xref: /haiku/src/libs/compat/openbsd_wlan/net80211/ieee80211_amrr.h (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1 /*	$OpenBSD: ieee80211_amrr.h,v 1.4 2007/06/16 13:17:05 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 ieee80211_amrr {
35 	u_int	amrr_min_success_threshold;
36 	u_int	amrr_max_success_threshold;
37 };
38 
39 #define IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD	 1
40 #define IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD	15
41 
42 /*
43  * Rate control state for a given node.
44  */
45 struct ieee80211_amrr_node {
46 	u_int	amn_success;
47 	u_int	amn_recovery;
48 	u_int	amn_success_threshold;
49 	u_int	amn_txcnt;
50 	u_int	amn_retrycnt;
51 };
52 
53 void	ieee80211_amrr_node_init(const struct ieee80211_amrr *,
54 	    struct ieee80211_amrr_node *);
55 void	ieee80211_amrr_choose(struct ieee80211_amrr *, struct ieee80211_node *,
56 	    struct ieee80211_amrr_node *);
57 
58 #endif /* _NET80211_IEEE80211_AMRR_H_ */
59