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

Commit 0987ef99 authored by Yue Ma's avatar Yue Ma
Browse files

cnss2: Move fbc_bypass check to proper places



Full boot chain bypass means firmware download is not done by MHI
driver. Hence put fbc_bypass check inside CNSS MHI APIs in order
to make the code more clear and readable.

Change-Id: Ib2caaeee722afb67622b2ba2726fb6e3ea339d8c
CRs-fixed: 2012394
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent e3dc15b0
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -36,13 +36,6 @@ static struct cnss_plat_data *plat_env;

static DECLARE_RWSEM(cnss_pm_sem);

static bool fbc_bypass;
#ifdef CONFIG_CNSS2_DEBUG
module_param(fbc_bypass, bool, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(fbc_bypass,
		 "Bypass firmware download when loading WLAN driver");
#endif

static bool qmi_bypass;
#ifdef CONFIG_CNSS2_DEBUG
module_param(qmi_bypass, bool, S_IRUSR | S_IWUSR);
@@ -1044,17 +1037,14 @@ static int cnss_qca6290_powerup(struct cnss_plat_data *plat_priv)
		goto power_off;
	}

	if (fbc_bypass)
		goto bypass_fbc;

	ret = cnss_pci_start_mhi(pci_priv);
	if (ret) {
		cnss_pr_err("Failed to start MHI, err = %d\n", ret);
		goto suspend_link;
	}

	cnss_set_pin_connect_status(plat_priv);

bypass_fbc:
	if (qmi_bypass)
		goto skip_fw_ready;

@@ -1103,7 +1093,6 @@ skip_fw_ready:
	return 0;

stop_mhi:
	if (!fbc_bypass)
	cnss_pci_stop_mhi(pci_priv);
suspend_link:
	cnss_suspend_pci_link(pci_priv);
@@ -1138,7 +1127,6 @@ static int cnss_qca6290_shutdown(struct cnss_plat_data *plat_priv)
	}

bypass_driver_remove:
	if (!fbc_bypass)
	cnss_pci_stop_mhi(pci_priv);

	ret = cnss_suspend_pci_link(pci_priv);
+13 −0
Original line number Diff line number Diff line
@@ -49,6 +49,13 @@ module_param(pci_link_down_panic, uint, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(pci_link_down_panic,
		 "Trigger kernel panic when PCI link down is detected");

static bool fbc_bypass;
#ifdef CONFIG_CNSS2_DEBUG
module_param(fbc_bypass, bool, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(fbc_bypass,
		 "Bypass firmware download when loading WLAN driver");
#endif

static int cnss_set_pci_config_space(struct cnss_pci_data *pci_priv, bool save)
{
	int ret = 0;
@@ -1194,6 +1201,9 @@ int cnss_pci_start_mhi(struct cnss_pci_data *pci_priv)
		return -ENODEV;
	}

	if (fbc_bypass)
		return 0;

	ret = cnss_pci_set_mhi_state(pci_priv, CNSS_MHI_INIT);
	if (ret)
		goto out;
@@ -1217,6 +1227,9 @@ void cnss_pci_stop_mhi(struct cnss_pci_data *pci_priv)
		return;
	}

	if (fbc_bypass)
		return;

	cnss_pci_set_mhi_state(pci_priv, CNSS_MHI_POWER_OFF);
	cnss_pci_set_mhi_state(pci_priv, CNSS_MHI_DEINIT);
}