]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Disable 11b rates for P2P (additional cases)
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Wed, 14 Oct 2015 09:26:32 +0000 (12:26 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 14 Oct 2015 20:57:53 +0000 (23:57 +0300)
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 <andrei.otcheretianski@intel.com>
src/drivers/driver_nl80211.c

index 05b0195492fd959ad45f3bc911ba7e7affa1aff2..e83a3dfbd45a3eea86b9a2bb92ea30fc654b3c94 100644 (file)
@@ -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);
 }