feat(wifi): add esp32c5 beta3 wifi support

This commit is contained in:
xuxiao 2024-03-28 20:52:43 +08:00
parent 8ea943e258
commit 27f61966cd
29 changed files with 1295 additions and 87 deletions

View File

@ -1,4 +1,4 @@
[codespell]
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci
write-changes = true

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -35,7 +35,9 @@
#include "soc/rtc.h"
#include "soc/soc_memory_layout.h"
#include "soc/dport_reg.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp_timer.h"
#if !CONFIG_FREERTOS_UNICORE
#include "esp_ipc.h"
@ -760,7 +762,7 @@ static int32_t queue_send_hlevel_wrapper(void *queue, void *item, uint32_t block
* @param item The message which will be send
* @param hptw need do task yield or not
* @return send success or not
* There is an issue here: When the queue is full, it may reture true but it send fail to the queue, sometimes.
* There is an issue here: When the queue is full, it may return true but it send fail to the queue, sometimes.
* But in Bluetooth controller's isr, We don't care about the return value.
* It only required tp send success when the queue is empty all the time.
* So, this function meets the requirement.
@ -1695,7 +1697,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
sdk_config_set_bt_pll_track_enable(true);
// inititalize bluetooth baseband
// initialize bluetooth baseband
btdm_check_and_init_bb();
ret = btdm_controller_enable(mode);
@ -1858,7 +1860,7 @@ esp_err_t esp_ble_scan_dupilcate_list_flush(void)
/**
* This function re-write controller's function,
* As coredump can not show paramerters in function which is in a .a file.
* As coredump can not show parameters in function which is in a .a file.
*
* After coredump fixing this issue, just delete this function.
*/

View File

@ -23,6 +23,7 @@
#include "esp_task.h"
#include "esp_attr.h"
#include "esp_phy_init.h"
#include "esp_private/phy.h"
#include "esp_bt.h"
#include "esp_err.h"
#include "esp_log.h"
@ -34,11 +35,12 @@
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/soc_memory_layout.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp_timer.h"
#include "esp_sleep.h"
#include "esp_rom_sys.h"
#include "esp_private/phy.h"
#if CONFIG_IDF_TARGET_ESP32C3
#include "riscv/interrupt.h"
#include "esp32c3/rom/rom_layout.h"

View File

@ -153,6 +153,7 @@ if(NOT BOOTLOADER_BUILD)
if(CONFIG_IDF_TARGET_ESP32C5)
list(REMOVE_ITEM srcs
"sleep_modes.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
"sleep_modem.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
"sleep_wake_stub.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
"sleep_gpio.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
"port/esp_clk_tree_common.c" # TODO: [ESP32C5] IDF-8638, IDF-8640

View File

@ -83,6 +83,9 @@ if(CONFIG_ESP_PHY_ENABLED)
target_link_libraries(${COMPONENT_LIB} PUBLIC btbb)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a libbtbb.a
$<TARGET_FILE:${esp_phy_lib}>)
elseif(CONFIG_SOC_WIFI_SUPPORTED)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a
$<TARGET_FILE:${esp_phy_lib}>)
endif()
if(CONFIG_ESP_PHY_ENABLE_CERT_TEST)

View File

@ -280,7 +280,7 @@ menu "Wi-Fi"
config ESP_WIFI_EXTRA_IRAM_OPT
bool "WiFi EXTRA IRAM speed optimization"
default y if IDF_TARGET_ESP32C6
default y if SOC_WIFI_HE_SUPPORT
default n
help
Select this option to place additional frequently called Wi-Fi library functions
@ -335,6 +335,7 @@ menu "Wi-Fi"
bool "WiFi SLP IRAM speed optimization"
select PM_SLP_DEFAULT_PARAMS_OPT
select PERIPH_CTRL_FUNC_IN_IRAM
default y if SOC_WIFI_HE_SUPPORT
help
Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM.
Some functions can be put in IRAM either by ESP_WIFI_IRAM_OPT and ESP_WIFI_RX_IRAM_OPT, or this one.
@ -470,14 +471,6 @@ menu "Wi-Fi"
help
Enable WiFi Aware (NAN) feature.
config ESP_WIFI_ENABLE_WIFI_TX_STATS
bool "Enable Wi-Fi transmission statistics"
depends on SOC_WIFI_HE_SUPPORT
default "y"
help
Enable Wi-Fi transmission statistics. Total support 4 access category. Each access category
will use 346 bytes memory.
config ESP_WIFI_MBEDTLS_CRYPTO
bool "Use MbedTLS crypto APIs"
default y
@ -614,10 +607,18 @@ menu "Wi-Fi"
help
Select this option to enable WPS registrar support in softAP mode.
config ESP_WIFI_ENABLE_WIFI_TX_STATS
bool "Enable Wi-Fi transmission statistics"
depends on SOC_WIFI_HE_SUPPORT
default n
help
Enable Wi-Fi transmission statistics. Total support 4 access category. Each access category
will use 346 bytes memory.
config ESP_WIFI_ENABLE_WIFI_RX_STATS
bool "Enable Wi-Fi reception statistics"
depends on SOC_WIFI_HE_SUPPORT
default "y"
default n
help
Enable Wi-Fi reception statistics. Total support 2 access category. Each access category
will use 190 bytes memory.
@ -625,10 +626,47 @@ menu "Wi-Fi"
config ESP_WIFI_ENABLE_WIFI_RX_MU_STATS
bool "Enable Wi-Fi DL MU-MIMO and DL OFDMA reception statistics"
depends on ESP_WIFI_ENABLE_WIFI_RX_STATS
default "y"
default n
help
Enable Wi-Fi DL MU-MIMO and DL OFDMA reception statistics. Will use 10932 bytes memory.
config ESP_WIFI_TX_HETB_QUEUE_NUM
int "WiFi TX HE TB QUEUE number for STA HE TB PPDU transmission"
depends on SOC_WIFI_HE_SUPPORT
range 1 4
default 3
help
Set the maximum number of queue that can be aggregated by the STA in the A-MPDU carried in the
HE TB PPDU.
config ESP_WIFI_ENABLE_DUMP_HESIGB
bool "Enable Wi-Fi dump HE-SIGB which is contained in DL HE MU PPDUs"
depends on SOC_WIFI_HE_SUPPORT_5G
default "n"
help
Enable Wi-Fi dump HE-SIGB which is contained in DL HE MU PPDUs.
config ESP_WIFI_ENABLE_DUMP_MU_CFO
bool "Enable Wi-Fi dump MU CFO"
depends on SOC_WIFI_HE_SUPPORT_5G
default "n"
help
Enable Wi-Fi dump MU CFO.
config ESP_WIFI_ENABLE_DUMP_CTRL_NDPA
bool "Enable Wi-Fi dump NDPA frames"
depends on SOC_WIFI_HE_SUPPORT_5G
default "n"
help
Enable Wi-Fi dump NDPA frames.
config ESP_WIFI_ENABLE_DUMP_CTRL_BFRP
bool "Enable Wi-Fi dump BFRP frames"
depends on SOC_WIFI_HE_SUPPORT_5G
default "n"
help
Enable Wi-Fi dump BFRP frames.
menu "WPS Configuration Options"
config ESP_WIFI_WPS_STRICT
bool "Strictly validate all WPS attributes"

View File

@ -32,15 +32,19 @@
#include "esp_cpu.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/dport_reg.h"
#include "soc/syscon_reg.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "dport_access.h"
#include "esp_rom_sys.h"
#include "esp32/rom/ets_sys.h"

View File

@ -31,17 +31,21 @@
#include "esp_timer.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc.h"
#include "soc/syscon_reg.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp32c2/rom/ets_sys.h"
#include "private/esp_modem_wrapper.h"

View File

@ -31,18 +31,22 @@
#include "esp_timer.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc.h"
#include "soc/syscon_reg.h"
#include "soc/system_reg.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp32c3/rom/ets_sys.h"
#include "private/esp_modem_wrapper.h"

View File

@ -0,0 +1,670 @@
/*
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <pthread.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "freertos/event_groups.h"
#include "freertos/portmacro.h"
#include "riscv/interrupt.h"
#include "esp_types.h"
#include "esp_random.h"
#include "esp_mac.h"
#include "esp_task.h"
#include "esp_intr_alloc.h"
#include "esp_attr.h"
#include "esp_log.h"
#include "esp_event.h"
#include "esp_heap_caps.h"
#include "esp_timer.h"
#include "esp_private/esp_modem_clock.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/rtc_cntl_periph.h"
#include "soc/rtc.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp32c5/rom/ets_sys.h"
#include "private/esp_modem_wrapper.h"
#include "esp_private/esp_modem_clock.h"
#if SOC_PM_MODEM_RETENTION_BY_REGDMA
#include "esp_private/esp_regdma.h"
#include "esp_private/sleep_retention.h"
#endif
#define TAG "esp_adapter"
#ifdef CONFIG_PM_ENABLE
extern void wifi_apb80m_request(void);
extern void wifi_apb80m_release(void);
#endif
IRAM_ATTR void *wifi_malloc( size_t size )
{
return malloc(size);
}
IRAM_ATTR void *wifi_realloc( void *ptr, size_t size )
{
return realloc(ptr, size);
}
IRAM_ATTR void *wifi_calloc( size_t n, size_t size )
{
return calloc(n, size);
}
static void *IRAM_ATTR wifi_zalloc_wrapper(size_t size)
{
void *ptr = wifi_calloc(1, size);
return ptr;
}
wifi_static_queue_t *wifi_create_queue( int queue_len, int item_size)
{
wifi_static_queue_t *queue = NULL;
queue = (wifi_static_queue_t *)heap_caps_malloc(sizeof(wifi_static_queue_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
if (!queue) {
return NULL;
}
queue->handle = xQueueCreate( queue_len, item_size);
return queue;
}
void wifi_delete_queue(wifi_static_queue_t *queue)
{
if (queue) {
vQueueDelete(queue->handle);
free(queue);
}
}
static void *wifi_create_queue_wrapper(int queue_len, int item_size)
{
return wifi_create_queue(queue_len, item_size);
}
static void wifi_delete_queue_wrapper(void *queue)
{
wifi_delete_queue(queue);
}
static void set_intr_wrapper(int32_t cpu_no, uint32_t intr_source, uint32_t intr_num, int32_t intr_prio)
{
esp_rom_route_intr_matrix(cpu_no, intr_source, intr_num);
esprv_int_set_priority(intr_num, intr_prio);
esprv_int_set_type(intr_num, INTR_TYPE_LEVEL);
}
static void clear_intr_wrapper(uint32_t intr_source, uint32_t intr_num)
{
}
static void set_isr_wrapper(int32_t n, void *f, void *arg)
{
intr_handler_set(n, (intr_handler_t)f, arg);
}
static void enable_intr_wrapper(uint32_t intr_mask)
{
esprv_int_enable(intr_mask);
}
static void disable_intr_wrapper(uint32_t intr_mask)
{
esprv_int_disable(intr_mask);
}
static bool IRAM_ATTR is_from_isr_wrapper(void)
{
return !xPortCanYield();
}
static void wifi_thread_semphr_free(void *data)
{
SemaphoreHandle_t *sem = (SemaphoreHandle_t *)(data);
if (sem) {
vSemaphoreDelete(sem);
}
}
static void *wifi_thread_semphr_get_wrapper(void)
{
static bool s_wifi_thread_sem_key_init = false;
static pthread_key_t s_wifi_thread_sem_key;
SemaphoreHandle_t sem = NULL;
if (s_wifi_thread_sem_key_init == false) {
if (0 != pthread_key_create(&s_wifi_thread_sem_key, wifi_thread_semphr_free)) {
return NULL;
}
s_wifi_thread_sem_key_init = true;
}
sem = pthread_getspecific(s_wifi_thread_sem_key);
if (!sem) {
sem = xSemaphoreCreateCounting(1, 0);
if (sem) {
pthread_setspecific(s_wifi_thread_sem_key, sem);
ESP_LOGV(TAG, "thread sem create: sem=%p", sem);
}
}
ESP_LOGV(TAG, "thread sem get: sem=%p", sem);
return (void *)sem;
}
static void *recursive_mutex_create_wrapper(void)
{
return (void *)xSemaphoreCreateRecursiveMutex();
}
static void *mutex_create_wrapper(void)
{
return (void *)xSemaphoreCreateMutex();
}
static void mutex_delete_wrapper(void *mutex)
{
vSemaphoreDelete(mutex);
}
static int32_t IRAM_ATTR mutex_lock_wrapper(void *mutex)
{
return (int32_t)xSemaphoreTakeRecursive(mutex, portMAX_DELAY);
}
static int32_t IRAM_ATTR mutex_unlock_wrapper(void *mutex)
{
return (int32_t)xSemaphoreGiveRecursive(mutex);
}
static void *queue_create_wrapper(uint32_t queue_len, uint32_t item_size)
{
return (void *)xQueueCreate(queue_len, item_size);
}
static int32_t queue_send_wrapper(void *queue, void *item, uint32_t block_time_tick)
{
if (block_time_tick == OSI_FUNCS_TIME_BLOCKING) {
return (int32_t)xQueueSend(queue, item, portMAX_DELAY);
} else {
return (int32_t)xQueueSend(queue, item, block_time_tick);
}
}
static int32_t IRAM_ATTR queue_send_from_isr_wrapper(void *queue, void *item, void *hptw)
{
return (int32_t)xQueueSendFromISR(queue, item, hptw);
}
static int32_t queue_send_to_back_wrapper(void *queue, void *item, uint32_t block_time_tick)
{
return (int32_t)xQueueGenericSend(queue, item, block_time_tick, queueSEND_TO_BACK);
}
static int32_t queue_send_to_front_wrapper(void *queue, void *item, uint32_t block_time_tick)
{
return (int32_t)xQueueGenericSend(queue, item, block_time_tick, queueSEND_TO_FRONT);
}
static int32_t queue_recv_wrapper(void *queue, void *item, uint32_t block_time_tick)
{
if (block_time_tick == OSI_FUNCS_TIME_BLOCKING) {
return (int32_t)xQueueReceive(queue, item, portMAX_DELAY);
} else {
return (int32_t)xQueueReceive(queue, item, block_time_tick);
}
}
static uint32_t event_group_wait_bits_wrapper(void *event, uint32_t bits_to_wait_for, int clear_on_exit, int wait_for_all_bits, uint32_t block_time_tick)
{
if (block_time_tick == OSI_FUNCS_TIME_BLOCKING) {
return (uint32_t)xEventGroupWaitBits(event, bits_to_wait_for, clear_on_exit, wait_for_all_bits, portMAX_DELAY);
} else {
return (uint32_t)xEventGroupWaitBits(event, bits_to_wait_for, clear_on_exit, wait_for_all_bits, block_time_tick);
}
}
static int32_t task_create_pinned_to_core_wrapper(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle, uint32_t core_id)
{
return (uint32_t)xTaskCreatePinnedToCore(task_func, name, stack_depth, param, prio, task_handle, (core_id < portNUM_PROCESSORS ? core_id : tskNO_AFFINITY));
}
static int32_t task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle)
{
return (uint32_t)xTaskCreate(task_func, name, stack_depth, param, prio, task_handle);
}
static int32_t IRAM_ATTR task_ms_to_tick_wrapper(uint32_t ms)
{
return (int32_t)(ms / portTICK_PERIOD_MS);
}
static int32_t task_get_max_priority_wrapper(void)
{
return (int32_t)(configMAX_PRIORITIES);
}
static int32_t esp_event_post_wrapper(const char *event_base, int32_t event_id, void *event_data, size_t event_data_size, uint32_t ticks_to_wait)
{
if (ticks_to_wait == OSI_FUNCS_TIME_BLOCKING) {
return (int32_t)esp_event_post(event_base, event_id, event_data, event_data_size, portMAX_DELAY);
} else {
return (int32_t)esp_event_post(event_base, event_id, event_data, event_data_size, ticks_to_wait);
}
}
static void IRAM_ATTR wifi_apb80m_request_wrapper(void)
{
#ifdef CONFIG_PM_ENABLE
wifi_apb80m_request();
#endif
}
static void IRAM_ATTR wifi_apb80m_release_wrapper(void)
{
#ifdef CONFIG_PM_ENABLE
wifi_apb80m_release();
#endif
}
static void IRAM_ATTR timer_arm_wrapper(void *timer, uint32_t tmout, bool repeat)
{
ets_timer_arm(timer, tmout, repeat);
}
static void wifi_reset_mac_wrapper(void)
{
modem_clock_module_mac_reset(PERIPH_WIFI_MODULE);
}
static void wifi_clock_enable_wrapper(void)
{
wifi_module_enable();
}
static void wifi_clock_disable_wrapper(void)
{
wifi_module_disable();
}
static int get_time_wrapper(void *t)
{
return os_get_time(t);
}
static void *IRAM_ATTR realloc_internal_wrapper(void *ptr, size_t size)
{
return heap_caps_realloc(ptr, size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
}
static void *IRAM_ATTR calloc_internal_wrapper(size_t n, size_t size)
{
return heap_caps_calloc(n, size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
}
static void *IRAM_ATTR zalloc_internal_wrapper(size_t size)
{
void *ptr = heap_caps_calloc(1, size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
return ptr;
}
static esp_err_t nvs_open_wrapper(const char *name, unsigned int open_mode, nvs_handle_t *out_handle)
{
return nvs_open(name, (nvs_open_mode_t)open_mode, out_handle);
}
static void esp_log_writev_wrapper(unsigned int level, const char *tag, const char *format, va_list args)
{
return esp_log_writev((esp_log_level_t)level, tag, format, args);
}
static void esp_log_write_wrapper(unsigned int level, const char *tag, const char *format, ...)
{
va_list list;
va_start(list, format);
esp_log_writev((esp_log_level_t)level, tag, format, list);
va_end(list);
}
static esp_err_t esp_read_mac_wrapper(uint8_t *mac, unsigned int type)
{
return esp_read_mac(mac, (esp_mac_type_t)type);
}
static int coex_init_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_init();
#else
return 0;
#endif
}
static void coex_deinit_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_deinit();
#endif
}
static int coex_enable_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_enable();
#else
return 0;
#endif
}
static void coex_disable_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_disable();
#endif
}
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_status_get();
#else
return 0;
#endif
}
static int coex_wifi_request_wrapper(uint32_t event, uint32_t latency, uint32_t duration)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_wifi_request(event, latency, duration);
#else
return 0;
#endif
}
static IRAM_ATTR int coex_wifi_release_wrapper(uint32_t event)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_wifi_release(event);
#else
return 0;
#endif
}
static int coex_wifi_channel_set_wrapper(uint8_t primary, uint8_t secondary)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_wifi_channel_set(primary, secondary);
#else
return 0;
#endif
}
static IRAM_ATTR int coex_event_duration_get_wrapper(uint32_t event, uint32_t *duration)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_event_duration_get(event, duration);
#else
return 0;
#endif
}
static int coex_pti_get_wrapper(uint32_t event, uint8_t *pti)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_pti_get(event, pti);
#else
return 0;
#endif
}
static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_schm_status_bit_clear(type, status);
#endif
}
static void coex_schm_status_bit_set_wrapper(uint32_t type, uint32_t status)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_schm_status_bit_set(type, status);
#endif
}
static IRAM_ATTR int coex_schm_interval_set_wrapper(uint32_t interval)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_schm_interval_set(interval);
#else
return 0;
#endif
}
static uint32_t coex_schm_interval_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_schm_interval_get();
#else
return 0;
#endif
}
static uint8_t coex_schm_curr_period_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_schm_curr_period_get();
#else
return 0;
#endif
}
static void *coex_schm_curr_phase_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_schm_curr_phase_get();
#else
return NULL;
#endif
}
static int coex_register_start_cb_wrapper(int (* cb)(void))
{
#if CONFIG_SW_COEXIST_ENABLE
return coex_register_start_cb(cb);
#else
return 0;
#endif
}
static int coex_schm_process_restart_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE
return coex_schm_process_restart();
#else
return 0;
#endif
}
static int coex_schm_register_cb_wrapper(int type, int(*cb)(int))
{
#if CONFIG_SW_COEXIST_ENABLE
return coex_schm_register_callback(type, cb);
#else
return 0;
#endif
}
static void IRAM_ATTR esp_empty_wrapper(void)
{
}
extern void set_bb_wdg(bool busy_chk, bool srch_chk, uint16_t max_busy, uint16_t max_srch, bool rst_en, bool int_en, bool clr);
static void esp_phy_enable_wrapper(void)
{
esp_phy_enable(PHY_MODEM_WIFI);
phy_wifi_enable_set(1);
//disable bb idle check(max: 139ms) for temporary to avoid unexpected RXTXPANIC
//TODO
set_bb_wdg(true, false, 0x18, 0xaa, false, false, false);
}
static void esp_phy_disable_wrapper(void)
{
phy_wifi_enable_set(0);
esp_phy_disable(PHY_MODEM_WIFI);
}
wifi_osi_funcs_t g_wifi_osi_funcs = {
._version = ESP_WIFI_OS_ADAPTER_VERSION,
._env_is_chip = esp_coex_common_env_is_chip_wrapper,
._set_intr = set_intr_wrapper,
._clear_intr = clear_intr_wrapper,
._set_isr = set_isr_wrapper,
._ints_on = enable_intr_wrapper,
._ints_off = disable_intr_wrapper,
._is_from_isr = is_from_isr_wrapper,
._spin_lock_create = esp_coex_common_spin_lock_create_wrapper,
._spin_lock_delete = free,
._wifi_int_disable = esp_coex_common_int_disable_wrapper,
._wifi_int_restore = esp_coex_common_int_restore_wrapper,
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
._semphr_create = esp_coex_common_semphr_create_wrapper,
._semphr_delete = esp_coex_common_semphr_delete_wrapper,
._semphr_take = esp_coex_common_semphr_take_wrapper,
._semphr_give = esp_coex_common_semphr_give_wrapper,
._wifi_thread_semphr_get = wifi_thread_semphr_get_wrapper,
._mutex_create = mutex_create_wrapper,
._recursive_mutex_create = recursive_mutex_create_wrapper,
._mutex_delete = mutex_delete_wrapper,
._mutex_lock = mutex_lock_wrapper,
._mutex_unlock = mutex_unlock_wrapper,
._queue_create = queue_create_wrapper,
._queue_delete = (void(*)(void *))vQueueDelete,
._queue_send = queue_send_wrapper,
._queue_send_from_isr = queue_send_from_isr_wrapper,
._queue_send_to_back = queue_send_to_back_wrapper,
._queue_send_to_front = queue_send_to_front_wrapper,
._queue_recv = queue_recv_wrapper,
._queue_msg_waiting = (uint32_t(*)(void *))uxQueueMessagesWaiting,
._event_group_create = (void *(*)(void))xEventGroupCreate,
._event_group_delete = (void(*)(void *))vEventGroupDelete,
._event_group_set_bits = (uint32_t(*)(void *, uint32_t))xEventGroupSetBits,
._event_group_clear_bits = (uint32_t(*)(void *, uint32_t))xEventGroupClearBits,
._event_group_wait_bits = event_group_wait_bits_wrapper,
._task_create_pinned_to_core = task_create_pinned_to_core_wrapper,
._task_create = task_create_wrapper,
._task_delete = (void(*)(void *))vTaskDelete,
._task_delay = vTaskDelay,
._task_ms_to_tick = task_ms_to_tick_wrapper,
._task_get_current_task = (void *(*)(void))xTaskGetCurrentTaskHandle,
._task_get_max_priority = task_get_max_priority_wrapper,
._malloc = malloc,
._free = free,
._event_post = esp_event_post_wrapper,
._get_free_heap_size = esp_get_free_internal_heap_size,
._rand = esp_random,
._dport_access_stall_other_cpu_start_wrap = esp_empty_wrapper,
._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper,
._wifi_apb80m_request = wifi_apb80m_request_wrapper,
._wifi_apb80m_release = wifi_apb80m_release_wrapper,
._phy_disable = esp_phy_disable_wrapper,
._phy_enable = esp_phy_enable_wrapper,
._phy_update_country_info = esp_phy_update_country_info,
._read_mac = esp_read_mac_wrapper,
._timer_arm = timer_arm_wrapper,
._timer_disarm = esp_coex_common_timer_disarm_wrapper,
._timer_done = esp_coex_common_timer_done_wrapper,
._timer_setfn = esp_coex_common_timer_setfn_wrapper,
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
._wifi_reset_mac = wifi_reset_mac_wrapper,
._wifi_clock_enable = wifi_clock_enable_wrapper,
._wifi_clock_disable = wifi_clock_disable_wrapper,
._wifi_rtc_enable_iso = esp_empty_wrapper,
._wifi_rtc_disable_iso = esp_empty_wrapper,
._esp_timer_get_time = esp_timer_get_time,
._nvs_set_i8 = nvs_set_i8,
._nvs_get_i8 = nvs_get_i8,
._nvs_set_u8 = nvs_set_u8,
._nvs_get_u8 = nvs_get_u8,
._nvs_set_u16 = nvs_set_u16,
._nvs_get_u16 = nvs_get_u16,
._nvs_open = nvs_open_wrapper,
._nvs_close = nvs_close,
._nvs_commit = nvs_commit,
._nvs_set_blob = nvs_set_blob,
._nvs_get_blob = nvs_get_blob,
._nvs_erase_key = nvs_erase_key,
._get_random = os_get_random,
._get_time = get_time_wrapper,
._random = os_random,
._slowclk_cal_get = esp_coex_common_clk_slowclk_cal_get_wrapper,
._log_write = esp_log_write_wrapper,
._log_writev = esp_log_writev_wrapper,
._log_timestamp = esp_log_timestamp,
._malloc_internal = esp_coex_common_malloc_internal_wrapper,
._realloc_internal = realloc_internal_wrapper,
._calloc_internal = calloc_internal_wrapper,
._zalloc_internal = zalloc_internal_wrapper,
._wifi_malloc = wifi_malloc,
._wifi_realloc = wifi_realloc,
._wifi_calloc = wifi_calloc,
._wifi_zalloc = wifi_zalloc_wrapper,
._wifi_create_queue = wifi_create_queue_wrapper,
._wifi_delete_queue = wifi_delete_queue_wrapper,
._coex_init = coex_init_wrapper,
._coex_deinit = coex_deinit_wrapper,
._coex_enable = coex_enable_wrapper,
._coex_disable = coex_disable_wrapper,
._coex_status_get = coex_status_get_wrapper,
._coex_wifi_request = coex_wifi_request_wrapper,
._coex_wifi_release = coex_wifi_release_wrapper,
._coex_wifi_channel_set = coex_wifi_channel_set_wrapper,
._coex_event_duration_get = coex_event_duration_get_wrapper,
._coex_pti_get = coex_pti_get_wrapper,
._coex_schm_status_bit_clear = coex_schm_status_bit_clear_wrapper,
._coex_schm_status_bit_set = coex_schm_status_bit_set_wrapper,
._coex_schm_interval_set = coex_schm_interval_set_wrapper,
._coex_schm_interval_get = coex_schm_interval_get_wrapper,
._coex_schm_curr_period_get = coex_schm_curr_period_get_wrapper,
._coex_schm_curr_phase_get = coex_schm_curr_phase_get_wrapper,
._coex_register_start_cb = coex_register_start_cb_wrapper,
#if SOC_PM_MODEM_RETENTION_BY_REGDMA
._regdma_link_set_write_wait_content = regdma_link_set_write_wait_content,
._sleep_retention_find_link_by_id = sleep_retention_find_link_by_id,
._sleep_retention_entries_create = (int (*)(const void *, int, int, int))sleep_retention_entries_create,
._sleep_retention_entries_destroy = sleep_retention_entries_destroy,
#endif
._coex_schm_process_restart = coex_schm_process_restart_wrapper,
._coex_schm_register_cb = coex_schm_register_cb_wrapper,
._magic = ESP_WIFI_OS_ADAPTER_MAGIC,
};

View File

@ -32,16 +32,20 @@
#include "esp_private/esp_modem_clock.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/rtc_cntl_periph.h"
#include "soc/rtc.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp32c6/rom/ets_sys.h"
#include "private/esp_modem_wrapper.h"
#include "esp_private/esp_modem_clock.h"

View File

@ -32,17 +32,21 @@
#include "esp_cpu.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/dport_reg.h"
#include "soc/rtc.h"
#include "soc/syscon_reg.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp_rom_sys.h"
#include "esp32s2/rom/ets_sys.h"
#include "private/esp_modem_wrapper.h"

View File

@ -32,18 +32,22 @@
#include "esp_cpu.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc.h"
#include "soc/syscon_reg.h"
#include "soc/system_reg.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp_rom_sys.h"
#include "esp32s3/rom/ets_sys.h"
#include "private/esp_modem_wrapper.h"

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -30,14 +30,14 @@ esp_err_t esp_wifi_set_htc_omc(const esp_wifi_htc_omc_t *om);
void esp_wifi_enable_rx_stbc(bool enable);
void esp_wifi_enable_su_bmfmee(bool enable);
esp_err_t esp_wifi_set_tf_padding_duration(int tf_padding_duration);
void esp_test_set_tx_mcs_pwr(wifi_phy_rate_t rate, int8_t max_pwr);
void hal_he_set_ul_mu(bool ul_mu_disable, bool ul_mu_data_disable);
void hal_he_set_bf_report_rate(sig_mode_t sig_mode, wifi_phy_rate_t rate);
void hal_he_set_bf_report_rate(sig_mode_t sig_mode, wifi_phy_rate_t rate, bool ersu, bool dcm);
void dbg_read_muedca_timer(uint8_t aci);
void dbg_read_axtb_diag(void);
void dbg_read_ax_diag(bool verbose);
void dbg_read_tx_mplen(const void*, uint8_t ac);
void dbg_tb_ignore_cca_enable(bool enable);
esp_err_t esp_wifi_sta_report_bsscolor_collision(void);
@ -52,6 +52,14 @@ void esp_test_clr_hw_statistics(void);
esp_err_t esp_test_get_hw_rx_statistics(esp_test_hw_rx_statistics_t *hw_rx_stats);
esp_err_t esp_test_get_hw_tb_statistics(esp_test_hw_tb_statistics_t *hw_tb_stats);
/**
* @brief Get tx stats enabled ACI bitmap
*
* @return
* - acibitmap
*/
uint8_t esp_wifi_get_tx_statistics_ena_acibitmap(void);
/**
* @brief Clear DL MU-MIMO and DL OFDMA reception statistics.
*
@ -162,7 +170,7 @@ esp_err_t esp_wifi_softap_add_color_change_announcement(uint8_t color);
*
* @attention This API should be called after esp_wifi_start().
*
* @param[in] bss_max_idle_enable enbale bss max idle
* @param[in] bss_max_idle_enable enable bss max idle
* @param[in] bss_max_idle_period_secs bss max idle period, unit seconds
* @param[in] protected_keep_alive using protected/unprotected frame to keep alive
*
@ -201,6 +209,12 @@ esp_err_t esp_wifi_sta_reset_muedca_timer(uint8_t aci_bitmap);
*/
esp_err_t esp_wifi_sta_set_bss_color_collision_detection(int threshold, int duration);
esp_err_t esp_test_clr_rx_ctrls(void);
esp_err_t esp_test_get_rx_ctrls(esp_test_rx_ctrl_t* rx);
void hal_set_tx_pwr(wifi_phy_rate_t rate, int8_t max_pwr);
int8_t hal_get_tx_pwr(wifi_phy_rate_t rate);
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -25,7 +25,7 @@ typedef enum {
typedef struct {
uint32_t mcs : 7;
uint32_t cwb : 1;
uint32_t cbw : 1;
uint32_t ht_length : 16;
uint32_t smoothing : 1;
uint32_t not_sounding : 1;
@ -104,6 +104,52 @@ typedef struct {
uint16_t pe_disambiguation : 1;
} __attribute__((packed)) esp_wifi_mu_siga2_t;
typedef struct {
uint32_t cbw : 2;
uint32_t pro_reserved : 1;
uint32_t stbc : 1;
uint32_t group_id : 6;
uint32_t su_nsts : 3;
uint32_t su_partial_aid : 9;
uint32_t txop_ps_not_allowed : 1;
uint32_t pro_reserved2 : 1;
uint32_t sgi : 1;
uint32_t sgi_nsym_disambigution : 1;
uint32_t su_coding : 1;
uint32_t ldpc_extra_ofdm_symbol : 1;
uint32_t su_mcs : 4;
} __attribute__((packed)) esp_wifi_vht_siga1_t;
typedef struct {
uint32_t ru_allocation :8;
uint32_t crc :4;
uint32_t tail :6; //18 bits
} esp_wifi_mu_sigb_common_t;
typedef struct {
uint32_t ru_allocation :16;
uint32_t center_26tone_ru :1;
uint32_t crc :4;
uint32_t tail :6; //not included into the sigb_common_info (21bits)
} esp_wifi_mu_sigb_common_80mhz_ppdu_t;
typedef struct {
uint32_t sta_id :11;
uint32_t nsts :3;
uint32_t beamformed :1;
uint32_t he_mcs :4;
uint32_t dcm :1;
uint32_t coding :1;
} esp_wifi_mu_sigb_user_non_mimo_t;
typedef struct {
uint32_t sta_id :11;
uint32_t spatial_config :4;
uint32_t he_mcs :4;
uint32_t rsvd :1;
uint32_t coding :1;
} esp_wifi_mu_sigb_user_mimo_t;
#define ESP_TEST_RX_MU_USER_NUM (9)
//support buffer mu-users for 4 duts
typedef struct {
@ -143,10 +189,66 @@ typedef struct {
uint32_t txbf;
uint32_t dcm;
} nonmimo[ESP_TEST_RX_MU_USER_NUM];
uint32_t ru_alloc_96_num_2046; // 106+106
uint32_t ru_alloc_112_num_2046; // 52+52+52+52
#if CONFIG_IDF_TARGET_ESP32C5
uint32_t mu_bru_id_0: 16;
uint32_t mu_bru_id_bssidx: 16;
uint32_t mu_bru_id_2047: 16;
uint32_t mu_uru_id_2046: 16;
#else
uint32_t rc_alloc_96_num_2046;
uint32_t ru_alloc_112_num_2046;
#endif
} esp_test_rx_mu_statistics_t; //10932 bytes
#if CONFIG_IDF_TARGET_ESP32C5
typedef struct {
uint32_t legacy;
uint32_t legacy_noeb;
uint32_t ht;
uint32_t ht_noeb;
uint32_t ht_stbc;
uint32_t ht_retry;
uint32_t ersu;
uint32_t ersu_noeb;
uint32_t ersu_txbf;
uint32_t ersu_dcm;
uint32_t ersu_dcm_txbf;
uint32_t ersu_retry;
uint32_t su;
uint32_t su_noeb;
uint32_t su_stbc;
uint32_t su_txbf;
uint32_t su_retry;
uint32_t su_frag;
uint32_t mu;
uint32_t mu_noeb;
uint32_t mu_stbc;
uint32_t mu_mimo;
uint32_t mu_ofdma;
uint32_t mu_txbf;
uint32_t mu_retry;
uint32_t mu_frag;
/*
* mu_bw[0] count the 20MHz MU PPDUs
* mu_bw[1] count the 40MHz MU PPDUs
* mu_bw[2] count the 80MHz MU PPDUs
*/
uint32_t mu_bw[3];
uint32_t mu_sigb_dump;
uint32_t vht;
uint32_t vht_noeb;
uint32_t vht_stbc;
uint32_t vht_txbf;
uint32_t vht_retry;
uint32_t rx_isr;
uint32_t rx_nblks;
uint32_t rx_ndpa;
uint32_t rx_reset_rxbase_cnt;
uint32_t rx_base_null_cnt;
} esp_test_rx_statistics_t; //140 bytes
#else
typedef struct {
uint32_t legacy;
uint32_t legacy_noeb;
@ -171,6 +273,7 @@ typedef struct {
uint32_t rx_isr;
uint32_t rx_nblks;
} esp_test_rx_statistics_t; //88 bytes
#endif
typedef enum {
TEST_TX_SUCCESS,
@ -303,13 +406,51 @@ typedef struct {
uint16_t rxhung_statis;
uint16_t txhung_statis;
uint32_t rxtxhung;
} esp_test_hw_rx_statistics_t; //76 bytes
#if CONFIG_IDF_TARGET_ESP32C5
uint32_t rxtxpanic;
uint8_t bf_ndp_timeout;
uint8_t bf_report_err;
#endif
} esp_test_hw_rx_statistics_t; //76->80 bytes
typedef struct {
uint32_t tot;
uint32_t occurs[2]; // 0: 0xc6 same bitmap; 1: 0xf5 tkip error
} esp_test_rx_error_occurs_t; //12 bytes
typedef struct {
int ndpa;
int ndpa_su;
int ndpa_su_bcast;
int ndpa_su_ucast;
int ndpa_mu;
int ndpa_cqi;
int basic;
int bsrp;
int mubar;
int bfrp;
int nfrp;
} esp_test_rx_ctrl_t;
typedef enum {
SU_NG4_CODEBOOKSIZE_0,
SU_NG4_CODEBOOKSIZE_1,
SU_NG16_CODEBOOKSIZE_0,
SU_NG16_CODEBOOKSIZE_1,
MU_NG4_CODEBOOKSIZE_0,
MU_NG4_CODEBOOKSIZE_1,
CQI,
MU_NG16_CODEBOOKSIZE_1,
NON_TB_SU_NG4_CODEBOOKSIZE_0,
NON_TB_SU_NG4_CODEBOOKSIZE_1,
NON_TB_SU_NG16_CODEBOOKSIZE_0,
NON_TB_SU_NG16_CODEBOOKSIZE_1,
NON_TB_SU_NG16_CODEBOOKSIZE_1_NC_2, /* fault injection */
NON_TB_SU_NG16_CODEBOOKSIZE_1_NSTS_2, /* fault injection */
NON_TB_SU_NG16_CODEBOOKSIZE_1_NSTS_6, /* fault injection */
NON_TB_CQI,
NON_TB_CQI_NC_2, /* fault injection */
} esp_test_he_sounding_type_t;
#ifdef __cplusplus
}

View File

@ -149,7 +149,7 @@ typedef struct wifi_osi_funcs_t {
int (* _coex_schm_process_restart)(void);
int (* _coex_schm_register_cb)(int, int (* cb)(int));
int (* _coex_register_start_cb)(int (* cb)(void));
#if CONFIG_IDF_TARGET_ESP32C6
#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C5
void (* _regdma_link_set_write_wait_content)(void *, uint32_t, uint32_t);
void * (* _sleep_retention_find_link_by_id)(int);
#endif

View File

@ -119,6 +119,8 @@ typedef struct {
uint64_t feature_caps; /**< Enables additional WiFi features and capabilities */
bool sta_disconnected_pm; /**< WiFi Power Management for station at disconnected status */
int espnow_max_encrypt_num; /**< Maximum encrypt number of peers supported by espnow */
int tx_hetb_queue_num; /**< WiFi TX HE TB QUEUE number for STA HE TB PPDU transmission */
bool dump_hesigb_enable; /**< enable dump sigb field */
int magic; /**< WiFi init magic number, it should be the last field */
} wifi_init_config_t;
@ -241,7 +243,19 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs;
#define WIFI_FTM_RESPONDER 0
#endif
#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0)
#if CONFIG_ESP_WIFI_ENABLE_DUMP_HESIGB && !WIFI_CSI_ENABLED
#define WIFI_DUMP_HESIGB_ENABLED true
#else
#define WIFI_DUMP_HESIGB_ENABLED false
#endif
#if CONFIG_ESP_WIFI_TX_HETB_QUEUE_NUM
#define WIFI_TX_HETB_QUEUE_NUM CONFIG_ESP_WIFI_TX_HETB_QUEUE_NUM
#else
#define WIFI_TX_HETB_QUEUE_NUM 1
#endif
#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0)
#define CONFIG_FEATURE_CACHE_TX_BUF_BIT (1<<1)
#define CONFIG_FEATURE_FTM_INITIATOR_BIT (1<<2)
#define CONFIG_FEATURE_FTM_RESPONDER_BIT (1<<3)
@ -276,6 +290,8 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs;
.feature_caps = WIFI_FEATURE_CAPS, \
.sta_disconnected_pm = WIFI_STA_DISCONNECTED_PM_ENABLED, \
.espnow_max_encrypt_num = CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM, \
.tx_hetb_queue_num = WIFI_TX_HETB_QUEUE_NUM, \
.dump_hesigb_enable = WIFI_DUMP_HESIGB_ENABLED, \
.magic = WIFI_INIT_CONFIG_MAGIC\
}
@ -588,9 +604,11 @@ esp_err_t esp_wifi_get_ps(wifi_ps_type_t *type);
/**
* @brief Set protocol type of specified interface
* The default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N).
* if CONFIG_SOC_WIFI_HE_SUPPORT, the default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX).
* if CONFIG_SOC_WIFI_HE_SUPPORT and band is 2.4G, the default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX).
* if CONFIG_SOC_WIFI_HE_SUPPORT and band is 5G, the default protocol is (WIFI_PROTOCOL_11A|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AC|WIFI_PROTOCOL_11AX).
*
* @attention Support 802.11b or 802.11bg or 802.11bgn or 802.11bgnax or LR mode
* @attention 2.4G: Support 802.11b or 802.11bg or 802.11bgn or 802.11bgnax or LR mode
* 5G: Support 802.11a or 802.11an or 802.11anac or 802.11anacax or LR mode
*
* @param ifx interfaces
* @param protocol_bitmap WiFi protocol bitmap
@ -1126,6 +1144,19 @@ esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx);
*/
esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config);
/**
* @brief Get CSI data configuration
*
* @param config configuration
*
* return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - 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_t esp_wifi_get_csi_config(wifi_csi_config_t *config);
/**
* @brief Enable or disable CSI
*
@ -1502,6 +1533,32 @@ esp_err_t esp_wifi_set_dynamic_cs(bool enabled);
*/
esp_err_t esp_wifi_sta_get_rssi(int *rssi);
#if SOC_WIFI_HE_SUPPORT_5G
/**
* @brief Set wifi band.
*
* @param[in] band wifi band 2.4G / 5G / 2.4G + 5G
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_set_band(wifi_band_t band);
/**
* @brief Get wifi band.
*
* @param[in] band store band of wifi
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_band(wifi_band_t* band);
#endif /* SOC_WIFI_HE_SUPPORT_5G */
#ifdef __cplusplus
}
#endif

View File

@ -143,7 +143,6 @@ esp_err_t esp_wifi_enable_rx_statistics(bool rx_stats, bool rx_mu_stats);
*/
esp_err_t esp_wifi_enable_tx_statistics(esp_wifi_aci_t aci, bool tx_stats);
#ifdef __cplusplus
}
#endif

View File

@ -40,6 +40,28 @@ enum {
/**
* @brief Channel state information(CSI) configuration type
*/
#if CONFIG_IDF_TARGET_ESP32C5
typedef struct {
uint32_t enable : 1; /**< enable to acquire CSI */
uint32_t acquire_csi_legacy : 1; /**< enable to acquire L-LTF */
uint32_t acquire_csi_force_lltf : 1; /**< enable to acquire L-LTF */
uint32_t acquire_csi_ht20 : 1; /**< enable to acquire HT-LTF when receiving an HT20 PPDU */
uint32_t acquire_csi_ht40 : 1; /**< enable to acquire HT-LTF when receiving an HT40 PPDU */
uint32_t acquire_csi_vht : 1; /**< enable to acquire VHT-LTF when receiving an VHT20 PPDU */
uint32_t acquire_csi_su : 1; /**< enable to acquire HE-LTF when receiving an HE20 SU PPDU */
uint32_t acquire_csi_mu : 1; /**< enable to acquire HE-LTF when receiving an HE20 MU PPDU */
uint32_t acquire_csi_dcm : 1; /**< enable to acquire HE-LTF when receiving an HE20 DCM applied PPDU */
uint32_t acquire_csi_beamformed : 1; /**< enable to acquire HE-LTF when receiving an HE20 Beamformed applied PPDU */
uint32_t acquire_csi_he_stbc_mode: 2; /**< when receiving an STBC applied HE PPDU,
0- acquire the complete HE-LTF1
1- acquire the complete HE-LTF2
2- sample evenly among the HE-LTF1 and HE-LTF2 */
uint32_t val_scale_cfg : 4; /**< value 0-8 */
uint32_t dump_ack_en : 1; /**< enable to dump 802.11 ACK frame, default disabled */
uint32_t reserved : 15; /**< reserved */
} wifi_csi_acquire_config_t;
#else
typedef struct {
uint32_t enable : 1; /**< enable to acquire CSI */
uint32_t acquire_csi_legacy : 1; /**< enable to acquire L-LTF when receiving a 11g PPDU */
@ -50,23 +72,20 @@ typedef struct {
uint32_t acquire_csi_dcm : 1; /**< enable to acquire HE-LTF when receiving an HE20 DCM applied PPDU */
uint32_t acquire_csi_beamformed : 1; /**< enable to acquire HE-LTF when receiving an HE20 Beamformed applied PPDU */
uint32_t acquire_csi_he_stbc : 2; /**< when receiving an STBC applied HE PPDU,
0- acquire the complete HE-LTF1,
0- acquire the complete HE-LTF1
1- acquire the complete HE-LTF2
2- sample evenly among the HE-LTF1 and HE-LTF2 */
uint32_t val_scale_cfg : 2; /**< value 0-3 */
uint32_t dump_ack_en : 1; /**< enable to dump 802.11 ACK frame, default disabled */
uint32_t reserved : 19; /**< reserved */
} wifi_csi_acquire_config_t;
#endif
/**
* @brief HE variant HT Control field including UPH(UL power headroom) and OM(Operation mode)
* @brief HE variant HT Control field including OM(Operation mode)
*/
typedef struct {
uint32_t id : 2; /**< HE Variant ID = 3 */
uint32_t uph_id : 4; /**< UPH control ID: 4 */
uint32_t ul_pw_headroom : 5; /**< the available UL power headroom for the current HE-MCS, unit: dB, value[0, 31] */
uint32_t min_tx_pw_flag : 1; /**< indicate that the min. transmit power for current HE-MCS is reached, set to 0 otherwise */
uint32_t rsvd : 2; /**< reserved */
uint32_t ctrl_id : 4; /**< OM control ID: 1 */
uint32_t rx_nss : 3; /**< the max. number of spatial streams for the reception, only accept 0. */
uint32_t bw : 2; /**< the operating channel width for both reception and transmission, only accept 0. */
@ -75,7 +94,7 @@ typedef struct {
uint32_t er_su_disable : 1; /**< disable the reception of 242-tone HE ER SU PPDU */
uint32_t dl_mu_mimo_resounding_recommendation : 1; /**< indicate the STA suggests the AP either resounding the channel or increase the channel sounding frequency with the STA */
uint32_t ul_mu_data_disable : 1; /**< disable UL MU data operations */
uint32_t padding : 2; /**< padding bits */
uint32_t padding : 14; /**< padding bits */
} esp_wifi_htc_omc_t;
/**
@ -89,7 +108,7 @@ typedef enum {
TWT_ACCEPT, /**< accept the TWT request with the TWT parameters, also used in unsolicited TWT response */
TWT_ALTERNATE, /**< indicate a counter-offer of TWT parameters without creation of a TWT agreement */
TWT_DICTATE, /**< indicate no TWT agreement is created, but one is likely to be accepted only if the requesting STA transmits a new TWT setup request with the indicated TWT parameters */
TWT_REJECT, /**< indicate that the negotiation has ended in failure to crate a new TWT agreement */
TWT_REJECT, /**< indicate that the negotiation has ended in failure to create a new TWT agreement */
} wifi_twt_setup_cmds_t;
/**
@ -126,19 +145,91 @@ typedef enum {
* @brief Reception format
*/
typedef enum {
RX_BB_FORMAT_11B = 0, /**< the reception frame is a 11b MPDU */
RX_BB_FORMAT_11G = 1, /**< the reception frame is a 11g MPDU */
RX_BB_FORMAT_HT = 2, /**< the reception frame is a HT MPDU */
RX_BB_FORMAT_VHT = 3, /**< the reception frame is a VHT MPDU */
RX_BB_FORMAT_HE_SU = 4, /**< the reception frame is a HE SU MPDU */
RX_BB_FORMAT_HE_MU = 5, /**< the reception frame is a HE MU MPDU */
RX_BB_FORMAT_HE_ERSU = 6, /**< the reception frame is a HE ER SU MPDU */
RX_BB_FORMAT_HE_TB = 7, /**< the reception frame is a HE TB MPDU */
RX_BB_FORMAT_11B = 0, /**< the reception frame is a 11b MPDU */
RX_BB_FORMAT_11G = 1, /**< the reception frame is a 11g MPDU */
RX_BB_FORMAT_11A = RX_BB_FORMAT_11G, /**< the reception frame is a 11a MPDU */
RX_BB_FORMAT_HT = 2, /**< the reception frame is a HT MPDU */
RX_BB_FORMAT_VHT = 3, /**< the reception frame is a VHT MPDU */
RX_BB_FORMAT_HE_SU = 4, /**< the reception frame is a HE SU MPDU */
RX_BB_FORMAT_HE_MU = 5, /**< the reception frame is a HE MU MPDU */
RX_BB_FORMAT_HE_ERSU = 6, /**< the reception frame is a HE ER SU MPDU */
RX_BB_FORMAT_HE_TB = 7, /**< the reception frame is a HE TB MPDU */
} wifi_rx_bb_format_t;
/**
* @brief RxControl Info
*/
#if CONFIG_IDF_TARGET_ESP32C5
typedef struct {
signed rssi:8; /**< the RSSI of the reception frame */
unsigned rate:5; /**< if cur_bb_format is RX_BB_FORMAT_11B, it's the transmission rate. otherwise it's Rate field of L-SIG */
unsigned : 1; /**< reserved */
unsigned : 2; /**< reserved */
unsigned : 12; /**< reserved */
unsigned rxmatch0:1; /**< indicate whether the reception frame is from interface 0 */
unsigned rxmatch1:1; /**< indicate whether the reception frame is from interface 1 */
unsigned rxmatch2:1; /**< indicate whether the reception frame is from interface 2 */
unsigned rxmatch3:1; /**< indicate whether the reception frame is from interface 3 */
uint32_t he_siga1; /**< HE-SIGA1 or HT-SIG or VHT-SIG */
unsigned rxend_state:8; /**< reception state, 0: successful, others: failure */
uint16_t he_siga2; /**< HE-SIGA2 */
unsigned : 7; /**< reserved */
unsigned is_group:1; /**< indicate whether the reception is a group addressed frame */
unsigned timestamp:32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */
unsigned : 15; /**< reserved */
unsigned : 15; /**< reserved */
unsigned : 2; /**< reserved */
unsigned noise_floor:8; /**< the noise floor of the reception frame */
signed : 8; /**< reserved */
signed : 8; /**< reserved */
unsigned : 8; /**< reserved */
unsigned : 8; /**< reserved */
unsigned : 8; /**< reserved */
unsigned : 2; /**< reserved */
unsigned sigb_len:10; /**< the sigb length */
unsigned : 1; /**< reserved */
unsigned : 1; /**< reserved */
unsigned : 1; /**< reserved */
unsigned : 1; /**< reserved */
unsigned channel:4; /**< the primary channel */
unsigned second:4; /**< the second channel if in HT40 */
unsigned : 12; /**< reserved */
unsigned : 4; /**< reserved */
unsigned : 1; /**< reserved */
unsigned : 7; /**< reserved */
unsigned : 2; /**< reserved */
unsigned : 4; /**< reserved */
unsigned : 2; /**< reserved */
unsigned : 11; /**< reserved */
unsigned : 1; /**< reserved */
unsigned : 12; /**< reserved */
unsigned : 12; /**< reserved */
unsigned cur_bb_format:4; /**< the format of the reception frame */
unsigned rx_channel_estimate_len:10; /**< the length of the channel information */
unsigned rx_channel_estimate_info_vld:1; /**< indicate the channel information is valid */
unsigned : 5; /**< reserved */
unsigned : 21; /**< reserved */
unsigned : 10; /**< reserved */
unsigned : 1; /**< reserved */
unsigned : 3; /**< reserved */
unsigned : 1; /**< reserved */
unsigned : 6; /**< reserved */
unsigned : 21; /**< reserved */
unsigned : 1; /**< reserved */
unsigned : 32; /**< reserved */
unsigned : 7; /**< reserved */
unsigned : 1; /**< reserved */
unsigned : 8; /**< reserved */
unsigned : 16; /**< reserved */
unsigned sig_len:14; /**< the length of the reception MPDU */
unsigned : 2; /**< reserved */
unsigned dump_len:14; /**< the length of the reception MPDU excluding the FCS */
unsigned : 2; /**< reserved */
unsigned rx_state:8; /**< reception state, 0: successful, others: failure */
unsigned : 8; /**< reserved */
unsigned : 16; /**< reserved */
} __attribute__((packed)) esp_wifi_rxctrl_t;
#else
typedef struct {
signed rssi : 8; /**< the RSSI of the reception frame */
unsigned rate : 5; /**< if cur_bb_format is RX_BB_FORMAT_11B, it's the transmission rate. otherwise it's Rate field of L-SIG */
@ -202,6 +293,7 @@ typedef struct {
unsigned rx_state : 8; /**< reception state, 0: successful, others: failure */
unsigned : 24; /**< reserved */
} __attribute__((packed)) esp_wifi_rxctrl_t;
#endif
/** Argument structure for WIFI_EVENT_TWT_SET_UP event */
typedef struct {
@ -240,6 +332,26 @@ typedef struct {
uint32_t actual_suspend_time_ms[8]; /**< the actual suspend time for each flow id, unit: ms */
} wifi_event_sta_itwt_suspend_t;
/**
* @brief TWT types
*/
typedef enum {
TWT_TYPE_INDIVIDUAL, /**< individual twt */
TWT_TYPE_BROADCAST, /**< broadcast twt */
TWT_TYPE_MAX, /**< the max value */
} wifi_twt_type_t;
/** Argument structure for twt configuration */
typedef struct {
bool post_wakeup_event; /**< post twt wakeup event */
} wifi_twt_config_t;
/** Argument structure for WIFI_EVENT_TWT_WAKEUP event */
typedef struct {
wifi_twt_type_t twt_type; /**< twt type */
uint8_t flow_id; /**< flow id */
} wifi_event_sta_twt_wakeup_t;
#ifdef __cplusplus
}
#endif

View File

@ -230,13 +230,23 @@ typedef struct {
uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */
uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */
uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */
uint32_t phy_11ax:1; /**< bit: 4 flag to identify if 11ax mode is enabled or not */
uint32_t wps:1; /**< bit: 5 flag to identify if WPS is supported or not */
uint32_t ftm_responder:1; /**< bit: 6 flag to identify if FTM is supported in responder mode */
uint32_t ftm_initiator:1; /**< bit: 7 flag to identify if FTM is supported in initiator mode */
uint32_t reserved:24; /**< bit: 8..31 reserved */
uint32_t phy_11a:1; /**< bit: 4 flag to identify if 11ax mode is enabled or not */
uint32_t phy_11ac:1; /**< bit: 5 flag to identify if 11ax mode is enabled or not */
uint32_t phy_11ax:1; /**< bit: 6 flag to identify if 11ax mode is enabled or not */
uint32_t wps:1; /**< bit: 7 flag to identify if WPS is supported or not */
uint32_t ftm_responder:1; /**< bit: 8 flag to identify if FTM is supported in responder mode */
uint32_t ftm_initiator:1; /**< bit: 9 flag to identify if FTM is supported in initiator mode */
uint32_t reserved:22; /**< bit: 10..31 reserved */
wifi_country_t country; /**< country information of AP */
wifi_he_ap_info_t he_ap; /**< HE AP info */
uint8_t bandwidth; /**< For either 20 MHz or 40 MHz operation, the Channel Width field is set to 0.
For AP 80 MHz this value is set to 1. For AP 160MHz sets this value is set to 2.
For AP 80+80MHz this value is set to 3*/
uint8_t vht_ch_freq1; /**< this fields are used only AP bandwidth is 80 and 160 MHz, to transmit the center channel
frequency of the BSS. For AP bandwidth is 80+80MHz, it is the center channel frequency
of the lower frequency segment.*/
uint8_t vht_ch_freq2; /**< this fields are used only AP bandwidth is 80+80MHz, and is used to transmit the center
channel frequency of the second segment. */
} wifi_ap_record_t;
typedef enum {
@ -262,15 +272,22 @@ typedef enum {
WIFI_PS_MAX_MODEM, /**< Maximum modem power saving. In this mode, interval to receive beacons is determined by the listen_interval parameter in wifi_sta_config_t */
} wifi_ps_type_t;
#define WIFI_PROTOCOL_11B 1
#define WIFI_PROTOCOL_11G 2
#define WIFI_PROTOCOL_11N 4
#define WIFI_PROTOCOL_LR 8
#define WIFI_PROTOCOL_11AX 16
#define WIFI_PROTOCOL_11B 0x1
#define WIFI_PROTOCOL_11G 0x2
#define WIFI_PROTOCOL_11N 0x4
#define WIFI_PROTOCOL_LR 0x8
#define WIFI_PROTOCOL_11A 0x10
#define WIFI_PROTOCOL_11AC 0x20
#define WIFI_PROTOCOL_11AX 0x40
typedef enum {
WIFI_BW_HT20 = 1, /* Bandwidth is HT20 */
WIFI_BW_HT40, /* Bandwidth is HT40 */
WIFI_BW_HT20 = 1, /* Bandwidth is HT20 */
WIFI_BW20 = WIFI_BW_HT20, /* Bandwidth is 20 MHz */
WIFI_BW_HT40, /* Bandwidth is HT40 */
WIFI_BW40 = WIFI_BW_HT40, /* Bandwidth is 40 MHz */
WIFI_BW80, /* Bandwidth is 80 MHz */
WIFI_BW160, /* Bandwidth is 160 MHz */
WIFI_BW80_BW80, /* Bandwidth is 80+80 MHz */
} wifi_bandwidth_t;
/** Configuration structure for Protected Management Frame */
@ -377,9 +394,11 @@ typedef struct {
uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */
uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */
uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */
uint32_t phy_11ax:1; /**< bit: 4 flag to identify if 11ax mode is enabled or not */
uint32_t is_mesh_child:1;/**< bit: 5 flag to identify mesh child */
uint32_t reserved:26; /**< bit: 6..31 reserved */
uint32_t phy_11a:1; /**< bit: 4 flag to identify if 11ax mode is enabled or not */
uint32_t phy_11ac:1; /**< bit: 5 flag to identify if 11ax mode is enabled or not */
uint32_t phy_11ax:1; /**< bit: 6 flag to identify if 11ax mode is enabled or not */
uint32_t is_mesh_child:1;/**< bit: 7 flag to identify mesh child */
uint32_t reserved:24; /**< bit: 8..31 reserved */
} wifi_sta_info_t;
typedef enum {
@ -420,9 +439,11 @@ typedef enum
WIFI_PHY_MODE_LR, /**< PHY mode for Low Rate */
WIFI_PHY_MODE_11B, /**< PHY mode for 11b */
WIFI_PHY_MODE_11G, /**< PHY mode for 11g */
WIFI_PHY_MODE_11A, /**< PHY mode for 11a */
WIFI_PHY_MODE_HT20, /**< PHY mode for Bandwidth HT20 */
WIFI_PHY_MODE_HT40, /**< PHY mode for Bandwidth HT40 */
WIFI_PHY_MODE_HE20, /**< PHY mode for Bandwidth HE20 */
WIFI_PHY_MODE_VHT20,/**< PHY mode for Bandwidth VHT20 */
} wifi_phy_mode_t;
/**
@ -776,6 +797,7 @@ typedef enum {
WIFI_EVENT_ITWT_TEARDOWN, /**< iTWT teardown */
WIFI_EVENT_ITWT_PROBE, /**< iTWT probe */
WIFI_EVENT_ITWT_SUSPEND, /**< iTWT suspend */
WIFI_EVENT_TWT_WAKEUP, /**< TWT wakeup */
WIFI_EVENT_NAN_STARTED, /**< NAN Discovery has started */
WIFI_EVENT_NAN_STOPPED, /**< NAN Discovery has stopped */
@ -1023,6 +1045,13 @@ typedef struct {
uint16_t report_len; /**< Length of the report*/
} wifi_event_neighbor_report_t;
/** Argument structure for wifi band */
typedef enum {
WIFI_BAND_2G = 1, /* Band is 2.4G */
WIFI_BAND_5G = 2, /* Band is 5G */
WIFI_BAND_2G_5G = 3, /* Band is 2,4G + 5G */
} wifi_band_t;
#ifdef __cplusplus
}
#endif

View File

@ -18,7 +18,7 @@ extern "C" {
#if CONFIG_IDF_TARGET_ESP32C2
#define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C5
#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 soft-AP */
#else
#define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */
@ -38,7 +38,7 @@ typedef struct {
signed rssi:8; /**< Received Signal Strength Indicator(RSSI) of packet. unit: dBm */
unsigned rate:5; /**< PHY rate encoding of the packet. Only valid for non HT(11bg) packet */
unsigned :1; /**< reserved */
unsigned sig_mode:2; /**< Protocol of the reveived packet, 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */
unsigned sig_mode:2; /**< Protocol of the received packet, 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */
unsigned :16; /**< reserved */
unsigned mcs:7; /**< Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */
unsigned cwb:1; /**< Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */
@ -121,7 +121,7 @@ typedef struct wifi_csi_info_t {
wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */
uint8_t mac[6]; /**< source MAC address of the CSI data */
uint8_t dmac[6]; /**< destination MAC address of the CSI data */
bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not, true indicates the first four bytes is invalid due to hardware limition */
bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not, true indicates the first four bytes is invalid due to hardware limitation */
int8_t *buf; /**< valid buffer of CSI data */
uint16_t len; /**< valid length of CSI data */
uint8_t *hdr; /**< header of the wifi packet */

View File

@ -23,6 +23,14 @@ config SOC_ASYNC_MEMCPY_SUPPORTED
bool
default y
config SOC_PHY_SUPPORTED
bool
default y
config SOC_WIFI_SUPPORTED
bool
default y
config SOC_SUPPORTS_SECURE_DL_MODE
bool
default y
@ -599,6 +607,10 @@ config SOC_UART_SUPPORT_FSM_TX_WAIT_SEND
bool
default y
config SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH
int
default 12
config SOC_PM_SUPPORT_CPU_PD
bool
default y
@ -690,3 +702,35 @@ config SOC_BLUFI_SUPPORTED
config SOC_BLE_MULTI_CONN_OPTIMIZATION
bool
default y
config SOC_WIFI_HW_TSF
bool
default y
config SOC_WIFI_FTM_SUPPORT
bool
default n
config SOC_WIFI_GCMP_SUPPORT
bool
default y
config SOC_WIFI_WAPI_SUPPORT
bool
default y
config SOC_WIFI_CSI_SUPPORT
bool
default y
config SOC_WIFI_MESH_SUPPORT
bool
default y
config SOC_WIFI_HE_SUPPORT
bool
default y
config SOC_WIFI_HE_SUPPORT_5G
bool
default y

View File

@ -31,7 +31,8 @@
#define SOC_ASYNC_MEMCPY_SUPPORTED 1
// #define SOC_USB_SERIAL_JTAG_SUPPORTED 1 // TODO: [ESP32C5] IDF-8721
// #define SOC_TEMP_SENSOR_SUPPORTED 1 // TODO: [ESP32C5] IDF-8727
// #define SOC_WIFI_SUPPORTED 1 // TODO: [ESP32C5] IDF-8851
#define SOC_PHY_SUPPORTED 1
#define SOC_WIFI_SUPPORTED 1
#define SOC_SUPPORTS_SECURE_DL_MODE 1
// #define SOC_LP_CORE_SUPPORTED 1 // TODO: [ESP32C5] IDF-8637
#define SOC_EFUSE_KEY_PURPOSE_FIELD 1
@ -504,7 +505,7 @@
// #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4)
/*--------------- WIFI LIGHT SLEEP CLOCK WIDTH CAPS --------------------------*/
// #define SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH (12)
#define SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH (12)
/*-------------------------- Power Management CAPS ----------------------------*/
// #define SOC_PM_SUPPORT_WIFI_WAKEUP (1)
@ -551,13 +552,14 @@
// #define SOC_TEMPERATURE_SENSOR_INTR_SUPPORT (1)
/*------------------------------------ WI-FI CAPS ------------------------------------*/
// #define SOC_WIFI_HW_TSF (1) /*!< Support hardware TSF */
// #define SOC_WIFI_FTM_SUPPORT (0) /*!< Support FTM */
// #define SOC_WIFI_GCMP_SUPPORT (1) /*!< Support GCMP(GCMP128 and GCMP256) */
// #define SOC_WIFI_WAPI_SUPPORT (1) /*!< Support WAPI */
// #define SOC_WIFI_CSI_SUPPORT (1) /*!< Support CSI */
// #define SOC_WIFI_MESH_SUPPORT (1) /*!< Support WIFI MESH */
// #define SOC_WIFI_HE_SUPPORT (1) /*!< Support Wi-Fi 6 */
#define SOC_WIFI_HW_TSF (1) /*!< Support hardware TSF */
#define SOC_WIFI_FTM_SUPPORT (0) /*!< Support FTM */
#define SOC_WIFI_GCMP_SUPPORT (1) /*!< Support GCMP(GCMP128 and GCMP256) */
#define SOC_WIFI_WAPI_SUPPORT (1) /*!< Support WAPI */
#define SOC_WIFI_CSI_SUPPORT (1) /*!< Support CSI */
#define SOC_WIFI_MESH_SUPPORT (1) /*!< Support WIFI MESH */
#define SOC_WIFI_HE_SUPPORT (1) /*!< Support Wi-Fi 6 in 2.4G */
#define SOC_WIFI_HE_SUPPORT_5G (1) /*!< Support Wi-Fi 6 in 5G */
/*---------------------------------- Bluetooth CAPS ----------------------------------*/
#define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */

View File

@ -34,7 +34,7 @@ API Guides
partition-tables
performance/index
reproducible-builds
:SOC_WIFI_SUPPORTED or SOC_BT_SUPPORTED or SOC_IEEE802154_SUPPORTED: RF_calibration
:(SOC_WIFI_SUPPORTED or SOC_BT_SUPPORTED or SOC_IEEE802154_SUPPORTED) and not esp32c5: RF_calibration
thread-local-storage
tools/index
unit-tests

View File

@ -34,7 +34,7 @@ API 指南
partition-tables
performance/index
reproducible-builds
:SOC_WIFI_SUPPORTED or SOC_BT_SUPPORTED or SOC_IEEE802154_SUPPORTED: RF_calibration
:(SOC_WIFI_SUPPORTED or SOC_BT_SUPPORTED or SOC_IEEE802154_SUPPORTED) and not esp32c5: RF_calibration
thread-local-storage
tools/index
unit-tests

View File

@ -453,7 +453,11 @@ Deep-sleep 有如下可配置选项:
为方便用户选择合适的低功耗模式,在介绍具体内容前先给出 Wi-Fi 场景下低功耗模式总结表,以方便用户根据需求快速选择想要了解的内容。
.. include:: sleep-current/{IDF_TARGET_PATH_NAME}_summary.inc
.. todo - add sleep-current/esp32c5_summary.inc
.. only:: not esp32c5
.. include:: sleep-current/{IDF_TARGET_PATH_NAME}_summary.inc
.. note::
@ -692,7 +696,11 @@ Deep-sleep 有如下可配置选项:
配置表现:
.. include:: sleep-current/{IDF_TARGET_PATH_NAME}_modem_sleep.inc
.. todo - add sleep-current/esp32c5_modem_sleep.inc
.. only:: not esp32c5
.. include:: sleep-current/{IDF_TARGET_PATH_NAME}_modem_sleep.inc
Auto Light-sleep + Wi-Fi 场景配置:
@ -702,7 +710,11 @@ Deep-sleep 有如下可配置选项:
该配置表现为 Auto Light-sleep 纯系统推荐配置 + 默认的 Wi-Fi 相关配置在 Wi-Fi 场景的表现。
.. include:: sleep-current/{IDF_TARGET_PATH_NAME}_light_sleep.inc
.. todo - add sleep-current/esp32c5_light_sleep.inc
.. only:: not esp32c5
.. include:: sleep-current/{IDF_TARGET_PATH_NAME}_light_sleep.inc
Deep-sleep + Wi-Fi 场景配置:

View File

@ -51,7 +51,9 @@ static int deep_sleep(int argc, char **argv)
if (deep_sleep_args.wakeup_time->count) {
uint64_t timeout = 1000ULL * deep_sleep_args.wakeup_time->ival[0];
ESP_LOGI(TAG, "Enabling timer wakeup, timeout=%lluus", timeout);
#if !CONFIG_IDF_TARGET_ESP32C5 // TODO: [ESP32C5] IDF-8638
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
#endif
}
#if SOC_PM_SUPPORT_EXT1_WAKEUP
@ -80,8 +82,9 @@ static int deep_sleep(int argc, char **argv)
#if CONFIG_IDF_TARGET_ESP32
rtc_gpio_isolate(GPIO_NUM_12);
#endif //CONFIG_IDF_TARGET_ESP32
#if !CONFIG_IDF_TARGET_ESP32C5 // TODO: [ESP32C5] IDF-8638
esp_deep_sleep_start();
#endif
return 1;
}
@ -132,11 +135,15 @@ static int light_sleep(int argc, char **argv)
arg_print_errors(stderr, light_sleep_args.end, argv[0]);
return 1;
}
#if !CONFIG_IDF_TARGET_ESP32C5 // TODO: [ESP32C5] IDF-8638
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
#endif
if (light_sleep_args.wakeup_time->count) {
uint64_t timeout = 1000ULL * light_sleep_args.wakeup_time->ival[0];
ESP_LOGI(TAG, "Enabling timer wakeup, timeout=%lluus", timeout);
#if !CONFIG_IDF_TARGET_ESP32C5 // TODO: [ESP32C5] IDF-8638
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
#endif
}
int io_count = light_sleep_args.wakeup_gpio_num->count;
if (io_count != light_sleep_args.wakeup_gpio_level->count) {
@ -156,17 +163,26 @@ static int light_sleep(int argc, char **argv)
ESP_ERROR_CHECK( gpio_wakeup_enable(io_num, level ? GPIO_INTR_HIGH_LEVEL : GPIO_INTR_LOW_LEVEL) );
}
if (io_count > 0) {
#if !CONFIG_IDF_TARGET_ESP32C5 // TODO: [ESP32C5] IDF-8638
ESP_ERROR_CHECK( esp_sleep_enable_gpio_wakeup() );
#endif
}
if (CONFIG_ESP_CONSOLE_UART_NUM >= 0 && CONFIG_ESP_CONSOLE_UART_NUM <= UART_NUM_1) {
ESP_LOGI(TAG, "Enabling UART wakeup (press ENTER to exit light sleep)");
ESP_ERROR_CHECK( uart_set_wakeup_threshold(CONFIG_ESP_CONSOLE_UART_NUM, 3) );
#if !CONFIG_IDF_TARGET_ESP32C5 // TODO: [ESP32C5] IDF-8638
ESP_ERROR_CHECK( esp_sleep_enable_uart_wakeup(CONFIG_ESP_CONSOLE_UART_NUM) );
#endif
}
fflush(stdout);
fsync(fileno(stdout));
#if !CONFIG_IDF_TARGET_ESP32C5 // TODO: [ESP32C5] IDF-8638
esp_light_sleep_start();
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
#else
esp_sleep_wakeup_cause_t cause = ESP_SLEEP_WAKEUP_TIMER;
#endif
const char *cause_str;
switch (cause) {
case ESP_SLEEP_WAKEUP_GPIO:

View File

@ -4,6 +4,6 @@ dependencies:
espressif/iperf-cmd:
version: "~0.1.1"
esp-qa/wifi-cmd:
version: "~0.0.2"
version: "~0.0.3"
esp-qa/ping-cmd:
version: "~0.0.1"

View File

@ -0,0 +1,42 @@
#
# ESP32C5-Specific
#
CONFIG_IDF_ENV_FPGA=n
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=40
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=60
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=40
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP_WIFI_TX_BA_WIN=32
CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP_WIFI_RX_BA_WIN=32
CONFIG_ESP_WIFI_NVS_ENABLED=n
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=51200
CONFIG_LWIP_TCP_WND_DEFAULT=65535
CONFIG_LWIP_TCP_RECVMBOX_SIZE=64
CONFIG_LWIP_UDP_RECVMBOX_SIZE=64
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64
CONFIG_LWIP_IP_REASS_MAX_PBUFS=15
#
# Serial flasher config
#
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
#
# Wi-Fi
#
CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS=y
CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS=y
CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS=y
CONFIG_ESP_WIFI_ENABLE_DUMP_HESIGB=n
CONFIG_ESP_WIFI_ENABLE_DUMP_MU_CFO=n
CONFIG_ESP_WIFI_ENABLE_DUMP_CTRL_NDPA=n
CONFIG_ESP_WIFI_ENABLE_DUMP_CTRL_BFRP=n
CONFIG_ESP_WIFI_SLP_IRAM_OPT=n
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
CONFIG_LWIP_TCPIP_CORE_LOCKING=y
CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y