@@ -321,7 +321,8 @@ config WIFI_RMT_ENABLE_WPA3_OWE_STA
321321config WIFI_RMT_SLP_IRAM_OPT
322322 bool "WiFi SLP IRAM speed optimization"
323323 select PM_SLP_DEFAULT_PARAMS_OPT
324- select PERIPH_CTRL_FUNC_IN_IRAM
324+ select PM_SLEEP_FUNC_IN_IRAM
325+ select ESP_PERIPH_CTRL_FUNC_IN_IRAM
325326 default y if SLAVE_SOC_WIFI_HE_SUPPORT
326327 help
327328 Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM.
@@ -341,14 +342,24 @@ config WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME
341342 during this period, the time will be refreshed. If the time is up, but the station still has packets
342343 to receive or send, the time will also be refreshed. unit: milliseconds.
343344
345+ config WIFI_RMT_BSS_MAX_IDLE_SUPPORT
346+ bool "Enable bss max idle support"
347+ default y if (SLAVE_SOC_WIFI_HE_SUPPORT || WIFI_RMT_WNM_SUPPORT)
348+ help
349+ Enables bss max idle support for Station and SoftAP. BSS max idle period enables an SoftAP to indicate
350+ a time period during which the AP does not disassociate a STA due to nonreceipt of frames from the STA.
351+ For station, max idle period is default 10 (1000TUs) and can be set through
352+ WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME. For softap, bss max idle parameters will be set through
353+ bss_max_idle_cfg in wifi_ap_config_t.
354+
344355config WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME
345356 int "Maximum keep alive time"
346357 range 10 60
347358 default 10
348359 help
349- Only for station in WIFI_PS_MIN_MODEM or WIFI_PS_MAX_MODEM . If no packet has been
350- sent within WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME, a null data packet will be sent
351- to maintain the connection with the AP . unit: seconds.
360+ Only for station. If no packet has been sent within WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME, a null data
361+ packet will be sent to maintain the connection with the AP. If WIFI_RMT_BSS_MAX_IDLE_SUPPORT is set,
362+ it will be sent as bss max idle period in association request . unit: seconds.
352363
353364config WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME
354365 int "Minimum wait broadcast data time"
@@ -430,8 +441,9 @@ config WIFI_RMT_SLP_BEACON_LOST_THRESHOLD
430441 default 3
431442 depends on WIFI_RMT_SLP_BEACON_LOST_OPT
432443 help
433- Maximum number of consecutive lost beacons allowed, WiFi keeps Rx state when
434- the number of consecutive beacons lost is greater than the given threshold.
444+ Maximum number of consecutive lost beacons allowed, the WiFi Rx state behaviour
445+ will be determined by WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_POLICY
446+ when the number of consecutive beacons lost is greater than the given threshold.
435447
436448config WIFI_RMT_SLP_PHY_ON_DELTA_EARLY_TIME
437449 int "Delta early time for RF PHY on"
@@ -451,6 +463,77 @@ config WIFI_RMT_SLP_PHY_OFF_DELTA_TIMEOUT_TIME
451463 Delta timeout time for rf phy off, When the beacon is lost, the next rf phy off will
452464 be delayed for the time specified by the configuration item. Unit: 1024 microsecond.
453465
466+ choice WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_POLICY
467+ prompt "Beacon strategy when beacon loss exceeds threshold"
468+ depends on WIFI_RMT_SLP_BEACON_LOST_OPT
469+ default WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_AUTO
470+ help
471+ Select the strategy to apply when the number of lost beacons exceeds the threshold.
472+
473+ - "Receive beacon": Keep RF on until a beacon is successfully received.
474+
475+ - "Drop beacon": Turn off RF and skip beacon reception during this period.
476+
477+ - "Auto": Beacon will been dropped only if WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE enabled
478+ and expected rx beacon probability stays below the standard.
479+
480+ config WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_RECEIVE
481+ bool "Receive beacon"
482+ config WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_DROP
483+ bool "Drop beacon"
484+ config WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_AUTO
485+ bool "Auto"
486+ endchoice
487+
488+ config WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
489+ bool "Sample beacon to calculate beacon offset"
490+ default n
491+ depends on WIFI_RMT_SLP_BEACON_LOST_OPT && !WIFI_RMT_ENHANCED_LIGHT_SLEEP
492+ help
493+ Select to enable feature sampling beacons to calculate beacon offset.
494+
495+ menu "Beacon Sample Configuration Options"
496+ visible if WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
497+ config WIFI_RMT_SLP_SAMPLE_BEACON_COUNT
498+ int "Sample beacons at wifi connected to adjust beacon parameters"
499+ range 100 1200
500+ default 300
501+ depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
502+ help
503+ Numble of sampled beacons at wifi connected to adjust beacon parameters.
504+
505+ config WIFI_RMT_SLP_SAMPLE_BEACON_DIFFERENCE_PERCENT
506+ int "Difference percentage triggers unstable event"
507+ range 0 100
508+ default 20
509+ depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
510+ help
511+ Difference triggers event WIFI_EVENT_STA_BEACON_OFFSET_UNSTABLE
512+ when the actual rx beacon probability continuously falls below
513+ the expected probability by this value.
514+ unit: percentage
515+
516+ config WIFI_RMT_SLP_SAMPLE_BEACON_STANDARD_PERCENT
517+ int "Standard percentage triggers beacon drop"
518+ range 0 100
519+ default 55
520+ depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
521+ help
522+ Standard triggers beacon drop when the expected rx beacon probability
523+ falls below this value under WIFI_RMT_SLP_BEACON_LOST_DROP_BEACON_AUTO mode.
524+ unit: percentage
525+
526+ config WIFI_RMT_SLP_SAMPLE_BEACON_RESAMPLE_PERIOD
527+ int "Resample period"
528+ range 0 255
529+ default 3
530+ depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
531+ help
532+ Resample period if beacon drop is active under WIFI_RMT_SLP_BEACON_LOST_DROP_BEACON_AUTO mode.
533+ It means never resample if setting this value to 0.
534+ unit: hours
535+ endmenu # "Beacon Sample Configuration Options"
536+
454537config WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM
455538 int "Maximum espnow encrypt peers number"
456539 range 0 4 if SLAVE_IDF_TARGET_ESP32C2
@@ -896,6 +979,12 @@ endif
896979 int
897980 default WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME
898981
982+ if WIFI_RMT_BSS_MAX_IDLE_SUPPORT
983+ config ESP_WIFI_BSS_MAX_IDLE_SUPPORT # ignore: multiple-definition
984+ bool
985+ default WIFI_RMT_BSS_MAX_IDLE_SUPPORT
986+ endif
987+
899988 config ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME # ignore: multiple-definition
900989 int
901990 default WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME
@@ -983,6 +1072,33 @@ endif
9831072 depends on WIFI_RMT_SLP_BEACON_LOST_OPT && SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW
9841073 default WIFI_RMT_SLP_PHY_OFF_DELTA_TIMEOUT_TIME
9851074
1075+ if WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
1076+ config ESP_WIFI_SLP_SAMPLE_BEACON_FEATURE # ignore: multiple-definition
1077+ bool
1078+ depends on WIFI_RMT_SLP_BEACON_LOST_OPT && !WIFI_RMT_ENHANCED_LIGHT_SLEEP
1079+ default WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
1080+ endif
1081+
1082+ config ESP_WIFI_SLP_SAMPLE_BEACON_COUNT # ignore: multiple-definition
1083+ int
1084+ depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
1085+ default WIFI_RMT_SLP_SAMPLE_BEACON_COUNT
1086+
1087+ config ESP_WIFI_SLP_SAMPLE_BEACON_DIFFERENCE_PERCENT # ignore: multiple-definition
1088+ int
1089+ depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
1090+ default WIFI_RMT_SLP_SAMPLE_BEACON_DIFFERENCE_PERCENT
1091+
1092+ config ESP_WIFI_SLP_SAMPLE_BEACON_STANDARD_PERCENT # ignore: multiple-definition
1093+ int
1094+ depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
1095+ default WIFI_RMT_SLP_SAMPLE_BEACON_STANDARD_PERCENT
1096+
1097+ config ESP_WIFI_SLP_SAMPLE_BEACON_RESAMPLE_PERIOD # ignore: multiple-definition
1098+ int
1099+ depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE
1100+ default WIFI_RMT_SLP_SAMPLE_BEACON_RESAMPLE_PERIOD
1101+
9861102 config ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM # ignore: multiple-definition
9871103 int
9881104 default WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM
0 commit comments