[RFC PATCH 20/34] Add support to handle PR PASN auth tx status
Peddolla Harshavardhan Reddy
peddolla at qti.qualcomm.com
Thu May 15 00:17:43 PDT 2025
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla at qti.qualcomm.com>
---
src/common/proximity_ranging.c | 35 ++++++++++++++++++++++++++++++++++
src/common/proximity_ranging.h | 2 ++
wpa_supplicant/events.c | 12 ++++++++++++
wpa_supplicant/pr_supplicant.c | 12 ++++++++++++
wpa_supplicant/pr_supplicant.h | 9 +++++++++
5 files changed, 70 insertions(+)
diff --git a/src/common/proximity_ranging.c b/src/common/proximity_ranging.c
index fd487450c..9c2f47627 100644
--- a/src/common/proximity_ranging.c
+++ b/src/common/proximity_ranging.c
@@ -1461,4 +1461,39 @@ out:
return ret;
}
+
+int pr_pasn_auth_tx_status(struct pr_data *pr, const u8 *data, size_t data_len,
+ bool acked)
+{
+ int ret = 0;
+ struct pr_device *dev;
+ struct pasn_data *pasn;
+ const struct ieee80211_mgmt *mgmt =
+ (const struct ieee80211_mgmt *) data;
+
+ if (!pr)
+ return -1;
+
+ dev = pr_get_device(pr, mgmt->da);
+ if (!dev || !dev->pasn) {
+ wpa_printf(MSG_DEBUG, "PR PASN: Peer not found " MACSTR,
+ MAC2STR(mgmt->da));
+ return -1;
+ }
+
+ pasn = dev->pasn;
+ wpa_printf(MSG_DEBUG, "PR PASN: ACK received From " MACSTR,
+ MAC2STR(mgmt->da));
+
+ ret = wpa_pasn_auth_tx_status(pasn, data, data_len, acked);
+ if (ret != 1 && !acked && pasn->frame)
+ return pasn->send_mgmt(pasn->cb_ctx, wpabuf_head(pasn->frame),
+ wpabuf_len(pasn->frame), 0, pasn->freq,
+ 1000);
+ wpabuf_free(pasn->frame);
+ pasn->frame = NULL;
+
+ return 0;
+}
+
#endif /* CONFIG_PASN */
diff --git a/src/common/proximity_ranging.h b/src/common/proximity_ranging.h
index a55b55298..6c44505f3 100644
--- a/src/common/proximity_ranging.h
+++ b/src/common/proximity_ranging.h
@@ -405,5 +405,7 @@ void pr_process_usd_elems(struct pr_data *pr, const u8 *ies, u16 ies_len,
int pr_initiate_pasn_auth(struct pr_data *pr, const u8 *addr, int freq,
u8 auth_mode, u8 ranging_role, u8 ranging_type,
int forced_pr_freq);
+int pr_pasn_auth_tx_status(struct pr_data *pr, const u8 *data, size_t data_len,
+ bool acked);
#endif /* PROXIMITY_RANGING_H */
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index fe8e45e07..ccd7ee1e9 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -53,6 +53,7 @@
#include "wmm_ac.h"
#include "nan_usd.h"
#include "dpp_supplicant.h"
+#include "pr_supplicant.h"
#define MAX_OWE_TRANSITION_BSS_SELECT_COUNT 5
@@ -6415,6 +6416,17 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
data->tx_status.ack) == 0)
break;
#endif /* CONFIG_P2P */
+#ifdef CONFIG_PR
+ if (data->tx_status.type == WLAN_FC_TYPE_MGMT &&
+ data->tx_status.stype == WLAN_FC_STYPE_AUTH &&
+ !wpa_s->pasn_auth_work &&
+ wpa_s->pr_pasn_auth_work &&
+ wpas_pr_pasn_auth_tx_status(wpa_s,
+ data->tx_status.data,
+ data->tx_status.data_len,
+ data->tx_status.ack) == 0)
+ break;
+#endif /* CONFIG_PR */
if (data->tx_status.type == WLAN_FC_TYPE_MGMT &&
data->tx_status.stype == WLAN_FC_STYPE_AUTH &&
wpas_pasn_auth_tx_status(wpa_s, data->tx_status.data,
diff --git a/wpa_supplicant/pr_supplicant.c b/wpa_supplicant/pr_supplicant.c
index 0ec4ca828..19ed04d0c 100644
--- a/wpa_supplicant/pr_supplicant.c
+++ b/wpa_supplicant/pr_supplicant.c
@@ -347,4 +347,16 @@ int wpas_pr_initiate_pasn_auth(struct wpa_supplicant *wpa_s,
return 0;
}
+
+int wpas_pr_pasn_auth_tx_status(struct wpa_supplicant *wpa_s, const u8 *data,
+ size_t data_len, bool acked)
+{
+ struct pr_data *pr = wpa_s->global->pr;
+
+ if (!wpa_s->pr_pasn_auth_work)
+ return -1;
+
+ return pr_pasn_auth_tx_status(pr, data, data_len, acked);
+}
+
#endif /* CONFIG_PASN */
diff --git a/wpa_supplicant/pr_supplicant.h b/wpa_supplicant/pr_supplicant.h
index 4f082fb5d..df5251c3b 100644
--- a/wpa_supplicant/pr_supplicant.h
+++ b/wpa_supplicant/pr_supplicant.h
@@ -26,6 +26,8 @@ int wpas_pr_initiate_pasn_auth(struct wpa_supplicant *wpa_s,
const u8 *peer_addr, int freq, u8 auth_mode,
u8 ranging_role, u8 ranging_type,
int forced_pr_freq);
+int wpas_pr_pasn_auth_tx_status(struct wpa_supplicant *wpa_s, const u8 *data,
+ size_t data_len, bool acked);
#else /* CONFIG_PR */
static inline int wpas_pr_init(struct wpa_global *global,
struct wpa_supplicant *wpa_s)
@@ -62,6 +64,13 @@ static inline int wpas_pr_initiate_pasn_auth(struct wpa_supplicant *wpa_s,
return 0;
}
+static inline int wpas_pr_pasn_auth_tx_status(struct wpa_supplicant *wpa_s,
+ const u8 *data, size_t data_len,
+ bool acked)
+{
+ return 0;
+}
+
#endif /* CONFIG_PR */
#endif /*PR_SUPPLICANT_H */
--
2.34.1
More information about the Hostap
mailing list