Merge pull request !535 from xionglei/master
This commit is contained in:
openharmony_ci 2024-11-03 02:45:31 +00:00 committed by Gitee
commit 589f9bef64
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
17 changed files with 410 additions and 21 deletions

View File

@ -25,6 +25,9 @@
#ifdef CONFIG_VENDOR_EXT
#include "vendor_ext.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
u32 hostapd_sta_flags_to_drv(u32 flags)
{
@ -734,6 +737,10 @@ int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
{
if (!hapd->driver || !hapd->driver->sta_deauth || !hapd->drv_priv)
return 0;
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED, reason);
#endif
return hapd->driver->sta_deauth(hapd->drv_priv, hapd->own_addr, addr,
reason);
}
@ -744,6 +751,10 @@ int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
{
if (!hapd->driver || !hapd->driver->sta_disassoc || !hapd->drv_priv)
return 0;
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED, reason);
#endif
return hapd->driver->sta_disassoc(hapd->drv_priv, hapd->own_addr, addr,
reason);
}

View File

@ -55,6 +55,10 @@
#include "hm_miracast_sink.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
#ifdef CONFIG_FILS
void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd,
struct sta_info *sta)
@ -167,6 +171,11 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
*/
wpa_printf(MSG_DEBUG,
"hostapd_notif_assoc: Skip event with no address");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_NO_ADDR);
#endif
return -1;
}
@ -179,6 +188,11 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
wpa_printf(MSG_DEBUG, "%s: Invalid SA=" MACSTR_SEC
" in received indication - ignore this indication silently",
__func__, MAC2STR_SEC(addr));
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_INVALID_SA);
#endif
return 0;
}
@ -186,7 +200,10 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_INFO, "associated");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr, P2P_INTERFACE_STATE_ASSOCIATING,
P2P_CHR_DEFAULT_REASON_CODE);
#endif
ieee802_11_parse_elems(req_ies, req_ies_len, &elems, 0);
if (elems.wps_ie) {
ie = elems.wps_ie - 2;
@ -338,6 +355,11 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
hostapd_sta_assoc(hapd, addr, reassoc, status,
buf, p - buf);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_REJECT_BY_GO);
#endif
return 0;
}
@ -363,6 +385,11 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
if (sta->wpa_sm == NULL) {
wpa_printf(MSG_ERROR,
"Failed to initialize WPA state machine");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_INIT_WPA_SM_FAIL);
#endif
return -1;
}
res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
@ -443,6 +470,11 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
hostapd_sta_assoc(hapd, addr, reassoc, status, buf,
p - buf);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_REJECT_BY_GO);
#endif
return 0;
}
@ -515,6 +547,11 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_INFO,
"No HS 2.0 OSEN element in association request");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
WLAN_REASON_INVALID_IE);
#endif
return WLAN_STATUS_INVALID_IE;
}
@ -525,11 +562,22 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
if (sta->wpa_sm == NULL) {
wpa_printf(MSG_WARNING,
"Failed to initialize WPA state machine");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_INIT_WPA_SM_FAIL);
#endif
return WLAN_STATUS_UNSPECIFIED_FAILURE;
}
if (wpa_validate_osen(hapd->wpa_auth, sta->wpa_sm,
elems.osen - 2, elems.osen_len + 2) < 0)
elems.osen - 2, elems.osen_len + 2) < 0) {
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
WLAN_REASON_INVALID_IE);
#endif
return WLAN_STATUS_INVALID_IE;
}
#endif /* CONFIG_HS20 */
}
#ifdef CONFIG_WPS
@ -542,6 +590,11 @@ skip_wpa_check:
hapd->conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) {
wpa_printf(MSG_INFO,
"MBO: Reject WPA2 association without PMF");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_WITHOUT_PMF);
#endif
return WLAN_STATUS_UNSPECIFIED_FAILURE;
}
#endif /* CONFIG_MBO */
@ -552,6 +605,11 @@ skip_wpa_check:
!elems.rsnxe);
if (!p) {
wpa_printf(MSG_DEBUG, "FT: Failed to write AssocResp IEs");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_WRITE_IE_FAIL);
#endif
return WLAN_STATUS_UNSPECIFIED_FAILURE;
}
#endif /* CONFIG_IEEE80211R_AP */
@ -650,6 +708,11 @@ skip_wpa_check:
status == WLAN_STATUS_FINITE_CYCLIC_GROUP_NOT_SUPPORTED) {
hostapd_sta_assoc(hapd, addr, reassoc, ret_status, buf,
p - buf);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_FINITE_CYCLIC_GROUP_UNSUPPORT);
#endif
return 0;
}
@ -1102,10 +1165,20 @@ void hostapd_event_connect_failed_reason(struct hostapd_data *hapd,
case MAX_CLIENT_REACHED:
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_REJECTED_MAX_STA MACSTR,
MAC2STR(addr));
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATED_AP_REJECTED_MAX_STA);
#endif
break;
case BLOCKED_CLIENT:
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_REJECTED_BLOCKED_STA MACSTR,
MAC2STR(addr));
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATED_AP_REJECTED_BLOCKED_STA);
#endif
break;
}
}

View File

@ -58,6 +58,9 @@
#ifdef CONFIG_LIBWPA_VENDOR
#include "hostapd_client.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
#ifdef CONFIG_WEP
@ -3305,6 +3308,10 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
/* Start IEEE 802.1X authentication process for new stations */
ieee802_1x_new_station(hapd, sta);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, sta->addr,
P2P_INTERFACE_STATE_ASSOCIATED, P2P_CHR_DEFAULT_REASON_CODE);
#endif
if (reassoc) {
if (sta->auth_alg != WLAN_AUTH_FT &&
sta->auth_alg != WLAN_AUTH_FILS_SK &&

View File

@ -51,6 +51,9 @@
#if defined(CONFIG_LIBWPA_VENDOR) || defined(CONFIG_VENDOR_EXT)
#include "wpa_supplicant_i.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
static void ap_sta_remove_in_other_bss(struct hostapd_data *hapd,
struct sta_info *sta);
@ -1458,7 +1461,7 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
wpa_printf(MSG_ERROR, "ap_sta_set_authorized AP_STA_DISCONNECTED os_snprintf_error");
} else {
hostapdApCbParm.id = 0;
wpa_printf(MSG_INFO, "%s HOSTAPD_EVENT_STA_JOIN AP_STA_DISCONNECTED %s%d", __func__,
wpa_printf(MSG_INFO, "%s HOSTAPD_EVENT_STA_JOIN AP_STA_DISCONNECTED %s%d", __func__,
log_buf, hostapdApCbParm.id);
HostapdEventReport(hapd->conf->iface, HOSTAPD_EVENT_STA_JOIN, (void *) &hostapdApCbParm);
}
@ -1514,15 +1517,23 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *addr, u16 reason)
{
if (sta)
if (sta) {
wpa_printf(MSG_DEBUG, "%s: %s STA " MACSTR_SEC " reason=%u",
hapd->conf->iface, __func__, MAC2STR_SEC(sta->addr),
reason);
else if (addr)
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, sta->addr,
P2P_INTERFACE_STATE_DISCONNECTED, reason);
#endif
} else if (addr) {
wpa_printf(MSG_DEBUG, "%s: %s addr " MACSTR_SEC " reason=%u",
hapd->conf->iface, __func__, MAC2STR_SEC(addr),
reason);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(hapd, addr,
P2P_INTERFACE_STATE_DISCONNECTED, reason);
#endif
}
if (sta == NULL && addr)
sta = ap_get_sta(hapd, addr);

View File

@ -36,6 +36,10 @@
#include "vendor_ext.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT)
#include "hm_miracast_sink.h"
#endif
@ -1059,6 +1063,11 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
if (data_len < sizeof(*hdr) + keyhdrlen) {
wpa_printf(MSG_DEBUG, "WPA: Ignore too short EAPOL-Key frame");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_TOO_SHORT);
#endif
return;
}
@ -1097,6 +1106,11 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
wpa_printf(MSG_DEBUG,
"Ignore EAPOL-Key with unexpected type %d in RSN mode",
key->type);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_UNEXPECTED_TYPE_IN_RSN_MODE);
#endif
return;
}
} else {
@ -1104,6 +1118,11 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
wpa_printf(MSG_DEBUG,
"Ignore EAPOL-Key with unexpected type %d in WPA mode",
key->type);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_UNEXPECTED_TYPE_IN_RSN_MODE);
#endif
return;
}
}
@ -1148,6 +1167,11 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
wpa_auth_logger(wpa_auth, sm->addr,
LOGGER_WARNING,
"advertised support for AES-128-CMAC, but did not use it");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_NOT_USE_AES_128_CMAC);
#endif
return;
}
@ -1157,6 +1181,11 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
wpa_auth_logger(wpa_auth, sm->addr,
LOGGER_WARNING,
"did not use HMAC-SHA1-AES with CCMP/GCMP");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_NOT_USE_HMAC_SHA1_AES);
#endif
return;
}
}
@ -1264,6 +1293,11 @@ continue_processing:
wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_INFO,
"received EAPOL-Key msg 2/4 in invalid state (%d) - dropped",
sm->wpa_ptk_state);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_MSG_2_4_DROP_INVALID_STATE);
#endif
return;
}
random_add_randomness(key->key_nonce, WPA_NONCE_LEN);
@ -1280,6 +1314,11 @@ continue_processing:
wpa_printf(MSG_DEBUG,
"WPA: Reject 4-way handshake to collect more entropy for random number generation");
random_mark_pool_ready();
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_REJECT_4WAY_HS_FOR_ENTROPY);
#endif
wpa_sta_disconnect(wpa_auth, sm->addr,
WLAN_REASON_PREV_AUTH_NOT_VALID);
return;
@ -1291,6 +1330,11 @@ continue_processing:
wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_INFO,
"received EAPOL-Key msg 4/4 in invalid state (%d) - dropped",
sm->wpa_ptk_state);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_MSG_4_4_DROP_INVALID_STATE);
#endif
return;
}
break;
@ -1300,6 +1344,11 @@ continue_processing:
wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_INFO,
"received EAPOL-Key msg 2/2 in invalid state (%d) - dropped",
sm->wpa_ptk_group_state);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_MSG_2_2_DROP_INVALID_STATE);
#endif
return;
}
break;
@ -1309,10 +1358,23 @@ continue_processing:
wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_DEBUG,
"received EAPOL-Key frame (%s)", msgtxt);
#ifdef CONFIG_P2P_CHR
if (msg == PAIRWISE_2) {
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_4WAY_HANDSHAKE_2, P2P_CHR_DEFAULT_REASON_CODE);
} else if (msg == PAIRWISE_4) {
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_GROUP_HANDSHAKE, P2P_CHR_DEFAULT_REASON_CODE);
}
#endif
if (key_info & WPA_KEY_INFO_ACK) {
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,
"received invalid EAPOL-Key: Key Ack set");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_INVALID_KEY_ACK_SET);
#endif
return;
}
@ -1320,6 +1382,11 @@ continue_processing:
!(key_info & WPA_KEY_INFO_MIC)) {
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,
"received invalid EAPOL-Key: Key MIC not set");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_INVALID_KEY_MIC_NOT_SET);
#endif
return;
}
@ -1328,6 +1395,11 @@ continue_processing:
(key_info & WPA_KEY_INFO_MIC)) {
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,
"received invalid EAPOL-Key: Key MIC set");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_RX_EAPOL_FRAME_INVALID_KEY_MIC_SET);
#endif
return;
}
#endif /* CONFIG_FILS */
@ -2317,6 +2389,10 @@ SM_STATE(WPA_PTK, PTKSTART)
wpa_send_eapol(sm->wpa_auth, sm,
WPA_KEY_INFO_ACK | WPA_KEY_INFO_KEY_TYPE, NULL,
sm->ANonce, pmkid, pmkid_len, 0, 0);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(sm->wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_4WAY_HANDSHAKE_1, P2P_CHR_DEFAULT_REASON_CODE);
#endif
}
@ -3051,9 +3127,15 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
if (!ok) {
wpa_auth_logger(sm->wpa_auth, sm->addr, LOGGER_DEBUG,
"invalid MIC in msg 2/4 of 4-Way Handshake");
if (psk_found)
if (psk_found) {
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(sm->wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_MSG_2_4_INVALID_MIC);
#endif
wpa_auth_psk_failure_report(sm->wpa_auth, sm->addr);
return;
}
}
/*
@ -3072,6 +3154,11 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
if (wpa_parse_kde_ies(key_data, key_data_length, &kde) < 0) {
wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_INFO,
"received EAPOL-Key msg 2/4 with invalid Key Data contents");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(sm->wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_MSG_2_4_INVALID_KEY_DATA_CONTENTS);
#endif
return;
}
if (kde.rsn_ie) {
@ -3096,6 +3183,11 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
}
wpa_hexdump(MSG_DEBUG, "WPA IE in msg 2/4",
eapol_key_ie, eapol_key_ie_len);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(sm->wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_MSG_2_4_WPA_IE_MISMATCH_ASSOCREQ);
#endif
/* MLME-DEAUTHENTICATE.request */
wpa_sta_disconnect(wpa_auth, sm->addr,
WLAN_REASON_PREV_AUTH_NOT_VALID);
@ -3222,6 +3314,11 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
if (vlan_id && wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt) &&
wpa_auth_update_vlan(wpa_auth, sm->addr, vlan_id) < 0) {
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(sm->wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_MSG_2_4_INVALID_VLAN_ID);
#endif
wpa_sta_disconnect(wpa_auth, sm->addr,
WLAN_REASON_PREV_AUTH_NOT_VALID);
return;
@ -3661,6 +3758,10 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
WPA_KEY_INFO_ACK | WPA_KEY_INFO_INSTALL |
WPA_KEY_INFO_KEY_TYPE,
_rsc, sm->ANonce, kde, pos - kde, 0, encr);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(sm->wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_4WAY_HANDSHAKE_3, P2P_CHR_DEFAULT_REASON_CODE);
#endif
done:
os_free(kde);
os_free(wpa_ie_buf);
@ -3686,6 +3787,11 @@ SM_STATE(WPA_PTK, PTKINITDONE)
0, sm->PTK.tk, klen,
KEY_FLAG_PAIRWISE_RX_TX);
if (res) {
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_go_p2p_state(sm->wpa_auth->cb_ctx, sm->addr,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_MSG_4_4_WPA_SET_KEY_FAIL);
#endif
wpa_sta_disconnect(sm->wpa_auth, sm->addr,
WLAN_REASON_PREV_AUTH_NOT_VALID);
return;

View File

@ -27,6 +27,10 @@
#include "hm_miracast_sink.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
static void
nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv,
const u8 *frame, size_t len,
@ -1945,8 +1949,14 @@ void nl80211_del_station_event(struct wpa_driver_nl80211_data *drv,
MAC2STR_SEC(addr));
#ifdef CONFIG_VENDOR_EXT
struct wpa_supplicant *wpa_s = drv->ctx;
if (tb[NL80211_ATTR_REASON_CODE]) {
wpa_vendor_ext_nl80211_set_disconnect_reason(drv, nla_get_u16(tb[NL80211_ATTR_REASON_CODE]));
#ifdef CONFIG_P2P_CHR
if (drv->nlmode == NL80211_IFTYPE_P2P_GO) {
wpa_supplicant_upload_del_station(wpa_s, addr);
}
#endif
}
#endif

View File

@ -14,7 +14,9 @@
#include "eap_common/eap_wsc_common.h"
#include "p2p/p2p.h"
#include "wps/wps.h"
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
struct eap_wsc_data {
enum { START, MESG, FRAG_ACK, WAIT_FRAG_ACK, DONE, FAIL } state;
@ -442,6 +444,13 @@ static void eap_wsc_process(struct eap_sm *sm, void *priv,
res = wps_process_msg(data->wps, op_code, data->in_buf);
switch (res) {
case WPS_DONE:
#ifdef CONFIG_P2P_CHR
if (sm->cfg != NULL) {
wpa_supplicant_upload_p2p_state(sm->cfg->msg_ctx,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_TO_SWITCH_MGMT, P2P_CHR_DEFAULT_REASON_CODE);
}
#endif
wpa_printf(MSG_DEBUG, "EAP-WSC: WPS processing completed "
"successfully - report EAP failure");
eap_wsc_state(data, FAIL);

View File

@ -28,6 +28,10 @@
#include "parse_miracast_ie.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
static void p2p_state_timeout(void *eloop_ctx, void *timeout_ctx);
static void p2p_device_free(struct p2p_data *p2p, struct p2p_device *dev);
static void p2p_process_presence_req(struct p2p_data *p2p, const u8 *da,
@ -4091,6 +4095,9 @@ static void p2p_timeout_connect(struct p2p_data *p2p)
if (p2p->go_neg_peer &&
(p2p->go_neg_peer->flags & P2P_DEV_WAIT_GO_NEG_CONFIRM)) {
p2p_dbg(p2p, "Wait for GO Negotiation Confirm timed out - assume GO Negotiation failed");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_chr_error_code(P2P_EVENT_REASON_GO_WAIT_CONFRIM_FAILURE);
#endif
p2p_go_neg_failed(p2p, -1);
return;
}
@ -4266,6 +4273,9 @@ static void p2p_timeout_invite_listen(struct p2p_data *p2p)
p2p->invite_peer->info.p2p_device_addr,
0, 0);
}
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_chr_error_code(P2P_EVENT_REASON_INVIT_TIMEOUT);
#endif
p2p_set_state(p2p, P2P_IDLE);
}
}

View File

@ -30,6 +30,10 @@
#include "p2p_harmony.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
static int p2p_go_det(u8 own_intent, u8 peer_value)
{
u8 peer_intent = peer_value >> 1;
@ -909,6 +913,9 @@ void p2p_process_go_neg_req(struct p2p_data *p2p, const u8 *sa,
* failed and do not reply to this GO Negotiation
* Request frame.
*/
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_chr_statistics_event(P2P_EVENT_REASON_PEER_REJECTED_BY_USER);
#endif
p2p->cfg->send_action_done(p2p->cfg->cb_ctx);
p2p_go_neg_failed(p2p, *msg.status);
p2p_parse_free(&msg);

View File

@ -39,6 +39,9 @@
#include "driver_nl80211.h"
#include "wpa_supplicant_i.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
static const u8 null_rsc[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
@ -805,6 +808,10 @@ static void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
}
wpa_sm_set_state(sm, WPA_4WAY_HANDSHAKE);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(sm->ctx->ctx, P2P_INTERFACE_STATE_4WAY_HANDSHAKE_1,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
wpa_msg_only_for_cb(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: RX message 1 of 4-Way "
"Handshake from " MACSTR " (ver=%d)", MAC2STR(src_addr), ver);
wpa_printf(MSG_DEBUG, "WPA: RX message 1 of 4-Way "
@ -986,7 +993,10 @@ static void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
kde, kde_len, ptk) < 0) {
goto failed;
}
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(sm->ctx->ctx, P2P_INTERFACE_STATE_4WAY_HANDSHAKE_2,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
os_free(kde_buf);
os_memcpy(sm->anonce, key->key_nonce, WPA_NONCE_LEN);
return;
@ -1018,7 +1028,10 @@ static void wpa_supplicant_key_neg_complete(struct wpa_sm *sm,
wpa_cipher_txt(sm->group_cipher));
wpa_sm_cancel_auth_timeout(sm);
wpa_sm_set_state(sm, WPA_COMPLETED);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(sm->ctx->ctx, P2P_INTERFACE_STATE_COMPLETED,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
if (secure) {
wpa_sm_mlme_setprotection(
sm, addr, MLME_SETPROTECTION_PROTECT_TYPE_RX_TX,
@ -2333,6 +2346,10 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
int i;
wpa_sm_set_state(sm, WPA_4WAY_HANDSHAKE);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(sm->ctx->ctx, P2P_INTERFACE_STATE_4WAY_HANDSHAKE_3,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
"RSN: RX message 3 of 4-Way Handshake from " MACSTR
" (ver=%d)%s", MAC2STR(sm->bssid), ver, mlo ? " (MLO)" : "");
@ -2510,7 +2527,10 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
eapol_sm_notify_portValid(sm->eapol, true);
}
wpa_sm_set_state(sm, WPA_GROUP_HANDSHAKE);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(sm->ctx->ctx, P2P_INTERFACE_STATE_GROUP_HANDSHAKE,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
if (mlo) {
if (wpa_supplicant_pairwise_mlo_gtk(sm, key, &ie, key_info) < 0) {
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
@ -2631,6 +2651,10 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
struct wpa_eapol_ie_parse ie;
wpa_sm_set_state(sm, WPA_4WAY_HANDSHAKE);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(sm->ctx->ctx, P2P_INTERFACE_STATE_4WAY_HANDSHAKE_3,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
wpa_msg_only_for_cb(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: RX message 3 of 4-Way "
"Handshake from " MACSTR " (ver=%d)", MAC2STR(sm->bssid), ver);
wpa_printf(MSG_DEBUG, "WPA: RX message 3 of 4-Way "
@ -2768,7 +2792,10 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
eapol_sm_notify_portValid(sm->eapol, true);
}
wpa_sm_set_state(sm, WPA_GROUP_HANDSHAKE);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(sm->ctx->ctx, P2P_INTERFACE_STATE_GROUP_HANDSHAKE,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
if (sm->group_cipher == WPA_CIPHER_GTK_NOT_USED) {
/* No GTK to be set to the driver */
} else if (!ie.gtk && sm->proto == WPA_PROTO_RSN) {

View File

@ -41,6 +41,9 @@
#include "p2p/p2p_i.h"
#endif /* CONFIG_WIFI_RPT */
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
#ifdef CONFIG_WPS
static void wpas_wps_ap_pin_timeout(void *eloop_data, void *user_ctx);
#endif /* CONFIG_WPS */
@ -931,7 +934,10 @@ static void wpas_ap_configured_cb(void *ctx)
#endif /* CONFIG_ACS */
wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s, P2P_INTERFACE_STATE_COMPLETED,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
if (wpa_s->ap_configured_cb)
wpa_s->ap_configured_cb(wpa_s->ap_configured_cb_ctx,
wpa_s->ap_configured_cb_data);

View File

@ -69,6 +69,11 @@
extern void wpas_connect_work_done(struct wpa_supplicant *wpa_s);
#endif
#ifdef CONFIG_P2P_CHR
#include "p2p/p2p_i.h"
#include "wpa_hw_p2p_chr.h"
#endif /* CONFIG_P2P_CHR */
#define MAX_OWE_TRANSITION_BSS_SELECT_COUNT 5
#define BUFFER_SIZE 128
@ -4076,6 +4081,10 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
ft_completed = wpa_fils_is_completed(wpa_s->wpa);
wpa_supplicant_set_state(wpa_s, WPA_ASSOCIATED);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s, P2P_INTERFACE_STATE_ASSOCIATED,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
if (os_memcmp(bssid, wpa_s->bssid, ETH_ALEN) != 0) {
if (os_reltime_initialized(&wpa_s->session_start)) {
os_reltime_age(&wpa_s->session_start,
@ -5024,6 +5033,23 @@ static void wpas_event_disconnect(struct wpa_supplicant *wpa_s, const u8 *addr,
u16 reason_code, int locally_generated,
const u8 *ie, size_t ie_len, int deauth)
{
#ifdef CONFIG_P2P_CHR
if (strncmp(wpa_s->ifname, "p2p", strlen("p2p")) == 0) {
if (wpa_s->global->p2p_disabled == 0 &&
wpa_s->global->p2p != NULL) {
struct p2p_message msg = {0};
int minor_code = 0;
if (ie != NULL &&
p2p_parse_ies(ie, ie_len, &msg) == 0) {
if (msg.minor_reason_code != NULL) {
minor_code = (int)*msg.minor_reason_code;
}
p2p_parse_free(&msg);
}
wpa_supplicant_upload_p2p_state(wpa_s, P2P_INTERFACE_STATE_DISCONNECTED, reason_code, minor_code);
}
}
#endif /* CONFIG_P2P_CHR */
#ifdef CONFIG_AP
if (wpa_s->ap_iface && addr) {
hostapd_notif_disassoc(wpa_s->ap_iface->bss[0], addr);
@ -5100,6 +5126,11 @@ static void wpas_event_disassoc(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_AP
if (wpa_s->ap_iface && info && info->addr) {
hostapd_notif_disassoc(wpa_s->ap_iface->bss[0], info->addr);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s,
P2P_INTERFACE_STATE_DISCONNECTED,
info->reason_code, P2P_CHR_DEFAULT_REASON_CODE);
#endif
return;
}
@ -5823,6 +5854,11 @@ static void wpas_event_assoc_reject(struct wpa_supplicant *wpa_s,
wpas_connection_failed(wpa_s, bssid, link_bssids);
#else
wpas_connection_failed(wpa_s, bssid);
#endif
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s,
P2P_INTERFACE_STATE_DISCONNECTED, DR_ASSOCIATING_REJECT,
wpa_s->assoc_status_code);
#endif
wpa_supplicant_mark_disassoc(wpa_s);
}
@ -6083,6 +6119,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)
sme_event_auth_timed_out(wpa_s, data);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_AUTH_TIMEOUT, P2P_CHR_DEFAULT_REASON_CODE);
#endif
break;
case EVENT_ASSOC_TIMED_OUT:
/* It is possible to get this event from earlier connection */
@ -6094,6 +6135,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)
sme_event_assoc_timed_out(wpa_s, data);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_ASSOCIATING_TIMEOUT, P2P_CHR_DEFAULT_REASON_CODE);
#endif
break;
case EVENT_TX_STATUS:
wpa_dbg(wpa_s, MSG_DEBUG, "EVENT_TX_STATUS dst=" MACSTR

View File

@ -69,6 +69,9 @@
#endif
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
/*
* How many times to try to scan to find the GO before giving up on join
* request.
@ -1610,6 +1613,12 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
wpa_printf(MSG_INFO, "WPA_EVENT_GROUP_FORMATION_FAILURE");
WpaEventReport(wpa_s->ifname, WPA_EVENT_GROUP_FORMATION_FAILURE, "");
#endif
#ifdef CONFIG_P2P_CHR
if (wpa_s->wpa_state == WPA_SCANNING) {
wpa_supplicant_upload_chr_error_code(P2P_EVENT_REASON_GROUP_FAILURE_IN_SCAN);
}
#endif
wpas_notify_p2p_group_formation_failure(wpa_s, "");
if (already_deleted)
return;
@ -2667,6 +2676,9 @@ static void wpas_p2p_group_formation_timeout(void *eloop_ctx,
{
struct wpa_supplicant *wpa_s = eloop_ctx;
wpa_printf(MSG_DEBUG, "P2P: Group Formation timed out");
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_group_formation_timeout(wpa_s);
#endif
wpas_p2p_group_formation_failed(wpa_s, 0);
}
@ -3837,6 +3849,9 @@ static void wpas_invitation_received(void *ctx, const u8 *sa, const u8 *bssid,
wpa_s->p2p_wps_method, 0, op_freq,
ssid, ssid_len);
}
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_invitation(wpa_s, sa, ETH_ALEN);
#endif
return;
}
@ -3845,7 +3860,9 @@ static void wpas_invitation_received(void *ctx, const u8 *sa, const u8 *bssid,
" was rejected (status %u)", MAC2STR_SEC(sa), status);
return;
}
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_invitation(wpa_s, sa, ETH_ALEN);
#endif
if (!s) {
if (bssid) {
wpa_msg_global(wpa_s, MSG_INFO,
@ -8063,7 +8080,9 @@ void wpas_p2p_wps_failed(struct wpa_supplicant *wpa_s,
}
wpas_notify_p2p_wps_failed(wpa_s, fail);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_pin_check_error(wpa_s, fail);
#endif
if (wpa_s == wpa_s->global->p2p_group_formation) {
/*
* Allow some time for the failed WPS negotiation exchange to
@ -9260,6 +9279,11 @@ int wpas_p2p_cancel(struct wpa_supplicant *wpa_s)
if (global->p2p == NULL)
return -1;
#ifdef CONFIG_P2P_CHR
if (global->p2p->state == P2P_WAIT_PEER_CONNECT) {
wpa_supplicant_upload_chr_error_code(P2P_EVENT_REASON_GO_WAIT_PEER_CONNECT_TIMEOUT);
}
#endif
wpa_printf(MSG_DEBUG, "P2P: Request to cancel group formation");
if (wpa_s->pending_interface_name[0] &&

View File

@ -41,6 +41,10 @@
#include "wpa_magiclink.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
static void wpa_supplicant_gen_assoc_event(struct wpa_supplicant *wpa_s)
{
struct wpa_ssid *ssid;
@ -259,9 +263,15 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit)
wpa_supplicant_notify_scanning(wpa_s, 0);
wpas_notify_scan_done(wpa_s, 0);
if (wpa_s->wpa_state == WPA_SCANNING)
if (wpa_s->wpa_state == WPA_SCANNING) {
wpa_supplicant_set_state(wpa_s,
wpa_s->scan_prev_wpa_state);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s,
wpas_switch_wpa_state_to_p2p_state(wpa_s->scan_prev_wpa_state),
DR_SCAN_TO_DRV_FAIL, ret);
#endif
}
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SCAN_FAILED "ret=%d%s",
ret, retry ? " retry=1" : "");
radio_work_done(work);
@ -1077,9 +1087,13 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
wpa_s->scan_prev_wpa_state = wpa_s->wpa_state;
if (wpa_s->wpa_state == WPA_DISCONNECTED ||
wpa_s->wpa_state == WPA_INACTIVE)
wpa_s->wpa_state == WPA_INACTIVE) {
wpa_supplicant_set_state(wpa_s, WPA_SCANNING);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s, P2P_INTERFACE_STATE_SCANNING,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
}
/*
* If autoscan has set its own scanning parameters
*/
@ -1471,9 +1485,15 @@ scan:
if (ret) {
wpa_msg(wpa_s, MSG_WARNING, "Failed to initiate AP scan");
if (wpa_s->scan_prev_wpa_state != wpa_s->wpa_state)
if (wpa_s->scan_prev_wpa_state != wpa_s->wpa_state) {
wpa_supplicant_set_state(wpa_s,
wpa_s->scan_prev_wpa_state);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s,
wpas_switch_wpa_state_to_p2p_state(wpa_s->scan_prev_wpa_state),
DR_TRIGGER_SCAN_FAIL, ret);
#endif
}
/* Restore scan_req since we will try to scan again */
wpa_s->scan_req = wpa_s->last_scan_req;
wpa_supplicant_req_scan(wpa_s, 1, 0);

View File

@ -86,7 +86,9 @@
#ifdef OPEN_HARMONY_P2P_ONEHOP_FIND
#include "p2p_onehop_scan_opt.h"
#endif
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
const char *const wpa_supplicant_version =
"wpa_supplicant v" VERSION_STR "\n"
"Copyright (c) 2003-2022, Jouni Malinen <j@w1.fi> and contributors";
@ -4010,6 +4012,10 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
}
#else
wpa_supplicant_set_state(wpa_s, WPA_ASSOCIATING);
#endif
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s, P2P_INTERFACE_STATE_ASSOCIATING,
P2P_CHR_DEFAULT_REASON_CODE, P2P_CHR_DEFAULT_REASON_CODE);
#endif
if (bss) {
params.ssid = bss->ssid;
@ -4278,6 +4284,11 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
wpas_connection_failed(wpa_s, wpa_s->pending_bssid);
#endif
wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_TRIGGER_ASSOCIATE_TO_DRV_FAIL, ret);
#endif
os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
return;
}

View File

@ -33,6 +33,11 @@
#include "p2p/p2p.h"
#include "p2p_supplicant.h"
#include "wps_supplicant.h"
#ifdef CONFIG_P2P_CHR
#include "wpa_hw_p2p_chr.h"
#endif
#ifdef CONFIG_HILINK_OKC_STA
#include "hilink_okc.h"
#endif
@ -134,6 +139,11 @@ int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s)
wpa_s->own_disconnect_req = 1;
#ifdef HARMONY_P2P_CONNECTIVITY_PATCH
os_sleep(0, WPA_DISCONNECT_SLEEP_TIME);
#endif
#ifdef CONFIG_P2P_CHR
wpa_supplicant_upload_p2p_state(wpa_s,
P2P_INTERFACE_STATE_DISCONNECTED,
DR_TO_SWITCH_MGMT, P2P_CHR_DEFAULT_REASON_CODE);
#endif
wpa_supplicant_deauthenticate(wpa_s,
WLAN_REASON_DEAUTH_LEAVING);

View File

@ -30,6 +30,7 @@ if (wpa_supplicant_vendor_ext && wpa_vendor_gni != "") {
"-DCONFIG_OPEN_HARMONY_MIRACAST_MAC",
"-DCONFIG_OPEN_HARMONY_SPECIFIC_P2P_FIND",
"-DCONFIG_OPEN_HARMONY_P2P_DFH_CONNECT",
"-DCONFIG_P2P_CHR",
"-DCONFIG_P2P_OPT",
"-DCONFIG_MIRACAST_SOURCE_OPT",
"-DHARMONY_CONNECTIVITY_PATCH",