MAC2STR(mgmt->da), acked);
ret = wpa_pasn_auth_tx_status(pasn, data, data_len, acked);
+ if (ret == 1 && acked && pr->cfg->pasn_result)
+ pr->cfg->pasn_result(pr->cfg->cb_ctx, dev->ranging_role,
+ dev->protocol_type, dev->final_op_class,
+ dev->final_op_channel, pr->cfg->country);
wpabuf_free(pasn->frame);
pasn->frame = NULL;
wpa_printf(MSG_INFO, "PR PASN: Failed to handle Auth3");
goto fail;
}
+
+ if (pr->cfg->pasn_result)
+ pr->cfg->pasn_result(pr->cfg->cb_ctx, dev->ranging_role,
+ dev->protocol_type, dev->final_op_class,
+ dev->final_op_channel, pr->cfg->country);
return 0;
fail:
int (*pasn_send_mgmt)(void *ctx, const u8 *data, size_t data_len,
int noack, unsigned int freq, unsigned int wait);
+ void (*pasn_result)(void *ctx, u8 role, u8 protocol_type, u8 op_class,
+ u8 op_channel, const char *country);
void (*set_keys)(void *ctx, const u8 *own_addr, const u8 *peer_addr,
int cipher, int akmp, struct wpa_ptk *ptk);
/* PASN authentication status */
#define PASN_AUTH_STATUS "PASN-AUTH-STATUS "
+/* Result of PASN performed for Proximity Ranging
+ * <result> role=<role> protocol=<protocol type> opclass=<op class> channel=<op channel> cc=<country>
+ */
+#define PR_PASN_RESULT "PR-PASN-RESULT "
+
/* BSS command information masks */
#define WPA_BSS_MASK_ALL 0xFFFDFFFF
}
#endif /* CONFIG_NAN_USD */
+
+
+void wpas_notify_pr_pasn_result(struct wpa_supplicant *wpa_s, u8 role,
+ u8 protocol_type, u8 op_class, u8 op_channel,
+ const char *country)
+{
+ wpa_msg_global(wpa_s, MSG_INFO, PR_PASN_RESULT
+ "SUCCESS role=%u protocol=%u opclass=%u channel=%u cc=%c%c",
+ role, protocol_type, op_class, op_channel,
+ country[0], country[1]);
+}
void wpas_notify_nan_subscribe_terminated(struct wpa_supplicant *wpa_s,
int subscribe_id,
enum nan_de_reason reason);
+void wpas_notify_pr_pasn_result(struct wpa_supplicant *wpa_s, u8 role,
+ u8 protocol_type, u8 op_class, u8 op_channel,
+ const char *country);
#endif /* NOTIFY_H */
#include "p2p/p2p.h"
#include "wpa_supplicant_i.h"
#include "config.h"
+#include "notify.h"
#include "driver_i.h"
#include "pr_supplicant.h"
}
+static void wpas_pr_pasn_result(void *ctx, u8 role, u8 protocol_type,
+ u8 op_class, u8 op_channel, const char *country)
+{
+ struct wpa_supplicant *wpa_s = ctx;
+
+ wpas_notify_pr_pasn_result(wpa_s, role, protocol_type, op_class,
+ op_channel, country);
+}
+
+
static void wpas_pr_pasn_set_keys(void *ctx, const u8 *own_addr,
const u8 *peer_addr, int cipher, int akmp,
struct wpa_ptk *ptk)
pr.support_6ghz = wpas_is_6ghz_supported(wpa_s, true);
pr.pasn_send_mgmt = wpas_pr_pasn_send_mgmt;
+ pr.pasn_result = wpas_pr_pasn_result;
pr.set_keys = wpas_pr_pasn_set_keys;
pr.clear_keys = wpas_pr_pasn_clear_keys;