[PATCH] mwifiex: Trigger a card reset on "DNLD_CMD: host to card failed".

Florian Achleitner
2015-04-16T09:22:13Z

Whenever this problem occurs, the driver can not continue. Thus,
trigger a card reset to restart the module firmware. Other firmware
communication issues are resolved by this last resort.
Also dump registers, to eventually allow some diagnostics.

Signed-off-by: Florian Achleitner <flo@fopen.at>
---

This works well at least for us.

drivers/net/wireless/mwifiex/cmdevt.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index c5a14ff..410f4f2 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -233,6 +233,12 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);

adapter->dbg.num_cmd_host_to_card_failure++;
+
+ if (adapter->if_ops.fw_dump)
+ adapter->if_ops.fw_dump(adapter);
+
+ if (adapter->if_ops.card_reset)
+ adapter->if_ops.card_reset(adapter);
return -1;
}

--
2.1.0