]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Share a single get_mode() implementation
authorAvraham Stern <avraham.stern@intel.com>
Mon, 15 Feb 2016 14:53:13 +0000 (16:53 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 21 Feb 2016 15:14:51 +0000 (17:14 +0200)
There is no need to duplicate this helper function in multiple files.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/scan.c
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 4c54b46c4d90564ffbe65317e9da24bbd8c4f7ed..5f5b91b5935ff2f122a85539a756839a7d0c7278 100644 (file)
@@ -3291,21 +3291,6 @@ static int wpas_p2p_default_channels(struct wpa_supplicant *wpa_s,
 }
 
 
-static 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;
-}
-
-
 enum chan_allowed {
        NOT_ALLOWED, NO_IR, ALLOWED
 };
index 3c3f9e01d0c646db8119f1106ac0de1244190460..f4f2c20c9021efe3997dbe30e920a9c30c276279 100644 (file)
@@ -521,21 +521,6 @@ static int non_p2p_network_enabled(struct wpa_supplicant *wpa_s)
 #endif /* CONFIG_P2P */
 
 
-static 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;
-}
-
-
 static void wpa_setband_scan_freqs_list(struct wpa_supplicant *wpa_s,
                                        enum hostapd_hw_mode band,
                                        struct wpa_driver_scan_params *params)
index fd38b9df8877509aecac9f4b07addf642fab9337..c6b8a58f193e607ac6ec729f08d649d8db1e28cf 100644 (file)
@@ -1322,21 +1322,6 @@ int sme_proc_obss_scan(struct wpa_supplicant *wpa_s)
 }
 
 
-static 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;
-}
-
-
 static void wpa_obss_scan_freqs_list(struct wpa_supplicant *wpa_s,
                                     struct wpa_driver_scan_params *params)
 {
index 8171b62ae543f2b6ad0f483f91d1d10ecf67172c..ba82e50cc8f82f8f272ad4e6bd10b397617a67f8 100644 (file)
@@ -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;
+}
index 7b74f383cdb1465d86ea3a20bc6349bcda4387a7..874299300b5ec5dbab9770437d1ac94d40cf30e5 100644 (file)
@@ -1206,4 +1206,7 @@ void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s,
 
 int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd);
 
+struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
+                                  u16 num_modes, enum hostapd_hw_mode mode);
+
 #endif /* WPA_SUPPLICANT_I_H */