From 3eafc494d8cef27fbcadf59620b83da5a5126289 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 12 Oct 2014 17:02:23 +0300 Subject: [PATCH] Fix CONFIG_NO_SCAN_PROCESSING=y build ht_supported() was used but not defined in such a case. Signed-off-by: Jouni Malinen --- src/drivers/driver.h | 3 +++ src/drivers/driver_common.c | 36 +++++++++++++++++++++++++++++++ wpa_supplicant/events.c | 36 ------------------------------- wpa_supplicant/wpa_supplicant_i.h | 2 -- 4 files changed, 39 insertions(+), 38 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 6af72943a..36f6f69ce 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -4198,6 +4198,9 @@ const char * event_to_string(enum wpa_event_type event); /* Convert chan_width to a string for logging and control interfaces */ const char * channel_width_to_string(enum chan_width width); +int ht_supported(const struct hostapd_hw_modes *mode); +int vht_supported(const struct hostapd_hw_modes *mode); + /* NULL terminated array of linked in driver wrappers */ extern struct wpa_driver_ops *wpa_drivers[]; diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c index 77e6905d5..c53b889d3 100644 --- a/src/drivers/driver_common.c +++ b/src/drivers/driver_common.c @@ -105,3 +105,39 @@ const char * channel_width_to_string(enum chan_width width) return "unknown"; } } + + +int ht_supported(const struct hostapd_hw_modes *mode) +{ + if (!(mode->flags & HOSTAPD_MODE_FLAG_HT_INFO_KNOWN)) { + /* + * The driver did not indicate whether it supports HT. Assume + * it does to avoid connection issues. + */ + return 1; + } + + /* + * IEEE Std 802.11n-2009 20.1.1: + * An HT non-AP STA shall support all EQM rates for one spatial stream. + */ + return mode->mcs_set[0] == 0xff; +} + + +int vht_supported(const struct hostapd_hw_modes *mode) +{ + if (!(mode->flags & HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN)) { + /* + * The driver did not indicate whether it supports VHT. Assume + * it does to avoid connection issues. + */ + return 1; + } + + /* + * A VHT non-AP STA shall support MCS 0-7 for one spatial stream. + * TODO: Verify if this complies with the standard + */ + return (mode->vht_mcs_set[0] & 0x3) != 3; +} diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 2d17aba3e..f9e82ddfb 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -582,42 +582,6 @@ static int freq_allowed(int *freqs, int freq) } -int ht_supported(const struct hostapd_hw_modes *mode) -{ - if (!(mode->flags & HOSTAPD_MODE_FLAG_HT_INFO_KNOWN)) { - /* - * The driver did not indicate whether it supports HT. Assume - * it does to avoid connection issues. - */ - return 1; - } - - /* - * IEEE Std 802.11n-2009 20.1.1: - * An HT non-AP STA shall support all EQM rates for one spatial stream. - */ - return mode->mcs_set[0] == 0xff; -} - - -int vht_supported(const struct hostapd_hw_modes *mode) -{ - if (!(mode->flags & HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN)) { - /* - * The driver did not indicate whether it supports VHT. Assume - * it does to avoid connection issues. - */ - return 1; - } - - /* - * A VHT non-AP STA shall support MCS 0-7 for one spatial stream. - * TODO: Verify if this complies with the standard - */ - return (mode->vht_mcs_set[0] & 0x3) != 3; -} - - static int rate_match(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) { const struct hostapd_hw_modes *mode = NULL, *modes; diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 6974ba269..ba9df624f 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -991,8 +991,6 @@ void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s); int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s); struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s, struct wpa_ssid **selected_ssid); -int ht_supported(const struct hostapd_hw_modes *mode); -int vht_supported(const struct hostapd_hw_modes *mode); /* eap_register.c */ int eap_register_methods(void);