Deleted Added
full compact
sample.c (144348) sample.c (144546)
1/*-
2 * Copyright (c) 2005 John Bicket
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34 * THE POSSIBILITY OF SUCH DAMAGES.
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005 John Bicket
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34 * THE POSSIBILITY OF SUCH DAMAGES.
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/dev/ath/ath_rate/sample/sample.c 144348 2005-03-30 20:20:49Z sam $");
38__FBSDID("$FreeBSD: head/sys/dev/ath/ath_rate/sample/sample.c 144546 2005-04-02 18:54:30Z sam $");
39
40/*
41 * John Bicket's SampleRate control algorithm.
42 */
43#include "opt_inet.h"
44
45#include <sys/param.h>
46#include <sys/systm.h>

--- 185 unchanged lines hidden (view full) ---

232 return ndx;
233 }
234 }
235 return current_ndx;
236}
237
238void
239ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
39
40/*
41 * John Bicket's SampleRate control algorithm.
42 */
43#include "opt_inet.h"
44
45#include <sys/param.h>
46#include <sys/systm.h>

--- 185 unchanged lines hidden (view full) ---

232 return ndx;
233 }
234 }
235 return current_ndx;
236}
237
238void
239ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
240 HAL_BOOL shortPreamble, size_t frameLen,
240 int shortPreamble, size_t frameLen,
241 u_int8_t *rix, int *try0, u_int8_t *txrate)
242{
243 struct sample_node *sn = ATH_NODE_SAMPLE(an);
244 struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc);
245 struct ieee80211com *ic = &sc->sc_ic;
246 int ndx, size_bin, mrr, best_ndx;
247 unsigned average_tx_time;
248

--- 124 unchanged lines hidden (view full) ---

373 *txrate = sn->rates[ndx].rateCode;
374 }
375 sn->packets_sent[size_bin]++;
376 an->an_node.ni_txrate = ndx;
377}
378
379void
380ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an,
241 u_int8_t *rix, int *try0, u_int8_t *txrate)
242{
243 struct sample_node *sn = ATH_NODE_SAMPLE(an);
244 struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc);
245 struct ieee80211com *ic = &sc->sc_ic;
246 int ndx, size_bin, mrr, best_ndx;
247 unsigned average_tx_time;
248

--- 124 unchanged lines hidden (view full) ---

373 *txrate = sn->rates[ndx].rateCode;
374 }
375 sn->packets_sent[size_bin]++;
376 an->an_node.ni_txrate = ndx;
377}
378
379void
380ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an,
381 struct ath_desc *ds, HAL_BOOL shortPreamble, u_int8_t rix)
381 struct ath_desc *ds, int shortPreamble, u_int8_t rix)
382{
383 struct sample_node *sn = ATH_NODE_SAMPLE(an);
384 int rateCode = -1;
385 int frame_size, size_bin, best_ndx, ndx;
386
387 frame_size = ds->ds_ctl0 & 0x0fff; /* low-order 12 bits of ds_ctl0 */
388 KASSERT(frame_size != 0, ("no frame size"));
389 size_bin = size_to_bin(frame_size);

--- 454 unchanged lines hidden ---
382{
383 struct sample_node *sn = ATH_NODE_SAMPLE(an);
384 int rateCode = -1;
385 int frame_size, size_bin, best_ndx, ndx;
386
387 frame_size = ds->ds_ctl0 & 0x0fff; /* low-order 12 bits of ds_ctl0 */
388 KASSERT(frame_size != 0, ("no frame size"));
389 size_bin = size_to_bin(frame_size);

--- 454 unchanged lines hidden ---