rtlwifi: rtl8192c: Prevent reconnect attempts if not connected
authorLarry Finger <Larry.Finger@lwfinger.net>
Mon, 18 Nov 2013 17:11:25 +0000 (11:11 -0600)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 5 Dec 2013 19:55:02 +0000 (14:55 -0500)
This driver has a watchdog timer that attempts to reconnect when beacon frames
are not seen for 6 seconds. This patch disables that reconnect whenever the
device has never been connected.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/base.c

index ff784072fb4233a29a46a55bf21d75e094bb8d5c..fcf9b621918c07ba2ab42e38622af9b56ac66682 100644 (file)
@@ -1437,7 +1437,8 @@ void rtl_watchdog_wq_callback(void *data)
                        /* if we can't recv beacon for 6s, we should
                         * reconnect this AP
                         */
-                       if (rtlpriv->link_info.roam_times >= 3) {
+                       if ((rtlpriv->link_info.roam_times >= 3) &&
+                           !is_zero_ether_addr(rtlpriv->mac80211.bssid)) {
                                RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
                                         "AP off, try to reconnect now\n");
                                rtlpriv->link_info.roam_times = 0;