Skip to content

Commit c55683c

Browse files
tkc17jukkar
authored andcommitted
[fromlist] SME: Add configurable driver processing time
Some drivers take longer than 100ms, and there by the keepalive is sent after the keepalive period and this causes disconnections sometimes, so, adjust for the driver's processing delay (a new driver capability) and send the keepalive early (no harm in sending early). Upstream PR: https://lists.infradead.org/pipermail/hostap/2025-July/043623.html Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 7fda615 commit c55683c

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

src/drivers/driver.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,6 +2458,9 @@ struct wpa_driver_capa {
24582458
unsigned int mbssid_max_interfaces;
24592459
/* Maximum profile periodicity for enhanced MBSSID advertisement */
24602460
unsigned int ema_max_periodicity;
2461+
2462+
/* Driver TX processing delay in microseconds, used for TX delay compensation */
2463+
unsigned int driver_tx_processing_delay_ms;
24612464
};
24622465

24632466

wpa_supplicant/events.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2924,8 +2924,15 @@ static void wnm_bss_keep_alive(void *eloop_ctx, void *sock_ctx)
29242924
if (wpa_s->sme.bss_max_idle_period) {
29252925
unsigned int msec;
29262926
msec = wpa_s->sme.bss_max_idle_period * 1024; /* times 1000 */
2927-
if (msec > 100)
2928-
msec -= 100;
2927+
{
2928+
unsigned int adj = wpa_s->driver_tx_processing_delay_ms;
2929+
2930+
/* Fallback to retain current behaviour */
2931+
if (adj < 100)
2932+
adj = 100;
2933+
if (msec > adj)
2934+
msec -= adj;
2935+
}
29292936
eloop_register_timeout(msec / 1000, msec % 1000 * 1000,
29302937
wnm_bss_keep_alive, wpa_s, NULL);
29312938
}
@@ -2959,8 +2966,15 @@ static void wnm_process_assoc_resp(struct wpa_supplicant *wpa_s,
29592966
eloop_cancel_timeout(wnm_bss_keep_alive, wpa_s, NULL);
29602967
/* msec times 1000 */
29612968
msec = wpa_s->sme.bss_max_idle_period * 1024;
2962-
if (msec > 100)
2963-
msec -= 100;
2969+
{
2970+
unsigned int adj = wpa_s->driver_tx_processing_delay_ms;
2971+
2972+
/* Fallback to retain current behaviour */
2973+
if (adj < 100)
2974+
adj = 100;
2975+
if (msec > adj)
2976+
msec -= adj;
2977+
}
29642978
eloop_register_timeout(msec / 1000, msec % 1000 * 1000,
29652979
wnm_bss_keep_alive, wpa_s,
29662980
NULL);

wpa_supplicant/wpa_supplicant.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7225,6 +7225,7 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
72257225
wpa_s->extended_capa_len >= 3 &&
72267226
wpa_s->extended_capa[2] & 0x40)
72277227
wpa_s->multi_bss_support = 1;
7228+
wpa_s->driver_tx_processing_delay_ms = capa.driver_tx_processing_delay_ms;
72287229
}
72297230
if (wpa_s->max_remain_on_chan == 0)
72307231
wpa_s->max_remain_on_chan = 1000;

wpa_supplicant/wpa_supplicant_i.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,8 @@ struct wpa_supplicant {
16261626
u64 first_beacon_tsf;
16271627
unsigned int beacons_checked;
16281628
unsigned int next_beacon_check;
1629+
1630+
unsigned int driver_tx_processing_delay_ms;
16291631
};
16301632

16311633

0 commit comments

Comments
 (0)