summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuanyuan Liu <yuanliu@codeaurora.org>2016-03-07 14:21:18 -0800
committerJeevan Shriram <jshriram@codeaurora.org>2016-04-07 15:55:54 -0700
commit7c7f4fd1cf1798d4a16236c8a672566456a9d93c (patch)
tree4815175224f493b998458079a773e0c2ba51d924
parent081ec1162e4413021eba0a64ce08071849811336 (diff)
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: Yuanyuan Liu <yuanliu@codeaurora.org>
-rw-r--r--drivers/soc/qcom/icnss.c44
-rw-r--r--drivers/soc/qcom/wlan_firmware_service_v01.h2
-rw-r--r--include/soc/qcom/icnss.h2
3 files changed, 47 insertions, 1 deletions
diff --git a/drivers/soc/qcom/icnss.c b/drivers/soc/qcom/icnss.c
index 78041e86717a..73c770137dd1 100644
--- a/drivers/soc/qcom/icnss.c
+++ b/drivers/soc/qcom/icnss.c
@@ -1037,7 +1037,7 @@ int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config,
memset(&req, 0, sizeof(req));
- if (mode == ICNSS_WALTEST)
+ if (mode == ICNSS_WALTEST || mode == ICNSS_CCPM)
goto skip;
else if (!config || !host_version) {
pr_err("%s: Invalid cfg pointer\n", __func__);
@@ -1119,6 +1119,38 @@ int icnss_get_ce_id(int irq)
}
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)
{
int ret = 0;
@@ -1184,6 +1216,13 @@ static int icnss_probe(struct platform_device *pdev)
penv->skip_qmi = of_property_read_bool(dev->of_node,
"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);
if (!penv->qmi_event_wq) {
pr_err("%s: workqueue creation failed\n", __func__);
@@ -1212,6 +1251,8 @@ err_qmi:
if (penv->qmi_event_wq)
destroy_workqueue(penv->qmi_event_wq);
err_workqueue:
+ device_remove_file(&pdev->dev, &dev_attr_icnss_wlan_mode);
+err_wlan_mode:
if (penv->msa_va)
dma_free_coherent(&pdev->dev, penv->msa_mem_size,
penv->msa_va, penv->msa_pa);
@@ -1227,6 +1268,7 @@ static int icnss_remove(struct platform_device *pdev)
&wlfw_clnt_nb);
if (penv->qmi_event_wq)
destroy_workqueue(penv->qmi_event_wq);
+ device_remove_file(&pdev->dev, &dev_attr_icnss_wlan_mode);
if (penv->msa_va)
dma_free_coherent(&pdev->dev, penv->msa_mem_size,
penv->msa_va, penv->msa_pa);
diff --git a/drivers/soc/qcom/wlan_firmware_service_v01.h b/drivers/soc/qcom/wlan_firmware_service_v01.h
index 6d007c297cf6..6e96cbabd9d8 100644
--- a/drivers/soc/qcom/wlan_firmware_service_v01.h
+++ b/drivers/soc/qcom/wlan_firmware_service_v01.h
@@ -60,6 +60,8 @@ enum wlfw_driver_mode_enum_v01 {
QMI_WLFW_EPPING_V01 = 2,
QMI_WLFW_WALTEST_V01 = 3,
QMI_WLFW_OFF_V01 = 4,
+ QMI_WLFW_CCPM_V01 = 5,
+ QMI_WLFW_QVIT_V01 = 6,
WLFW_DRIVER_MODE_ENUM_MAX_VAL_V01 = INT_MAX,
};
diff --git a/include/soc/qcom/icnss.h b/include/soc/qcom/icnss.h
index 14a22fd1b55f..27ae1332947c 100644
--- a/include/soc/qcom/icnss.h
+++ b/include/soc/qcom/icnss.h
@@ -72,6 +72,8 @@ enum icnss_driver_mode {
ICNSS_EPPING,
ICNSS_WALTEST,
ICNSS_OFF,
+ ICNSS_CCPM,
+ ICNSS_QVIT,
};
struct icnss_soc_info {