ieee80211_scan.c (276730) | ieee80211_scan.c (276757) |
---|---|
1/*- 2 * Copyright (c) 2002-2008 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-2008 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.c 276730 2015-01-06 02:08:45Z adrian $"); | 27__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_scan.c 276757 2015-01-06 18:25:10Z adrian $"); |
28 29/* 30 * IEEE 802.11 scanning support. 31 */ 32#include "opt_wlan.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> --- 219 unchanged lines hidden (view full) --- 255 /* XXX stat+msg */ 256 scan = NULL; 257 } 258 } 259 ss->ss_ops = scan; 260 } 261} 262 | 28 29/* 30 * IEEE 802.11 scanning support. 31 */ 32#include "opt_wlan.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> --- 219 unchanged lines hidden (view full) --- 255 /* XXX stat+msg */ 256 scan = NULL; 257 } 258 } 259 ss->ss_ops = scan; 260 } 261} 262 |
263/* 264 * XXX TODO: should be a global method! 265 */ 266static char 267channel_type(const struct ieee80211_channel *c) 268{ 269 if (IEEE80211_IS_CHAN_ST(c)) 270 return 'S'; 271 if (IEEE80211_IS_CHAN_108A(c)) 272 return 'T'; 273 if (IEEE80211_IS_CHAN_108G(c)) 274 return 'G'; 275 if (IEEE80211_IS_CHAN_HT(c)) 276 return 'n'; 277 if (IEEE80211_IS_CHAN_A(c)) 278 return 'a'; 279 if (IEEE80211_IS_CHAN_ANYG(c)) 280 return 'g'; 281 if (IEEE80211_IS_CHAN_B(c)) 282 return 'b'; 283 return 'f'; 284} 285 | |
286void 287ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss) 288{ 289 struct ieee80211com *ic = ss->ss_ic; 290 const char *sep; 291 int i; 292 293 sep = ""; 294 for (i = ss->ss_next; i < ss->ss_last; i++) { 295 const struct ieee80211_channel *c = ss->ss_chans[i]; 296 297 printf("%s%u%c", sep, ieee80211_chan2ieee(ic, c), | 263void 264ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss) 265{ 266 struct ieee80211com *ic = ss->ss_ic; 267 const char *sep; 268 int i; 269 270 sep = ""; 271 for (i = ss->ss_next; i < ss->ss_last; i++) { 272 const struct ieee80211_channel *c = ss->ss_chans[i]; 273 274 printf("%s%u%c", sep, ieee80211_chan2ieee(ic, c), |
298 channel_type(c)); | 275 ieee80211_channel_type_char(c)); |
299 sep = ", "; 300 } 301} 302 303#ifdef IEEE80211_DEBUG 304void 305ieee80211_scan_dump(struct ieee80211_scan_state *ss) 306{ --- 457 unchanged lines hidden --- | 276 sep = ", "; 277 } 278} 279 280#ifdef IEEE80211_DEBUG 281void 282ieee80211_scan_dump(struct ieee80211_scan_state *ss) 283{ --- 457 unchanged lines hidden --- |