[PATCH v3 14/46] PR: Replace format_and_bw attribute with preamble/BW bitmaps

Jouni Malinen j at w1.fi
Thu May 21 00:53:42 PDT 2026


On Wed, May 13, 2026 at 03:29:38PM +0530, Kavita Kavita wrote:
> The PD ranging capability used a single format-and-bandwidth
> attribute in wpa_driver_capa to represent the best supported
> combination. This only considered the highest supported bandwidth
> and assumed all lower bandwidths were also supported, which is
> not always the case. The channel population logic inherited the
> same assumption.
> 
> Replace the attribute with separate preamble and bandwidth
> bitmaps so each supported combination is explicitly represented.
> Parse the corresponding nl80211 attributes to populate these
> bitmaps and remove the now redundant attribute from driver.h.
> Update the channel population logic to check each operating
> class bandwidth directly against the bitmap rather than
> inferring support from the highest supported value.

What is that discussion about parsing nl80211 attributes about? This
patch does not include any changes to src/drivers/driver_nl80211*.c.

> diff --git a/src/common/proximity_ranging.h b/src/common/proximity_ranging.h
> @@ -98,6 +98,7 @@ enum edca_format_and_bw_value {
>  	EDCA_FORMAT_AND_BW_VHT160_SINGLE_LO = 16,
> +	EDCA_FORMAT_AND_BW_MAX,

>  /**
> @@ -114,6 +115,7 @@ enum ntb_format_and_bw_value {
>  	NTB_FORMAT_AND_BW_HE160_SINGLE_LO = 5,
> +	NTB_FORMAT_AND_BW_MAX,

How exactly are these values expected to be used? Aren't those only for
implementation specific purposes to indicate no matching value was
found? However, the implementation seems to be encoding these in
pr_get_edca_capabilities() into an actual capability field.. Is that
expected? It was a bit difficult to understand the changes since these
*_FORMAT_AND_BW_MAX values were actually not checked against anywhere,
i.e., they were only returned when there was no match.

> diff --git a/src/drivers/driver.h b/src/drivers/driver.h
>  
> +/**
> + * Channel width index values used in PD ranging capability bitmaps
> + * (pd_bandwidths). The bit position in the bitmap corresponds to the
> + * channel width; these values match the nl80211_chan_width enum so
> + * that drivers can use them directly.
> + */
> +#define WPA_PR_CHAN_WIDTH_20		1
> +#define WPA_PR_CHAN_WIDTH_40		2
> +#define WPA_PR_CHAN_WIDTH_80		3
> +#define WPA_PR_CHAN_WIDTH_80P80	4
> +#define WPA_PR_CHAN_WIDTH_160		5
> +
> +/**
> + * Preamble index values used in PD ranging capability bitmaps
> + * (pd_preambles). The bit position in the bitmap corresponds to the
> + * preamble type; these values match the nl80211_preamble enum so
> + * that drivers can use them directly.
> + */
> +#define WPA_PR_PREAMBLE_HT	1
> +#define WPA_PR_PREAMBLE_VHT	2
> +#define WPA_PR_PREAMBLE_HE	4

It is not a good idea to try to match values of nl80211.h enums in this
manner in a context that is supposed to be independent of the driver
interface. In other words, the references to nl80211 needs to be removed
here and driver_nl80211*.c should use mapping functions between the
wpa_supplicant specific values and the values in nl80211.h.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list