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

Arend van Spriel arend
Sat Jan 12 08:28:19 PST 2013


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

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;
 }
-- 
1.7.10.4





More information about the Hostap mailing list