Deleted Added
full compact
ieee80211_scan_sta.c (189377) ieee80211_scan_sta.c (189980)
1/*-
2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
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

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

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
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

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

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_scan_sta.c 189377 2009-03-04 22:05:25Z sam $");
27__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_scan_sta.c 189980 2009-03-18 19:28:17Z sam $");
28
29/*
30 * IEEE 802.11 station scanning support.
31 */
32#include "opt_wlan.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>

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

121#define MATCH_FAILS 0x0040 /* too many failed auth attempts */
122#define MATCH_NOTSEEN 0x0080 /* not seen in recent scans */
123#define MATCH_RSSI 0x0100 /* rssi deemed too low to use */
124#define MATCH_CC 0x0200 /* country code mismatch */
125#define MATCH_TDMA_NOIE 0x0400 /* no TDMA ie */
126#define MATCH_TDMA_NOTMASTER 0x0800 /* not TDMA master */
127#define MATCH_TDMA_NOSLOT 0x1000 /* all TDMA slots occupied */
128#define MATCH_TDMA_LOCAL 0x2000 /* local address */
28
29/*
30 * IEEE 802.11 station scanning support.
31 */
32#include "opt_wlan.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>

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

121#define MATCH_FAILS 0x0040 /* too many failed auth attempts */
122#define MATCH_NOTSEEN 0x0080 /* not seen in recent scans */
123#define MATCH_RSSI 0x0100 /* rssi deemed too low to use */
124#define MATCH_CC 0x0200 /* country code mismatch */
125#define MATCH_TDMA_NOIE 0x0400 /* no TDMA ie */
126#define MATCH_TDMA_NOTMASTER 0x0800 /* not TDMA master */
127#define MATCH_TDMA_NOSLOT 0x1000 /* all TDMA slots occupied */
128#define MATCH_TDMA_LOCAL 0x2000 /* local address */
129#define MATCH_TDMA_VERSION 0x4000 /* protocol version mismatch */
129static int match_bss(struct ieee80211vap *,
130 const struct ieee80211_scan_state *, struct sta_entry *, int);
131static void adhoc_age(struct ieee80211_scan_state *);
132
133static __inline int
134isocmp(const uint8_t cc1[], const uint8_t cc2[])
135{
136 return (cc1[0] == cc2[0] && cc1[1] == cc2[1]);

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

965 /*
966 * TDMA operation cannot coexist with a normal 802.11 network;
967 * skip if IBSS or ESS capabilities are marked and require
968 * the beacon have a TDMA ie present.
969 */
970 if (vap->iv_caps & IEEE80211_C_TDMA) {
971 const struct ieee80211_tdma_param *tdma =
972 (const struct ieee80211_tdma_param *)se->se_ies.tdma_ie;
130static int match_bss(struct ieee80211vap *,
131 const struct ieee80211_scan_state *, struct sta_entry *, int);
132static void adhoc_age(struct ieee80211_scan_state *);
133
134static __inline int
135isocmp(const uint8_t cc1[], const uint8_t cc2[])
136{
137 return (cc1[0] == cc2[0] && cc1[1] == cc2[1]);

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

966 /*
967 * TDMA operation cannot coexist with a normal 802.11 network;
968 * skip if IBSS or ESS capabilities are marked and require
969 * the beacon have a TDMA ie present.
970 */
971 if (vap->iv_caps & IEEE80211_C_TDMA) {
972 const struct ieee80211_tdma_param *tdma =
973 (const struct ieee80211_tdma_param *)se->se_ies.tdma_ie;
974 const struct ieee80211_tdma_state *ts = vap->iv_tdma;
973
974 if (tdma == NULL)
975 fail |= MATCH_TDMA_NOIE;
975
976 if (tdma == NULL)
977 fail |= MATCH_TDMA_NOIE;
978 else if (tdma->tdma_version != ts->tdma_version)
979 fail |= MATCH_TDMA_VERSION;
976 else if (tdma->tdma_slot != 0)
977 fail |= MATCH_TDMA_NOTMASTER;
978 else if (tdma_isfull(tdma))
979 fail |= MATCH_TDMA_NOSLOT;
980#if 0
981 else if (ieee80211_local_address(se->se_macaddr))
982 fail |= MATCH_TDMA_LOCAL;
983#endif

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

1057#ifdef IEEE80211_DEBUG
1058 if (ieee80211_msg(vap, debug)) {
1059 printf(" %c %s",
1060 fail & MATCH_FAILS ? '=' :
1061 fail & MATCH_NOTSEEN ? '^' :
1062 fail & MATCH_CC ? '$' :
1063#ifdef IEEE80211_SUPPORT_TDMA
1064 fail & MATCH_TDMA_NOIE ? '&' :
980 else if (tdma->tdma_slot != 0)
981 fail |= MATCH_TDMA_NOTMASTER;
982 else if (tdma_isfull(tdma))
983 fail |= MATCH_TDMA_NOSLOT;
984#if 0
985 else if (ieee80211_local_address(se->se_macaddr))
986 fail |= MATCH_TDMA_LOCAL;
987#endif

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

1061#ifdef IEEE80211_DEBUG
1062 if (ieee80211_msg(vap, debug)) {
1063 printf(" %c %s",
1064 fail & MATCH_FAILS ? '=' :
1065 fail & MATCH_NOTSEEN ? '^' :
1066 fail & MATCH_CC ? '$' :
1067#ifdef IEEE80211_SUPPORT_TDMA
1068 fail & MATCH_TDMA_NOIE ? '&' :
1065 fail & MATCH_TDMA_NOTMASTER ? ':' :
1066 fail & MATCH_TDMA_NOSLOT ? '@' :
1067 fail & MATCH_TDMA_LOCAL ? '#' :
1069 fail & MATCH_TDMA_VERSION ? 'v' :
1070 fail & MATCH_TDMA_NOTMASTER ? 's' :
1071 fail & MATCH_TDMA_NOSLOT ? 'f' :
1072 fail & MATCH_TDMA_LOCAL ? 'l' :
1068#endif
1069 fail ? '-' : '+', ether_sprintf(se->se_macaddr));
1070 printf(" %s%c", ether_sprintf(se->se_bssid),
1071 fail & MATCH_BSSID ? '!' : ' ');
1072 printf(" %3d%c", ieee80211_chan2ieee(ic, se->se_chan),
1073 fail & MATCH_CHANNEL ? '!' : ' ');
1074 printf(" %+4d%c", se->se_rssi, fail & MATCH_RSSI ? '!' : ' ');
1075 printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2,
1076 fail & MATCH_RATE ? '!' : ' ');
1077 printf(" %4s%c",
1078 (se->se_capinfo & IEEE80211_CAPINFO_ESS) ? "ess" :
1073#endif
1074 fail ? '-' : '+', ether_sprintf(se->se_macaddr));
1075 printf(" %s%c", ether_sprintf(se->se_bssid),
1076 fail & MATCH_BSSID ? '!' : ' ');
1077 printf(" %3d%c", ieee80211_chan2ieee(ic, se->se_chan),
1078 fail & MATCH_CHANNEL ? '!' : ' ');
1079 printf(" %+4d%c", se->se_rssi, fail & MATCH_RSSI ? '!' : ' ');
1080 printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2,
1081 fail & MATCH_RATE ? '!' : ' ');
1082 printf(" %4s%c",
1083 (se->se_capinfo & IEEE80211_CAPINFO_ESS) ? "ess" :
1079 (se->se_capinfo & IEEE80211_CAPINFO_IBSS) ? "ibss" :
1080 "????",
1084 (se->se_capinfo & IEEE80211_CAPINFO_IBSS) ? "ibss" : "",
1081 fail & MATCH_CAPINFO ? '!' : ' ');
1082 printf(" %3s%c ",
1083 (se->se_capinfo & IEEE80211_CAPINFO_PRIVACY) ?
1084 "wep" : "no",
1085 fail & MATCH_PRIVACY ? '!' : ' ');
1086 ieee80211_print_essid(se->se_ssid+2, se->se_ssid[1]);
1087 printf("%s\n", fail & MATCH_SSID ? "!" : "");
1088 }

--- 701 unchanged lines hidden ---
1085 fail & MATCH_CAPINFO ? '!' : ' ');
1086 printf(" %3s%c ",
1087 (se->se_capinfo & IEEE80211_CAPINFO_PRIVACY) ?
1088 "wep" : "no",
1089 fail & MATCH_PRIVACY ? '!' : ' ');
1090 ieee80211_print_essid(se->se_ssid+2, se->se_ssid[1]);
1091 printf("%s\n", fail & MATCH_SSID ? "!" : "");
1092 }

--- 701 unchanged lines hidden ---