2010-01-03 17:48:11 +01:00
|
|
|
/*
|
|
|
|
* WPA Supplicant - Scanning
|
2014-01-03 08:48:00 +01:00
|
|
|
* Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi>
|
2010-01-03 17:48:11 +01:00
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2010-01-03 17:48:11 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCAN_H
|
|
|
|
#define SCAN_H
|
|
|
|
|
2019-12-06 23:27:47 +01:00
|
|
|
/*
|
|
|
|
* Noise floor values to use when we have signal strength
|
|
|
|
* measurements, but no noise floor measurements. These values were
|
|
|
|
* measured in an office environment with many APs.
|
|
|
|
*/
|
|
|
|
#define DEFAULT_NOISE_FLOOR_2GHZ (-89)
|
|
|
|
#define DEFAULT_NOISE_FLOOR_5GHZ (-92)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Channels with a great SNR can operate at full rate. What is a great SNR?
|
|
|
|
* This doc https://supportforums.cisco.com/docs/DOC-12954 says, "the general
|
|
|
|
* rule of thumb is that any SNR above 20 is good." This one
|
|
|
|
* http://www.cisco.com/en/US/tech/tk722/tk809/technologies_q_and_a_item09186a00805e9a96.shtml#qa23
|
|
|
|
* recommends 25 as a minimum SNR for 54 Mbps data rate. The estimates used in
|
|
|
|
* scan_est_throughput() allow even smaller SNR values for the maximum rates
|
|
|
|
* (21 for 54 Mbps, 22 for VHT80 MCS9, 24 for HT40 and HT20 MCS7). Use 25 as a
|
|
|
|
* somewhat conservative value here.
|
|
|
|
*/
|
|
|
|
#define GREAT_SNR 25
|
|
|
|
|
|
|
|
#define IS_5GHZ(n) (n > 4000)
|
|
|
|
|
2012-05-10 13:34:46 +02:00
|
|
|
int wpa_supplicant_enabled_networks(struct wpa_supplicant *wpa_s);
|
2010-01-03 17:48:11 +01:00
|
|
|
void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec);
|
2011-09-27 21:21:38 +02:00
|
|
|
int wpa_supplicant_delayed_sched_scan(struct wpa_supplicant *wpa_s,
|
|
|
|
int sec, int usec);
|
2011-09-27 21:21:29 +02:00
|
|
|
int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s);
|
2010-01-03 17:48:11 +01:00
|
|
|
void wpa_supplicant_cancel_scan(struct wpa_supplicant *wpa_s);
|
2013-07-20 16:47:02 +02:00
|
|
|
void wpa_supplicant_cancel_delayed_sched_scan(struct wpa_supplicant *wpa_s);
|
2011-09-27 21:21:29 +02:00
|
|
|
void wpa_supplicant_cancel_sched_scan(struct wpa_supplicant *wpa_s);
|
2010-01-03 17:48:11 +01:00
|
|
|
void wpa_supplicant_notify_scanning(struct wpa_supplicant *wpa_s,
|
|
|
|
int scanning);
|
|
|
|
struct wpa_driver_scan_params;
|
|
|
|
int wpa_supplicant_trigger_scan(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_driver_scan_params *params);
|
|
|
|
struct wpa_scan_results *
|
|
|
|
wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s,
|
|
|
|
struct scan_info *info, int new_scan);
|
|
|
|
int wpa_supplicant_update_scan_results(struct wpa_supplicant *wpa_s);
|
2010-01-03 19:27:32 +01:00
|
|
|
const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie);
|
2010-01-03 17:48:11 +01:00
|
|
|
const u8 * wpa_scan_get_vendor_ie(const struct wpa_scan_res *res,
|
|
|
|
u32 vendor_type);
|
2013-10-14 18:25:28 +02:00
|
|
|
const u8 * wpa_scan_get_vendor_ie_beacon(const struct wpa_scan_res *res,
|
|
|
|
u32 vendor_type);
|
2010-01-03 17:48:11 +01:00
|
|
|
struct wpabuf * wpa_scan_get_vendor_ie_multi(const struct wpa_scan_res *res,
|
|
|
|
u32 vendor_type);
|
2012-02-16 15:30:13 +01:00
|
|
|
int wpa_supplicant_filter_bssid_match(struct wpa_supplicant *wpa_s,
|
|
|
|
const u8 *bssid);
|
2013-02-03 17:14:05 +01:00
|
|
|
void wpa_supplicant_update_scan_int(struct wpa_supplicant *wpa_s, int sec);
|
2013-02-07 17:06:51 +01:00
|
|
|
void scan_only_handler(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_scan_results *scan_res);
|
2013-03-18 16:11:15 +01:00
|
|
|
int wpas_scan_scheduled(struct wpa_supplicant *wpa_s);
|
2014-01-03 08:48:00 +01:00
|
|
|
struct wpa_driver_scan_params *
|
|
|
|
wpa_scan_clone_params(const struct wpa_driver_scan_params *src);
|
|
|
|
void wpa_scan_free_params(struct wpa_driver_scan_params *params);
|
2014-02-26 07:04:10 +01:00
|
|
|
int wpas_start_pno(struct wpa_supplicant *wpa_s);
|
|
|
|
int wpas_stop_pno(struct wpa_supplicant *wpa_s);
|
2016-09-05 16:32:58 +02:00
|
|
|
void wpas_scan_reset_sched_scan(struct wpa_supplicant *wpa_s);
|
2016-09-26 23:09:33 +02:00
|
|
|
void wpas_scan_restart_sched_scan(struct wpa_supplicant *wpa_s);
|
2010-01-03 17:48:11 +01:00
|
|
|
|
2014-12-29 07:41:06 +01:00
|
|
|
void wpas_mac_addr_rand_scan_clear(struct wpa_supplicant *wpa_s,
|
|
|
|
unsigned int type);
|
|
|
|
int wpas_mac_addr_rand_scan_set(struct wpa_supplicant *wpa_s,
|
|
|
|
unsigned int type, const u8 *addr,
|
|
|
|
const u8 *mask);
|
2019-10-18 01:03:51 +02:00
|
|
|
int wpas_mac_addr_rand_scan_get_mask(struct wpa_supplicant *wpa_s,
|
|
|
|
unsigned int type, u8 *mask);
|
2015-10-19 16:00:34 +02:00
|
|
|
int wpas_abort_ongoing_scan(struct wpa_supplicant *wpa_s);
|
2016-04-21 13:29:56 +02:00
|
|
|
void filter_scan_res(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_scan_results *res);
|
|
|
|
void scan_snr(struct wpa_scan_res *res);
|
|
|
|
void scan_est_throughput(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_scan_res *res);
|
2019-12-06 23:27:47 +01:00
|
|
|
unsigned int wpas_get_est_tpt(const struct wpa_supplicant *wpa_s,
|
|
|
|
const u8 *ies, size_t ies_len, int rate,
|
|
|
|
int snr);
|
2016-07-19 09:11:15 +02:00
|
|
|
void wpa_supplicant_set_default_scan_ies(struct wpa_supplicant *wpa_s);
|
2020-11-20 15:28:50 +01:00
|
|
|
int wpa_add_scan_freqs_list(struct wpa_supplicant *wpa_s,
|
|
|
|
enum hostapd_hw_mode band,
|
|
|
|
struct wpa_driver_scan_params *params, int is_6ghz);
|
2014-12-29 07:41:06 +01:00
|
|
|
|
2010-01-03 17:48:11 +01:00
|
|
|
#endif /* SCAN_H */
|