[PATCH 3/4] wpa_supplicant: Disable 11b rates for P2P

Ilan Peer ilan.peer
Wed Oct 14 02:26:32 PDT 2015


From: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

Some drivers (like mac80211) do not accept changing the bitrate
mask before the network interface is up, thus calling
nl80211_disable_11b_rates() before the interface is up fails,
and the P2P network interface continues to use invalid
bitrates.

To fix this call nl80211_disable_11b_rates() immediately
after the interface is brought up (and also after rfkill
is unblocked).

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/drivers/driver_nl80211.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 05b0195..c2f0b70 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1537,6 +1537,11 @@ static void wpa_driver_nl80211_rfkill_unblocked(void *ctx)
 			   "after rfkill unblock");
 		return;
 	}
+
+	if (is_p2p_net_interface(drv->nlmode))
+		nl80211_disable_11b_rates(drv,
+					  drv->ifindex, 1);
+
 	/* rtnetlink ifup handler will report interface as enabled */
 }
 
@@ -2227,6 +2232,11 @@ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv,
 				   "interface '%s' UP", bss->ifname);
 			return ret;
 		}
+
+		if (is_p2p_net_interface(nlmode))
+			nl80211_disable_11b_rates(bss->drv,
+						  bss->drv->ifindex, 1);
+
 		if (nlmode == NL80211_IFTYPE_P2P_DEVICE)
 			return ret;
 	} else {
@@ -6471,9 +6481,14 @@ static int wpa_driver_nl80211_deinit_p2p_cli(void *priv)
 static void wpa_driver_nl80211_resume(void *priv)
 {
 	struct i802_bss *bss = priv;
+	enum nl80211_iftype nlmode = nl80211_get_ifmode(bss);
 
 	if (i802_set_iface_flags(bss, 1))
 		wpa_printf(MSG_DEBUG, "nl80211: Failed to set interface up on resume event");
+
+	if (is_p2p_net_interface(nlmode))
+		nl80211_disable_11b_rates(bss->drv,
+					  bss->drv->ifindex, 1);
 }
 
 
-- 
1.9.1




More information about the Hostap mailing list