[PATCH 6/6] driver_nl80211: use p2p interface types

Johannes Berg johannes
Fri Sep 17 11:16:28 PDT 2010

On Thu, 2010-09-16 at 15:03 +0200, Johannes Berg wrote:

> This modifies the nl80211 driver to no longer
> use interface modes but rather use interface
> types throughout, and then also use the new
> p2p interface types. Additionally, the ability
> to use p2p is now discovered based on the
> supported interface types.

Suck. Clearly, I didn't pay attention.

> @@ -4125,6 +4152,7 @@ static int wpa_driver_nl80211_associate(
>  	struct wpa_driver_nl80211_data *drv = bss->drv;
>  	int ret = -1;
>  	struct nl_msg *msg;
> +	enum nl80211_iftype wanted_iftype = NL80211_IFTYPE_STATION;
>  	if (params->mode == IEEE80211_MODE_AP)
>  		return wpa_driver_nl80211_ap(drv, params);
> @@ -4132,8 +4160,11 @@ static int wpa_driver_nl80211_associate(
>  	if (params->mode == IEEE80211_MODE_IBSS)
>  		return wpa_driver_nl80211_ibss(drv, params);
> +	if (params->p2p)
> +		wanted_iftype = NL80211_IFTYPE_P2P_CLIENT;

This (and probably the corresponding AP code?) will _always_ select p2p,
because params->p2p will be set to true whenever p2p support is compiled
in, and wpa_s is configured with p2p support, even though it's a
connection to a legacy AP (which may or may not be doing p2p enterprise

#ifdef CONFIG_P2P
        if (wpa_s->global->p2p &&
            (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_CAPABLE))
                params.p2p = 1;
#endif /* CONFIG_P2P */

Is this intentional? Is there any (other) way to distinguish between a
"regular" connection, even if that includes advertising p2p
functionality for purposes of managed p2p? The intent of my work here
was to make such connections with the regular managed interface type,
not p2p-client.


More information about the Hostap mailing list