From fcc61230d1475f5a7b185ad7e086dbefdb9f69b8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 31 Dec 2013 19:19:37 +0200 Subject: [PATCH] Declare wpa_drivers in src/drivers/driver.h This avoids some warnings from sparse. Signed-hostap: Jouni Malinen --- hostapd/config_file.c | 3 --- hostapd/main.c | 2 -- src/ap/hostapd.c | 1 - src/drivers/driver.h | 3 +++ src/drivers/drivers.c | 5 +++-- wpa_supplicant/ctrl_iface.c | 2 -- wpa_supplicant/main.c | 2 -- wpa_supplicant/wpa_priv.c | 2 -- wpa_supplicant/wpa_supplicant.c | 1 - 9 files changed, 6 insertions(+), 15 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index ae059176e..fa1a7fb4b 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -22,9 +22,6 @@ #include "config_file.h" -extern struct wpa_driver_ops *wpa_drivers[]; - - #ifndef CONFIG_NO_VLAN static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss, const char *fname) diff --git a/hostapd/main.c b/hostapd/main.c index 4e9fe404d..1b798dafc 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -33,8 +33,6 @@ extern int wpa_debug_level; extern int wpa_debug_show_keys; extern int wpa_debug_timestamp; -extern struct wpa_driver_ops *wpa_drivers[]; - struct hapd_global { void **drv_priv; diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 69459f77d..71f8ee2b4 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -42,7 +42,6 @@ static int setup_interface2(struct hostapd_iface *iface); static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx); extern int wpa_debug_level; -extern struct wpa_driver_ops *wpa_drivers[]; int hostapd_for_each_interface(struct hapd_interfaces *interfaces, diff --git a/src/drivers/driver.h b/src/drivers/driver.h index eecb736be..b4442becb 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -3803,4 +3803,7 @@ void wpa_scan_results_free(struct wpa_scan_results *res); /* Convert wpa_event_type to a string for logging */ const char * event_to_string(enum wpa_event_type event); +/* NULL terminated array of linked in driver wrappers */ +extern struct wpa_driver_ops *wpa_drivers[]; + #endif /* DRIVER_H */ diff --git a/src/drivers/drivers.c b/src/drivers/drivers.c index 04eb4fd1c..446ab6392 100644 --- a/src/drivers/drivers.c +++ b/src/drivers/drivers.c @@ -6,8 +6,9 @@ * See README for more details. */ -#include "includes.h" - +#include "utils/includes.h" +#include "utils/common.h" +#include "driver.h" #ifdef CONFIG_DRIVER_WEXT extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */ diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 557ed7a3b..975e42c93 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -41,8 +41,6 @@ #include "autoscan.h" #include "wnm_sta.h" -extern struct wpa_driver_ops *wpa_drivers[]; - static int wpa_supplicant_global_iface_list(struct wpa_global *global, char *buf, int len); static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global, diff --git a/wpa_supplicant/main.c b/wpa_supplicant/main.c index 39b837e58..37f0c7813 100644 --- a/wpa_supplicant/main.c +++ b/wpa_supplicant/main.c @@ -16,8 +16,6 @@ #include "driver_i.h" #include "p2p_supplicant.h" -extern struct wpa_driver_ops *wpa_drivers[]; - static void usage(void) { diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c index 4afaae904..3c4355a19 100644 --- a/wpa_supplicant/wpa_priv.c +++ b/wpa_supplicant/wpa_priv.c @@ -552,8 +552,6 @@ static void wpa_priv_interface_deinit(struct wpa_priv_interface *iface) } -extern struct wpa_driver_ops *wpa_drivers[]; - static struct wpa_priv_interface * wpa_priv_interface_init(const char *dir, const char *params) { diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index d999e06a1..d3e11acaf 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -107,7 +107,6 @@ const char *wpa_supplicant_full_license5 = extern int wpa_debug_level; extern int wpa_debug_show_keys; extern int wpa_debug_timestamp; -extern struct wpa_driver_ops *wpa_drivers[]; /* Configure default/group WEP keys for static WEP */ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)