esp_wifi: fix some wifi bugs:

1. fix sta reset beacon timeout timer issue
2. fix pairwise cipher tkip pmf compability issue
3. fix country policy issue
4. fix deinit return wrong status issue
5. fix get wrong channel value use esp_wifi_get_config
6. fix bug of missing unlock when wifi stop
7. fix error of esp_wifi_start_scan in api esp_wifi_connect
8. fix fail to scan after recv disassoc/deauth for esp32s2
This commit is contained in:
muhaidong 2022-10-21 14:37:16 +08:00
parent 5158f347cd
commit 234a45b2b3
2 changed files with 17 additions and 16 deletions

View File

@ -329,7 +329,7 @@ esp_err_t esp_wifi_restore(void);
* *
* @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode * @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode
* @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect. * @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect.
* @attention 3. The scanning triggered by esp_wifi_start_scan() will not be effective until connection between ESP32 and the AP is established. * @attention 3. The scanning triggered by esp_wifi_scan_start() will not be effective until connection between ESP32 and the AP is established.
* If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error * If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error
* number ESP_ERR_WIFI_STATE. * number ESP_ERR_WIFI_STATE.
* If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called * If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called
@ -587,20 +587,21 @@ esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second);
/** /**
* @brief configure country info * @brief configure country info
* *
* @attention 1. The default country is {.cc="CN", .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO} * @attention 1. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, .policy=WIFI_COUNTRY_POLICY_AUTO}.
* @attention 2. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which * @attention 2. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '.
* the station is connected is used. E.g. if the configured country info is {.cc="USA", .schan=1, .nchan=11} * @attention 3. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which
* the station is connected is used. E.g. if the configured country info is {.cc="US", .schan=1, .nchan=11}
* and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14}
* then the country info that will be used is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected * then the country info that will be used is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected
* from the AP the country info is set back back to the country info of the station automatically, * from the AP the country info is set back to the country info of the station automatically,
* {.cc="US", .schan=1, .nchan=11} in the example. * {.cc="US", .schan=1, .nchan=11} in the example.
* @attention 3. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, always use the configured country info. * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always.
* @attention 4. When the country info is changed because of configuration or because the station connects to a different * @attention 5. When the country info is changed because of configuration or because the station connects to a different
* external AP, the country IE in probe response/beacon of the soft-AP is changed also. * external AP, the country IE in probe response/beacon of the soft-AP is also changed.
* @attention 5. The country configuration is stored into flash. * @attention 6. The country configuration is stored into flash.
* @attention 6. This API doesn't validate the per-country rules, it's up to the user to fill in all fields according to * @attention 7. This API doesn't validate the per-country rules, it's up to the user to fill in all fields according to
* local regulations. * local regulations.
* @attention 7. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the * @attention 8. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the
* country info. * country info.
* *
* @param country the configured country info * @param country the configured country info
@ -898,7 +899,7 @@ esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx);
* @return * @return
* - ESP_OK: succeed * - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start
* - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is out of range * - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is out of range
*/ */
esp_err_t esp_wifi_set_max_tx_power(int8_t power); esp_err_t esp_wifi_set_max_tx_power(int8_t power);
@ -911,7 +912,7 @@ esp_err_t esp_wifi_set_max_tx_power(int8_t power);
* @return * @return
* - ESP_OK: succeed * - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start
* - ESP_ERR_WIFI_ARG: invalid argument * - ESP_ERR_WIFI_ARG: invalid argument
*/ */
esp_err_t esp_wifi_get_max_tx_power(int8_t *power); esp_err_t esp_wifi_get_max_tx_power(int8_t *power);
@ -1007,7 +1008,7 @@ esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx);
* return * return
* - ESP_OK: succeed * - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled
* - ESP_ERR_INVALID_ARG: invalid argument * - ESP_ERR_INVALID_ARG: invalid argument
*/ */
esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config);
@ -1020,7 +1021,7 @@ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config);
* return * return
* - ESP_OK: succeed * - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled
* - ESP_ERR_INVALID_ARG: invalid argument * - ESP_ERR_INVALID_ARG: invalid argument
*/ */
esp_err_t esp_wifi_set_csi(bool en); esp_err_t esp_wifi_set_csi(bool en);

@ -1 +1 @@
Subproject commit 92930748f57dfd8facd49fd50730efa6fd40e55d Subproject commit e4b797d71045cf0c582f91eb7314869443fd98fa