[PATCH 1/5] nl80211: add HW capabilities parsing support

Sven Eckelmann sven at narfation.org
Fri Jun 14 05:10:53 PDT 2019

On Tuesday, 16 April 2019 14:33:57 CEST John Crispin wrote:
> Add code to parse the iftype element when reading the band info. This is
> required to find out about the HE capabilities of an AP.
> Signed-off-by: Shashidhar Lakkavalli <slakkavalli at datto.com>
> Signed-off-by: John Crispin <john at phrozen.org>
> ---
> +static int phy_info_iftype(struct hostapd_hw_modes *mode, struct nlattr *nl_iftype)
> +{
> +       struct nlattr *tb_band_iftypes[NL80211_BAND_IFTYPE_ATTR_MAX + 1];
> +       struct he_capabilities *he_capab = &mode->he_capab;
> +       struct nlattr *tb_iftypes[NL80211_IFTYPE_MAX + 1];
> +       int len;
> +
> +       nla_parse(tb_band_iftypes, NL80211_BAND_IFTYPE_ATTR_MAX, nla_data(nl_iftype),
> +                 nla_len(nl_iftype), NULL);
> +
> +       if (!tb_band_iftypes[NL80211_BAND_IFTYPE_ATTR_IFTYPES])
> +               return NL_STOP;
> +
> +       if (nla_parse_nested(tb_iftypes, NL80211_IFTYPE_MAX, tb_band_iftypes[NL80211_BAND_IFTYPE_ATTR_IFTYPES], NULL))
> +               return NL_STOP;
> +
> +       if (!nla_get_flag(tb_iftypes[NL80211_IFTYPE_AP]))
> +               return NL_OK;

This looks wrong - or at least too limited. nl80211 exports this information 
not only for AP but for all other iftypes. So for all other iftypes than AP 
(which hostapd+wpa_supplicant supports) the extracted information most likely
is incorrect.

Seems like we need to extend this. I was first trying to extend 
get_hw_feature_data to accept a opmode but it turns out that wpa_supplicant 
doesn't have a concept of opmode for an interface - only for ssid. So we need 
to change this parsing function to actually get the he_capab for all iftypes 
and not only for APs.

Since the code for the he_capab (just checked 
1b90aae9299f0a8618001b38882317787a690485..HEAD) came from you: Do you have 
patches in the pipeline which modify the he_capab? Because these might
also need further adjustments.

Kind regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20190614/1f0573af/attachment.sig>

More information about the Hostap mailing list