mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 10:18:21 -05:00
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>
This commit is contained in:
parent
75cc211d6b
commit
ea69d9737c
@ -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
|
||||
};
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user