From e8dc205f1710522ebc9a416140c32e8e15afd069 Mon Sep 17 00:00:00 2001 From: Andrei Otcheretianski Date: Wed, 14 Oct 2015 12:26:32 +0300 Subject: [PATCH] nl80211: Disable 11b rates for P2P (additional cases) Some drivers (like mac80211) do not accept changing the TX 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 --- src/drivers/driver_nl80211.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 05b019549..e83a3dfbd 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1537,6 +1537,10 @@ 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 +2231,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 +6480,13 @@ 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); } -- 2.47.2