Search Linux Wireless

Re: RTL8192CU continually reconnecting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/09/2013 05:05 PM, Mark Cave-Ayland wrote:
On 09/09/13 20:03, Larry Finger wrote:

There were no secrets in that dump, but it did reveal a major clue.

A response from your system for your AP was:

mode 2, state 0, is_beacon 0, is_probe_resp 1, length 147

For the number of beacons to be updated, the state has to be 2 or 3. My
system has scan_ssid=1 in the wpa_supplicant configuration file. When
the scan finishes, then a value of 2 is set into the mode variable.

The attached updated patch should set the correct mode even if scanning
is not enabled.

Aha! This patch is definitely a step in the right direction - with this applied,
wpa_supplicant now associates immediately with the AP without the initial delay :)

However... I'm still seeing the same "rtlwifi:rtl_watchdog_wq_callback():<0-0>
AP off, try to reconnect now" message appearing in dmesg after every 10s or so.
I've uploaded the updated dmesg output to
http://www.ilande.co.uk/tmp/rtl8192cu_patch-2-dmesg.txt for you to take a look at.

I also tried another experiment which was to change your patch so that instead
of logging just the first 100 beacons to dmesg, log every 10th beacon (count %
10) to dmesg instead. This showed that even when the timeouts are occurring
against the AP, I'm still seeing a continual stream of beacons from other
stations on the network.

Looking at only every 10th one could be systematically missing the ones from your AP.

This makes me wonder if Oleksij is correct in that the problem is that not all
the frames coming from the USB interface are being picked up by the driver.
Perhaps not all incoming USB RX buffers are being scanned (causing some queued
frames to be lost) or maybe USB transfers can contain more than 1 frame and
rtlwifi is only catching the first frame within each notified transfer?

None of those suppositions make any sense.

To double check whether it was a general ehci-pci problem, I tried plugging in a
spare zd1211rw dongle and that worked absolutely fine. So I think that's a
reasonable indication that general USB function is okay.

I do not suspect any USB problem unless it is in rtl8192cu.

Could you please run the attached patch? It will only print messages for your AP, and print enough to still be getting them when the AP timeout occurs.

Thanks,

Larry

Index: wireless-testing-save/drivers/net/wireless/rtlwifi/usb.c
===================================================================
--- wireless-testing-save.orig/drivers/net/wireless/rtlwifi/usb.c
+++ wireless-testing-save/drivers/net/wireless/rtlwifi/usb.c
@@ -484,6 +484,8 @@ static void _rtl_usb_rx_process_agg(stru
 			if (unicast)
 				rtlpriv->link_info.num_rx_inperiod++;
 		}
+		/* static bcn for roaming */
+		rtl_beacon_statistic(hw, skb);
 	}
 }
 
Index: wireless-testing-save/drivers/net/wireless/rtlwifi/core.c
===================================================================
--- wireless-testing-save.orig/drivers/net/wireless/rtlwifi/core.c
+++ wireless-testing-save/drivers/net/wireless/rtlwifi/core.c
@@ -184,6 +184,7 @@ static int rtl_op_add_interface(struct i
 					rtlpriv->cfg->maps
 					[RTL_IBSS_INT_MASKS]);
 		}
+		mac->link_state = MAC80211_LINKED;
 		break;
 	case NL80211_IFTYPE_ADHOC:
 		RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
Index: wireless-testing-save/drivers/net/wireless/rtlwifi/base.c
===================================================================
--- wireless-testing-save.orig/drivers/net/wireless/rtlwifi/base.c
+++ wireless-testing-save/drivers/net/wireless/rtlwifi/base.c
@@ -1287,6 +1287,17 @@ void rtl_beacon_statistic(struct ieee802
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+	static int count;
+
+	/* and only beacons from the associated BSSID, please */
+	if (compare_ether_addr(hdr->addr3, rtlpriv->mac80211.bssid))
+		return;
+
+	if (count++ < 1200) {
+		pr_info("mode %d, state %d, is_beacon %d, is_probe_resp %d, length %d\n",
+			rtlpriv->mac80211.opmode, rtlpriv->mac80211.link_state, ieee80211_is_beacon(hdr->frame_control),
+			ieee80211_is_probe_resp(hdr->frame_control), skb->len);
+	}
 
 	if (rtlpriv->mac80211.opmode != NL80211_IFTYPE_STATION)
 		return;
@@ -1303,10 +1314,6 @@ void rtl_beacon_statistic(struct ieee802
 	if (skb->len <= 40 + FCS_LEN)
 		return;
 
-	/* and only beacons from the associated BSSID, please */
-	if (compare_ether_addr(hdr->addr3, rtlpriv->mac80211.bssid))
-		return;
-
 	rtlpriv->link_info.bcn_rx_inperiod++;
 }
 EXPORT_SYMBOL_GPL(rtl_beacon_statistic);

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux