Patchwork [v2,01/10] nl80211_driver: Identify if nl80211 is capable of p2p device abstraction

login
register
mail settings
Submitter dvdspndl@gmail.com
Date March 17, 2013, 8:57 p.m.
Message ID <1363553840-7844-2-git-send-email-dvdspndl@gmail.com>
Download mbox | patch
Permalink /patch/228320/
State Changes Requested
Headers show

Comments

dvdspndl@gmail.com - March 17, 2013, 8:57 p.m.
From: Nirav Shah <nirav.j2.shah@intel.com>

Check the supported interfaces attribute to identify support for
a dedicated p2p device interface type. If set update the driver
capabilities flag to notify the supplicant.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
---
 src/drivers/driver.h         |   12 ++++++++++--
 src/drivers/driver_nl80211.c |   12 ++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)
Arend van Spriel - March 18, 2013, 2:30 p.m.
On 03/17/2013 09:57 PM, David Spinadel wrote:
> From: Nirav Shah <nirav.j2.shah@intel.com>
>
> Check the supported interfaces attribute to identify support for
> a dedicated p2p device interface type. If set update the driver
> capabilities flag to notify the supplicant.
>
> Signed-off-by: David Spinadel <david.spinadel@intel.com>
> ---
>   src/drivers/driver.h         |   12 ++++++++++--
>   src/drivers/driver_nl80211.c |   12 ++++++++++++
>   2 files changed, 22 insertions(+), 2 deletions(-)
>
[...]
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index b2dc813..cf15603 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -2557,6 +2557,7 @@ struct wiphy_info_data {
>   	unsigned int p2p_client_supported:1;
>   	unsigned int p2p_concurrent:1;
>   	unsigned int p2p_multichan_concurrent:1;
> +	unsigned int p2p_device_supported:1;
>   };
>
>
> @@ -2600,6 +2601,9 @@ static void wiphy_info_supported_iftypes(struct wiphy_info_data *info,
>   		case NL80211_IFTYPE_P2P_CLIENT:
>   			info->p2p_client_supported = 1;
>   			break;
> +		case NL80211_IFTYPE_P2P_DEVICE:
> +			info->p2p_device_supported = 1;
> +			break;
>   		case NL80211_IFTYPE_MONITOR:
>   			info->monitor_supported = 1;
>   			break;
> @@ -2871,6 +2875,10 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
>
>   	if (info->p2p_go_supported && info->p2p_client_supported)
>   		drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
> +
> +	if (p2p_device_supported)

This does not build for obvious reasons. Should be:
+	if (info->p2p_device_supported)

> +		capa->flags |= WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;
> +
>   	if (info->p2p_concurrent) {
>   		wpa_printf(MSG_DEBUG, "nl80211: Use separate P2P group "
>   			   "interface (driver advertised support)");
> @@ -6168,6 +6176,8 @@ static const char * nl80211_iftype_str(enum nl80211_iftype mode)
>   		return "P2P_CLIENT";
>   	case NL80211_IFTYPE_P2P_GO:
>   		return "P2P_GO";
> +	case NL80211_IFTYPE_P2P_DEVICE:
> +		return "P2P_DEVICE";
>   	default:
>   		return "unknown";
>   	}
> @@ -8336,6 +8346,8 @@ static enum nl80211_iftype wpa_driver_nl80211_if_type(
>   		return NL80211_IFTYPE_AP;
>   	case WPA_IF_P2P_GO:
>   		return NL80211_IFTYPE_P2P_GO;
> +	case WPA_IF_P2P_DEVICE:
> +		return NL80211_IFTYPE_P2P_DEVICE;
>   	}
>   	return -1;
>   }
>
Arend van Spriel - March 18, 2013, 2:32 p.m.
On 03/17/2013 09:57 PM, David Spinadel wrote:
> From: Nirav Shah <nirav.j2.shah@intel.com>
>
> Check the supported interfaces attribute to identify support for
> a dedicated p2p device interface type. If set update the driver
> capabilities flag to notify the supplicant.
>
> Signed-off-by: David Spinadel <david.spinadel@intel.com>
> ---
>   src/drivers/driver.h         |   12 ++++++++++--
>   src/drivers/driver_nl80211.c |   12 ++++++++++++
>   2 files changed, 22 insertions(+), 2 deletions(-)
>

> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index b2dc813..cf15603 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -2871,6 +2875,10 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
>
>   	if (info->p2p_go_supported && info->p2p_client_supported)
>   		drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
> +
> +	if (p2p_device_supported)
> +		capa->flags |= WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;

and:
		drv->capa.flags |= WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;

> +
>   	if (info->p2p_concurrent) {
>   		wpa_printf(MSG_DEBUG, "nl80211: Use separate P2P group "
>   			   "interface (driver advertised support)");
Spinadel, David - March 18, 2013, 2:56 p.m.
Sorry. Will resend later. Waiting for some more comments for the last fixes.

Thanks,
David 

> -----Original Message-----
> From: hostap-bounces@lists.shmoo.com [mailto:hostap-
> bounces@lists.shmoo.com] On Behalf Of Arend van Spriel
> Sent: Monday, March 18, 2013 16:33
> To: David Spinadel
> Cc: hostap@lists.shmoo.com
> Subject: Re: [PATCH v2 01/10] nl80211_driver: Identify if nl80211 is capable of
> p2p device abstraction
> 
> On 03/17/2013 09:57 PM, David Spinadel wrote:
> > From: Nirav Shah <nirav.j2.shah@intel.com>
> >
> > Check the supported interfaces attribute to identify support for a
> > dedicated p2p device interface type. If set update the driver
> > capabilities flag to notify the supplicant.
> >
> > Signed-off-by: David Spinadel <david.spinadel@intel.com>
> > ---
> >   src/drivers/driver.h         |   12 ++++++++++--
> >   src/drivers/driver_nl80211.c |   12 ++++++++++++
> >   2 files changed, 22 insertions(+), 2 deletions(-)
> >
> 
> > diff --git a/src/drivers/driver_nl80211.c
> > b/src/drivers/driver_nl80211.c index b2dc813..cf15603 100644
> > --- a/src/drivers/driver_nl80211.c
> > +++ b/src/drivers/driver_nl80211.c
> > @@ -2871,6 +2875,10 @@ static int wpa_driver_nl80211_get_info(struct
> > wpa_driver_nl80211_data *drv,
> >
> >   	if (info->p2p_go_supported && info->p2p_client_supported)
> >   		drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
> > +
> > +	if (p2p_device_supported)
> > +		capa->flags |=
> WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;
> 
> and:
> 		drv->capa.flags |=
> WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;
> 
> > +
> >   	if (info->p2p_concurrent) {
> >   		wpa_printf(MSG_DEBUG, "nl80211: Use separate P2P group
> "
> >   			   "interface (driver advertised support)");
> 
> 
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Johannes Berg - April 9, 2013, 1:41 p.m.
On Sun, 2013-03-17 at 22:57 +0200, David Spinadel wrote:

> @@ -2871,6 +2875,10 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
>  
>  	if (info->p2p_go_supported && info->p2p_client_supported)
>  		drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
> +
> +	if (p2p_device_supported)
> +		capa->flags |= WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;

Doesn't that have to be info->... to even compile?

johannes
Arend van Spriel - April 9, 2013, 1:45 p.m.
On 04/09/2013 03:41 PM, Johannes Berg wrote:
> On Sun, 2013-03-17 at 22:57 +0200, David Spinadel wrote:
>
>> @@ -2871,6 +2875,10 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
>>
>>   	if (info->p2p_go_supported && info->p2p_client_supported)
>>   		drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
>> +
>> +	if (p2p_device_supported)
>> +		capa->flags |= WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;
>
> Doesn't that have to be info->... to even compile?

It does. At least with my compiler :-)

I notified David some time ago about it. I guess there should be a v3 
series. I guess after the probe_req reporting issue I mentioned last 
week has been looked into.

Regards,
Arend

Patch

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index ab6907d..9ccd8ce 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -824,7 +824,7 @@  struct wpa_driver_capa {
  * it cannot be used for P2P group operations or non-P2P purposes.
  */
 #define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE	0x00000400
-/* This interface is P2P capable (P2P Device, GO, or P2P Client */
+/* This interface is P2P capable (P2P GO, or P2P Client */
 #define WPA_DRIVER_FLAGS_P2P_CAPABLE	0x00000800
 /* Driver supports concurrent operations on multiple channels */
 #define WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT	0x00001000
@@ -866,6 +866,8 @@  struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_OBSS_SCAN			0x04000000
 /* Driver supports IBSS (Ad-hoc) mode */
 #define WPA_DRIVER_FLAGS_IBSS				0x08000000
+/* Driver supports a dedicated interface for p2p device */
+#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE		0x10000000
 	unsigned int flags;
 
 	int max_scan_ssids;
@@ -984,7 +986,13 @@  enum wpa_driver_if_type {
 	 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
 	 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
 	 */
-	WPA_IF_P2P_GROUP
+	WPA_IF_P2P_GROUP,
+
+	/**
+	 * WPA_IF_P2P_DEVICE - P2P device interface is used to indentify the
+	 * abstracted p2p device function in the driver
+	 */
+	WPA_IF_P2P_DEVICE
 };
 
 struct wpa_init_params {
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index b2dc813..cf15603 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2557,6 +2557,7 @@  struct wiphy_info_data {
 	unsigned int p2p_client_supported:1;
 	unsigned int p2p_concurrent:1;
 	unsigned int p2p_multichan_concurrent:1;
+	unsigned int p2p_device_supported:1;
 };
 
 
@@ -2600,6 +2601,9 @@  static void wiphy_info_supported_iftypes(struct wiphy_info_data *info,
 		case NL80211_IFTYPE_P2P_CLIENT:
 			info->p2p_client_supported = 1;
 			break;
+		case NL80211_IFTYPE_P2P_DEVICE:
+			info->p2p_device_supported = 1;
+			break;
 		case NL80211_IFTYPE_MONITOR:
 			info->monitor_supported = 1;
 			break;
@@ -2871,6 +2875,10 @@  static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
 
 	if (info->p2p_go_supported && info->p2p_client_supported)
 		drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
+
+	if (p2p_device_supported)
+		capa->flags |= WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;
+
 	if (info->p2p_concurrent) {
 		wpa_printf(MSG_DEBUG, "nl80211: Use separate P2P group "
 			   "interface (driver advertised support)");
@@ -6168,6 +6176,8 @@  static const char * nl80211_iftype_str(enum nl80211_iftype mode)
 		return "P2P_CLIENT";
 	case NL80211_IFTYPE_P2P_GO:
 		return "P2P_GO";
+	case NL80211_IFTYPE_P2P_DEVICE:
+		return "P2P_DEVICE";
 	default:
 		return "unknown";
 	}
@@ -8336,6 +8346,8 @@  static enum nl80211_iftype wpa_driver_nl80211_if_type(
 		return NL80211_IFTYPE_AP;
 	case WPA_IF_P2P_GO:
 		return NL80211_IFTYPE_P2P_GO;
+	case WPA_IF_P2P_DEVICE:
+		return NL80211_IFTYPE_P2P_DEVICE;
 	}
 	return -1;
 }