Implement a generic TX rate control algorithm framework in 802.11 layer.
[dragonfly.git] / sys / netproto / 802_11 / wlan_ratectl / amrr / ieee80211_ratectl_amrr.h
1 /*
2  * Copyright (c) 2004 INRIA
3  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer,
11  *    without modification.
12  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
13  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
14  *    redistribution must be conditioned upon including a substantially
15  *    similar Disclaimer requirement for further binary redistribution.
16  * 3. Neither the names of the above-listed copyright holders nor the names
17  *    of any contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  * Alternatively, this software may be distributed under the terms of the
21  * GNU General Public License ("GPL") version 2 as published by the Free
22  * Software Foundation.
23  *
24  * NO WARRANTY
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
28  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
29  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
30  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
33  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
35  * THE POSSIBILITY OF SUCH DAMAGES.
36  *
37  * $FreeBSD: src/sys/dev/ath/ath_rate/amrr/amrr.h,v 1.2 2004/12/31 22:41:45 sam Exp $
38  * $DragonFly: src/sys/netproto/802_11/wlan_ratectl/amrr/Attic/ieee80211_ratectl_amrr.h,v 1.1 2006/09/01 15:12:12 sephe Exp $
39  */
40
41 #ifndef _IEEE80211_RATECTL_AMRR_H
42 #define _IEEE80211_RATECTL_AMRR_H
43
44 struct amrr_softc {
45         struct ieee80211com     *ic;
46         struct callout          timer;          /* periodic timer */
47         struct sysctl_ctx_list  sysctl_ctx;
48         struct sysctl_oid       *sysctl_oid;
49         int                     interval;       /* unit: ms */
50         int                     max_success_threshold;
51         int                     min_success_threshold;
52         int                     debug;
53 };
54
55 struct amrr_data {
56         /* AMRR statistics for this node */
57         u_int   ad_tx_try_cnt[IEEE80211_AMRR_RATEIDX_MAX];
58         u_int   ad_tx_failure_cnt; 
59
60         /* AMRR algorithm state for this node */
61         u_int   ad_success_threshold;
62         u_int   ad_success;
63         u_int   ad_recovery;
64 };
65
66 #endif  /* !_IEEE80211_RATECTL_AMRR_H */