Skip to content

Commit b5c53d6

Browse files
sylvioalvesmmahadevan108
authored andcommitted
wifi: esp32: move kconfig to driver area
Make sure all kconfig related to Wi-Fi is in its driver area. This commit also removes esp_timer_init() call from Wi-Fi driver. Signed-off-by: Sylvio Alves <[email protected]>
1 parent 45fbc31 commit b5c53d6

File tree

3 files changed

+93
-54
lines changed

3 files changed

+93
-54
lines changed

drivers/wifi/esp32/Kconfig.esp32

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,39 @@ config ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM
175175
than WiFi layer can transmit. In these cases, we may run out of TX
176176
buffers.
177177

178+
choice ESP32_WIFI_MGMT_RX_BUFFER
179+
prompt "Type of WiFi RX MGMT buffers"
180+
default ESP32_WIFI_STATIC_RX_MGMT_BUFFER
181+
help
182+
Select type of WiFi RX MGMT buffers:
183+
184+
If "Static" is selected, WiFi RX MGMT buffers are allocated when WiFi is initialized and released
185+
when WiFi is de-initialized. The size of each static RX MGMT buffer is fixed to about 500 Bytes.
186+
187+
If "Dynamic" is selected, each WiFi RX MGMT buffer is allocated as needed when a MGMT data frame is
188+
received. The MGMT buffer is freed after the MGMT data frame has been processed by the WiFi driver.
189+
190+
config ESP32_WIFI_STATIC_RX_MGMT_BUFFER
191+
bool "Static"
192+
config ESP32_WIFI_DYNAMIC_RX_MGMT_BUFFER
193+
bool "Dynamic"
194+
endchoice
195+
196+
config ESP32_WIFI_DYNAMIC_RX_MGMT_BUF
197+
int
198+
default 0 if ESP32_WIFI_STATIC_RX_MGMT_BUFFER
199+
default 1 if ESP32_WIFI_DYNAMIC_RX_MGMT_BUFFER
200+
201+
config ESP32_WIFI_RX_MGMT_BUF_NUM_DEF
202+
int "Max number of WiFi RX MGMT buffers"
203+
range 1 10
204+
default 5
205+
help
206+
Set the number of WiFi RX_MGMT buffers.
207+
208+
For Management buffers, the number of dynamic and static management buffers is the same.
209+
In order to prevent memory fragmentation, the management buffer type should be set to static first.
210+
178211
config ESP32_WIFI_CSI_ENABLED
179212
bool "WiFi CSI(Channel State Information)"
180213
default n
@@ -234,6 +267,13 @@ config ESP32_WIFI_AMSDU_TX_ENABLED
234267
help
235268
Select this option to enable AMSDU TX feature
236269

270+
config ESP32_WIFI_MGMT_SBUF_NUM
271+
int "WiFi mgmt short buffer number"
272+
range 6 32
273+
default 32
274+
help
275+
Set the number of WiFi management short buffer.
276+
237277
config ESP32_WIFI_IRAM_OPT
238278
bool "WiFi IRAM speed optimization"
239279
default n if (BT && ESP_SPIRAM && SOC_SERIES_ESP32)
@@ -251,10 +291,62 @@ config ESP32_WIFI_RX_IRAM_OPT
251291
When this option is disabled, more than 17Kbytes of IRAM memory will be saved
252292
but Wi-Fi performance will be reduced.
253293

294+
config ESP32_WIFI_MAX_THREAD_PRIORITY
295+
int "Maximum work queue thread priority"
296+
default 7
297+
help
298+
Maximum priority of thread used for processing driver work queue items.
299+
300+
config ESP32_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME
301+
int "Minimum active time"
302+
range 8 60
303+
default 50
304+
help
305+
Only for station in WIFI_PS_MIN_MODEM or WIFI_PS_MAX_MODEM. When the station enters the active state,
306+
it will work for at least ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME. If a data packet is received or sent
307+
during this period, the time will be refreshed. If the time is up, but the station still has packets
308+
to receive or send, the time will also be refreshed. unit: milliseconds.
309+
310+
config ESP32_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME
311+
int "Maximum keep alive time"
312+
range 10 60
313+
default 10
314+
help
315+
Only for station in WIFI_PS_MIN_MODEM or WIFI_PS_MAX_MODEM. If no packet has been
316+
sent within ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME, a null data packet will be sent
317+
to maintain the connection with the AP. unit: seconds.
318+
319+
config ESP32_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME
320+
int "Minimum wait broadcast data time"
321+
range 10 30
322+
default 15
323+
help
324+
Only for station in WIFI_PS_MIN_MODEM or WIFI_PS_MAX_MODEM. When the station knows through the beacon
325+
that AP will send broadcast packet, it will wait for ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME
326+
before entering the sleep process. If a broadcast packet is received with more data bits, the time
327+
will refreshed. unit: milliseconds.
328+
329+
choice ESP_WIFI_HEAP
330+
prompt "Wifi adapter heap in use"
331+
default ESP_WIFI_HEAP_RUNTIME
332+
333+
config ESP_WIFI_HEAP_RUNTIME
334+
bool "Wifi adapter use ESP runtime heap"
335+
depends on ESP_HEAP_RUNTIME
336+
337+
config ESP_WIFI_HEAP_SPIRAM
338+
bool "Wifi adapter use SPIRAM heap"
339+
depends on ESP_SPIRAM
340+
341+
config ESP_WIFI_HEAP_SYSTEM
342+
bool "Wifi adapter use system heap"
343+
344+
endchoice # ESP_WIFI_HEAP
345+
254346
config ESP32_WIFI_FTM_ENABLE
255347
bool "WiFi FTM"
256348
default n
257-
depends on SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C3
349+
depends on SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6 || SOC_SERIES_ESP32S2 || SOC_SERIES_ESP32S3
258350
help
259351
Enable feature Fine Timing Measurement for calculating WiFi Round-Trip-Time (RTT).
260352

drivers/wifi/esp32/src/esp_wifi_drv.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,6 @@ static int esp32_wifi_dev_init(const struct device *dev)
871871
adc2_init_code_calibration();
872872
#endif /* CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 */
873873

874-
esp_timer_init();
875874
wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT();
876875
esp_err_t ret = esp_wifi_init(&config);
877876

@@ -883,7 +882,6 @@ static int esp32_wifi_dev_init(const struct device *dev)
883882
LOG_ERR("Unable to initialize the Wi-Fi: %d", ret);
884883
return -EIO;
885884
}
886-
887885
if (IS_ENABLED(CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4)) {
888886
net_mgmt_init_event_callback(&esp32_dhcp_cb, wifi_event_handler, DHCPV4_MASK);
889887
net_mgmt_add_event_callback(&esp32_dhcp_cb);

soc/espressif/common/Kconfig.wifi

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)