mirror of
https://gitee.com/openharmony/third_party_wpa_supplicant
synced 2024-11-27 01:41:08 +00:00
1. Optimize the resource release of sta&ap in stop process; 2.Resolve some bugs in AP initialization.
Signed-off-by: SubmarinePhantom <liuxiyao223@huawei.com> Change-Id: Ie49b9decb1c7f81f70cd3e809e9fd31715d2ddd9
This commit is contained in:
parent
ab5c2b029c
commit
e07f6d5031
@ -68,7 +68,9 @@
|
||||
"src/ap/ap_config.h",
|
||||
"hostapd/ap_main.h",
|
||||
"src/ap/ctrl_iface_ap.h",
|
||||
"hostapd/ap_ctrl_iface.h"
|
||||
"hostapd/ap_ctrl_iface.h",
|
||||
"hostapd/ctrl_iface.h",
|
||||
"src/eap_server/eap_methods.h"
|
||||
]
|
||||
},
|
||||
"name":"//third_party/wpa_supplicant/wpa_supplicant-2.9_standard:wpa"
|
||||
|
4
wpa_supplicant-2.9_standard/hostapd/ap_main.c
Executable file → Normal file
4
wpa_supplicant-2.9_standard/hostapd/ap_main.c
Executable file → Normal file
@ -166,11 +166,11 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
|
||||
wpa_printf(MSG_ERROR, "hapd->conf == NULL");
|
||||
return -1;
|
||||
}
|
||||
if (strcmp(hapd->conf->iface, "wlan0") == 0) {
|
||||
if (strstr(hapd->conf->iface, "wlan") != NULL) {
|
||||
gHostapd = hapd;
|
||||
wpa_printf(MSG_ERROR, "gHostapd = %p", gHostapd);
|
||||
} else {
|
||||
wpa_printf(MSG_ERROR, "fail to set gHostapd ifname = %s", hapd->conf->iface);
|
||||
wpa_printf(MSG_INFO, "fail to set gHostapd ifname = %s", hapd->conf->iface);
|
||||
}
|
||||
|
||||
/* Initialize the driver interface */
|
||||
|
@ -2347,8 +2347,10 @@ int hostapd_setup_interface(struct hostapd_iface *iface)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!iface->conf)
|
||||
if (!iface->conf) {
|
||||
wpa_printf(MSG_ERROR, "iface->conf already exists!.");
|
||||
return -1;
|
||||
}
|
||||
ret = setup_interface(iface);
|
||||
if (ret) {
|
||||
wpa_printf(MSG_ERROR, "%s: Unable to setup interface.",
|
||||
@ -2734,8 +2736,10 @@ int hostapd_enable_iface(struct hostapd_iface *hapd_iface)
|
||||
{
|
||||
size_t j;
|
||||
|
||||
if (!hapd_iface)
|
||||
if (!hapd_iface) {
|
||||
wpa_printf(MSG_ERROR, "hapd_iface is NULL!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (hapd_iface->enable_iface_cb)
|
||||
return hapd_iface->enable_iface_cb(hapd_iface);
|
||||
@ -2763,14 +2767,13 @@ int hostapd_enable_iface(struct hostapd_iface *hapd_iface)
|
||||
hapd_iface->interfaces->driver_init(hapd_iface))
|
||||
return -1;
|
||||
|
||||
#ifndef CONFIG_LIBWPA_VENDOR
|
||||
if (hostapd_setup_interface(hapd_iface)) {
|
||||
hostapd_deinit_driver(hapd_iface->bss[0]->driver,
|
||||
hapd_iface->bss[0]->drv_priv,
|
||||
hapd_iface);
|
||||
wpa_printf(MSG_ERROR, "hostapd_setup_interface fail!");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -5130,6 +5130,9 @@ void wpa_supplicant_event_hapd(void *ctx, enum wpa_event_type event, union wpa_e
|
||||
void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
if (ctx == NULL) {
|
||||
wpa_printf(MSG_ERROR, "ctx is NULL, Event is %s (%d).", event_to_string(event), event);
|
||||
}
|
||||
if (run_mode == 1) {
|
||||
return wpa_supplicant_event_hapd(ctx, event, data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user