amrr.c (218160) | amrr.c (227364) |
---|---|
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: --- 23 unchanged lines hidden (view full) --- 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 */ 38 39#include <sys/cdefs.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: --- 23 unchanged lines hidden (view full) --- 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 */ 38 39#include <sys/cdefs.h> |
40__FBSDID("$FreeBSD: head/sys/dev/ath/ath_rate/amrr/amrr.c 218160 2011-02-01 08:10:18Z adrian $"); | 40__FBSDID("$FreeBSD: head/sys/dev/ath/ath_rate/amrr/amrr.c 227364 2011-11-08 22:43:13Z adrian $"); |
41 42/* 43 * AMRR rate control. See: 44 * http://www-sop.inria.fr/rapports/sophia/RR-5208.html 45 * "IEEE 802.11 Rate Adaptation: A Practical Approach" by 46 * Mathieu Lacage, Hossein Manshaei, Thierry Turletti 47 */ 48#include "opt_inet.h" --- 68 unchanged lines hidden (view full) --- 117/* 118 * Get the TX rates. 119 * 120 * The short preamble bits aren't set here; the caller should augment 121 * the returned rate with the relevant preamble rate flag. 122 */ 123void 124ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, | 41 42/* 43 * AMRR rate control. See: 44 * http://www-sop.inria.fr/rapports/sophia/RR-5208.html 45 * "IEEE 802.11 Rate Adaptation: A Practical Approach" by 46 * Mathieu Lacage, Hossein Manshaei, Thierry Turletti 47 */ 48#include "opt_inet.h" --- 68 unchanged lines hidden (view full) --- 117/* 118 * Get the TX rates. 119 * 120 * The short preamble bits aren't set here; the caller should augment 121 * the returned rate with the relevant preamble rate flag. 122 */ 123void 124ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, |
125 uint8_t rix0, uint8_t *rix, uint8_t *try) | 125 uint8_t rix0, struct ath_rc_series *rc) |
126{ 127 struct amrr_node *amn = ATH_NODE_AMRR(an); 128 | 126{ 127 struct amrr_node *amn = ATH_NODE_AMRR(an); 128 |
129/* rix[0] = amn->amn_tx_rate0; */ 130 rix[1] = amn->amn_tx_rate1; 131 rix[2] = amn->amn_tx_rate2; 132 rix[3] = amn->amn_tx_rate3; | 129 rc[0].flags = rc[1].flags = rc[2].flags = rc[3].flags = 0; |
133 | 130 |
134 try[0] = amn->amn_tx_try0; 135 try[1] = amn->amn_tx_try1; 136 try[2] = amn->amn_tx_try2; 137 try[3] = amn->amn_tx_try3; | 131 rc[0].rix = amn->amn_tx_rate0; 132 rc[1].rix = amn->amn_tx_rate1; 133 rc[2].rix = amn->amn_tx_rate2; 134 rc[3].rix = amn->amn_tx_rate3; 135 136 rc[0].tries = amn->amn_tx_try0; 137 rc[1].tries = amn->amn_tx_try1; 138 rc[2].tries = amn->amn_tx_try2; 139 rc[3].tries = amn->amn_tx_try3; |
138} 139 140 141void 142ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an, 143 struct ath_desc *ds, int shortPreamble, u_int8_t rix) 144{ 145 struct amrr_node *amn = ATH_NODE_AMRR(an); 146 147 ath_hal_setupxtxdesc(sc->sc_ah, ds 148 , amn->amn_tx_rate1sp, amn->amn_tx_try1 /* series 1 */ 149 , amn->amn_tx_rate2sp, amn->amn_tx_try2 /* series 2 */ 150 , amn->amn_tx_rate3sp, amn->amn_tx_try3 /* series 3 */ 151 ); 152} 153 154void 155ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, | 140} 141 142 143void 144ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an, 145 struct ath_desc *ds, int shortPreamble, u_int8_t rix) 146{ 147 struct amrr_node *amn = ATH_NODE_AMRR(an); 148 149 ath_hal_setupxtxdesc(sc->sc_ah, ds 150 , amn->amn_tx_rate1sp, amn->amn_tx_try1 /* series 1 */ 151 , amn->amn_tx_rate2sp, amn->amn_tx_try2 /* series 2 */ 152 , amn->amn_tx_rate3sp, amn->amn_tx_try3 /* series 3 */ 153 ); 154} 155 156void 157ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, |
156 const struct ath_buf *bf) | 158 const struct ath_rc_series *rc, const struct ath_tx_status *ts, 159 int frame_size, int nframes, int nbad) |
157{ 158 struct amrr_node *amn = ATH_NODE_AMRR(an); | 160{ 161 struct amrr_node *amn = ATH_NODE_AMRR(an); |
159 const struct ath_tx_status *ts = &bf->bf_status.ds_txstat; | |
160 int sr = ts->ts_shortretry; 161 int lr = ts->ts_longretry; 162 int retry_count = sr + lr; 163 164 amn->amn_tx_try0_cnt++; 165 if (retry_count == 1) { 166 amn->amn_tx_try1_cnt++; 167 } else if (retry_count == 2) { --- 292 unchanged lines hidden --- | 162 int sr = ts->ts_shortretry; 163 int lr = ts->ts_longretry; 164 int retry_count = sr + lr; 165 166 amn->amn_tx_try0_cnt++; 167 if (retry_count == 1) { 168 amn->amn_tx_try1_cnt++; 169 } else if (retry_count == 2) { --- 292 unchanged lines hidden --- |