FreeBSD kernel WLAN code
ieee80211_scan.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD$");
30
31/*
32 * IEEE 802.11 scanning support.
33 */
34#include "opt_wlan.h"
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/proc.h>
39#include <sys/kernel.h>
40#include <sys/malloc.h>
41#include <sys/condvar.h>
42
43#include <sys/socket.h>
44
45#include <net/if.h>
46#include <net/if_var.h>
47#include <net/if_media.h>
48#include <net/ethernet.h>
49
51
52/* XXX until it's implemented as attach ops */
54
55#include <net/bpf.h>
56
57/*
58 * Roaming-related defaults. RSSI thresholds are as returned by the
59 * driver (.5dBm). Transmit rate thresholds are IEEE rate codes (i.e
60 * .5M units) or MCS.
61 */
62/* rssi thresholds */
63#define ROAM_RSSI_11A_DEFAULT 14 /* 11a bss */
64#define ROAM_RSSI_11B_DEFAULT 14 /* 11b bss */
65#define ROAM_RSSI_11BONLY_DEFAULT 14 /* 11b-only bss */
66/* transmit rate thresholds */
67#define ROAM_RATE_11A_DEFAULT 2*12 /* 11a bss */
68#define ROAM_RATE_11B_DEFAULT 2*5 /* 11b bss */
69#define ROAM_RATE_11BONLY_DEFAULT 2*1 /* 11b-only bss */
70#define ROAM_RATE_HALF_DEFAULT 2*6 /* half-width 11a/g bss */
71#define ROAM_RATE_QUARTER_DEFAULT 2*3 /* quarter-width 11a/g bss */
72#define ROAM_MCS_11N_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11n bss */
73#define ROAM_MCS_11AC_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11ac bss; XXX not used yet */
74
75void
77{
78 /*
79 * If there's no scan method pointer, attach the
80 * swscan set as a default.
81 */
82 if (ic->ic_scan_methods == NULL)
84 else
86}
87
88void
90{
91
92 /*
93 * Ideally we'd do the ss_ops detach call here;
94 * but then sc_detach() would need to be split in two.
95 *
96 * I'll do that later.
97 */
99}
100
103 .rate = ROAM_RATE_11A_DEFAULT },
105 .rate = ROAM_RATE_11B_DEFAULT },
109 .rate = ROAM_RATE_11A_DEFAULT },
111 .rate = ROAM_RATE_11A_DEFAULT },
113 .rate = ROAM_RATE_11A_DEFAULT },
115 .rate = ROAM_RATE_HALF_DEFAULT },
119 .rate = ROAM_MCS_11N_DEFAULT },
121 .rate = ROAM_MCS_11N_DEFAULT },
123 .rate = ROAM_MCS_11AC_DEFAULT },
125 .rate = ROAM_MCS_11AC_DEFAULT },
126
127};
128
129void
131{
132 struct ieee80211com *ic = vap->iv_ic;
133 int m;
134
138
140
141 memset(vap->iv_roamparms, 0, sizeof(vap->iv_roamparms));
142 for (m = IEEE80211_MODE_AUTO + 1; m < IEEE80211_MODE_MAX; m++) {
143 if (isclr(ic->ic_modecaps, m))
144 continue;
145
146 memcpy(&vap->iv_roamparms[m], &defroam[m], sizeof(defroam[m]));
147 }
148
149 ic->ic_scan_methods->sc_vattach(vap);
150}
151
152void
154{
155 struct ieee80211com *ic = vap->iv_ic;
156 struct ieee80211_scan_state *ss;
157
158 IEEE80211_LOCK(ic);
159 ss = ic->ic_scan;
160
161 ic->ic_scan_methods->sc_vdetach(vap);
162
163 if (ss != NULL && ss->ss_vap == vap) {
164 if (ss->ss_ops != NULL) {
165 ss->ss_ops->scan_detach(ss);
166 ss->ss_ops = NULL;
167 }
168 ss->ss_vap = NULL;
169 }
171}
172
173/*
174 * Simple-minded scanner module support.
175 */
176static const char *scan_modnames[IEEE80211_OPMODE_MAX] = {
177 "wlan_scan_sta", /* IEEE80211_M_IBSS */
178 "wlan_scan_sta", /* IEEE80211_M_STA */
179 "wlan_scan_wds", /* IEEE80211_M_WDS */
180 "wlan_scan_sta", /* IEEE80211_M_AHDEMO */
181 "wlan_scan_ap", /* IEEE80211_M_HOSTAP */
182 "wlan_scan_monitor", /* IEEE80211_M_MONITOR */
183 "wlan_scan_sta", /* IEEE80211_M_MBSS */
184};
186
187const struct ieee80211_scanner *
189{
190 if (mode >= IEEE80211_OPMODE_MAX)
191 return NULL;
192 if (scanners[mode] == NULL)
194 return scanners[mode];
195}
196
197void
199 const struct ieee80211_scanner *scan)
200{
201 if (mode >= IEEE80211_OPMODE_MAX)
202 return;
203 scanners[mode] = scan;
204}
205
206void
208 const struct ieee80211_scanner *scan)
209{
210 if (mode >= IEEE80211_OPMODE_MAX)
211 return;
212 if (scanners[mode] == scan)
213 scanners[mode] = NULL;
214}
215
216void
218{
219 int m;
220
221 for (m = 0; m < IEEE80211_OPMODE_MAX; m++)
222 if (scanners[m] == scan)
223 scanners[m] = NULL;
224}
225
226/*
227 * Update common scanner state to reflect the current
228 * operating mode. This is called when the state machine
229 * is transitioned to RUN state w/o scanning--e.g. when
230 * operating in monitor mode. The purpose of this is to
231 * ensure later callbacks find ss_ops set to properly
232 * reflect current operating mode.
233 */
234void
236 const struct ieee80211_scanner *scan)
237{
238 struct ieee80211com *ic = vap->iv_ic;
239 struct ieee80211_scan_state *ss = ic->ic_scan;
240
242
243#ifdef IEEE80211_DEBUG
244 if (ss->ss_vap != vap || ss->ss_ops != scan) {
246 "%s: current scanner is <%s:%s>, switch to <%s:%s>\n",
247 __func__,
248 ss->ss_vap != NULL ?
249 ss->ss_vap->iv_ifp->if_xname : "none",
250 ss->ss_vap != NULL ?
252 vap->iv_ifp->if_xname,
254 }
255#endif
256 ss->ss_vap = vap;
257 if (ss->ss_ops != scan) {
258 /*
259 * Switch scanners; detach old, attach new. Special
260 * case where a single scan module implements multiple
261 * policies by using different scan ops but a common
262 * core. We assume if the old and new attach methods
263 * are identical then it's ok to just change ss_ops
264 * and not flush the internal state of the module.
265 */
266 if (scan == NULL || ss->ss_ops == NULL ||
267 ss->ss_ops->scan_attach != scan->scan_attach) {
268 if (ss->ss_ops != NULL)
269 ss->ss_ops->scan_detach(ss);
270 if (scan != NULL && !scan->scan_attach(ss)) {
271 /* XXX attach failure */
272 /* XXX stat+msg */
273 scan = NULL;
274 }
275 }
276 ss->ss_ops = scan;
277 }
278}
279
280void
282{
283 struct ieee80211com *ic = ss->ss_ic;
284 const char *sep;
285 int i;
286
287 sep = "";
288 for (i = ss->ss_next; i < ss->ss_last; i++) {
289 const struct ieee80211_channel *c = ss->ss_chans[i];
290
291 printf("%s%u%c", sep, ieee80211_chan2ieee(ic, c),
293 sep = ", ";
294 }
295}
296
297#ifdef IEEE80211_DEBUG
298void
300{
301 struct ieee80211vap *vap = ss->ss_vap;
302
303 if_printf(vap->iv_ifp, "scan set ");
305 printf(" dwell min %ums max %ums\n",
307}
308#endif /* IEEE80211_DEBUG */
309
310void
312 int nssid, const struct ieee80211_scan_ssid ssids[])
313{
314 if (nssid > IEEE80211_SCAN_MAX_SSID) {
315 /* XXX printf */
317 "%s: too many ssid %d, ignoring all of them\n",
318 __func__, nssid);
319 return;
320 }
321 memcpy(ss->ss_ssid, ssids, nssid * sizeof(ssids[0]));
322 ss->ss_nssid = nssid;
323}
324
325/*
326 * Start a scan unless one is already going.
327 */
328int
329ieee80211_start_scan(struct ieee80211vap *vap, int flags,
330 u_int duration, u_int mindwell, u_int maxdwell,
331 u_int nssid, const struct ieee80211_scan_ssid ssids[])
332{
333 const struct ieee80211_scanner *scan;
334 struct ieee80211com *ic = vap->iv_ic;
335
336 scan = ieee80211_scanner_get(vap->iv_opmode);
337 if (scan == NULL) {
339 "%s: no scanner support for %s mode\n",
340 __func__, ieee80211_opmode_name[vap->iv_opmode]);
341 /* XXX stat */
342 return 0;
343 }
344
345 return ic->ic_scan_methods->sc_start_scan(scan, vap, flags, duration,
346 mindwell, maxdwell, nssid, ssids);
347}
348
349/*
350 * Check the scan cache for an ap/channel to use; if that
351 * fails then kick off a new scan.
352 */
353int
354ieee80211_check_scan(struct ieee80211vap *vap, int flags,
355 u_int duration, u_int mindwell, u_int maxdwell,
356 u_int nssid, const struct ieee80211_scan_ssid ssids[])
357{
358 struct ieee80211com *ic = vap->iv_ic;
359 struct ieee80211_scan_state *ss = ic->ic_scan;
360 const struct ieee80211_scanner *scan;
361 int result;
362
363 scan = ieee80211_scanner_get(vap->iv_opmode);
364 if (scan == NULL) {
366 "%s: no scanner support for %s mode\n",
367 __func__, vap->iv_opmode);
368 /* XXX stat */
369 return 0;
370 }
371
372 /*
373 * Check if there's a list of scan candidates already.
374 * XXX want more than the ap we're currently associated with
375 */
376
377 IEEE80211_LOCK(ic);
379 "%s: %s scan, %s%s%s%s%s\n"
380 , __func__
381 , flags & IEEE80211_SCAN_ACTIVE ? "active" : "passive"
382 , flags & IEEE80211_SCAN_FLUSH ? "flush" : "append"
383 , flags & IEEE80211_SCAN_NOPICK ? ", nopick" : ""
384 , flags & IEEE80211_SCAN_NOJOIN ? ", nojoin" : ""
385 , flags & IEEE80211_SCAN_PICK1ST ? ", pick1st" : ""
386 , flags & IEEE80211_SCAN_ONCE ? ", once" : ""
387 );
388
389 if (ss->ss_ops != scan) {
390 /* XXX re-use cache contents? e.g. adhoc<->sta */
391 flags |= IEEE80211_SCAN_FLUSH;
392 }
393
394 /*
395 * XXX TODO: separate things out a bit better.
396 */
398
399 result = ic->ic_scan_methods->sc_check_scan(scan, vap, flags, duration,
400 mindwell, maxdwell, nssid, ssids);
401
403
404 return (result);
405}
406
407/*
408 * Check the scan cache for an ap/channel to use; if that fails
409 * then kick off a scan using the current settings.
410 */
411int
413{
414 return ieee80211_check_scan(vap,
417 vap->iv_des_nssid, vap->iv_des_ssid);
418}
419
420/*
421 * Restart a previous scan. If the previous scan completed
422 * then we start again using the existing channel list.
423 */
424int
425ieee80211_bg_scan(struct ieee80211vap *vap, int flags)
426{
427 struct ieee80211com *ic = vap->iv_ic;
428 const struct ieee80211_scanner *scan;
429
430 // IEEE80211_UNLOCK_ASSERT(sc);
431
432 scan = ieee80211_scanner_get(vap->iv_opmode);
433 if (scan == NULL) {
435 "%s: no scanner support for %s mode\n",
436 __func__, vap->iv_opmode);
437 /* XXX stat */
438 return 0;
439 }
440
441 /*
442 * XXX TODO: pull apart the bgscan logic into whatever
443 * belongs here and whatever belongs in the software
444 * scanner.
445 */
446 return (ic->ic_scan_methods->sc_bg_scan(scan, vap, flags));
447}
448
449/*
450 * Cancel any scan currently going on for the specified vap.
451 */
452void
454{
455 struct ieee80211com *ic = vap->iv_ic;
456
458}
459
460/*
461 * Cancel any scan currently going on.
462 *
463 * This is called during normal 802.11 data path to cancel
464 * a scan so a newly arrived normal data packet can be sent.
465 */
466void
468{
469 struct ieee80211com *ic = vap->iv_ic;
470
472}
473
474/*
475 * Manually switch to the next channel in the channel list.
476 * Provided for drivers that manage scanning themselves
477 * (e.g. for firmware-based devices).
478 */
479void
481{
482 struct ieee80211com *ic = vap->iv_ic;
483
485}
486
487/*
488 * Manually stop a scan that is currently running.
489 * Provided for drivers that are not able to scan single channels
490 * (e.g. for firmware-based devices).
491 */
492void
494{
495 struct ieee80211com *ic = vap->iv_ic;
496 struct ieee80211_scan_state *ss;
497
498 IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: called\n", __func__);
499
500 IEEE80211_LOCK(ic);
501 ss = ic->ic_scan;
502 ss->ss_next = ss->ss_last; /* all channels are complete */
503
505
507}
508
509/*
510 * Probe the current channel, if allowed, while scanning.
511 * If the channel is not marked passive-only then send
512 * a probe request immediately. Otherwise mark state and
513 * listen for beacons on the channel; if we receive something
514 * then we'll transmit a probe request.
515 */
516void
518{
519 struct ieee80211com *ic = vap->iv_ic;
520
521 if ((ic->ic_curchan->ic_flags & IEEE80211_CHAN_PASSIVE) && !force) {
523 return;
524 }
525
526 ic->ic_scan_methods->sc_scan_probe_curchan(vap, force);
527}
528
529#ifdef IEEE80211_DEBUG
530static void
531dump_country(const uint8_t *ie)
532{
533 const struct ieee80211_country_ie *cie =
534 (const struct ieee80211_country_ie *) ie;
535 int i, nbands, schan, nchan;
536
537 if (cie->len < 3) {
538 printf(" <bogus country ie, len %d>", cie->len);
539 return;
540 }
541 printf(" country [%c%c%c", cie->cc[0], cie->cc[1], cie->cc[2]);
542 nbands = (cie->len - 3) / sizeof(cie->band[0]);
543 for (i = 0; i < nbands; i++) {
544 schan = cie->band[i].schan;
545 nchan = cie->band[i].nchan;
546 if (nchan != 1)
547 printf(" %u-%u,%u", schan, schan + nchan-1,
548 cie->band[i].maxtxpwr);
549 else
550 printf(" %u,%u", schan, cie->band[i].maxtxpwr);
551 }
552 printf("]");
553}
554
555void
556ieee80211_scan_dump_probe_beacon(uint8_t subtype, int isnew,
557 const uint8_t mac[IEEE80211_ADDR_LEN],
558 const struct ieee80211_scanparams *sp, int rssi)
559{
560
561 printf("[%s] %s%s on chan %u (bss chan %u) ",
562 ether_sprintf(mac), isnew ? "new " : "",
563 ieee80211_mgt_subtype_name(subtype), sp->chan, sp->bchan);
564 ieee80211_print_essid(sp->ssid + 2, sp->ssid[1]);
565 printf(" rssi %d\n", rssi);
566
567 if (isnew) {
568 printf("[%s] caps 0x%x bintval %u erp 0x%x",
569 ether_sprintf(mac), sp->capinfo, sp->bintval, sp->erp);
570 if (sp->country != NULL)
571 dump_country(sp->country);
572 printf("\n");
573 }
574}
575#endif /* IEEE80211_DEBUG */
576
577/*
578 * Process a beacon or probe response frame.
579 */
580void
582 struct ieee80211_channel *curchan,
583 const struct ieee80211_scanparams *sp,
584 const struct ieee80211_frame *wh,
585 int subtype, int rssi, int noise)
586{
587 struct ieee80211com *ic = vap->iv_ic;
588
589 return (ic->ic_scan_methods->sc_add_scan(vap, curchan, sp, wh, subtype,
590 rssi, noise));
591}
592
593/*
594 * Timeout/age scan cache entries; called from sta timeout
595 * timer (XXX should be self-contained).
596 */
597void
599{
600 struct ieee80211_scan_state *ss = ic->ic_scan;
601
602 if (ss->ss_ops != NULL)
603 ss->ss_ops->scan_age(ss);
604}
605
606/*
607 * Mark a scan cache entry after a successful associate.
608 */
609void
610ieee80211_scan_assoc_success(struct ieee80211vap *vap, const uint8_t mac[])
611{
612 struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan;
613
614 if (ss->ss_ops != NULL) {
616 mac, "%s", __func__);
617 ss->ss_ops->scan_assoc_success(ss, mac);
618 }
619}
620
621/*
622 * Demerit a scan cache entry after failing to associate.
623 */
624void
626 const uint8_t mac[], int reason)
627{
628 struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan;
629
630 if (ss->ss_ops != NULL) {
632 "%s: reason %u", __func__, reason);
633 ss->ss_ops->scan_assoc_fail(ss, mac, reason);
634 }
635}
636
637/*
638 * Iterate over the contents of the scan cache.
639 */
640void
642 ieee80211_scan_iter_func *f, void *arg)
643{
644 struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan;
645
646 if (ss->ss_ops != NULL)
647 ss->ss_ops->scan_iterate(ss, f, arg);
648}
649
650/*
651 * Flush the contents of the scan cache.
652 */
653void
655{
656 struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan;
657
658 if (ss->ss_ops != NULL && ss->ss_vap == vap) {
659 IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s\n", __func__);
660 ss->ss_ops->scan_flush(ss);
661 }
662}
663
664/*
665 * Check the scan cache for an ap/channel to use; if that
666 * fails then kick off a new scan.
667 */
668struct ieee80211_channel *
670{
671 struct ieee80211_scan_state *ss = ic->ic_scan;
672
674
675 if (ss == NULL || ss->ss_ops == NULL || ss->ss_vap == NULL) {
676 /* XXX printf? */
677 return NULL;
678 }
679 if (ss->ss_ops->scan_pickchan == NULL) {
681 "%s: scan module does not support picking a channel, "
682 "opmode %s\n", __func__, ss->ss_vap->iv_opmode);
683 return NULL;
684 }
685 return ss->ss_ops->scan_pickchan(ss, flags);
686}
@ IEEE80211_MODE_11NG
Definition: _ieee80211.h:71
@ IEEE80211_MODE_TURBO_A
Definition: _ieee80211.h:67
@ IEEE80211_MODE_11NA
Definition: _ieee80211.h:70
@ IEEE80211_MODE_11G
Definition: _ieee80211.h:65
@ IEEE80211_MODE_HALF
Definition: _ieee80211.h:72
@ IEEE80211_MODE_STURBO_A
Definition: _ieee80211.h:69
@ IEEE80211_MODE_VHT_2GHZ
Definition: _ieee80211.h:74
@ IEEE80211_MODE_TURBO_G
Definition: _ieee80211.h:68
@ IEEE80211_MODE_AUTO
Definition: _ieee80211.h:62
@ IEEE80211_MODE_QUARTER
Definition: _ieee80211.h:73
@ IEEE80211_MODE_11B
Definition: _ieee80211.h:64
@ IEEE80211_MODE_VHT_5GHZ
Definition: _ieee80211.h:75
@ IEEE80211_MODE_11A
Definition: _ieee80211.h:63
#define IEEE80211_CHAN_PASSIVE
Definition: _ieee80211.h:178
#define IEEE80211_OPMODE_MAX
Definition: _ieee80211.h:94
@ IEEE80211_ROAMING_AUTO
Definition: _ieee80211.h:133
ieee80211_opmode
Definition: _ieee80211.h:85
#define IEEE80211_MODE_MAX
Definition: _ieee80211.h:77
int ieee80211_chan2ieee(struct ieee80211com *ic, const struct ieee80211_channel *c)
Definition: ieee80211.c:1076
char ieee80211_channel_type_char(const struct ieee80211_channel *c)
Definition: ieee80211.c:2626
#define IEEE80211_ADDR_LEN
Definition: ieee80211.h:37
static const struct ieee80211_aclator mac
void ieee80211_load_module(const char *modname)
#define IEEE80211_UNLOCK(_ic)
#define ticks_to_msecs(t)
#define IEEE80211_LOCK_ASSERT(_ic)
#define IEEE80211_LOCK(_ic)
void ieee80211_print_essid(const uint8_t *essid, int len)
const char * ieee80211_opmode_name[IEEE80211_OPMODE_MAX]
static __inline const char * ieee80211_mgt_subtype_name(uint8_t subtype)
const struct ieee80211_scanner * ieee80211_scanner_get(enum ieee80211_opmode mode)
#define ROAM_RATE_11B_DEFAULT
#define ROAM_MCS_11N_DEFAULT
#define ROAM_RSSI_11B_DEFAULT
void ieee80211_scan_detach(struct ieee80211com *ic)
int ieee80211_bg_scan(struct ieee80211vap *vap, int flags)
static const struct ieee80211_roamparam defroam[IEEE80211_MODE_MAX]
#define ROAM_RSSI_11A_DEFAULT
void ieee80211_scan_copy_ssid(struct ieee80211vap *vap, struct ieee80211_scan_state *ss, int nssid, const struct ieee80211_scan_ssid ssids[])
void ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss)
#define ROAM_RSSI_11BONLY_DEFAULT
void ieee80211_scanner_unregister(enum ieee80211_opmode mode, const struct ieee80211_scanner *scan)
#define ROAM_RATE_11A_DEFAULT
void ieee80211_cancel_anyscan(struct ieee80211vap *vap)
#define ROAM_RATE_11BONLY_DEFAULT
void ieee80211_add_scan(struct ieee80211vap *vap, struct ieee80211_channel *curchan, const struct ieee80211_scanparams *sp, const struct ieee80211_frame *wh, int subtype, int rssi, int noise)
#define ROAM_RATE_QUARTER_DEFAULT
void ieee80211_scan_iterate(struct ieee80211vap *vap, ieee80211_scan_iter_func *f, void *arg)
void ieee80211_scan_assoc_fail(struct ieee80211vap *vap, const uint8_t mac[], int reason)
int ieee80211_start_scan(struct ieee80211vap *vap, int flags, u_int duration, u_int mindwell, u_int maxdwell, u_int nssid, const struct ieee80211_scan_ssid ssids[])
__FBSDID("$FreeBSD$")
void ieee80211_scanner_unregister_all(const struct ieee80211_scanner *scan)
struct ieee80211_channel * ieee80211_scan_pickchannel(struct ieee80211com *ic, int flags)
void ieee80211_cancel_scan(struct ieee80211vap *vap)
void ieee80211_scan_vdetach(struct ieee80211vap *vap)
#define ROAM_RATE_HALF_DEFAULT
void ieee80211_scan_attach(struct ieee80211com *ic)
static const char * scan_modnames[IEEE80211_OPMODE_MAX]
int ieee80211_check_scan(struct ieee80211vap *vap, int flags, u_int duration, u_int mindwell, u_int maxdwell, u_int nssid, const struct ieee80211_scan_ssid ssids[])
#define ROAM_MCS_11AC_DEFAULT
void ieee80211_scan_done(struct ieee80211vap *vap)
void ieee80211_scan_timeout(struct ieee80211com *ic)
int ieee80211_check_scan_current(struct ieee80211vap *vap)
void ieee80211_scanner_register(enum ieee80211_opmode mode, const struct ieee80211_scanner *scan)
void ieee80211_scan_next(struct ieee80211vap *vap)
void ieee80211_scan_vattach(struct ieee80211vap *vap)
void ieee80211_scan_update_locked(struct ieee80211vap *vap, const struct ieee80211_scanner *scan)
void ieee80211_scan_flush(struct ieee80211vap *vap)
static const struct ieee80211_scanner * scanners[IEEE80211_OPMODE_MAX]
void ieee80211_probe_curchan(struct ieee80211vap *vap, int force)
void ieee80211_scan_assoc_success(struct ieee80211vap *vap, const uint8_t mac[])
#define IEEE80211_SCAN_ONCE
#define IEEE80211_SCAN_PICK1ST
#define IEEE80211_SCAN_NOJOIN
void ieee80211_scan_iter_func(void *, const struct ieee80211_scan_entry *)
#define IEEE80211_SCAN_FOREVER
#define IEEE80211_SCAN_NOPICK
#define IEEE80211_SCAN_ACTIVE
#define IEEE80211_SCAN_FLUSH
void ieee80211_scan_dump_probe_beacon(uint8_t subtype, int isnew, const uint8_t mac[IEEE80211_ADDR_LEN], const struct ieee80211_scanparams *sp, int rssi)
void ieee80211_scan_dump(struct ieee80211_scan_state *ss)
#define IEEE80211_SCAN_MAX_SSID
void ieee80211_swscan_attach(struct ieee80211com *ic)
#define IEEE80211_FEXT_PROBECHAN
#define IEEE80211_BGSCAN_INTVAL_DEFAULT
Definition: ieee80211_var.h:70
#define IEEE80211_MSG_SCAN
#define IEEE80211_SCAN_VALID_DEFAULT
Definition: ieee80211_var.h:76
#define IEEE80211_NOTE_MAC(_vap, _m, _mac, _fmt,...)
#define IEEE80211_BGSCAN_IDLE_DEFAULT
Definition: ieee80211_var.h:73
#define IEEE80211_DPRINTF(_vap, _m, _fmt,...)
uint32_t ic_flags
Definition: _ieee80211.h:141
struct ieee80211_country_ie::@5 band[1]
void(* sc_cancel_anyscan)(struct ieee80211vap *)
int(* sc_start_scan)(const struct ieee80211_scanner *, struct ieee80211vap *, int, u_int, u_int, u_int, u_int, const struct ieee80211_scan_ssid ssids[])
void(* sc_add_scan)(struct ieee80211vap *, struct ieee80211_channel *, const struct ieee80211_scanparams *, const struct ieee80211_frame *, int, int, int)
void(* sc_vattach)(struct ieee80211vap *)
void(* sc_scan_done)(struct ieee80211vap *)
void(* sc_scan_next)(struct ieee80211vap *)
int(* sc_check_scan)(const struct ieee80211_scanner *, struct ieee80211vap *, int, u_int, u_int, u_int, u_int, const struct ieee80211_scan_ssid ssids[])
void(* sc_attach)(struct ieee80211com *)
void(* sc_detach)(struct ieee80211com *)
void(* sc_scan_probe_curchan)(struct ieee80211vap *, int)
int(* sc_bg_scan)(const struct ieee80211_scanner *, struct ieee80211vap *, int)
void(* sc_cancel_scan)(struct ieee80211vap *)
void(* sc_vdetach)(struct ieee80211vap *)
unsigned long ss_maxdwell
const struct ieee80211_scanner * ss_ops
struct ieee80211com * ss_ic
struct ieee80211_channel * ss_chans[IEEE80211_SCAN_MAX]
struct ieee80211_scan_ssid ss_ssid[IEEE80211_SCAN_MAX_SSID]
struct ieee80211vap * ss_vap
unsigned long ss_mindwell
int(* scan_flush)(struct ieee80211_scan_state *)
int(* scan_detach)(struct ieee80211_scan_state *)
void(* scan_assoc_success)(struct ieee80211_scan_state *, const uint8_t macaddr[IEEE80211_ADDR_LEN])
int(* scan_attach)(struct ieee80211_scan_state *)
void(* scan_assoc_fail)(struct ieee80211_scan_state *, const uint8_t macaddr[IEEE80211_ADDR_LEN], int reason)
void(* scan_age)(struct ieee80211_scan_state *)
void(* scan_iterate)(struct ieee80211_scan_state *, ieee80211_scan_iter_func *, void *)
struct ieee80211_channel *(* scan_pickchan)(struct ieee80211_scan_state *, int)
uint32_t ic_flags_ext
struct ieee80211_scan_methods * ic_scan_methods
uint8_t ic_modecaps[IEEE80211_MODE_BYTES]
struct ieee80211_scan_state * ic_scan
struct ieee80211_channel * ic_curchan
struct ieee80211com * iv_ic
enum ieee80211_roamingmode iv_roaming
enum ieee80211_opmode iv_opmode
u_int iv_scanvalid
u_int iv_bgscanidle
u_int iv_bgscanintvl
struct ieee80211_roamparam iv_roamparms[IEEE80211_MODE_MAX]
struct ifnet * iv_ifp
struct ieee80211_scan_ssid iv_des_ssid[1]