Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6482e7c5 authored by Dundi Raviteja's avatar Dundi Raviteja
Browse files

qcacld-3.0: Remove hdd context validation in wlan_hdd_disconnect

If driver is removing while STA is in connected state, disconnect
is not happening because hdd context validation will not be success
while driver unload is in progress.

To address this issue, remove validation of hdd context in
wlan_hdd_disconnect to allow disconnection while driver unload
is in progress.

Change-Id: Ia10aa9237a30490f3085458ab38ce27c4eeebaf0
CRs-Fixed: 2284198
parent 2a1efe51
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -18712,20 +18712,21 @@ static int wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
{
	int status, result = 0;
	QDF_STATUS status;
	int result = 0;
	unsigned long rc;
	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
	hdd_station_ctx_t *hdd_sta_ctx;
	hdd_context_t *hdd_ctx;
	eConnectionState prev_conn_state;
	tHalHandle hal = WLAN_HDD_GET_HAL_CTX(pAdapter);
	tHalHandle hal;
	uint32_t wait_time = WLAN_WAIT_TIME_DISCONNECT;
	ENTER();
	status = wlan_hdd_validate_context(pHddCtx);
	hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
	hal = WLAN_HDD_GET_HAL_CTX(pAdapter);
	if (0 != status)
		return status;
	if (pAdapter->device_mode ==  QDF_STA_MODE) {
		sme_indicate_disconnect_inprogress(hal, pAdapter->sessionId);
		hdd_debug("Stop firmware roaming");
@@ -18737,7 +18738,7 @@ int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
		 *
		 */
		INIT_COMPLETION(pAdapter->roaming_comp_var);
		if (hdd_is_roaming_in_progress(pHddCtx)) {
		if (hdd_is_roaming_in_progress(hdd_ctx)) {
			rc = wait_for_completion_timeout(
				&pAdapter->roaming_comp_var,
				msecs_to_jiffies(WLAN_WAIT_TIME_STOP_ROAM));
@@ -18758,7 +18759,7 @@ int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
		}
	}
	prev_conn_state = pHddStaCtx->conn_info.connState;
	prev_conn_state = hdd_sta_ctx->conn_info.connState;
	/*stop tx queues */
	hdd_info("Disabling queues");
	wlan_hdd_netif_queue_control(pAdapter,
@@ -18795,7 +18796,7 @@ int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
		hdd_debug("Already disconnected or connect was in sme/roam pending list and removed by disconnect");
	} else if (0 != status) {
		hdd_err("csr_roam_disconnect failure, status: %d", (int)status);
		pHddStaCtx->staDebugState = status;
		hdd_sta_ctx->staDebugState = status;
		result = -EINVAL;
		goto disconnected;
	}