Skip to contentSkip to conversation

Staging: rtl8192e: Do not mess with carrier settings while scanning

PATCH New Samuel Ortiz 1 participant 3 messages Jun 10, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Staging: rtl8192e: Do not mess with carrier settings while scanning

Toggling the link carrier is a non sense and is the grossest locking I can think of. Moreover, it's giving a completely inaccurate status to userspace who could for example decide to turn the interface down on carrier off detection.

---
 .../rtl8192e/ieee80211/ieee80211_softmac_wx.c      |    3 ---
 drivers/staging/rtl8192e/r8192E_core.c             |    1 -
 2 files changed, 0 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c +0 -3
index 1bbd49f..1ce3df2 100644
@@ -337,8 +337,6 @@ void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee)
 	ieee80211_sta_ps_send_null_frame(ieee, 1);
 #endif
 
-	netif_carrier_off(ieee->dev);
-
 	if (ieee->data_hard_stop)
 		ieee->data_hard_stop(ieee->dev);
 
@@ -389,7 +387,6 @@ void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee)
 	if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
 		ieee80211_start_send_beacons(ieee);
 
-	netif_carrier_on(ieee->dev);
 	count = 0;
 	up(&ieee->wx_sem);
 
drivers/staging/rtl8192e/r8192E_core.c +0 -1
index eb41402..ef0adad 100644
@@ -4318,7 +4318,6 @@ RESET_START:
 			del_timer_sync(&ieee->associate_timer);
                         cancel_delayed_work(&ieee->associate_retry_wq);
 			ieee80211_stop_scan(ieee);
-			netif_carrier_off(dev);
 			up(&ieee->wx_sem);
 		}
 		else{
Signature · 1 line
1.7.0
#1 lore raw

PATCH 2/3 Staging: rtl8192e: Do not autoconnect based on probe response

Getting a probe response after sending a probe request to a specific SSID doesnt mean we're trying to associate with this SSID. wpa_supplicant should be the only one deciding when to join an SSID, not the kernel.

---
 drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c +0 -4
index da10067..d33ed64 100644
@@ -2793,8 +2793,6 @@ static inline void ieee80211_process_probe_response(
 #endif
 		memcpy(target, &network, sizeof(*target));
 		list_add_tail(&target->list, &ieee->network_list);
-		if(ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)
-			ieee80211_softmac_new_net(ieee,&network);
 	} else {
 		IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
 				     escape_essid(target->ssid,
@@ -2821,8 +2819,6 @@ static inline void ieee80211_process_probe_response(
 		//YJ,add,080819,for hidden ap,end
 
 		update_network(target, &network);
-		if(renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE))
-			ieee80211_softmac_new_net(ieee,&network);
 	}
 
 	spin_unlock_irqrestore(&ieee->lock, flags);
Signature · 1 line
1.7.0
#2 lore raw

PATCH 3/3 Staging: rtl8192e: Do not send NULL BSSID events when not associated

In reply to Samuel Ortiz

If we're not associated, we should not send wireless events to let userspace know that we just left an ESSID, simply because we havent yet joined it. If we keep on doing that, wpa_supplicant could receive such events while actually trying to join an ESSID, and thus decide to stop trying. This leads to a lot of connection failures as this driver seems to be sending GIWAP events quite a lot.

---
 .../staging/rtl8192e/ieee80211/ieee80211_softmac.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c +7 -2
index 46b6e8c..d2a243a 100644
@@ -2873,11 +2873,16 @@ void ieee80211_disassociate(struct ieee80211_device *ieee)
 	if(IS_DOT11D_ENABLE(ieee))
 		Dot11d_Reset(ieee);
 #endif
-	ieee->state = IEEE80211_NOLINK;
 	ieee->is_set_key = false;
 	ieee->link_change(ieee->dev);
 	//HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
-	notify_wx_assoc_event(ieee);
+	if (ieee->state == IEEE80211_LINKED ||
+	    ieee->state == IEEE80211_ASSOCIATING) {
+		ieee->state = IEEE80211_NOLINK;
+		notify_wx_assoc_event(ieee);
+	}
+
+	ieee->state = IEEE80211_NOLINK;
 
 }
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
Signature · 1 line
1.7.0