Commit bfc2dc7a authored by Vladimir Kondratiev's avatar Vladimir Kondratiev Committed by Kalle Valo

wil6210: fw debug mode

refactor module parameter debug_fw to act as "fw debug mode",
where driver do nothing but allow card memory access.
Signed-off-by: default avatarVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 73b25f66
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
#define WAIT_FOR_DISCONNECT_TIMEOUT_MS 2000 #define WAIT_FOR_DISCONNECT_TIMEOUT_MS 2000
#define WAIT_FOR_DISCONNECT_INTERVAL_MS 10 #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; bool no_fw_recovery;
module_param(no_fw_recovery, bool, S_IRUGO | S_IWUSR); module_param(no_fw_recovery, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(no_fw_recovery, " disable automatic FW error recovery"); 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) ...@@ -686,6 +690,17 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
WARN_ON(!mutex_is_locked(&wil->mutex)); WARN_ON(!mutex_is_locked(&wil->mutex));
WARN_ON(test_bit(wil_status_napi_en, wil->status)); 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); cancel_work_sync(&wil->disconnect_worker);
wil6210_disconnect(wil, NULL, WLAN_REASON_DEAUTH_LEAVING, false); wil6210_disconnect(wil, NULL, WLAN_REASON_DEAUTH_LEAVING, false);
wil_bcast_fini(wil); wil_bcast_fini(wil);
......
...@@ -24,6 +24,11 @@ static int wil_open(struct net_device *ndev) ...@@ -24,6 +24,11 @@ static int wil_open(struct net_device *ndev)
wil_dbg_misc(wil, "%s()\n", __func__); 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); return wil_up(wil);
} }
......
...@@ -27,10 +27,6 @@ MODULE_PARM_DESC(use_msi, ...@@ -27,10 +27,6 @@ MODULE_PARM_DESC(use_msi,
" Use MSI interrupt: " " Use MSI interrupt: "
"0 - don't, 1 - (default) - single, or 3"); "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 static
void wil_set_capabilities(struct wil6210_priv *wil) void wil_set_capabilities(struct wil6210_priv *wil)
{ {
...@@ -133,8 +129,6 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil) ...@@ -133,8 +129,6 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil)
mutex_lock(&wil->mutex); mutex_lock(&wil->mutex);
rc = wil_reset(wil, false); rc = wil_reset(wil, false);
mutex_unlock(&wil->mutex); mutex_unlock(&wil->mutex);
if (debug_fw)
rc = 0;
if (rc) if (rc)
goto release_irq; goto release_irq;
......
...@@ -29,6 +29,7 @@ extern unsigned short rx_ring_overflow_thrsh; ...@@ -29,6 +29,7 @@ extern unsigned short rx_ring_overflow_thrsh;
extern int agg_wsize; extern int agg_wsize;
extern u32 vring_idle_trsh; extern u32 vring_idle_trsh;
extern bool rx_align_2; extern bool rx_align_2;
extern bool debug_fw;
#define WIL_NAME "wil6210" #define WIL_NAME "wil6210"
#define WIL_FW_NAME "wil6210.fw" /* code */ #define WIL_FW_NAME "wil6210.fw" /* code */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment