mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-08 15:45:14 +00:00
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>
This commit is contained in:
parent
c8ec0f5c9b
commit
482b30b653
2 changed files with 48 additions and 0 deletions
|
@ -358,6 +358,36 @@ ret:
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ath9k_htc_fw_panic_report(struct htc_target *htc_handle,
|
||||||
|
struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
uint32_t *pattern = (uint32_t *)skb->data;
|
||||||
|
|
||||||
|
switch (*pattern) {
|
||||||
|
case 0x33221199:
|
||||||
|
{
|
||||||
|
struct htc_panic_bad_vaddr *htc_panic;
|
||||||
|
htc_panic = (struct htc_panic_bad_vaddr *) skb->data;
|
||||||
|
dev_err(htc_handle->dev, "ath: firmware panic! "
|
||||||
|
"exccause: 0x%08x; pc: 0x%08x; badvaddr: 0x%08x.\n",
|
||||||
|
htc_panic->exccause, htc_panic->pc,
|
||||||
|
htc_panic->badvaddr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x33221299:
|
||||||
|
{
|
||||||
|
struct htc_panic_bad_epid *htc_panic;
|
||||||
|
htc_panic = (struct htc_panic_bad_epid *) skb->data;
|
||||||
|
dev_err(htc_handle->dev, "ath: firmware panic! "
|
||||||
|
"bad epid: 0x%08x\n", htc_panic->epid);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
dev_err(htc_handle->dev, "ath: uknown panic pattern!\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HTC Messages are handled directly here and the obtained SKB
|
* HTC Messages are handled directly here and the obtained SKB
|
||||||
* is freed.
|
* is freed.
|
||||||
|
@ -379,6 +409,12 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
|
||||||
htc_hdr = (struct htc_frame_hdr *) skb->data;
|
htc_hdr = (struct htc_frame_hdr *) skb->data;
|
||||||
epid = htc_hdr->endpoint_id;
|
epid = htc_hdr->endpoint_id;
|
||||||
|
|
||||||
|
if (epid == 0x99) {
|
||||||
|
ath9k_htc_fw_panic_report(htc_handle, skb);
|
||||||
|
kfree_skb(skb);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (epid >= ENDPOINT_MAX) {
|
if (epid >= ENDPOINT_MAX) {
|
||||||
if (pipe_id != USB_REG_IN_PIPE)
|
if (pipe_id != USB_REG_IN_PIPE)
|
||||||
dev_kfree_skb_any(skb);
|
dev_kfree_skb_any(skb);
|
||||||
|
|
|
@ -77,6 +77,18 @@ struct htc_config_pipe_msg {
|
||||||
u8 credits;
|
u8 credits;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
struct htc_panic_bad_vaddr {
|
||||||
|
__be32 pattern;
|
||||||
|
__be32 exccause;
|
||||||
|
__be32 pc;
|
||||||
|
__be32 badvaddr;
|
||||||
|
} __packed;
|
||||||
|
|
||||||
|
struct htc_panic_bad_epid {
|
||||||
|
__be32 pattern;
|
||||||
|
__be32 epid;
|
||||||
|
} __packed;
|
||||||
|
|
||||||
struct htc_ep_callbacks {
|
struct htc_ep_callbacks {
|
||||||
void *priv;
|
void *priv;
|
||||||
void (*tx) (void *, struct sk_buff *, enum htc_endpoint_id, bool txok);
|
void (*tx) (void *, struct sk_buff *, enum htc_endpoint_id, bool txok);
|
||||||
|
|
Loading…
Add table
Reference in a new issue