FreeBSD kernel WLAN code
ieee80211_scan.c File Reference
#include <sys/cdefs.h>
#include "opt_wlan.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/condvar.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_media.h>
#include <net/ethernet.h>
#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211_scan_sw.h>
#include <net/bpf.h>
Include dependency graph for ieee80211_scan.c:

Go to the source code of this file.

Macros

#define ROAM_RSSI_11A_DEFAULT   14 /* 11a bss */
 
#define ROAM_RSSI_11B_DEFAULT   14 /* 11b bss */
 
#define ROAM_RSSI_11BONLY_DEFAULT   14 /* 11b-only bss */
 
#define ROAM_RATE_11A_DEFAULT   2*12 /* 11a bss */
 
#define ROAM_RATE_11B_DEFAULT   2*5 /* 11b bss */
 
#define ROAM_RATE_11BONLY_DEFAULT   2*1 /* 11b-only bss */
 
#define ROAM_RATE_HALF_DEFAULT   2*6 /* half-width 11a/g bss */
 
#define ROAM_RATE_QUARTER_DEFAULT   2*3 /* quarter-width 11a/g bss */
 
#define ROAM_MCS_11N_DEFAULT   (1 | IEEE80211_RATE_MCS) /* 11n bss */
 
#define ROAM_MCS_11AC_DEFAULT   (1 | IEEE80211_RATE_MCS) /* 11ac bss; XXX not used yet */
 

Functions

 __FBSDID ("$FreeBSD$")
 
void ieee80211_scan_attach (struct ieee80211com *ic)
 
void ieee80211_scan_detach (struct ieee80211com *ic)
 
void ieee80211_scan_vattach (struct ieee80211vap *vap)
 
void ieee80211_scan_vdetach (struct ieee80211vap *vap)
 
const struct ieee80211_scannerieee80211_scanner_get (enum ieee80211_opmode mode)
 
void ieee80211_scanner_register (enum ieee80211_opmode mode, const struct ieee80211_scanner *scan)
 
void ieee80211_scanner_unregister (enum ieee80211_opmode mode, const struct ieee80211_scanner *scan)
 
void ieee80211_scanner_unregister_all (const struct ieee80211_scanner *scan)
 
void ieee80211_scan_update_locked (struct ieee80211vap *vap, const struct ieee80211_scanner *scan)
 
void ieee80211_scan_dump_channels (const struct ieee80211_scan_state *ss)
 
void ieee80211_scan_copy_ssid (struct ieee80211vap *vap, struct ieee80211_scan_state *ss, int nssid, const struct ieee80211_scan_ssid ssids[])
 
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[])
 
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[])
 
int ieee80211_check_scan_current (struct ieee80211vap *vap)
 
int ieee80211_bg_scan (struct ieee80211vap *vap, int flags)
 
void ieee80211_cancel_scan (struct ieee80211vap *vap)
 
void ieee80211_cancel_anyscan (struct ieee80211vap *vap)
 
void ieee80211_scan_next (struct ieee80211vap *vap)
 
void ieee80211_scan_done (struct ieee80211vap *vap)
 
void ieee80211_probe_curchan (struct ieee80211vap *vap, int force)
 
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)
 
void ieee80211_scan_timeout (struct ieee80211com *ic)
 
void ieee80211_scan_assoc_success (struct ieee80211vap *vap, const uint8_t mac[])
 
void ieee80211_scan_assoc_fail (struct ieee80211vap *vap, const uint8_t mac[], int reason)
 
void ieee80211_scan_iterate (struct ieee80211vap *vap, ieee80211_scan_iter_func *f, void *arg)
 
void ieee80211_scan_flush (struct ieee80211vap *vap)
 
struct ieee80211_channelieee80211_scan_pickchannel (struct ieee80211com *ic, int flags)
 

Variables

static const struct ieee80211_roamparam defroam [IEEE80211_MODE_MAX]
 
static const char * scan_modnames [IEEE80211_OPMODE_MAX]
 
static const struct ieee80211_scannerscanners [IEEE80211_OPMODE_MAX]
 

Macro Definition Documentation

◆ ROAM_MCS_11AC_DEFAULT

#define ROAM_MCS_11AC_DEFAULT   (1 | IEEE80211_RATE_MCS) /* 11ac bss; XXX not used yet */

Definition at line 73 of file ieee80211_scan.c.

◆ ROAM_MCS_11N_DEFAULT

#define ROAM_MCS_11N_DEFAULT   (1 | IEEE80211_RATE_MCS) /* 11n bss */

Definition at line 72 of file ieee80211_scan.c.

◆ ROAM_RATE_11A_DEFAULT

#define ROAM_RATE_11A_DEFAULT   2*12 /* 11a bss */

Definition at line 67 of file ieee80211_scan.c.

◆ ROAM_RATE_11B_DEFAULT

#define ROAM_RATE_11B_DEFAULT   2*5 /* 11b bss */

Definition at line 68 of file ieee80211_scan.c.

◆ ROAM_RATE_11BONLY_DEFAULT

#define ROAM_RATE_11BONLY_DEFAULT   2*1 /* 11b-only bss */

Definition at line 69 of file ieee80211_scan.c.

◆ ROAM_RATE_HALF_DEFAULT

#define ROAM_RATE_HALF_DEFAULT   2*6 /* half-width 11a/g bss */

Definition at line 70 of file ieee80211_scan.c.

◆ ROAM_RATE_QUARTER_DEFAULT

#define ROAM_RATE_QUARTER_DEFAULT   2*3 /* quarter-width 11a/g bss */

Definition at line 71 of file ieee80211_scan.c.

◆ ROAM_RSSI_11A_DEFAULT

#define ROAM_RSSI_11A_DEFAULT   14 /* 11a bss */

Definition at line 63 of file ieee80211_scan.c.

◆ ROAM_RSSI_11B_DEFAULT

#define ROAM_RSSI_11B_DEFAULT   14 /* 11b bss */

Definition at line 64 of file ieee80211_scan.c.

◆ ROAM_RSSI_11BONLY_DEFAULT

#define ROAM_RSSI_11BONLY_DEFAULT   14 /* 11b-only bss */

Definition at line 65 of file ieee80211_scan.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ ieee80211_add_scan()

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 
)

Definition at line 581 of file ieee80211_scan.c.

References ieee80211com::ic_scan_methods, ieee80211vap::iv_ic, and ieee80211_scan_methods::sc_add_scan.

Referenced by adhoc_recv_mgmt(), hostap_recv_mgmt(), mesh_recv_mgmt(), and sta_recv_mgmt().

Here is the caller graph for this function:

◆ ieee80211_bg_scan()

int ieee80211_bg_scan ( struct ieee80211vap vap,
int  flags 
)

Definition at line 425 of file ieee80211_scan.c.

References ieee80211com::ic_scan_methods, IEEE80211_DPRINTF, IEEE80211_MSG_SCAN, ieee80211_scanner_get(), ieee80211vap::iv_ic, ieee80211vap::iv_opmode, and ieee80211_scan_methods::sc_bg_scan.

Referenced by sta_recv_mgmt(), and sta_roam_check().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ieee80211_cancel_anyscan()

void ieee80211_cancel_anyscan ( struct ieee80211vap vap)

Definition at line 467 of file ieee80211_scan.c.

References ieee80211com::ic_scan_methods, ieee80211vap::iv_ic, and ieee80211_scan_methods::sc_cancel_anyscan.

Referenced by ieee80211_start_pkt().

Here is the caller graph for this function:

◆ ieee80211_cancel_scan()

void ieee80211_cancel_scan ( struct ieee80211vap vap)

◆ ieee80211_check_scan()

◆ ieee80211_check_scan_current()

int ieee80211_check_scan_current ( struct ieee80211vap vap)

Definition at line 412 of file ieee80211_scan.c.

References ieee80211_check_scan(), IEEE80211_SCAN_ACTIVE, IEEE80211_SCAN_FOREVER, ieee80211vap::iv_des_nssid, and ieee80211vap::iv_des_ssid.

Referenced by adhoc_newstate(), hostap_newstate(), mesh_newstate(), sta_authretry(), sta_newstate(), and wds_newstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ieee80211_probe_curchan()

◆ ieee80211_scan_assoc_fail()

void ieee80211_scan_assoc_fail ( struct ieee80211vap vap,
const uint8_t  mac[],
int  reason 
)

Definition at line 625 of file ieee80211_scan.c.

References ieee80211com::ic_scan, IEEE80211_MSG_SCAN, IEEE80211_NOTE_MAC, ieee80211vap::iv_ic, mac, ieee80211_scanner::scan_assoc_fail, and ieee80211_scan_state::ss_ops.

Referenced by sta_authretry(), and sta_newstate().

Here is the caller graph for this function:

◆ ieee80211_scan_assoc_success()

void ieee80211_scan_assoc_success ( struct ieee80211vap vap,
const uint8_t  mac[] 
)

Definition at line 610 of file ieee80211_scan.c.

References ieee80211com::ic_scan, IEEE80211_MSG_SCAN, IEEE80211_NOTE_MAC, ieee80211vap::iv_ic, mac, ieee80211_scanner::scan_assoc_success, and ieee80211_scan_state::ss_ops.

Referenced by sta_newstate().

Here is the caller graph for this function:

◆ ieee80211_scan_attach()

void ieee80211_scan_attach ( struct ieee80211com ic)

Definition at line 76 of file ieee80211_scan.c.

References ieee80211com::ic_scan_methods, ieee80211_swscan_attach(), and ieee80211_scan_methods::sc_attach.

Referenced by ieee80211_ifattach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ieee80211_scan_copy_ssid()

void ieee80211_scan_copy_ssid ( struct ieee80211vap vap,
struct ieee80211_scan_state ss,
int  nssid,
const struct ieee80211_scan_ssid  ssids[] 
)

◆ ieee80211_scan_detach()

void ieee80211_scan_detach ( struct ieee80211com ic)

Definition at line 89 of file ieee80211_scan.c.

References ieee80211com::ic_scan_methods, and ieee80211_scan_methods::sc_detach.

Referenced by ieee80211_ifdetach().

Here is the caller graph for this function:

◆ ieee80211_scan_done()

◆ ieee80211_scan_dump_channels()

void ieee80211_scan_dump_channels ( const struct ieee80211_scan_state ss)

◆ ieee80211_scan_flush()

◆ ieee80211_scan_iterate()

void ieee80211_scan_iterate ( struct ieee80211vap vap,
ieee80211_scan_iter_func f,
void *  arg 
)

Definition at line 641 of file ieee80211_scan.c.

References ieee80211com::ic_scan, ieee80211vap::iv_ic, ieee80211_scanner::scan_iterate, and ieee80211_scan_state::ss_ops.

Referenced by ieee80211_ioctl_getscanresults(), and setmlme_assoc_sta().

Here is the caller graph for this function:

◆ ieee80211_scan_next()

void ieee80211_scan_next ( struct ieee80211vap vap)

◆ ieee80211_scan_pickchannel()

struct ieee80211_channel * ieee80211_scan_pickchannel ( struct ieee80211com ic,
int  flags 
)

◆ ieee80211_scan_timeout()

void ieee80211_scan_timeout ( struct ieee80211com ic)

Definition at line 598 of file ieee80211_scan.c.

References ieee80211com::ic_scan, ieee80211_scanner::scan_age, and ieee80211_scan_state::ss_ops.

Referenced by ieee80211_node_timeout().

Here is the caller graph for this function:

◆ ieee80211_scan_update_locked()

◆ ieee80211_scan_vattach()

◆ ieee80211_scan_vdetach()

◆ ieee80211_scanner_get()

const struct ieee80211_scanner * ieee80211_scanner_get ( enum ieee80211_opmode  mode)

Definition at line 188 of file ieee80211_scan.c.

References ieee80211_load_module(), IEEE80211_OPMODE_MAX, scan_modnames, and scanners.

Referenced by ieee80211_bg_scan(), ieee80211_check_scan(), and ieee80211_start_scan().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ieee80211_scanner_register()

void ieee80211_scanner_register ( enum ieee80211_opmode  mode,
const struct ieee80211_scanner scan 
)

Definition at line 198 of file ieee80211_scan.c.

References IEEE80211_OPMODE_MAX, and scanners.

◆ ieee80211_scanner_unregister()

void ieee80211_scanner_unregister ( enum ieee80211_opmode  mode,
const struct ieee80211_scanner scan 
)

Definition at line 207 of file ieee80211_scan.c.

References IEEE80211_OPMODE_MAX, and scanners.

◆ ieee80211_scanner_unregister_all()

void ieee80211_scanner_unregister_all ( const struct ieee80211_scanner scan)

Definition at line 217 of file ieee80211_scan.c.

References IEEE80211_OPMODE_MAX, and scanners.

◆ ieee80211_start_scan()

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[] 
)

Definition at line 329 of file ieee80211_scan.c.

References ieee80211com::ic_scan_methods, IEEE80211_DPRINTF, IEEE80211_MSG_SCAN, ieee80211_opmode_name, ieee80211_scanner_get(), ieee80211vap::iv_ic, ieee80211vap::iv_opmode, and ieee80211_scan_methods::sc_start_scan.

Referenced by ieee80211_ioctl_set80211(), and ieee80211_scanreq().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ defroam

const struct ieee80211_roamparam defroam[IEEE80211_MODE_MAX]
static
Initial value:
= {
}
@ 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_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 ROAM_RATE_11B_DEFAULT
#define ROAM_MCS_11N_DEFAULT
#define ROAM_RSSI_11B_DEFAULT
#define ROAM_RSSI_11A_DEFAULT
#define ROAM_RSSI_11BONLY_DEFAULT
#define ROAM_RATE_11A_DEFAULT
#define ROAM_RATE_11BONLY_DEFAULT
#define ROAM_RATE_QUARTER_DEFAULT
#define ROAM_RATE_HALF_DEFAULT
#define ROAM_MCS_11AC_DEFAULT

Definition at line 101 of file ieee80211_scan.c.

Referenced by ieee80211_scan_vattach().

◆ scan_modnames

const char* scan_modnames[IEEE80211_OPMODE_MAX]
static
Initial value:
= {
"wlan_scan_sta",
"wlan_scan_sta",
"wlan_scan_wds",
"wlan_scan_sta",
"wlan_scan_ap",
"wlan_scan_monitor",
"wlan_scan_sta",
}

Definition at line 176 of file ieee80211_scan.c.

Referenced by ieee80211_scanner_get().

◆ scanners