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