Deleted Added
full compact
ieee80211_proto.c (160690) ieee80211_proto.c (165569)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
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:

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

26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
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:

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

26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_proto.c 160690 2006-07-26 03:15:16Z sam $");
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_proto.c 165569 2006-12-27 18:46:18Z sam $");
35
36/*
37 * IEEE 802.11 protocol support.
38 */
39
40#include "opt_inet.h"
41
42#include <sys/param.h>

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

324
325int
326ieee80211_fix_rate(struct ieee80211_node *ni, int flags)
327{
328#define RV(v) ((v) & IEEE80211_RATE_VAL)
329 struct ieee80211com *ic = ni->ni_ic;
330 int i, j, ignore, error;
331 int okrate, badrate, fixedrate;
35
36/*
37 * IEEE 802.11 protocol support.
38 */
39
40#include "opt_inet.h"
41
42#include <sys/param.h>

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

324
325int
326ieee80211_fix_rate(struct ieee80211_node *ni, int flags)
327{
328#define RV(v) ((v) & IEEE80211_RATE_VAL)
329 struct ieee80211com *ic = ni->ni_ic;
330 int i, j, ignore, error;
331 int okrate, badrate, fixedrate;
332 struct ieee80211_rateset *srs, *nrs;
332 const struct ieee80211_rateset *srs;
333 struct ieee80211_rateset *nrs;
333 u_int8_t r;
334
335 /*
336 * If the fixed rate check was requested but no
337 * fixed has been defined then just remove it.
338 */
339 if ((flags & IEEE80211_F_DOFRATE) &&
340 ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE)
341 flags &= ~IEEE80211_F_DOFRATE;
342 error = 0;
343 okrate = badrate = fixedrate = 0;
334 u_int8_t r;
335
336 /*
337 * If the fixed rate check was requested but no
338 * fixed has been defined then just remove it.
339 */
340 if ((flags & IEEE80211_F_DOFRATE) &&
341 ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE)
342 flags &= ~IEEE80211_F_DOFRATE;
343 error = 0;
344 okrate = badrate = fixedrate = 0;
344 srs = &ic->ic_sup_rates[ieee80211_chan2mode(ic, ni->ni_chan)];
345 srs = ieee80211_get_suprates(ic, ni->ni_chan);
345 nrs = &ni->ni_rates;
346 for (i = 0; i < nrs->rs_nrates; ) {
347 ignore = 0;
348 if (flags & IEEE80211_F_DOSORT) {
349 /*
350 * Sort rates.
351 */
352 for (j = i + 1; j < nrs->rs_nrates; j++) {

--- 801 unchanged lines hidden ---
346 nrs = &ni->ni_rates;
347 for (i = 0; i < nrs->rs_nrates; ) {
348 ignore = 0;
349 if (flags & IEEE80211_F_DOSORT) {
350 /*
351 * Sort rates.
352 */
353 for (j = i + 1; j < nrs->rs_nrates; j++) {

--- 801 unchanged lines hidden ---