[RFC 06/10] nl80211_driver: add support for P2P device in adding and removing interface

Arend van Spriel arend
Mon Feb 11 03:15:43 PST 2013


From: David Spinadel <david.spinadel at intel.com>

Don't try to assign ifindex for P2P device interface and
check that the ifindex is valid before trying to remove it.

Don't try to set TX rates for P2P device interface since it's
not a network device.

Signed-hostap: David Spinadel <david.spinadel at intel.com>
---
 src/drivers/driver_nl80211.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index f0306f1..183761a 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -6051,6 +6051,13 @@ static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv,
 		return ret;
 	}
 
+	if (iftype == NL80211_IFTYPE_P2P_DEVICE) {
+		wpa_printf(MSG_DEBUG,
+			   "nl80211 New P2P device interface %s created",
+			   ifname);
+		return 0;
+	}
+
 	ifidx = if_nametoindex(ifname);
 	wpa_printf(MSG_DEBUG, "nl80211: New interface %s created: ifindex=%d",
 		   ifname, ifidx);
@@ -6094,7 +6101,8 @@ static int nl80211_create_iface(struct wpa_driver_nl80211_data *drv,
 						wds, handler, arg);
 	}
 
-	if (ret >= 0 && is_p2p_interface(iftype))
+	if (ret >= 0 && is_p2p_interface(iftype) &&
+	    iftype != NL80211_IFTYPE_P2P_DEVICE)
 		nl80211_disable_11b_rates(drv, ret, 1);
 
 	return ret;
@@ -7345,7 +7353,7 @@ done:
 		return ret;
 	}
 
-	if (is_p2p_interface(nlmode))
+	if (is_p2p_interface(nlmode) && nlmode != NL80211_IFTYPE_P2P_DEVICE)
 		nl80211_disable_11b_rates(drv, drv->ifindex, 1);
 	else if (drv->disabled_11b_rates)
 		nl80211_disable_11b_rates(drv, drv->ifindex, 0);
-- 
1.7.10.4





More information about the Hostap mailing list