Patchwork [RFC,3/3] driver: add new P2P device interface type

login
register
mail settings
Submitter Arend van Spriel
Date Jan. 12, 2013, 4:28 p.m.
Message ID <1358008099-11846-4-git-send-email-arend@broadcom.com>
Download mbox | patch
Permalink /patch/211509/
State Superseded
Headers show

Comments

Arend van Spriel - Jan. 12, 2013, 4:28 p.m.
The nl80211 api introduced the concept of a P2P device used
for P2P management operations. This patch introduces this
concept in the supplicant driver interface.

Cc: David Spinadel <david.spinadel@intel.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Greg Goldman <ggoldman@broadcom.com>
Signed-hostap: Arend van Spriel <arend@broadcom.com>
---
 src/drivers/driver.h         |    9 +++++++++
 src/drivers/driver_nl80211.c |    5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

Patch

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 948df27..4361e3d 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -941,6 +941,15 @@  enum wpa_driver_if_type {
 	WPA_IF_AP_BSS,
 
 	/**
+	 * WPA_IF_P2P_DEV - P2P Device
+	 *
+	 * This interface has no network interface associated with it
+	 * and shall be used for P2P management, ie. discovery, go negotiation,
+	 * etc.
+	 */
+	WPA_IF_P2P_DEV,
+
+	/**
 	 * WPA_IF_P2P_GO - P2P Group Owner
 	 */
 	WPA_IF_P2P_GO,
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index ea984b2..e93791d 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -362,7 +362,8 @@  static int is_sta_interface(enum nl80211_iftype nlmode)
 static int is_p2p_interface(enum nl80211_iftype nlmode)
 {
 	return (nlmode == NL80211_IFTYPE_P2P_CLIENT ||
-		nlmode == NL80211_IFTYPE_P2P_GO);
+		nlmode == NL80211_IFTYPE_P2P_GO ||
+		nlmode == NL80211_IFTYPE_P2P_DEVICE);
 }
 
 
@@ -8010,6 +8011,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_DEV:
+		return NL80211_IFTYPE_P2P_DEVICE;
 	}
 	return -1;
 }