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/dev/ath/if_athrate.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 2004-2008 Sam Leffler, Errno Consulting
    3  * Copyright (c) 2004 Video54 Technologies, Inc.
    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  *
   17  * NO WARRANTY
   18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   19  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   20  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
   21  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
   22  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
   23  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
   26  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
   28  * THE POSSIBILITY OF SUCH DAMAGES.
   29  *
   30  * $FreeBSD: releng/8.4/sys/dev/ath/if_athrate.h 184346 2008-10-27 16:58:06Z sam $
   31  */
   32 #ifndef _ATH_RATECTRL_H_
   33 #define _ATH_RATECTRL_H_
   34 
   35 /*
   36  * Interface definitions for transmit rate control modules for the
   37  * Atheros driver.
   38  *
   39  * A rate control module is responsible for choosing the transmit rate
   40  * for each data frame.  Management+control frames are always sent at
   41  * a fixed rate.
   42  *
   43  * Only one module may be present at a time; the driver references
   44  * rate control interfaces by symbol name.  If multiple modules are
   45  * to be supported we'll need to switch to a registration-based scheme
   46  * as is currently done, for example, for authentication modules.
   47  *
   48  * An instance of the rate control module is attached to each device
   49  * at attach time and detached when the device is destroyed.  The module
   50  * may associate data with each device and each node (station).  Both
   51  * sets of storage are opaque except for the size of the per-node storage
   52  * which must be provided when the module is attached.
   53  *
   54  * The rate control module is notified for each state transition and
   55  * station association/reassociation.  Otherwise it is queried for a
   56  * rate for each outgoing frame and provided status from each transmitted
   57  * frame.  Any ancillary processing is the responsibility of the module
   58  * (e.g. if periodic processing is required then the module should setup
   59  * it's own timer).
   60  *
   61  * In addition to the transmit rate for each frame the module must also
   62  * indicate the number of attempts to make at the specified rate.  If this
   63  * number is != ATH_TXMAXTRY then an additional callback is made to setup
   64  * additional transmit state.  The rate control code is assumed to write
   65  * this additional data directly to the transmit descriptor.
   66  */
   67 struct ath_softc;
   68 struct ath_node;
   69 struct ath_desc;
   70 
   71 struct ath_ratectrl {
   72         size_t  arc_space;      /* space required for per-node state */
   73 };
   74 /*
   75  * Attach/detach a rate control module.
   76  */
   77 struct ath_ratectrl *ath_rate_attach(struct ath_softc *);
   78 void    ath_rate_detach(struct ath_ratectrl *);
   79 
   80 
   81 /*
   82  * State storage handling.
   83  */
   84 /*
   85  * Initialize per-node state already allocated for the specified
   86  * node; this space can be assumed initialized to zero.
   87  */
   88 void    ath_rate_node_init(struct ath_softc *, struct ath_node *);
   89 /*
   90  * Cleanup any per-node state prior to the node being reclaimed.
   91  */
   92 void    ath_rate_node_cleanup(struct ath_softc *, struct ath_node *);
   93 /*
   94  * Update rate control state on station associate/reassociate 
   95  * (when operating as an ap or for nodes discovered when operating
   96  * in ibss mode).
   97  */
   98 void    ath_rate_newassoc(struct ath_softc *, struct ath_node *,
   99                 int isNewAssociation);
  100 
  101 /*
  102  * Transmit handling.
  103  */
  104 /*
  105  * Return the transmit info for a data packet.  If multi-rate state
  106  * is to be setup then try0 should contain a value other than ATH_TXMATRY
  107  * and ath_rate_setupxtxdesc will be called after deciding if the frame
  108  * can be transmitted with multi-rate retry.
  109  */
  110 void    ath_rate_findrate(struct ath_softc *, struct ath_node *,
  111                 int shortPreamble, size_t frameLen,
  112                 u_int8_t *rix, int *try0, u_int8_t *txrate);
  113 /*
  114  * Setup any extended (multi-rate) descriptor state for a data packet.
  115  * The rate index returned by ath_rate_findrate is passed back in.
  116  */
  117 void    ath_rate_setupxtxdesc(struct ath_softc *, struct ath_node *,
  118                 struct ath_desc *, int shortPreamble, u_int8_t rix);
  119 /*
  120  * Update rate control state for a packet associated with the
  121  * supplied transmit descriptor.  The routine is invoked both
  122  * for packets that were successfully sent and for those that
  123  * failed (consult the descriptor for details).
  124  */
  125 struct ath_buf;
  126 void    ath_rate_tx_complete(struct ath_softc *, struct ath_node *,
  127                 const struct ath_buf *);
  128 #endif /* _ATH_RATECTRL_H_ */

Cache object: 9de6d25b3c38236b3ce862baf5a50d34


[ 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.