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

Commit 731df269 authored by Jyoti Kumari's avatar Jyoti Kumari Committed by Madan Koyyalamudi
Browse files

qcacld-3.0: Cleanup SAP interface if start_bss is aborted

Currently, SAP state machine is moved to INIT state when SAP
start is aborted due to timeout or SSR. SAP is not cleaned up
in such cases as eWNI_SME_STOP_BSS_REQ (which further issues
vdev down and cleanup the peers properly) is not sent to
below layers(firmware).

Replace qdf_wait_for_event_completion to
wait_for_completion_timeout in start_bss which will wait
till the normal operation execute irrespective of firmware
state/SSR.

Change-Id: Ifff2ca9658769cb1145f1c5cb278cd7551cb8c00
CRs-Fixed: 3058550
parent e6fe4c51
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5885,7 +5885,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
		goto error;
	}

	qdf_status = qdf_wait_for_event_completion(&hostapd_state->qdf_event,
	qdf_status = qdf_wait_single_event(&hostapd_state->qdf_event,
					SME_CMD_START_BSS_TIMEOUT);

	wlansap_reset_sap_config_add_ie(config, eUPDATE_IE_ALL);
@@ -5902,6 +5902,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
		hdd_set_connection_in_progress(false);
		sme_get_command_q_status(mac_handle);
		wlansap_stop_bss(WLAN_HDD_GET_SAP_CTX_PTR(adapter));
		if (!cds_is_driver_recovering())
			QDF_ASSERT(0);
		ret = -EINVAL;
		goto error;
+2 −2
Original line number Diff line number Diff line
@@ -16292,7 +16292,7 @@ void wlan_hdd_start_sap(struct hdd_adapter *ap_adapter, bool reinit)
		goto end;

	hdd_debug("Waiting for SAP to start");
	qdf_status = qdf_wait_for_event_completion(&hostapd_state->qdf_event,
	qdf_status = qdf_wait_single_event(&hostapd_state->qdf_event,
					SME_CMD_START_BSS_TIMEOUT);
	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
		hdd_err("SAP Start failed");
@@ -18542,7 +18542,7 @@ void hdd_restart_sap(struct hdd_adapter *ap_adapter)

		hdd_info("Waiting for SAP to start");
		qdf_status =
			qdf_wait_for_event_completion(&hostapd_state->qdf_event,
			qdf_wait_single_event(&hostapd_state->qdf_event,
					SME_CMD_START_BSS_TIMEOUT);
		wlansap_reset_sap_config_add_ie(sap_config,
				eUPDATE_IE_ALL);
+2 −2
Original line number Diff line number Diff line
@@ -1533,7 +1533,7 @@ static void hdd_restart_sap_with_new_phymode(struct hdd_context *hdd_ctx,
		hdd_err("SAP Start Bss fail");
		return;
	}
	status = qdf_wait_for_event_completion(&hostapd_state->qdf_event,
	status = qdf_wait_single_event(&hostapd_state->qdf_event,
				       SME_CMD_START_BSS_TIMEOUT);
	if (!QDF_IS_STATUS_SUCCESS(status)) {
		mutex_unlock(&hdd_ctx->sap_lock);
+4 −6
Original line number Diff line number Diff line
@@ -2433,7 +2433,7 @@ static QDF_STATUS sap_fsm_handle_radar_during_cac(struct sap_context *sap_ctx,
}

/**
 * sap_fsm_handle_start_failure() - handle start failure or stop during cac wait
 * sap_fsm_handle_start_failure() - handle sap start failure
 * @sap_ctx: SAP context
 * @msg: event msg
 * @mac_handle: Opaque handle to the global MAC context
@@ -2446,13 +2446,11 @@ static QDF_STATUS sap_fsm_handle_start_failure(struct sap_context *sap_ctx,
{
	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;

	if (msg == eSAP_HDD_STOP_INFRA_BSS &&
	    (QDF_IS_STATUS_SUCCESS(wlan_vdev_is_dfs_cac_wait(sap_ctx->vdev)) ||
	     QDF_IS_STATUS_SUCCESS(
	     wlan_vdev_is_restart_progress(sap_ctx->vdev)))) {
	if (msg == eSAP_HDD_STOP_INFRA_BSS) {
		/* Transition from SAP_STARTING to SAP_STOPPING */
		sap_debug("In cac wait state from state %s => %s",
		sap_debug("SAP start is in progress, state from state %s => %s",
			  "SAP_STARTING", "SAP_STOPPING");

		/*
		 * Stop the CAC timer only in following conditions
		 * single AP: if there is a single AP then stop timer