From 63013e10604e8008e463bc1eb9937f8034d2e61c Mon Sep 17 00:00:00 2001 From: xiehang Date: Wed, 12 Jun 2019 14:40:29 +0800 Subject: [PATCH] wps: add overlap event (backport v3.1) --- components/esp32/event_default_handlers.c | 4 ++++ components/esp32/include/esp_event.h | 1 + components/esp32/lib | 2 +- .../wpa_supplicant/include/wpa2/eap_peer/eap_i.h | 10 ++++++++-- components/wpa_supplicant/include/wps/wps.h | 6 +++--- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/esp32/event_default_handlers.c b/components/esp32/event_default_handlers.c index 8a397a3457..10c4616d9a 100644 --- a/components/esp32/event_default_handlers.c +++ b/components/esp32/event_default_handlers.c @@ -314,6 +314,10 @@ static esp_err_t esp_system_event_debug(system_event_t *event) ESP_LOGD(TAG, "SYSTEM_EVENT_STA_WPS_ER_PIN"); break; } + case SYSTEM_EVENT_STA_WPS_ER_PBC_OVERLAP: { + ESP_LOGD(TAG, "SYSTEM_EVENT_STA_WPS_ER_PBC_OVERLAP"); + break; + } case SYSTEM_EVENT_AP_START: { ESP_LOGD(TAG, "SYSTEM_EVENT_AP_START"); break; diff --git a/components/esp32/include/esp_event.h b/components/esp32/include/esp_event.h index 3bb2a77b9f..a251884181 100644 --- a/components/esp32/include/esp_event.h +++ b/components/esp32/include/esp_event.h @@ -40,6 +40,7 @@ typedef enum { SYSTEM_EVENT_STA_WPS_ER_FAILED, /**< ESP32 station wps fails in enrollee mode */ SYSTEM_EVENT_STA_WPS_ER_TIMEOUT, /**< ESP32 station wps timeout in enrollee mode */ SYSTEM_EVENT_STA_WPS_ER_PIN, /**< ESP32 station wps pin code in enrollee mode */ + SYSTEM_EVENT_STA_WPS_ER_PBC_OVERLAP, /*!< ESP32 station wps overlap in enrollee mode */ SYSTEM_EVENT_AP_START, /**< ESP32 soft-AP start */ SYSTEM_EVENT_AP_STOP, /**< ESP32 soft-AP stop */ SYSTEM_EVENT_AP_STACONNECTED, /**< a station connected to ESP32 soft-AP */ diff --git a/components/esp32/lib b/components/esp32/lib index 629d7a3b17..7def1ca817 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 629d7a3b1790d5ffff16d2db1ed1d7873787a438 +Subproject commit 7def1ca81715689275e401b7e1d674b552738ea8 diff --git a/components/wpa_supplicant/include/wpa2/eap_peer/eap_i.h b/components/wpa_supplicant/include/wpa2/eap_peer/eap_i.h index 6204f46538..6adf5ec7e3 100644 --- a/components/wpa_supplicant/include/wpa2/eap_peer/eap_i.h +++ b/components/wpa_supplicant/include/wpa2/eap_peer/eap_i.h @@ -98,6 +98,13 @@ struct eap_method { #define BLOB_NAME_LEN 3 #define BLOB_NUM 3 +enum SIG_WPA2 { + SIG_WPA2_START = 0, + SIG_WPA2_RX, + SIG_WPA2_TASK_DEL, + SIG_WPA2_MAX, +}; + /** * struct eap_sm - EAP state machine data */ @@ -114,8 +121,7 @@ struct eap_sm { u8 current_identifier; u8 ownaddr[ETH_ALEN]; #ifdef USE_WPA2_TASK -#define SIG_WPA2_NUM 2 - u8 wpa2_sig_cnt[SIG_WPA2_NUM]; + u8 wpa2_sig_cnt[SIG_WPA2_MAX]; #endif u8 finish_state; diff --git a/components/wpa_supplicant/include/wps/wps.h b/components/wpa_supplicant/include/wps/wps.h index b731b9b95f..31092cbb83 100644 --- a/components/wpa_supplicant/include/wps/wps.h +++ b/components/wpa_supplicant/include/wps/wps.h @@ -1009,9 +1009,9 @@ enum wps_cb_status { typedef void (*wps_st_cb_t)(int status); #ifdef USE_WPS_TASK -#define SIG_WPS_START 0 -#define SIG_WPS_RX 1 -#define SIG_WPS_NUM 2 +#define SIG_WPS_START 2 +#define SIG_WPS_RX 3 +#define SIG_WPS_NUM 9 #endif #define WPS_EAP_EXT_VENDOR_TYPE "WFA-SimpleConfig-Enrollee-1-0"