ieee80211_amrr.h revision 164633
1164633Ssam/* $FreeBSD: head/sys/net80211/ieee80211_amrr.h 164633 2006-11-26 19:55:26Z sam $ */
2164633Ssam/*	$OpenBSD: ieee80211_amrr.h,v 1.3 2006/06/17 19:34:31 damien Exp $	*/
3164633Ssam
4164633Ssam/*-
5164633Ssam * Copyright (c) 2006
6164633Ssam *	Damien Bergamini <damien.bergamini@free.fr>
7164633Ssam *
8164633Ssam * Permission to use, copy, modify, and distribute this software for any
9164633Ssam * purpose with or without fee is hereby granted, provided that the above
10164633Ssam * copyright notice and this permission notice appear in all copies.
11164633Ssam *
12164633Ssam * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13164633Ssam * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14164633Ssam * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15164633Ssam * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16164633Ssam * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17164633Ssam * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18164633Ssam * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19164633Ssam */
20164633Ssam#ifndef _NET80211_IEEE80211_AMRR_H_
21164633Ssam#define _NET80211_IEEE80211_AMRR_H_
22164633Ssam
23164633Ssam/*-
24164633Ssam * Naive implementation of the Adaptive Multi Rate Retry algorithm:
25164633Ssam *
26164633Ssam * "IEEE 802.11 Rate Adaptation: A Practical Approach"
27164633Ssam *  Mathieu Lacage, Hossein Manshaei, Thierry Turletti
28164633Ssam *  INRIA Sophia - Projet Planete
29164633Ssam *  http://www-sop.inria.fr/rapports/sophia/RR-5208.html
30164633Ssam */
31164633Ssam
32164633Ssam/*
33164633Ssam * Rate control settings.
34164633Ssam */
35164633Ssamstruct ieee80211com;
36164633Ssam
37164633Ssamstruct ieee80211_amrr {
38164633Ssam	u_int	amrr_min_success_threshold;
39164633Ssam	u_int	amrr_max_success_threshold;
40164633Ssam	struct ieee80211com *amrr_ic;
41164633Ssam};
42164633Ssam
43164633Ssam#define IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD	 1
44164633Ssam#define IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD	15
45164633Ssam
46164633Ssam/*
47164633Ssam * Rate control state for a given node.
48164633Ssam */
49164633Ssamstruct ieee80211_amrr_node {
50164633Ssam	u_int	amn_success;
51164633Ssam	u_int	amn_recovery;
52164633Ssam	u_int	amn_success_threshold;
53164633Ssam	u_int	amn_txcnt;
54164633Ssam	u_int	amn_retrycnt;
55164633Ssam};
56164633Ssam
57164633Ssamvoid	ieee80211_amrr_init(struct ieee80211_amrr *,
58164633Ssam	    struct ieee80211com *ic, int, int);
59164633Ssamvoid	ieee80211_amrr_node_init(struct ieee80211_amrr *,
60164633Ssam	    struct ieee80211_amrr_node *);
61164633Ssamvoid	ieee80211_amrr_choose(struct ieee80211_amrr *, struct ieee80211_node *,
62164633Ssam	    struct ieee80211_amrr_node *);
63164633Ssam
64164633Ssam#endif /* _NET80211_IEEE80211_AMRR_H_ */
65