[PATCH v3 01/36] PR: Initialize Proximity Ranging global context
Benjamin Berg
benjamin at sipsolutions.net
Mon Oct 20 01:55:13 PDT 2025
Hi,
On Thu, 2025-08-28 at 21:12 +0530, Peddolla Harshavardhan Reddy wrote:
> Add changes to initialize and deinitialize the Proximity Ranging(PR)
> global context and Makefile changes to enable the compilation of
> this feature. The Proximity Ranging context will be global making it
> common to all interfaces.
>
> The compilation of changes related to Proximity Ranging can be
> enabled using the CONFIG_PR flag.
>
> Signed-off-by: Peddolla Harshavardhan Reddy <peddolla at qti.qualcomm.com>
> [SNIP]
> diff --git a/wpa_supplicant/pr_supplicant.h b/wpa_supplicant/pr_supplicant.h
> new file mode 100644
> index 000000000..0fffd5c35
> --- /dev/null
> +++ b/wpa_supplicant/pr_supplicant.h
> @@ -0,0 +1,31 @@
> +/*
> + * Proxmity Ranging
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + *
> + * This software may be distributed under the terms of the BSD license.
> + * See README for more details.
> + */
> +
> +#ifndef PR_SUPPLICANT_H
> +#define PR_SUPPLICANT_H
> +
> +#include "common/proximity_ranging.h"
> +
> +#ifdef CONFIG_PR
> +
> +int wpas_pr_init(struct wpa_global *global, struct wpa_supplicant *wpa_s);
> +void wpas_pr_deinit(struct wpa_supplicant *wpa_s);
> +#else /* CONFIG_PR */
> +static inline int wpas_pr_init(struct wpa_global *global,
> + struct wpa_supplicant *wpa_s)
> +{
> + return -1;
> +}
This is currently breaking the hwsim tests. The CONFIG_PR= option is no
(yet) set in the example configuration. As PR cannot be initialized,
everything immediately fails.
Benjamin
> +static inline void wpas_pr_deinit(struct wpa_supplicant *wpa_s)
> +{
> +}
> +
> +#endif /* CONFIG_PR */
> +
> +#endif /*PR_SUPPLICANT_H */
> diff --git a/wpa_supplicant/wpa_supplicant.c
> b/wpa_supplicant/wpa_supplicant.c
> index 0586c371a..3c8cc0727 100644
> --- a/wpa_supplicant/wpa_supplicant.c
> +++ b/wpa_supplicant/wpa_supplicant.c
> @@ -66,6 +66,7 @@
> #include "mesh.h"
> #include "dpp_supplicant.h"
> #include "nan_usd.h"
> +#include "pr_supplicant.h"
> #ifdef CONFIG_MESH
> #include "ap/ap_config.h"
> #include "ap/hostapd.h"
> @@ -740,6 +741,8 @@ static void wpa_supplicant_cleanup(struct
> wpa_supplicant *wpa_s)
>
> wpas_p2p_deinit(wpa_s);
>
> + wpas_pr_deinit(wpa_s);
> +
> #ifdef CONFIG_OFFCHANNEL
> offchannel_deinit(wpa_s);
> #endif /* CONFIG_OFFCHANNEL */
> @@ -7919,7 +7922,6 @@ static int wpa_supplicant_init_iface(struct
> wpa_supplicant *wpa_s,
> if (wpas_nan_usd_init(wpa_s) < 0)
> return -1;
> #endif /* CONFIG_NAN_USD */
> -
> if (wpa_supplicant_init_eapol(wpa_s) < 0)
> return -1;
> wpa_sm_set_eapol(wpa_s->wpa, wpa_s->eapol);
> @@ -7959,6 +7961,9 @@ static int wpa_supplicant_init_iface(struct
> wpa_supplicant *wpa_s,
> return -1;
> }
>
> + if (wpas_pr_init(wpa_s->global, wpa_s) < 0)
> + return -1;
> +
> if (wpa_bss_init(wpa_s) < 0)
> return -1;
>
> diff --git a/wpa_supplicant/wpa_supplicant_i.h
> b/wpa_supplicant/wpa_supplicant_i.h
> index 2f77413d5..cc8ee34ad 100644
> --- a/wpa_supplicant/wpa_supplicant_i.h
> +++ b/wpa_supplicant/wpa_supplicant_i.h
> @@ -288,9 +288,11 @@ struct wpa_global {
> size_t drv_count;
> struct os_time suspend_time;
> struct p2p_data *p2p;
> + struct pr_data *pr;
> struct wpa_supplicant *p2p_init_wpa_s;
> struct wpa_supplicant *p2p_group_formation;
> struct wpa_supplicant *p2p_invite_group;
> + struct wpa_supplicant *pr_init_wpa_s;
> u8 p2p_dev_addr[ETH_ALEN];
> struct os_reltime p2p_go_wait_client;
> struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */
More information about the Hostap
mailing list