[PATCH 67/76] staging: rtl8723au: rtw_do_join23a(): Don't start scanning if network isn't found

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

 



From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>

Don't start running network scans if trying to connect to a network
not in our cache. Let the 802.11 stack do it's job instead.

Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
---
 drivers/staging/rtl8723au/core/rtw_ioctl_set.c | 85 ++++----------------------
 1 file changed, 13 insertions(+), 72 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c
index a994893e..4f6d7f5 100644
--- a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c
@@ -24,17 +24,8 @@
 
 int rtw_do_join23a(struct rtw_adapter *padapter)
 {
-	struct list_head *plist, *phead;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct rtw_queue *queue = &pmlmepriv->scanned_queue;
-	int ret = _SUCCESS;
-
-	spin_lock_bh(&pmlmepriv->scanned_queue.lock);
-	phead = get_list_head(queue);
-	plist = phead->next;
-
-	RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-		 ("%s: phead = %p; plist = %p\n\n\n", __func__, phead, plist));
+	int ret;
 
 	pmlmepriv->cur_network.join_res = -2;
 
@@ -42,75 +33,25 @@ int rtw_do_join23a(struct rtw_adapter *padapter)
 
 	pmlmepriv->to_join = true;
 
-	if (list_empty(&queue->queue)) {
-		spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
-		_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
-
-		/* when set_ssid/set_bssid for rtw_do_join23a(), but
-		   scanning queue is empty */
-		/* we try to issue sitesurvey firstly */
-
-		if (pmlmepriv->LinkDetectInfo.bBusyTraffic == false ||
-		    padapter->mlmepriv.to_roaming > 0) {
-			RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-				 ("%s: site survey if scanned_queue is empty\n",
-					 __func__));
-			/*  submit site_survey23a_cmd */
-			ret = rtw_sitesurvey_cmd23a(padapter,
-						 &pmlmepriv->assoc_ssid, 1,
-						 NULL, 0);
-			if (ret != _SUCCESS) {
-				pmlmepriv->to_join = false;
-				RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
-					 ("%s: site survey return error\n",
-						 __func__));
-			}
+	ret = rtw_select_and_join_from_scanned_queue23a(pmlmepriv);
+	if (ret == _SUCCESS) {
+		pmlmepriv->to_join = false;
+	} else {
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
+			/* switch to ADHOC_MASTER */
+			ret = rtw_do_join_adhoc(padapter);
+			if (ret != _SUCCESS)
+				goto exit;
 		} else {
-			pmlmepriv->to_join = false;
-			ret = _FAIL;
-		}
+			/*  can't associate ; reset under-linking */
+			_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
 
-		goto exit;
-	} else {
-		int select_ret;
-		spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
-		select_ret = rtw_select_and_join_from_scanned_queue23a(pmlmepriv);
-		if (select_ret == _SUCCESS) {
+			ret = _FAIL;
 			pmlmepriv->to_join = false;
-		} else {
-			if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
-				/* switch to ADHOC_MASTER */
-				ret = rtw_do_join_adhoc(padapter);
-				if (ret != _SUCCESS)
-					goto exit;
-			} else {
-				/*  can't associate ; reset under-linking */
-				_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
-
-				/* when set_ssid/set_bssid for rtw_do_join23a(),
-				   but there are no desired bss in scanning
-				   queue */
-				/* we try to issue sitesurvey firstly */
-				if (pmlmepriv->LinkDetectInfo.bBusyTraffic ==
-				    false || padapter->mlmepriv.to_roaming > 0){
-					/* DBG_8723A("rtw_do_join23a() when   no "
-					   "desired bss in scanning queue\n");
-					*/
-					ret = rtw_sitesurvey_cmd23a(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
-					if (ret != _SUCCESS) {
-						pmlmepriv->to_join = false;
-						RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("%s: site survey return error\n", __func__));
-					}
-				} else {
-					ret = _FAIL;
-					pmlmepriv->to_join = false;
-				}
-			}
 		}
 	}
 
 exit:
-
 	return ret;
 }
 
-- 
1.9.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux