Skip to content

Commit c7f146b

Browse files
committed
Merge branch 'fix/backport_wifi_fixes_v5.3' into 'release/v5.3'
fix(esp_wifi): backport some wifi fixes to v5.3 See merge request espressif/esp-idf!30933
2 parents 86a49de + 68be49d commit c7f146b

File tree

19 files changed

+104
-73
lines changed

19 files changed

+104
-73
lines changed

components/esp_rom/esp32c2/ld/esp32c2.rom.ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ hal_sniffer_enable = 0x40001eec;
16551655
hal_sniffer_disable = 0x40001ef0;
16561656
/*hal_sniffer_rx_set_promis = 0x40001ef4;*/
16571657
hal_sniffer_rx_clr_statistics = 0x40001ef8;
1658-
hal_sniffer_set_promis_misc_pkt = 0x40001efc;
1658+
/*hal_sniffer_set_promis_misc_pkt = 0x40001efc;*/
16591659
tsf_hal_set_tsf_enable = 0x40001f00;
16601660
tsf_hal_set_tsf_disable = 0x40001f04;
16611661
tsf_hal_is_tsf_enabled = 0x40001f08;
@@ -1849,7 +1849,7 @@ ieee80211_alloc_tx_buf = 0x40002108;
18491849
/* ieee80211_send_nulldata = 0x40002110; */
18501850
/* ieee80211_setup_robust_mgmtframe = 0x40002114; */
18511851
ieee80211_encap_null_data = 0x4000211c;
1852-
ieee80211_send_deauth = 0x40002120;
1852+
ieee80211_send_deauth_no_bss = 0x40002120;
18531853
ieee80211_alloc_deauth = 0x40002124;
18541854
ieee80211_send_proberesp = 0x40002128;
18551855
ieee80211_getcapinfo = 0x40002130;

components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rcUpdateTxDone = 0x4000177c;
3131
wDevCheckBlockError = 0x400017b4;
3232
/* wDev_IndicateFrame = 0x400017c8;*/
3333
wDev_ProcessFiq = 0x400017f0;
34-
wDev_ProcessRxSucData = 0x400017f4;
34+
/*wDev_ProcessRxSucData = 0x400017f4;*/
3535
/*ppProcTxDone = 0x40001804;*/
3636
pm_tx_data_done_process = 0x40001808;
3737
ppMapWaitTxq = 0x40001810;

components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ lmacReachLongLimit = 0x40000cb8;
7474
lmacReachShortLimit = 0x40000cbc;
7575
lmacRecycleMPDU = 0x40000cc0;
7676
lmacRxDone = 0x40000cc4;
77-
lmacSetTxFrame = 0x40000cc8;
77+
/*lmacSetTxFrame = 0x40000cc8;*/
7878
lmacTxDone = 0x40000ccc;
7979
lmacTxFrame = 0x40000cd0;
8080
lmacDisableTransmit = 0x40000cd4;

components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ lmacReachLongLimit = 0x40000b60;
4848
lmacReachShortLimit = 0x40000b64;
4949
lmacRecycleMPDU = 0x40000b68;
5050
lmacRxDone = 0x40000b6c;
51-
lmacSetTxFrame = 0x40000b70;
51+
/*lmacSetTxFrame = 0x40000b70;*/
5252
lmacTxDone = 0x40000b74;
5353
lmacTxFrame = 0x40000b78;
5454
mac_tx_set_duration = 0x40000b7c;

components/esp_wifi/include/esp_mesh.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2017-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -141,7 +141,7 @@ extern "C" {
141141
#define MESH_ASSOC_FLAG_STA_VOTED (0x04) /**< station vote done, set when connect to router */
142142
#define MESH_ASSOC_FLAG_NETWORK_FREE (0x08) /**< no root in current network */
143143
#define MESH_ASSOC_FLAG_STA_VOTE_EXPIRE (0x10) /**< the voted address is expired, means the voted device lose the chance to be root */
144-
#define MESH_ASSOC_FLAG_ROOTS_FOUND (0x20) /**< roots conflict is found, means that thre are at least two roots in the mesh network */
144+
#define MESH_ASSOC_FLAG_ROOTS_FOUND (0x20) /**< roots conflict is found, means that there are at least two roots in the mesh network */
145145
#define MESH_ASSOC_FLAG_ROOT_FIXED (0x40) /**< the root is fixed in the mesh network */
146146

147147
/**
@@ -216,7 +216,7 @@ typedef enum {
216216
MESH_ROOT, /**< the only sink of the mesh network. Has the ability to access external IP network */
217217
MESH_NODE, /**< intermediate device. Has the ability to forward packets over the mesh network */
218218
MESH_LEAF, /**< has no forwarding ability */
219-
MESH_STA, /**< connect to router with a standlone Wi-Fi station mode, no network expansion capability */
219+
MESH_STA, /**< connect to router with a standalone Wi-Fi station mode, no network expansion capability */
220220
} mesh_type_t;
221221

222222
/**
@@ -642,14 +642,16 @@ esp_err_t esp_mesh_stop(void);
642642
* - Field size should not exceed MESH_MPS. Note that the size of one mesh packet should not exceed MESH_MTU.
643643
* - Field proto should be set to data protocol in use (default is MESH_PROTO_BIN for binary).
644644
* - Field tos should be set to transmission tos (type of service) in use (default is MESH_TOS_P2P for point-to-point reliable).
645+
* - If the packet is to the root, MESH_TOS_P2P must be set to ensure reliable transmission.
646+
* - As long as the MESH_TOS_P2P is set, the API is blocking, even if the flag is set with MESH_DATA_NONBLOCK.
647+
* - As long as the MESH_TOS_DEF is set, the API is non-blocking.
645648
* @param[in] flag bitmap for data sent
649+
* - Flag is at least one of the three MESH_DATA_P2P/MESH_DATA_FROMDS/MESH_DATA_TODS, which represents the direction of packet sending.
646650
* - Speed up the route search
647-
* - If the packet is to the root and "to" parameter is NULL, set this parameter to 0.
648651
* - If the packet is to an internal device, MESH_DATA_P2P should be set.
649652
* - If the packet is to the root ("to" parameter isn't NULL) or to external IP network, MESH_DATA_TODS should be set.
650653
* - If the packet is from the root to an internal device, MESH_DATA_FROMDS should be set.
651-
* - Specify whether this API is block or non-block, block by default
652-
* - If needs non-blocking, MESH_DATA_NONBLOCK should be set. Otherwise, may use esp_mesh_send_block_time() to specify a blocking time.
654+
* - Specify whether this API is blocking or non-blocking, blocking by default.
653655
* - In the situation of the root change, MESH_DATA_DROP identifies this packet can be dropped by the new root
654656
* for upstream data to external IP network, we try our best to avoid data loss caused by the root change, but
655657
* there is a risk that the new root is running out of memory because most of memory is occupied by the pending data which
@@ -684,6 +686,7 @@ esp_err_t esp_mesh_send(const mesh_addr_t *to, const mesh_data_t *data,
684686
int flag, const mesh_opt_t opt[], int opt_count);
685687
/**
686688
* @brief Set blocking time of esp_mesh_send()
689+
* - Suggest to set the blocking time to at least 5s when the environment is poor. Otherwise, esp_mesh_send() may timeout frequently.
687690
*
688691
* @attention This API shall be called before mesh is started.
689692
*
@@ -1202,6 +1205,7 @@ int esp_mesh_get_xon_qsize(void);
12021205

12031206
/**
12041207
* @brief Set whether allow more than one root existing in one network
1208+
* - The default value is true, that is, multiple roots are allowed.
12051209
*
12061210
* @param[in] allowed allow or not
12071211
*

components/esp_wifi/include/esp_wifi_he_types.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,18 @@ typedef struct {
302302
uint64_t target_wake_time; /**< TWT SP start time */
303303
} wifi_event_sta_itwt_setup_t;
304304

305+
/**
306+
* @brief iTWT teardown status
307+
*/
308+
typedef enum {
309+
ITWT_TEARDOWN_FAIL, /**< station sends teardown frame fail */
310+
ITWT_TEARDOWN_SUCCESS, /**< 1) station successfully sends teardown frame to AP; 2) station receives teardown frame from AP */
311+
} wifi_itwt_teardown_status_t;
312+
305313
/** Argument structure for WIFI_EVENT_TWT_TEARDOWN event */
306314
typedef struct {
307315
uint8_t flow_id; /**< flow id */
316+
wifi_itwt_teardown_status_t status; /**< itwt teardown status */
308317
} wifi_event_sta_itwt_teardown_t;
309318

310319
/**

components/esp_wifi/include/esp_wifi_types_generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ typedef struct {
903903
uint8_t mac[6]; /**< MAC address of the station disconnects to soft-AP */
904904
uint8_t aid; /**< the aid that soft-AP gave to the station disconnects to */
905905
bool is_mesh_child; /**< flag to identify mesh child */
906-
uint8_t reason; /**< reason of disconnection */
906+
uint16_t reason; /**< reason of disconnection */
907907
} wifi_event_ap_stadisconnected_t;
908908

909909
/** Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event */

components/esp_wifi/wifi_apps/nan_app/src/nan_app.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -28,12 +28,13 @@
2828
#define NDP_REJECTED BIT5
2929

3030
/* Macros */
31-
#define MACADDR_LEN 6
31+
#define MACADDR_LEN 6
3232
#define MACADDR_EQUAL(a1, a2) (memcmp(a1, a2, MACADDR_LEN))
3333
#define MACADDR_COPY(dst, src) (memcpy(dst, src, MACADDR_LEN))
34-
#define NAN_DW_INTVL_MS 524 /* NAN DW interval (512 TU's ~= 524 mSec) */
35-
#define NAN_NDP_RESP_TIMEOUT_DW 4
34+
#define NAN_DW_INTVL_MS 524 /* NAN DW interval (512 TU's ~= 524 mSec) */
35+
#define NAN_NDP_RESP_TIMEOUT_DW 8
3636
#define NAN_NDP_RESP_TIMEOUT NAN_NDP_RESP_TIMEOUT_DW*NAN_DW_INTVL_MS
37+
#define NAN_NDP_TERM_TIMEOUT 2*NAN_DW_INTVL_MS /* NDP Termination Timeout - 2 DW*/
3738

3839
/* Global Variables */
3940
static const char *TAG = "nan_app";
@@ -800,7 +801,7 @@ esp_err_t esp_wifi_nan_stop(void)
800801

801802
NAN_DATA_UNLOCK();
802803
os_event_group_clear_bits(nan_event_group, NDP_TERMINATED);
803-
os_event_group_wait_bits(nan_event_group, NDP_TERMINATED, pdFALSE, pdFALSE, portMAX_DELAY);
804+
os_event_group_wait_bits(nan_event_group, NDP_TERMINATED, pdFALSE, pdFALSE, pdMS_TO_TICKS(NAN_NDP_TERM_TIMEOUT));
804805
os_event_group_clear_bits(nan_event_group, NDP_TERMINATED);
805806
/* Wait for 1 NAN DW interval (512 TU's ~= 524 mSec) for successful termination */
806807
g_wifi_osi_funcs._task_delay(NAN_DW_INTVL_MS/portTICK_PERIOD_MS);

examples/bluetooth/blufi/main/blufi_example_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base,
246246
}
247247
case WIFI_EVENT_AP_STADISCONNECTED: {
248248
wifi_event_ap_stadisconnected_t* event = (wifi_event_ap_stadisconnected_t*) event_data;
249-
BLUFI_INFO("station "MACSTR" leave, AID=%d", MAC2STR(event->mac), event->aid);
249+
BLUFI_INFO("station "MACSTR" leave, AID=%d, reason=%d", MAC2STR(event->mac), event->aid, event->reason);
250250
break;
251251
}
252252

0 commit comments

Comments
 (0)