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

Commit c84c7a79 authored by Yuanyuan Liu's avatar Yuanyuan Liu
Browse files

icnss: Update WLAN mode in wlan_firmware_service



Add CCPM/QVIT in WLAN mode and add support fo setting
WLAN mode from command line.

CRs-Fixed: 986484
Change-Id: I5921dc3978bf96221b50148bb2f86b0ffed3b5fb
Signed-off-by: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
parent 03c29333
Loading
Loading
Loading
Loading
+43 −1
Original line number Original line Diff line number Diff line
@@ -1036,7 +1036,7 @@ int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config,


	memset(&req, 0, sizeof(req));
	memset(&req, 0, sizeof(req));


	if (mode == ICNSS_WALTEST)
	if (mode == ICNSS_WALTEST || mode == ICNSS_CCPM)
		goto skip;
		goto skip;
	else if (!config || !host_version) {
	else if (!config || !host_version) {
		pr_err("%s: Invalid cfg pointer\n", __func__);
		pr_err("%s: Invalid cfg pointer\n", __func__);
@@ -1118,6 +1118,38 @@ int icnss_get_ce_id(int irq)
}
}
EXPORT_SYMBOL(icnss_get_ce_id);
EXPORT_SYMBOL(icnss_get_ce_id);


static ssize_t icnss_wlan_mode_store(struct device *dev,
				     struct device_attribute *attr,
				     const char *buf,
				     size_t count)
{
	int val;
	int ret;

	if (!penv)
		return -ENODEV;

	ret = kstrtoint(buf, 0, &val);
	if (ret)
		return ret;

	if (val == ICNSS_WALTEST || val == ICNSS_CCPM) {
		pr_debug("%s: WLAN Test Mode -> %d\n", __func__, val);
		ret = icnss_wlan_enable(NULL, val, NULL);
		if (ret)
			pr_err("%s: WLAN Test Mode %d failed with %d\n",
			       __func__, val, ret);
	} else {
		pr_err("%s: Mode %d is not supported from command line\n",
		       __func__, val);
		ret = -EINVAL;
	}

	return ret;
}

static DEVICE_ATTR(icnss_wlan_mode, S_IWUSR, NULL, icnss_wlan_mode_store);

static int icnss_probe(struct platform_device *pdev)
static int icnss_probe(struct platform_device *pdev)
{
{
	int ret = 0;
	int ret = 0;
@@ -1183,6 +1215,13 @@ static int icnss_probe(struct platform_device *pdev)
	penv->skip_qmi = of_property_read_bool(dev->of_node,
	penv->skip_qmi = of_property_read_bool(dev->of_node,
					       "qcom,skip-qmi");
					       "qcom,skip-qmi");


	ret = device_create_file(dev, &dev_attr_icnss_wlan_mode);
	if (ret) {
		pr_err("%s: wlan_mode sys file creation failed\n",
		       __func__);
		goto err_wlan_mode;
	}

	penv->qmi_event_wq = alloc_workqueue("icnss_qmi_event", 0, 0);
	penv->qmi_event_wq = alloc_workqueue("icnss_qmi_event", 0, 0);
	if (!penv->qmi_event_wq) {
	if (!penv->qmi_event_wq) {
		pr_err("%s: workqueue creation failed\n", __func__);
		pr_err("%s: workqueue creation failed\n", __func__);
@@ -1211,6 +1250,8 @@ err_qmi:
	if (penv->qmi_event_wq)
	if (penv->qmi_event_wq)
		destroy_workqueue(penv->qmi_event_wq);
		destroy_workqueue(penv->qmi_event_wq);
err_workqueue:
err_workqueue:
	device_remove_file(&pdev->dev, &dev_attr_icnss_wlan_mode);
err_wlan_mode:
	if (penv->msa_va)
	if (penv->msa_va)
		dma_free_coherent(&pdev->dev, penv->msa_mem_size,
		dma_free_coherent(&pdev->dev, penv->msa_mem_size,
				  penv->msa_va, penv->msa_pa);
				  penv->msa_va, penv->msa_pa);
@@ -1226,6 +1267,7 @@ static int icnss_remove(struct platform_device *pdev)
					  &wlfw_clnt_nb);
					  &wlfw_clnt_nb);
	if (penv->qmi_event_wq)
	if (penv->qmi_event_wq)
		destroy_workqueue(penv->qmi_event_wq);
		destroy_workqueue(penv->qmi_event_wq);
	device_remove_file(&pdev->dev, &dev_attr_icnss_wlan_mode);
	if (penv->msa_va)
	if (penv->msa_va)
		dma_free_coherent(&pdev->dev, penv->msa_mem_size,
		dma_free_coherent(&pdev->dev, penv->msa_mem_size,
				  penv->msa_va, penv->msa_pa);
				  penv->msa_va, penv->msa_pa);
+2 −0
Original line number Original line Diff line number Diff line
@@ -60,6 +60,8 @@ enum wlfw_driver_mode_enum_v01 {
	QMI_WLFW_EPPING_V01 = 2,
	QMI_WLFW_EPPING_V01 = 2,
	QMI_WLFW_WALTEST_V01 = 3,
	QMI_WLFW_WALTEST_V01 = 3,
	QMI_WLFW_OFF_V01 = 4,
	QMI_WLFW_OFF_V01 = 4,
	QMI_WLFW_CCPM_V01 = 5,
	QMI_WLFW_QVIT_V01 = 6,
	WLFW_DRIVER_MODE_ENUM_MAX_VAL_V01 = INT_MAX,
	WLFW_DRIVER_MODE_ENUM_MAX_VAL_V01 = INT_MAX,
};
};


+2 −0
Original line number Original line Diff line number Diff line
@@ -72,6 +72,8 @@ enum icnss_driver_mode {
	ICNSS_EPPING,
	ICNSS_EPPING,
	ICNSS_WALTEST,
	ICNSS_WALTEST,
	ICNSS_OFF,
	ICNSS_OFF,
	ICNSS_CCPM,
	ICNSS_QVIT,
};
};


struct icnss_soc_info {
struct icnss_soc_info {