From fd3fc234c3c3cf9798805ae3441beb9234253797 Mon Sep 17 00:00:00 2001 From: Lior David Date: Sat, 20 Feb 2016 13:46:10 +0200 Subject: wpa_supplicant: Expose wpas_get_bands() and related API Expose the functions wpas_get_bands() and wpas_freq_to_band() and the enum wpa_radio_work_band, since they will be needed outside wpa_supplicant.c. Change-Id: I2bea4838f852395d9df0d1c2ad2db51060722f1e Signed-off-by: Lior David Git-commit: 2b6e9f91df7acf19998f967fcc6c5f4bb911d1d8 Git-repo: git://w1.fi/srv/git/hostap.git CRs-Fixed: 985990 --- src/common/defs.h | 6 ++++++ wpa_supplicant/wpa_supplicant.c | 5 ++--- wpa_supplicant/wpa_supplicant_i.h | 8 +++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/common/defs.h b/src/common/defs.h index eb080ea8..2e313794 100644 --- a/src/common/defs.h +++ b/src/common/defs.h @@ -334,4 +334,10 @@ enum set_band { WPA_SETBAND_2G }; +enum wpa_radio_work_band { + BAND_2_4_GHZ = BIT(0), + BAND_5_GHZ = BIT(1), + BAND_60_GHZ = BIT(2), +}; + #endif /* DEFS_H */ diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index cd75e566..7ed09305 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -3896,7 +3896,7 @@ static int wpas_set_wowlan_triggers(struct wpa_supplicant *wpa_s, } -static enum wpa_radio_work_band wpas_freq_to_band(int freq) +enum wpa_radio_work_band wpas_freq_to_band(int freq) { if (freq < 3000) return BAND_2_4_GHZ; @@ -3906,8 +3906,7 @@ static enum wpa_radio_work_band wpas_freq_to_band(int freq) } -static unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, - const int *freqs) +unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs) { int i; unsigned int band = 0; diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 59f25ff7..3b7a6994 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -307,11 +307,6 @@ struct wpa_radio { #define MAX_ACTIVE_WORKS 2 -enum wpa_radio_work_band { - BAND_2_4_GHZ = BIT(0), - BAND_5_GHZ = BIT(1), - BAND_60_GHZ = BIT(2), -}; /** * struct wpa_radio_work - Radio work item @@ -357,6 +352,9 @@ struct wpa_external_work { unsigned int timeout; }; +enum wpa_radio_work_band wpas_freq_to_band(int freq); +unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs); + /** * offchannel_send_action_result - Result of offchannel send Action frame */ -- cgit v1.2.3