aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_supplicant.c
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2016-02-15 14:53:13 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-21 15:14:51 (GMT)
commitea69d9737cfdf42610ad8134b05ecbf9daf1c289 (patch)
treeeb5e69462b7cc7ffa38f6e3f8106e85ed8c64c06 /wpa_supplicant/wpa_supplicant.c
parent75cc211d6b40b0028343bcca94c61e458445b4ec (diff)
downloadhostap-ea69d9737cfdf42610ad8134b05ecbf9daf1c289.zip
hostap-ea69d9737cfdf42610ad8134b05ecbf9daf1c289.tar.gz
hostap-ea69d9737cfdf42610ad8134b05ecbf9daf1c289.tar.bz2
wpa_supplicant: Share a single get_mode() implementation
There is no need to duplicate this helper function in multiple files. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Diffstat (limited to 'wpa_supplicant/wpa_supplicant.c')
-rw-r--r--wpa_supplicant/wpa_supplicant.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 8171b62..ba82e50 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -6252,3 +6252,17 @@ int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame,
return -1;
}
+
+
+struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
+ u16 num_modes, enum hostapd_hw_mode mode)
+{
+ u16 i;
+
+ for (i = 0; i < num_modes; i++) {
+ if (modes[i].mode == mode)
+ return &modes[i];
+ }
+
+ return NULL;
+}