]> git.karo-electronics.de Git - linux-beck.git/commitdiff
wil6210: fw debug mode
authorVladimir Kondratiev <QCA_vkondrat@QCA.qualcomm.com>
Mon, 30 Mar 2015 08:28:50 +0000 (11:28 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 28 Apr 2015 16:59:46 +0000 (19:59 +0300)
refactor module parameter debug_fw to act as "fw debug mode",
where driver do nothing but allow card memory access.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/main.c
drivers/net/wireless/ath/wil6210/netdev.c
drivers/net/wireless/ath/wil6210/pcie_bus.c
drivers/net/wireless/ath/wil6210/wil6210.h

index c2a238426425462c7ff40f61c8e98fec9dadca6d..0623d8c98956be664e5204116b5ab010bc35d71f 100644 (file)
 #define WAIT_FOR_DISCONNECT_TIMEOUT_MS 2000
 #define WAIT_FOR_DISCONNECT_INTERVAL_MS 10
 
+bool debug_fw; /* = false; */
+module_param(debug_fw, bool, S_IRUGO);
+MODULE_PARM_DESC(debug_fw, " do not perform card reset. For FW debug");
+
 bool no_fw_recovery;
 module_param(no_fw_recovery, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(no_fw_recovery, " disable automatic FW error recovery");
@@ -686,6 +690,17 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
        WARN_ON(!mutex_is_locked(&wil->mutex));
        WARN_ON(test_bit(wil_status_napi_en, wil->status));
 
+       if (debug_fw) {
+               static const u8 mac[ETH_ALEN] = {
+                       0x00, 0xde, 0xad, 0x12, 0x34, 0x56,
+               };
+               struct net_device *ndev = wil_to_ndev(wil);
+
+               ether_addr_copy(ndev->perm_addr, mac);
+               ether_addr_copy(ndev->dev_addr, ndev->perm_addr);
+               return 0;
+       }
+
        cancel_work_sync(&wil->disconnect_worker);
        wil6210_disconnect(wil, NULL, WLAN_REASON_DEAUTH_LEAVING, false);
        wil_bcast_fini(wil);
index f2f7ea29558e058f27d7f934ba36769db36306c2..6042f61b016c010568c3b9f5903cff8ff668f0eb 100644 (file)
@@ -24,6 +24,11 @@ static int wil_open(struct net_device *ndev)
 
        wil_dbg_misc(wil, "%s()\n", __func__);
 
+       if (debug_fw) {
+               wil_err(wil, "%s() while in debug_fw mode\n", __func__);
+               return -EINVAL;
+       }
+
        return wil_up(wil);
 }
 
index 109986114abfa10d6bd6083fa52fb29de2912fea..58c79166a6d11a5d676b857ccee5f55f0b71a415 100644 (file)
@@ -27,10 +27,6 @@ MODULE_PARM_DESC(use_msi,
                 " Use MSI interrupt: "
                 "0 - don't, 1 - (default) - single, or 3");
 
-static bool debug_fw; /* = false; */
-module_param(debug_fw, bool, S_IRUGO);
-MODULE_PARM_DESC(debug_fw, " load driver if FW not ready. For FW debug");
-
 static
 void wil_set_capabilities(struct wil6210_priv *wil)
 {
@@ -133,8 +129,6 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil)
        mutex_lock(&wil->mutex);
        rc = wil_reset(wil, false);
        mutex_unlock(&wil->mutex);
-       if (debug_fw)
-               rc = 0;
        if (rc)
                goto release_irq;
 
index 4310972c9e1687b5b12dc4c101c9076932d907a8..f4681e3975ff08a16e5c62a6234dd00a875a8ce9 100644 (file)
@@ -29,6 +29,7 @@ extern unsigned short rx_ring_overflow_thrsh;
 extern int agg_wsize;
 extern u32 vring_idle_trsh;
 extern bool rx_align_2;
+extern bool debug_fw;
 
 #define WIL_NAME "wil6210"
 #define WIL_FW_NAME "wil6210.fw" /* code */