Lines Matching +full:mode +full:- +full:xxx

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
51 /* XXX until it's implemented as attach ops */
57 * Roaming-related defaults. RSSI thresholds are as returned by the
64 #define ROAM_RSSI_11BONLY_DEFAULT 14 /* 11b-only bss */
68 #define ROAM_RATE_11BONLY_DEFAULT 2*1 /* 11b-only bss */
69 #define ROAM_RATE_HALF_DEFAULT 2*6 /* half-width 11a/g bss */
70 #define ROAM_RATE_QUARTER_DEFAULT 2*3 /* quarter-width 11a/g bss */
72 #define ROAM_MCS_11AC_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11ac bss; XXX not used yet */
81 if (ic->ic_scan_methods == NULL)
84 ic->ic_scan_methods->sc_attach(ic);
97 ic->ic_scan_methods->sc_detach(ic);
131 struct ieee80211com *ic = vap->iv_ic;
134 vap->iv_bgscanidle = (IEEE80211_BGSCAN_IDLE_DEFAULT*1000)/hz;
135 vap->iv_bgscanintvl = IEEE80211_BGSCAN_INTVAL_DEFAULT*hz;
136 vap->iv_scanvalid = IEEE80211_SCAN_VALID_DEFAULT*hz;
138 vap->iv_roaming = IEEE80211_ROAMING_AUTO;
140 memset(vap->iv_roamparms, 0, sizeof(vap->iv_roamparms));
142 if (isclr(ic->ic_modecaps, m))
145 memcpy(&vap->iv_roamparms[m], &defroam[m], sizeof(defroam[m]));
148 ic->ic_scan_methods->sc_vattach(vap);
154 struct ieee80211com *ic = vap->iv_ic;
158 ss = ic->ic_scan;
160 ic->ic_scan_methods->sc_vdetach(vap);
162 if (ss != NULL && ss->ss_vap == vap) {
163 if (ss->ss_ops != NULL) {
164 ss->ss_ops->scan_detach(ss);
165 ss->ss_ops = NULL;
167 ss->ss_vap = NULL;
173 * Simple-minded scanner module support.
187 ieee80211_scanner_get(enum ieee80211_opmode mode)
189 if (mode >= IEEE80211_OPMODE_MAX)
191 if (scanners[mode] == NULL)
192 ieee80211_load_module(scan_modnames[mode]);
193 return scanners[mode];
197 ieee80211_scanner_register(enum ieee80211_opmode mode,
200 if (mode >= IEEE80211_OPMODE_MAX)
202 scanners[mode] = scan;
206 ieee80211_scanner_unregister(enum ieee80211_opmode mode,
209 if (mode >= IEEE80211_OPMODE_MAX)
211 if (scanners[mode] == scan)
212 scanners[mode] = NULL;
227 * operating mode. This is called when the state machine
228 * is transitioned to RUN state w/o scanning--e.g. when
229 * operating in monitor mode. The purpose of this is to
231 * reflect current operating mode.
237 struct ieee80211com *ic = vap->iv_ic;
238 struct ieee80211_scan_state *ss = ic->ic_scan;
243 if (ss->ss_vap != vap || ss->ss_ops != scan) {
247 ss->ss_vap != NULL ?
248 ss->ss_vap->iv_ifp->if_xname : "none",
249 ss->ss_vap != NULL ?
250 ieee80211_opmode_name[ss->ss_vap->iv_opmode] : "none",
251 vap->iv_ifp->if_xname,
252 ieee80211_opmode_name[vap->iv_opmode]);
255 ss->ss_vap = vap;
256 if (ss->ss_ops != scan) {
265 if (scan == NULL || ss->ss_ops == NULL ||
266 ss->ss_ops->scan_attach != scan->scan_attach) {
267 if (ss->ss_ops != NULL)
268 ss->ss_ops->scan_detach(ss);
269 if (scan != NULL && !scan->scan_attach(ss)) {
270 /* XXX attach failure */
271 /* XXX stat+msg */
275 ss->ss_ops = scan;
283 struct ieee80211com *ic = ss->ss_ic;
288 for (i = ss->ss_next; i < ss->ss_last; i++) {
289 const struct ieee80211_channel *c = ss->ss_chans[i];
300 struct ieee80211vap *vap = ss->ss_vap;
302 if_printf(vap->iv_ifp, "scan set ");
305 ticks_to_msecs(ss->ss_mindwell), ticks_to_msecs(ss->ss_maxdwell));
314 /* XXX printf */
320 memcpy(ss->ss_ssid, ssids, nssid * sizeof(ssids[0]));
321 ss->ss_nssid = nssid;
333 struct ieee80211com *ic = vap->iv_ic;
335 scan = ieee80211_scanner_get(vap->iv_opmode);
338 "%s: no scanner support for %s mode\n",
339 __func__, ieee80211_opmode_name[vap->iv_opmode]);
340 /* XXX stat */
344 return ic->ic_scan_methods->sc_start_scan(scan, vap, flags, duration,
357 struct ieee80211com *ic = vap->iv_ic;
358 struct ieee80211_scan_state *ss = ic->ic_scan;
362 scan = ieee80211_scanner_get(vap->iv_opmode);
365 "%s: no scanner support for %s mode\n",
366 __func__, vap->iv_opmode);
367 /* XXX stat */
373 * XXX want more than the ap we're currently associated with
388 if (ss->ss_ops != scan) {
389 /* XXX re-use cache contents? e.g. adhoc<->sta */
394 * XXX TODO: separate things out a bit better.
398 result = ic->ic_scan_methods->sc_check_scan(scan, vap, flags, duration,
416 vap->iv_des_nssid, vap->iv_des_ssid);
426 struct ieee80211com *ic = vap->iv_ic;
431 scan = ieee80211_scanner_get(vap->iv_opmode);
434 "%s: no scanner support for %s mode\n",
435 __func__, vap->iv_opmode);
436 /* XXX stat */
441 * XXX TODO: pull apart the bgscan logic into whatever
445 return (ic->ic_scan_methods->sc_bg_scan(scan, vap, flags));
454 struct ieee80211com *ic = vap->iv_ic;
456 ic->ic_scan_methods->sc_cancel_scan(vap);
468 struct ieee80211com *ic = vap->iv_ic;
470 ic->ic_scan_methods->sc_cancel_anyscan(vap);
476 * (e.g. for firmware-based devices).
481 struct ieee80211com *ic = vap->iv_ic;
483 ic->ic_scan_methods->sc_scan_next(vap);
489 * (e.g. for firmware-based devices).
494 struct ieee80211com *ic = vap->iv_ic;
500 ss = ic->ic_scan;
501 ss->ss_next = ss->ss_last; /* all channels are complete */
503 ic->ic_scan_methods->sc_scan_done(vap);
510 * If the channel is not marked passive-only then send
518 struct ieee80211com *ic = vap->iv_ic;
520 if ((ic->ic_curchan->ic_flags & IEEE80211_CHAN_PASSIVE) && !force) {
521 ic->ic_flags_ext |= IEEE80211_FEXT_PROBECHAN;
525 ic->ic_scan_methods->sc_scan_probe_curchan(vap, force);
536 if (cie->len < 3) {
537 printf(" <bogus country ie, len %d>", cie->len);
540 printf(" country [%c%c%c", cie->cc[0], cie->cc[1], cie->cc[2]);
541 nbands = (cie->len - 3) / sizeof(cie->band[0]);
543 schan = cie->band[i].schan;
544 nchan = cie->band[i].nchan;
546 printf(" %u-%u,%u", schan, schan + nchan-1,
547 cie->band[i].maxtxpwr);
549 printf(" %u,%u", schan, cie->band[i].maxtxpwr);
562 ieee80211_mgt_subtype_name(subtype), sp->chan, sp->bchan);
563 ieee80211_print_essid(sp->ssid + 2, sp->ssid[1]);
568 ether_sprintf(mac), sp->capinfo, sp->bintval, sp->erp);
569 if (sp->country != NULL)
570 dump_country(sp->country);
586 struct ieee80211com *ic = vap->iv_ic;
588 return (ic->ic_scan_methods->sc_add_scan(vap, curchan, sp, wh, subtype,
594 * timer (XXX should be self-contained).
599 struct ieee80211_scan_state *ss = ic->ic_scan;
601 if (ss->ss_ops != NULL)
602 ss->ss_ops->scan_age(ss);
612 struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan;
614 if (ss->ss_ops != NULL) {
617 ss->ss_ops->scan_assoc_success(ss, mac);
628 struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan;
630 if (ss->ss_ops != NULL) {
633 ss->ss_ops->scan_assoc_fail(ss, mac, reason);
644 struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan;
646 if (ss->ss_ops != NULL)
647 ss->ss_ops->scan_iterate(ss, f, arg);
656 struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan;
658 if (ss->ss_ops != NULL && ss->ss_vap == vap) {
660 ss->ss_ops->scan_flush(ss);
671 struct ieee80211_scan_state *ss = ic->ic_scan;
675 if (ss == NULL || ss->ss_ops == NULL || ss->ss_vap == NULL) {
676 /* XXX printf? */
679 if (ss->ss_ops->scan_pickchan == NULL) {
680 IEEE80211_DPRINTF(ss->ss_vap, IEEE80211_MSG_SCAN,
682 "opmode %s\n", __func__, ss->ss_vap->iv_opmode);
685 return ss->ss_ops->scan_pickchan(ss, flags);