ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
@ 2014-02-10 17:13 Marek Puzyniak
  2014-02-11  6:17 ` Michal Kazior
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Puzyniak @ 2014-02-10 17:13 UTC (permalink / raw)
  To: ath10k; +Cc: Marek Puzyniak, linux-wireless

Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
in firmware 10.1. In order to have firmware crash simulation
functionality also in firmware 10.1 driver can force firmware
crash by performing not allowed operation. Driver can deliberately
crash firmware when setting vdev param for vdev id out of range.

Command to trigger firmware crash:
echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 6debd28..84b79c5 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -482,11 +482,23 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file,
 	ath10k_info("simulating firmware crash\n");
 
 	ret = ath10k_wmi_force_fw_hang(ar, WMI_FORCE_FW_HANG_ASSERT, 0);
-	if (ret)
+	if (ret == 0) {
+		ret = count;
+		goto exit;
+	}
+
+	if (ret != -EOPNOTSUPP) {
 		ath10k_warn("failed to force fw hang (%d)\n", ret);
+		goto exit;
+	}
 
-	if (ret == 0)
-		ret = count;
+	/*
+	 * Firmware does not support WMI_FORCE_FW_HANG_ASSERT.
+	 * Force firmware crash by setting any vdev parameter for
+	 * not allowed vdev id.
+	 */
+	ath10k_wmi_vdev_set_param(ar, TARGET_NUM_VDEVS + 1,
+				  ar->wmi.vdev_param->rts_threshold, 0);
 
 exit:
 	mutex_unlock(&ar->conf_mutex);
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-13 15:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-10 17:13 [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware Marek Puzyniak
2014-02-11  6:17 ` Michal Kazior
2014-02-13 14:52   ` Kalle Valo
2014-02-13 15:08     ` Marek Puzyniak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox