[PATCH 05/16] PR: Release pr-pasn-start-auth radio work on PASN success

Peddolla Harshavardhan Reddy peddolla.reddy at oss.qualcomm.com
Sun Jul 12 23:29:53 PDT 2026


Currently when PASN authentication completes successfully,
wpas_pr_ranging_params() cancels the PASN timeout but does not
release the pr-pasn-start-auth radio work item. This causes the
work to remain active until the 10-second timeout fires, blocking
other radio work unnecessarily.

Add wpas_pr_pasn_auth_work_done() to free the auth work context and
call radio_work_done() to release the radio work item. Call it from
wpas_pr_ranging_params() immediately after canceling the PASN timeout
so the work is released as soon as ranging is triggered following
successful PASN authentication.

Fixes: 5d9d8215d720 ("PR: Add ranging session timeout and integrate socket cleanup")
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy at oss.qualcomm.com>
---
 wpa_supplicant/pr_supplicant.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/wpa_supplicant/pr_supplicant.c b/wpa_supplicant/pr_supplicant.c
index dcf913255..5a8aee652 100644
--- a/wpa_supplicant/pr_supplicant.c
+++ b/wpa_supplicant/pr_supplicant.c
@@ -23,6 +23,7 @@
 #ifdef CONFIG_PASN
 static void wpas_pr_pasn_timeout(void *eloop_ctx, void *timeout_ctx);
 static void wpas_pr_pasn_roc_total_timeout(void *eloop_ctx, void *timeout_ctx);
+static void wpas_pr_pasn_auth_work_done(struct wpa_supplicant *wpa_s);
 
 /* Total listen window (ms) for the PASN responder ROC */
 #define PR_PASN_RESPONDER_ROC_DURATION 5000
@@ -538,6 +539,7 @@ static void wpas_pr_ranging_params(void *ctx, const u8 *dev_addr,
 	 * Cleanup happens on COMPLETE event or session timeout.
 	 */
 	eloop_cancel_timeout(wpas_pr_pasn_timeout, wpa_s, NULL);
+	wpas_pr_pasn_auth_work_done(wpa_s);
 
 	/* Trigger ranging measurement after successful PASN authentication */
 	if (wpas_pr_trigger_ranging(wpa_s, peer_addr, freq, op_class,
@@ -982,6 +984,24 @@ static void wpas_pr_pasn_cancel_auth_work(struct wpa_supplicant *wpa_s)
 }
 
 
+/**
+ * wpas_pr_pasn_auth_work_done - Release PASN auth radio work
+ */
+static void wpas_pr_pasn_auth_work_done(struct wpa_supplicant *wpa_s)
+{
+	struct wpa_pr_pasn_auth_work *awork;
+
+	if (!wpa_s->pr_pasn_auth_work)
+		return;
+
+	awork = wpa_s->pr_pasn_auth_work->ctx;
+	wpas_pr_pasn_free_auth_work(awork);
+	wpa_s->pr_pasn_auth_work->ctx = NULL;
+	radio_work_done(wpa_s->pr_pasn_auth_work);
+	wpa_s->pr_pasn_auth_work = NULL;
+}
+
+
 /**
  * wpas_pr_pasn_roc_work_done - Idempotent helper to complete ROC radio work
  */
-- 
2.34.1




More information about the Hostap mailing list