wil6210: support new WMI-only FW capability
authorDedy Lansky <qca_dlansky@qca.qualcomm.com>
Fri, 20 Jan 2017 11:49:47 +0000 (13:49 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 27 Jan 2017 17:49:34 +0000 (19:49 +0200)
WMI_ONLY FW is used for testing in production. It cannot be used for
scan/connect, etc.
In case FW reports this capability, driver will not allow interface up.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/netdev.c
drivers/net/wireless/ath/wil6210/pcie_bus.c
drivers/net/wireless/ath/wil6210/wmi.h

index d5df744a12b3ecfd96979b11b71dc3506a80351d..1843d98136d9ff2a4459ac80b2cc1c9022378d8a 100644 (file)
@@ -24,8 +24,9 @@ static int wil_open(struct net_device *ndev)
 
        wil_dbg_misc(wil, "open\n");
 
-       if (debug_fw) {
-               wil_err(wil, "while in debug_fw mode\n");
+       if (debug_fw ||
+           test_bit(WMI_FW_CAPABILITY_WMI_ONLY, wil->fw_capabilities)) {
+               wil_err(wil, "while in debug_fw or wmi_only mode\n");
                return -EINVAL;
        }
 
index 8baa603bec42b2c98ad9de13a1552e7ae5aac023..b85b4f71b15da4e5cfa970144cde19f42582924d 100644 (file)
@@ -99,8 +99,10 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil)
         */
        int msi_only = pdev->msi_enabled;
        bool _use_msi = use_msi;
+       bool wmi_only = test_bit(WMI_FW_CAPABILITY_WMI_ONLY,
+                                wil->fw_capabilities);
 
-       wil_dbg_misc(wil, "if_pcie_enable\n");
+       wil_dbg_misc(wil, "if_pcie_enable, wmi_only %d\n", wmi_only);
 
        pdev->msi_enabled = 0;
 
@@ -123,9 +125,11 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil)
        if (rc)
                goto stop_master;
 
-       /* need reset here to obtain MAC */
+       /* need reset here to obtain MAC or in case of WMI-only FW, full reset
+        * and fw loading takes place
+        */
        mutex_lock(&wil->mutex);
-       rc = wil_reset(wil, false);
+       rc = wil_reset(wil, wmi_only);
        mutex_unlock(&wil->mutex);
        if (rc)
                goto release_irq;
index 9c4a0bdc51f3e6addbfb97b48e6a00b57103f686..906aa723e4150af2e9a8b3c3a9bf0ffa98d7d2f6 100644 (file)
@@ -57,6 +57,7 @@ enum wmi_fw_capability {
        WMI_FW_CAPABILITY_RF_SECTORS            = 2,
        WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT      = 3,
        WMI_FW_CAPABILITY_DISABLE_AP_SME        = 4,
+       WMI_FW_CAPABILITY_WMI_ONLY              = 5,
        WMI_FW_CAPABILITY_MAX,
 };