Explorar el Código

qcacld-3.0: Wait for MC thread clean-up during IBSS leave

Ensure that wait for MC thread clean-up happens as part
of IBSS leave so that by the time upper stack calls the
change interface, we are all set to proceed further.

CRs-Fixed: 949956
Change-Id: Ib0ee79fe38cbf3c462bd8157c4e014c086f5c29f
Chandrasekaran, Manishekar hace 9 años
padre
commit
d32d7007fc
Se han modificado 1 ficheros con 13 adiciones y 0 borrados
  1. 13 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 13 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -9320,6 +9320,7 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
 	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
 	int status;
 	CDF_STATUS hal_status;
+	unsigned long rc;
 
 	ENTER();
 
@@ -9364,6 +9365,18 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
 		       hal_status);
 		return -EAGAIN;
 	}
+
+	/* wait for mc thread to cleanup and then return to upper stack
+	 * so by the time upper layer calls the change interface, we are
+	 * all set to proceed further
+	 */
+	rc = wait_for_completion_timeout(&pAdapter->disconnect_comp_var,
+			msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT));
+	if (!rc) {
+		hdd_err("Failed to disconnect, timed out");
+		return -ETIMEDOUT;
+	}
+
 	EXIT();
 	return 0;
 }