2 * Copyright (c) 2004 Sam Leffler, Errno Consulting
3 * Copyright (c) 2004 Video54 Technologies, Inc.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer,
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.
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.
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.
37 * $Id: //depot/sw/branches/fusion_usb/target_firmware/wlan/target/madwifi/ath/if_athrate.h#2 $
39 #ifndef _ATH_RATECTRL_H_
40 #define _ATH_RATECTRL_H_
45 struct ath_node_target;
48 struct ieee80211com_target;
51 size_t arc_space; /* space required for per-node state */
54 #define ATH_RC_DS_FLAG 0x01
55 #define ATH_RC_CW40_FLAG 0x02
56 #define ATH_RC_HT40_SGI_FLAG 0x04
57 #define ATH_RC_HT_FLAG 0x08
58 #define ATH_RC_RTSCTS_FLAG 0x10
59 #define ATH_RC_TX_STBC_FLAG 0x20 /* TX STBC */
60 #define ATH_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */
61 #define ATH_RC_RX_STBC_FLAG_S 6
62 #define ATH_RC_WEP_TKIP_FLAG 0x100 /* WEP/TKIP encryption */
69 #define ATH_RC_PROBE_ALLOWED 0x00000001
70 #define ATH_RC_MINRATE_LASTRATE 0x00000002
72 struct ath_rc_series {
75 u_int8_t tx_chainmask;
77 a_uint32_t max4msframelen;
78 a_uint32_t txrateKbps;
82 * Attach/detach a rate control module.
84 struct ath_ratectrl *ath_rate_attach(struct ath_softc_tgt *);
85 void ath_rate_detach(struct ath_ratectrl *);
88 * Return the transmit info for a data packet. If multi-rate state
89 * is to be setup then try0 should contain a value other than ATH_TXMATRY
90 * and ath_rate_setupxtxdesc will be called after deciding if the frame
91 * can be transmitted with multi-rate retry.
93 void ath_rate_findrate(struct ath_softc_tgt *sc,
94 struct ath_node_target *an,
95 a_int32_t shortPreamble,
101 struct ath_rc_series series[],
104 * Update rate control state for a packet associated with the
105 * supplied transmit descriptor. The routine is invoked both
106 * for packets that were successfully sent and for those that
107 * failed (consult the descriptor for details).
109 void ath_rate_tx_complete(struct ath_softc_tgt *, struct ath_node_target *,
110 struct ath_tx_desc *, struct ath_rc_series series[],
111 a_int32_t nframes, a_int32_t nbad);
114 void ath_rate_stateupdate(struct ath_softc_tgt *sc, struct ath_node_target *an,
115 enum ath_rc_cwmode cwmode);
117 #endif /* _ATH_RATECTRL_H_ */