diff mbox

[02/20] driver: nl80211: Identify if nl80211 is capable of p2p device abstraction

Message ID 1368710915-32176-3-git-send-email-arend@broadcom.com
State Superseded
Headers show

Commit Message

Arend van Spriel May 16, 2013, 1:28 p.m. UTC
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 |    8 ++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

Comments

Johannes Berg May 16, 2013, 1:40 p.m. UTC | #1
On Thu, 2013-05-16 at 15:28 +0200, Arend van Spriel wrote:

>  #define WPA_DRIVER_FLAGS_RADAR				0x10000000
> +/* Driver supports a dedicated interface for p2p device */
> +#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE		0x10000000

I think you botched that rebase :-)

joahnnes
Arend van Spriel May 16, 2013, 1:46 p.m. UTC | #2
On 05/16/2013 03:40 PM, Johannes Berg wrote:
> On Thu, 2013-05-16 at 15:28 +0200, Arend van Spriel wrote:
>
>>   #define WPA_DRIVER_FLAGS_RADAR				0x10000000
>> +/* Driver supports a dedicated interface for p2p device */
>> +#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE		0x10000000
>
> I think you botched that rebase :-)

Crap. I forgot to change the digit when resolving the conflict. Thanks.

Regards,
Arend
diff mbox

Patch

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 59102a4..56a1e60 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -830,7 +830,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
@@ -874,6 +874,8 @@  struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_IBSS				0x08000000
 /* Driver supports radar detection */
 #define WPA_DRIVER_FLAGS_RADAR				0x10000000
+/* Driver supports a dedicated interface for p2p device */
+#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE		0x10000000
 	unsigned int flags;
 
 	int max_scan_ssids;
@@ -1001,7 +1003,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 6cc47cc..b304ddd 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2653,6 +2653,10 @@  static void wiphy_info_supported_iftypes(struct wiphy_info_data *info,
 		case NL80211_IFTYPE_ADHOC:
 			info->capa->flags |= WPA_DRIVER_FLAGS_IBSS;
 			break;
+		case NL80211_IFTYPE_P2P_DEVICE:
+			info->capa->flags |=
+				WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;
+			break;
 		case NL80211_IFTYPE_P2P_GO:
 			info->p2p_go_supported = 1;
 			break;
@@ -6280,6 +6284,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";
 	}
@@ -8442,6 +8448,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;
 }