From ef1a45f28a42d2c57c98435936de5ef0d48ede90 Mon Sep 17 00:00:00 2001 From: Emmanuel Grumbach Date: Fri, 6 Dec 2019 14:27:47 -0800 Subject: [PATCH] Move scan/roaming related defines to a header file This is a step towards allowing these values to be used in both scan.c and events.c. Signed-off-by: Emmanuel Grumbach --- wpa_supplicant/scan.c | 22 ---------------------- wpa_supplicant/scan.h | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 4d158a9c6..fea410250 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -1956,20 +1956,6 @@ struct wpabuf * wpa_scan_get_vendor_ie_multi(const struct wpa_scan_res *res, } -/* - * 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) - /* Compare function for sorting scan results. Return >0 if @b is considered * better. */ static int wpa_scan_result_compar(const void *a, const void *b) @@ -2178,14 +2164,6 @@ void filter_scan_res(struct wpa_supplicant *wpa_s, } -/* - * 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) - void scan_snr(struct wpa_scan_res *res) { if (res->flags & WPA_SCAN_NOISE_INVALID) { diff --git a/wpa_supplicant/scan.h b/wpa_supplicant/scan.h index 58caa7818..5ad1ce9f1 100644 --- a/wpa_supplicant/scan.h +++ b/wpa_supplicant/scan.h @@ -9,6 +9,28 @@ #ifndef SCAN_H #define SCAN_H +/* + * 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) + int wpa_supplicant_enabled_networks(struct wpa_supplicant *wpa_s); void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec); int wpa_supplicant_delayed_sched_scan(struct wpa_supplicant *wpa_s,