P2P: Send AP mode WPS-FAIL event to parent interface
The AP operation with wpa_supplicant requires an additional callback to get the needed event information from hostapd side so that wpa_msg() can be called for wpa_s->parent if needed.
This commit is contained in:
parent
545cc6af25
commit
a0dee79709
3 changed files with 31 additions and 0 deletions
|
@ -27,6 +27,8 @@ struct sta_info;
|
||||||
struct hostap_sta_driver_data;
|
struct hostap_sta_driver_data;
|
||||||
struct ieee80211_ht_capabilities;
|
struct ieee80211_ht_capabilities;
|
||||||
struct full_dynamic_vlan;
|
struct full_dynamic_vlan;
|
||||||
|
enum wps_event;
|
||||||
|
union wps_event_data;
|
||||||
|
|
||||||
struct hostapd_probereq_cb {
|
struct hostapd_probereq_cb {
|
||||||
int (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
|
int (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
|
||||||
|
@ -185,6 +187,10 @@ struct hostapd_data {
|
||||||
const u8 *uuid_e);
|
const u8 *uuid_e);
|
||||||
void *wps_reg_success_cb_ctx;
|
void *wps_reg_success_cb_ctx;
|
||||||
|
|
||||||
|
void (*wps_event_cb)(void *ctx, enum wps_event event,
|
||||||
|
union wps_event_data *data);
|
||||||
|
void *wps_event_cb_ctx;
|
||||||
|
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
struct p2p_data *p2p;
|
struct p2p_data *p2p;
|
||||||
struct p2p_group *p2p_group;
|
struct p2p_group *p2p_group;
|
||||||
|
|
|
@ -572,6 +572,8 @@ static void hostapd_wps_event_cb(void *ctx, enum wps_event event,
|
||||||
case WPS_EV_ER_AP_SETTINGS:
|
case WPS_EV_ER_AP_SETTINGS:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (hapd->wps_event_cb)
|
||||||
|
hapd->wps_event_cb(hapd->wps_event_cb_ctx, event, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
#include "common/ieee802_11_defs.h"
|
#include "common/ieee802_11_defs.h"
|
||||||
|
#include "common/wpa_ctrl.h"
|
||||||
#include "ap/hostapd.h"
|
#include "ap/hostapd.h"
|
||||||
#include "ap/ap_config.h"
|
#include "ap/ap_config.h"
|
||||||
#ifdef NEED_AP_MLME
|
#ifdef NEED_AP_MLME
|
||||||
|
@ -200,6 +201,26 @@ static void ap_public_action_rx(void *ctx, const u8 *buf, size_t len, int freq)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void ap_wps_event_cb(void *ctx, enum wps_event event,
|
||||||
|
union wps_event_data *data)
|
||||||
|
{
|
||||||
|
struct wpa_supplicant *wpa_s = ctx;
|
||||||
|
|
||||||
|
if (event == WPS_EV_FAIL && wpa_s->parent && wpa_s->parent != wpa_s) {
|
||||||
|
struct wps_event_fail *fail = &data->fail;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* src/ap/wps_hostapd.c has already sent this on the main
|
||||||
|
* interface, so only send on the parent interface here if
|
||||||
|
* needed.
|
||||||
|
*/
|
||||||
|
wpa_msg(wpa_s->parent, MSG_INFO, WPS_EVENT_FAIL
|
||||||
|
"msg=%d config_error=%d",
|
||||||
|
fail->msg, fail->config_error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int ap_vendor_action_rx(void *ctx, const u8 *buf, size_t len, int freq)
|
static int ap_vendor_action_rx(void *ctx, const u8 *buf, size_t len, int freq)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
|
@ -366,6 +387,8 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
|
||||||
ap_probe_req_rx, wpa_s);
|
ap_probe_req_rx, wpa_s);
|
||||||
hapd_iface->bss[i]->wps_reg_success_cb = ap_wps_reg_success_cb;
|
hapd_iface->bss[i]->wps_reg_success_cb = ap_wps_reg_success_cb;
|
||||||
hapd_iface->bss[i]->wps_reg_success_cb_ctx = wpa_s;
|
hapd_iface->bss[i]->wps_reg_success_cb_ctx = wpa_s;
|
||||||
|
hapd_iface->bss[i]->wps_event_cb = ap_wps_event_cb;
|
||||||
|
hapd_iface->bss[i]->wps_event_cb_ctx = wpa_s;
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
hapd_iface->bss[i]->p2p = wpa_s->global->p2p;
|
hapd_iface->bss[i]->p2p = wpa_s->global->p2p;
|
||||||
hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(
|
hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(
|
||||||
|
|
Loading…
Reference in a new issue