hostapd: fix a few compile errors and warnings

SVN-Revision: 26751
This commit is contained in:
Felix Fietkau 2011-04-24 03:34:46 +00:00
parent e15e8f6976
commit cbbe49a1d8
6 changed files with 46 additions and 23 deletions

View File

@ -31,7 +31,7 @@
struct hapd_interfaces { struct hapd_interfaces {
@@ -163,6 +165,15 @@ static void hostapd_logger_cb(void *ctx, @@ -163,6 +165,16 @@ static void hostapd_logger_cb(void *ctx,
} }
#endif /* CONFIG_NO_HOSTAPD_LOGGER */ #endif /* CONFIG_NO_HOSTAPD_LOGGER */
@ -42,12 +42,13 @@
+ return -1; + return -1;
+ } + }
+ daemonize = 0; + daemonize = 0;
+ return 0;
+} +}
+ +
/** /**
* hostapd_init - Allocate and initialize per-interface data * hostapd_init - Allocate and initialize per-interface data
@@ -184,6 +195,7 @@ static struct hostapd_iface * hostapd_in @@ -184,6 +196,7 @@ static struct hostapd_iface * hostapd_in
if (hapd_iface == NULL) if (hapd_iface == NULL)
goto fail; goto fail;
@ -55,7 +56,7 @@
hapd_iface->reload_config = hostapd_reload_config; hapd_iface->reload_config = hostapd_reload_config;
hapd_iface->config_read_cb = hostapd_config_read; hapd_iface->config_read_cb = hostapd_config_read;
hapd_iface->config_fname = os_strdup(config_file); hapd_iface->config_fname = os_strdup(config_file);
@@ -399,7 +411,7 @@ static int hostapd_global_init(struct ha @@ -399,7 +412,7 @@ static int hostapd_global_init(struct ha
} }
@ -64,7 +65,7 @@
{ {
#ifdef EAP_SERVER_TNC #ifdef EAP_SERVER_TNC
tncs_global_deinit(); tncs_global_deinit();
@@ -419,8 +431,7 @@ static void hostapd_global_deinit(const @@ -419,8 +432,7 @@ static void hostapd_global_deinit(const
} }
@ -74,7 +75,7 @@
{ {
#ifdef EAP_SERVER_TNC #ifdef EAP_SERVER_TNC
int tnc = 0; int tnc = 0;
@@ -441,11 +452,6 @@ static int hostapd_global_run(struct hap @@ -441,11 +453,6 @@ static int hostapd_global_run(struct hap
} }
#endif /* EAP_SERVER_TNC */ #endif /* EAP_SERVER_TNC */
@ -86,7 +87,7 @@
eloop_run(); eloop_run();
return 0; return 0;
@@ -501,8 +507,7 @@ int main(int argc, char *argv[]) @@ -501,8 +508,7 @@ int main(int argc, char *argv[])
struct hapd_interfaces interfaces; struct hapd_interfaces interfaces;
int ret = 1; int ret = 1;
size_t i; size_t i;
@ -96,7 +97,7 @@
const char *log_file = NULL; const char *log_file = NULL;
if (os_program_init()) if (os_program_init())
@@ -576,7 +581,7 @@ int main(int argc, char *argv[]) @@ -576,7 +582,7 @@ int main(int argc, char *argv[])
goto out; goto out;
} }
@ -105,7 +106,7 @@
goto out; goto out;
ret = 0; ret = 0;
@@ -587,7 +592,7 @@ int main(int argc, char *argv[]) @@ -587,7 +593,7 @@ int main(int argc, char *argv[])
hostapd_interface_deinit_free(interfaces.iface[i]); hostapd_interface_deinit_free(interfaces.iface[i]);
os_free(interfaces.iface); os_free(interfaces.iface);

View File

@ -212,7 +212,7 @@
wpa_debug_open_syslog(); wpa_debug_open_syslog();
--- a/hostapd/main.c --- a/hostapd/main.c
+++ b/hostapd/main.c +++ b/hostapd/main.c
@@ -501,6 +501,9 @@ static const char * hostapd_msg_ifname_c @@ -502,6 +502,9 @@ static const char * hostapd_msg_ifname_c
return NULL; return NULL;
} }
@ -222,7 +222,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@@ -513,6 +516,7 @@ int main(int argc, char *argv[]) @@ -514,6 +517,7 @@ int main(int argc, char *argv[])
if (os_program_init()) if (os_program_init())
return -1; return -1;

View File

@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c --- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c
@@ -2092,23 +2092,41 @@ wpa_driver_nl80211_finish_drv_init(struc @@ -2092,23 +2092,43 @@ wpa_driver_nl80211_finish_drv_init(struc
} }
@ -33,18 +33,20 @@
+ +
+ for (bss = &drv->first_bss; bss; bss = bss->next) + for (bss = &drv->first_bss; bss; bss = bss->next)
+ wpa_driver_nl80211_del_bss_beacon(bss); + wpa_driver_nl80211_del_bss_beacon(bss);
+
+ return 0;
+} +}
+ +
+static int wpa_driver_nl80211_stop_ap(void *priv) +static int wpa_driver_nl80211_stop_ap(void *priv)
+{ +{
+ struct i802_bss *bss = priv; + struct i802_bss *bss = priv;
+ +
+ wpa_driver_nl80211_del_beacon(bss->drv); + return wpa_driver_nl80211_del_beacon(bss->drv);
+} +}
/** /**
* wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
@@ -6581,4 +6599,5 @@ const struct wpa_driver_ops wpa_driver_n @@ -6581,4 +6601,5 @@ const struct wpa_driver_ops wpa_driver_n
.set_intra_bss = nl80211_set_intra_bss, .set_intra_bss = nl80211_set_intra_bss,
.set_param = nl80211_set_param, .set_param = nl80211_set_param,
.get_radio_name = nl80211_get_radio_name, .get_radio_name = nl80211_get_radio_name,

View File

@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c --- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c
@@ -4919,9 +4919,6 @@ static int wpa_driver_nl80211_set_mode(v @@ -4921,9 +4921,6 @@ static int wpa_driver_nl80211_set_mode(v
/* Try to set the mode again while the interface is /* Try to set the mode again while the interface is
* down */ * down */
ret = nl80211_set_mode(drv, drv->ifindex, nlmode); ret = nl80211_set_mode(drv, drv->ifindex, nlmode);
@ -10,7 +10,7 @@
if (!ret) if (!ret)
break; break;
} else } else
@@ -4934,6 +4931,8 @@ static int wpa_driver_nl80211_set_mode(v @@ -4936,6 +4933,8 @@ static int wpa_driver_nl80211_set_mode(v
wpa_printf(MSG_DEBUG, "nl80211: Mode change succeeded while " wpa_printf(MSG_DEBUG, "nl80211: Mode change succeeded while "
"interface is down"); "interface is down");
drv->nlmode = nlmode; drv->nlmode = nlmode;

View File

@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c --- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c
@@ -5502,6 +5502,9 @@ static int i802_set_wds_sta(void *priv, @@ -5504,6 +5504,9 @@ static int i802_set_wds_sta(void *priv,
linux_set_iface_flags(drv->ioctl_sock, name, 1); linux_set_iface_flags(drv->ioctl_sock, name, 1);
return i802_set_sta_vlan(priv, addr, name, 0); return i802_set_sta_vlan(priv, addr, name, 0);
} else { } else {
@ -10,7 +10,7 @@
i802_set_sta_vlan(priv, addr, bss->ifname, 0); i802_set_sta_vlan(priv, addr, bss->ifname, 0);
return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN, return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
name); name);
@@ -5942,14 +5945,14 @@ static int wpa_driver_nl80211_if_remove( @@ -5944,14 +5947,14 @@ static int wpa_driver_nl80211_if_remove(
return -1; return -1;
#ifdef HOSTAPD #ifdef HOSTAPD

View File

@ -23,7 +23,15 @@
--- a/src/ap/hostapd.c --- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c +++ b/src/ap/hostapd.c
@@ -285,6 +285,7 @@ static void hostapd_cleanup_iface_pre(st @@ -27,6 +27,7 @@
#include "beacon.h"
#include "iapp.h"
#include "ieee802_1x.h"
+#include "ieee802_11.h"
#include "ieee802_11_auth.h"
#include "vlan_init.h"
#include "wpa_auth.h"
@@ -285,6 +286,7 @@ static void hostapd_cleanup_iface_pre(st
*/ */
static void hostapd_cleanup_iface(struct hostapd_iface *iface) static void hostapd_cleanup_iface(struct hostapd_iface *iface)
{ {
@ -77,7 +85,19 @@
#endif /* IEEE802_11_H */ #endif /* IEEE802_11_H */
--- a/src/ap/ieee802_11_ht.c --- a/src/ap/ieee802_11_ht.c
+++ b/src/ap/ieee802_11_ht.c +++ b/src/ap/ieee802_11_ht.c
@@ -70,12 +70,15 @@ u8 * hostapd_eid_ht_operation(struct hos @@ -20,9 +20,11 @@
#include "drivers/driver.h"
#include "hostapd.h"
#include "ap_config.h"
+#include "ap_drv_ops.h"
#include "sta_info.h"
#include "beacon.h"
#include "ieee802_11.h"
+#include "utils/eloop.h"
u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
@@ -70,12 +72,15 @@ u8 * hostapd_eid_ht_operation(struct hos
oper->control_chan = hapd->iconf->channel; oper->control_chan = hapd->iconf->channel;
oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode); oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
@ -99,14 +119,14 @@
pos += sizeof(*oper); pos += sizeof(*oper);
@@ -265,3 +268,80 @@ void hostapd_get_ht_capab(struct hostapd @@ -265,3 +270,80 @@ void hostapd_get_ht_capab(struct hostapd
neg_ht_cap->ht_capabilities_info = host_to_le16(cap); neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
} }
+ +
+static int hostapd_set_force_20mhz(struct hostapd_iface *iface); +static void hostapd_set_force_20mhz(struct hostapd_iface *iface);
+ +
+static int hostapd_restore_40mhz(void *eloop_data, void *user_ctx) +static void hostapd_restore_40mhz(void *eloop_data, void *user_ctx)
+{ +{
+ struct hostapd_iface *iface = eloop_data; + struct hostapd_iface *iface = eloop_data;
+ struct os_time time; + struct os_time time;
@ -132,7 +152,7 @@
+ hostapd_set_force_20mhz(iface); + hostapd_set_force_20mhz(iface);
+} +}
+ +
+static int hostapd_set_force_20mhz(struct hostapd_iface *iface) +static void hostapd_set_force_20mhz(struct hostapd_iface *iface)
+{ +{
+ int secondary_channel; + int secondary_channel;
+ int i; + int i;