diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2014-02-04 04:27:50 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-12 15:36:03 -0500 |
commit | 482b30b653e2be8aa1bf70b7aaac56ff0aeb070c (patch) | |
tree | 7e5eed513e020b08f0653d1f226a1fba7a820afc /drivers/net/wireless/ath | |
parent | c8ec0f5c9bc4ef3263d5c77e6fd0489a89ed9941 (diff) |
ath9k_htc: catch fw panic pattern
... and print what we get.
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_hst.c | 36 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_hst.h | 12 |
2 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c index aac4a406a513..a0ff5b637054 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.c +++ b/drivers/net/wireless/ath/ath9k/htc_hst.c | |||
@@ -358,6 +358,36 @@ ret: | |||
358 | kfree_skb(skb); | 358 | kfree_skb(skb); |
359 | } | 359 | } |
360 | 360 | ||
361 | static void ath9k_htc_fw_panic_report(struct htc_target *htc_handle, | ||
362 | struct sk_buff *skb) | ||
363 | { | ||
364 | uint32_t *pattern = (uint32_t *)skb->data; | ||
365 | |||
366 | switch (*pattern) { | ||
367 | case 0x33221199: | ||
368 | { | ||
369 | struct htc_panic_bad_vaddr *htc_panic; | ||
370 | htc_panic = (struct htc_panic_bad_vaddr *) skb->data; | ||
371 | dev_err(htc_handle->dev, "ath: firmware panic! " | ||
372 | "exccause: 0x%08x; pc: 0x%08x; badvaddr: 0x%08x.\n", | ||
373 | htc_panic->exccause, htc_panic->pc, | ||
374 | htc_panic->badvaddr); | ||
375 | break; | ||
376 | } | ||
377 | case 0x33221299: | ||
378 | { | ||
379 | struct htc_panic_bad_epid *htc_panic; | ||
380 | htc_panic = (struct htc_panic_bad_epid *) skb->data; | ||
381 | dev_err(htc_handle->dev, "ath: firmware panic! " | ||
382 | "bad epid: 0x%08x\n", htc_panic->epid); | ||
383 | break; | ||
384 | } | ||
385 | default: | ||
386 | dev_err(htc_handle->dev, "ath: uknown panic pattern!\n"); | ||
387 | break; | ||
388 | } | ||
389 | } | ||
390 | |||
361 | /* | 391 | /* |
362 | * HTC Messages are handled directly here and the obtained SKB | 392 | * HTC Messages are handled directly here and the obtained SKB |
363 | * is freed. | 393 | * is freed. |
@@ -379,6 +409,12 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle, | |||
379 | htc_hdr = (struct htc_frame_hdr *) skb->data; | 409 | htc_hdr = (struct htc_frame_hdr *) skb->data; |
380 | epid = htc_hdr->endpoint_id; | 410 | epid = htc_hdr->endpoint_id; |
381 | 411 | ||
412 | if (epid == 0x99) { | ||
413 | ath9k_htc_fw_panic_report(htc_handle, skb); | ||
414 | kfree_skb(skb); | ||
415 | return; | ||
416 | } | ||
417 | |||
382 | if (epid >= ENDPOINT_MAX) { | 418 | if (epid >= ENDPOINT_MAX) { |
383 | if (pipe_id != USB_REG_IN_PIPE) | 419 | if (pipe_id != USB_REG_IN_PIPE) |
384 | dev_kfree_skb_any(skb); | 420 | dev_kfree_skb_any(skb); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.h b/drivers/net/wireless/ath/ath9k/htc_hst.h index e1ffbb6bd636..06474ccc7696 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.h +++ b/drivers/net/wireless/ath/ath9k/htc_hst.h | |||
@@ -77,6 +77,18 @@ struct htc_config_pipe_msg { | |||
77 | u8 credits; | 77 | u8 credits; |
78 | } __packed; | 78 | } __packed; |
79 | 79 | ||
80 | struct htc_panic_bad_vaddr { | ||
81 | __be32 pattern; | ||
82 | __be32 exccause; | ||
83 | __be32 pc; | ||
84 | __be32 badvaddr; | ||
85 | } __packed; | ||
86 | |||
87 | struct htc_panic_bad_epid { | ||
88 | __be32 pattern; | ||
89 | __be32 epid; | ||
90 | } __packed; | ||
91 | |||
80 | struct htc_ep_callbacks { | 92 | struct htc_ep_callbacks { |
81 | void *priv; | 93 | void *priv; |
82 | void (*tx) (void *, struct sk_buff *, enum htc_endpoint_id, bool txok); | 94 | void (*tx) (void *, struct sk_buff *, enum htc_endpoint_id, bool txok); |