The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/net80211/ieee80211_rssadapt.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /* $OpenBSD: ieee80211_rssadapt.h,v 1.4 2007/06/16 13:17:05 damien Exp $ */
    2 /* $NetBSD: ieee80211_rssadapt.h,v 1.3 2004/05/06 03:03:20 dyoung Exp $ */
    3 
    4 /*-
    5  * Copyright (c) 2003, 2004 David Young.  All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or
    8  * without modification, are permitted provided that the following
    9  * conditions are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. Redistributions in binary form must reproduce the above
   13  *    copyright notice, this list of conditions and the following
   14  *    disclaimer in the documentation and/or other materials provided
   15  *    with the distribution.
   16  * 3. The name of David Young may not be used to endorse or promote
   17  *    products derived from this software without specific prior
   18  *    written permission.
   19  *
   20  * THIS SOFTWARE IS PROVIDED BY David Young ``AS IS'' AND ANY
   21  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
   22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
   23  * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL David
   24  * Young BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
   26  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   28  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
   31  * OF SUCH DAMAGE.
   32  */
   33 #ifndef _NET80211_IEEE80211_RSSADAPT_H_
   34 #define _NET80211_IEEE80211_RSSADAPT_H_
   35 
   36 /* Data-rate adaptation loosely based on "Link Adaptation Strategy
   37  * for IEEE 802.11 WLAN via Received Signal Strength Measurement"
   38  * by Javier del Prado Pavon and Sunghyun Choi.
   39  */
   40 
   41 /* Buckets for frames 0-128 bytes long, 129-1024, 1025-maximum. */
   42 #define IEEE80211_RSSADAPT_BKTS         3
   43 #define IEEE80211_RSSADAPT_BKT0         128
   44 #define IEEE80211_RSSADAPT_BKTPOWER     3       /* 2**_BKTPOWER */
   45 
   46 #define ieee80211_rssadapt_thresh_new \
   47     (ieee80211_rssadapt_thresh_denom - ieee80211_rssadapt_thresh_old)
   48 #define ieee80211_rssadapt_decay_new \
   49     (ieee80211_rssadapt_decay_denom - ieee80211_rssadapt_decay_old)
   50 #define ieee80211_rssadapt_avgrssi_new \
   51     (ieee80211_rssadapt_avgrssi_denom - ieee80211_rssadapt_avgrssi_old)
   52 
   53 struct ieee80211_rssadapt_expavgctl {
   54         /* RSS threshold decay. */
   55         u_int rc_decay_denom;
   56         u_int rc_decay_old;
   57         /* RSS threshold update. */
   58         u_int rc_thresh_denom;
   59         u_int rc_thresh_old;
   60         /* RSS average update. */
   61         u_int rc_avgrssi_denom;
   62         u_int rc_avgrssi_old;
   63 };
   64 
   65 struct ieee80211_rssadapt {
   66         /* exponential average RSSI << 8 */
   67         u_int16_t               ra_avg_rssi;
   68         /* Tx failures in this update interval */
   69         u_int32_t               ra_nfail;
   70         /* Tx successes in this update interval */
   71         u_int32_t               ra_nok;
   72         /* exponential average packets/second */
   73         u_int32_t               ra_pktrate;
   74         /* RSSI threshold for each Tx rate */
   75         u_int16_t               ra_rate_thresh[IEEE80211_RSSADAPT_BKTS]
   76                                     [IEEE80211_RATE_SIZE];
   77         struct timeval          ra_last_raise;
   78         struct timeval          ra_raise_interval;
   79 };
   80 
   81 /* Properties of a Tx packet, for link adaptation. */
   82 struct ieee80211_rssdesc {
   83         u_int                    id_len;        /* Tx packet length */
   84         u_int                    id_rateidx;    /* index into ni->ni_rates */
   85         struct ieee80211_node   *id_node;       /* destination STA MAC */
   86         u_int8_t                 id_rssi;       /* destination STA avg RSS @
   87                                                  * Tx time
   88                                                  */
   89 };
   90 
   91 void    ieee80211_rssadapt_updatestats(struct ieee80211_rssadapt *);
   92 void    ieee80211_rssadapt_input(struct ieee80211com *,
   93             const struct ieee80211_node *, struct ieee80211_rssadapt *, int);
   94 void    ieee80211_rssadapt_lower_rate(struct ieee80211com *,
   95             const struct ieee80211_node *, struct ieee80211_rssadapt *,
   96             const struct ieee80211_rssdesc *);
   97 void    ieee80211_rssadapt_raise_rate(struct ieee80211com *,
   98             struct ieee80211_rssadapt *, const struct ieee80211_rssdesc *);
   99 int     ieee80211_rssadapt_choose(struct ieee80211_rssadapt *,
  100             const struct ieee80211_rateset *, const struct ieee80211_frame *,
  101             u_int, int, const char *, int);
  102 #ifdef IEEE80211_DEBUG
  103 extern int ieee80211_rssadapt_debug;
  104 #endif /* IEEE80211_DEBUG */
  105 
  106 #endif /* _NET80211_IEEE80211_RSSADAPT_H_ */

Cache object: 97ac4db2db5fda2ae917e21d534994e1


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.