From 2b6e9f91df7acf19998f967fcc6c5f4bb911d1d8 Mon Sep 17 00:00:00 2001 From: Lior David Date: Sat, 20 Feb 2016 13:46:10 +0200 Subject: [PATCH] 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. Signed-off-by: Lior David --- 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 b3ac4e863..6ef929cf2 100644 --- a/src/common/defs.h +++ b/src/common/defs.h @@ -335,4 +335,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 6b9c95741..136cb58e6 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -4022,7 +4022,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; @@ -4032,8 +4032,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 1ec2cd810..1b16d281a 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -308,11 +308,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 @@ -358,6 +353,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 */