Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Oleksij Rempel and committed by
John W. Linville
482b30b6 c8ec0f5c

+48
+36
drivers/net/wireless/ath/ath9k/htc_hst.c
··· 358 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 392 * HTC Messages are handled directly here and the obtained SKB 363 393 * is freed. ··· 408 378 409 379 htc_hdr = (struct htc_frame_hdr *) skb->data; 410 380 epid = htc_hdr->endpoint_id; 381 + 382 + if (epid == 0x99) { 383 + ath9k_htc_fw_panic_report(htc_handle, skb); 384 + kfree_skb(skb); 385 + return; 386 + } 411 387 412 388 if (epid >= ENDPOINT_MAX) { 413 389 if (pipe_id != USB_REG_IN_PIPE)
+12
drivers/net/wireless/ath/ath9k/htc_hst.h
··· 77 77 u8 credits; 78 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 92 struct htc_ep_callbacks { 81 93 void *priv; 82 94 void (*tx) (void *, struct sk_buff *, enum htc_endpoint_id, bool txok);