]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PR: Handle PR PASN auth TX status
authorPeddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
Sat, 26 Apr 2025 20:58:07 +0000 (02:28 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 17 Oct 2025 10:22:51 +0000 (13:22 +0300)
Check if an ACK is received for transmitted PASN frame that contains
Proximity Ranging element(s).

Signed-off-by: Peddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
src/common/proximity_ranging.c
src/common/proximity_ranging.h
wpa_supplicant/events.c
wpa_supplicant/pr_supplicant.c
wpa_supplicant/pr_supplicant.h

index 7f842bc24668c781e0806a7543aaea951a0be106..79a6f3a2dbbcd3886bdd72ca39cc48b7ee86451d 100644 (file)
@@ -1539,4 +1539,35 @@ 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_INFO, "PR PASN: Peer not found " MACSTR,
+                          MAC2STR(mgmt->da));
+               return -1;
+       }
+
+       pasn = dev->pasn;
+       wpa_printf(MSG_DEBUG, "PR PASN: TX status from " MACSTR " ack=%d",
+                  MAC2STR(mgmt->da), acked);
+
+       ret = wpa_pasn_auth_tx_status(pasn, data, data_len, acked);
+       wpabuf_free(pasn->frame);
+       pasn->frame = NULL;
+
+       return ret;
+}
+
 #endif /* CONFIG_PASN */
index bae16dcfc96e9f540dbe9d34a6aadc3e86d49292..9dc75719b27b8434c929a1cbb34a3dda2fdd7156 100644 (file)
@@ -467,5 +467,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 */
index 9d5024c43e5dc3e30e120e0a0566713005c93a32..0d62440267a6eda20db1608c6d518fe44a402f51 100644 (file)
@@ -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
@@ -6486,6 +6487,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,
index 7f7fdf143d9c84411c919f32afe28039226c82e1..5bdb121c99ff38c2405b47decd9e6f951ae37c92 100644 (file)
@@ -526,4 +526,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 */
index 920a859ec2529c57cb0b623ccad2cb616621f16f..b4c1283051764817459b06c565ed5027bfc42915 100644 (file)
@@ -25,6 +25,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 */
 
@@ -63,6 +65,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 */