diff --git a/components/esp_phy/esp32c6/phy_init_data.c b/components/esp_phy/esp32c6/phy_init_data.c index f60ba8f7e3..499b60d660 100644 --- a/components/esp_phy/esp32c6/phy_init_data.c +++ b/components/esp_phy/esp32c6/phy_init_data.c @@ -13,8 +13,8 @@ const char __attribute__((section(".rodata"))) phy_init_magic_pre[] = PHY_INIT_M * @brief Structure containing default recommended PHY initialization parameters. */ const esp_phy_init_data_t phy_init_data= { { - 0x01, - 0x00, + 0xa, + 0x0, LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x54), LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x54), LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), @@ -29,60 +29,62 @@ const esp_phy_init_data_t phy_init_data= { { LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x3C), LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x3C), LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x3C), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48), + 0x0, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, 0x00, 0x00, 0x00, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, 0, 0, 0, @@ -138,9 +140,7 @@ const esp_phy_init_data_t phy_init_data= { { 0, 0, 0, - 0, - 0, - 0x70 + 0x51 } }; const char __attribute__((section(".rodata"))) phy_init_magic_post[] = PHY_INIT_MAGIC; diff --git a/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld b/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld index 09472c477e..83e6d8cc6e 100644 --- a/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld +++ b/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld @@ -112,7 +112,7 @@ pm_disable_sleep_delay_timer = 0x40000d50; /*pm_dream = 0x40000d54;*/ pm_mac_wakeup = 0x40000d58; pm_mac_sleep = 0x40000d5c; -pm_enable_active_timer = 0x40000d60; +/*pm_enable_active_timer = 0x40000d60;*/ pm_enable_sleep_delay_timer = 0x40000d64; pm_local_tsf_process = 0x40000d68; pm_set_beacon_filter = 0x40000d6c; diff --git a/components/esp_wifi/include/esp_wifi_he_types.h b/components/esp_wifi/include/esp_wifi_he_types.h index 404dc1cf1d..fa139131df 100644 --- a/components/esp_wifi/include/esp_wifi_he_types.h +++ b/components/esp_wifi/include/esp_wifi_he_types.h @@ -406,6 +406,7 @@ typedef enum { /** Argument structure for twt configuration */ typedef struct { bool post_wakeup_event; /**< post twt wakeup event */ + bool twt_enable_keep_alive; /**< twt enable send qos null to keep alive */ } wifi_twt_config_t; /** Argument structure for WIFI_EVENT_TWT_WAKEUP event */ diff --git a/components/esp_wifi/include/esp_wifi_types_generic.h b/components/esp_wifi/include/esp_wifi_types_generic.h index 15a9585d96..beb2e06212 100644 --- a/components/esp_wifi/include/esp_wifi_types_generic.h +++ b/components/esp_wifi/include/esp_wifi_types_generic.h @@ -258,9 +258,9 @@ typedef struct { 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 bandwidth; /**< For AP 20 MHz this value is set to 1. For AP 40 MHz this value is set to 2. + For AP 80 MHz this value is set to 3. For AP 160MHz this value is set to 4. + For AP 80+80MHz this value is set to 5*/ 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.*/ diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 4b81aaa3da..564eb0c3a9 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 4b81aaa3daffee120989beb144a92d06fa6c001d +Subproject commit 564eb0c3a90c40852360181e96e9cf53b7d818ff diff --git a/examples/wifi/itwt/main/Kconfig.projbuild b/examples/wifi/itwt/main/Kconfig.projbuild index 9eb0e46e7b..8d8dd52b2e 100644 --- a/examples/wifi/itwt/main/Kconfig.projbuild +++ b/examples/wifi/itwt/main/Kconfig.projbuild @@ -38,6 +38,12 @@ menu "Example Configuration" help Set static gateway address. + config EXAMPLE_TWT_ENABLE_KEEP_ALIVE_QOS_NULL + bool "enable keep alive qos null" + default n + help + Enable send QOS NULL to keep alive during TWT. + menu "iTWT Configuration" config EXAMPLE_ITWT_TRIGGER_ENABLE bool "trigger-enabled" diff --git a/examples/wifi/itwt/main/itwt_main.c b/examples/wifi/itwt/main/itwt_main.c index e2f4ecc771..c1e44d8eb2 100644 --- a/examples/wifi/itwt/main/itwt_main.c +++ b/examples/wifi/itwt/main/itwt_main.c @@ -49,6 +49,12 @@ static const char *TAG = "itwt"; #define DEFAULT_PWD CONFIG_EXAMPLE_WIFI_PASSWORD #define ITWT_SETUP_SUCCESS 1 +#if CONFIG_EXAMPLE_TWT_ENABLE_KEEP_ALIVE_QOS_NULL +bool keep_alive_enabled = true; +#else +bool keep_alive_enabled = false; +#endif + #if CONFIG_EXAMPLE_ITWT_TRIGGER_ENABLE uint8_t trigger_enabled = 1; #else @@ -264,6 +270,12 @@ static void wifi_itwt(void) ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); + wifi_twt_config_t wifi_twt_config = { + .post_wakeup_event = false, + .twt_enable_keep_alive = keep_alive_enabled, + }; + ESP_ERROR_CHECK(esp_wifi_sta_twt_config(&wifi_twt_config)); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20); esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_11AX); esp_wifi_set_ps(WIFI_PS_MIN_MODEM);