Skip to content

Commit db57b62

Browse files
moore-brosholtmann
authored andcommitted
Bluetooth: btmtksdio: add support of processing firmware coredump and log
Add support of processing the firmware coredump and log for the diagnostic purpose. Co-developed-by: Mark-yw Chen <[email protected]> Signed-off-by: Mark-yw Chen <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent d156250 commit db57b62

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

drivers/bluetooth/btmtksdio.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,29 @@ static int btmtksdio_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
324324
return err;
325325
}
326326

327+
static int btmtksdio_recv_acl(struct hci_dev *hdev, struct sk_buff *skb)
328+
{
329+
struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
330+
u16 handle = le16_to_cpu(hci_acl_hdr(skb)->handle);
331+
332+
switch (handle) {
333+
case 0xfc6f:
334+
/* Firmware dump from device: when the firmware hangs, the
335+
* device can no longer suspend and thus disable auto-suspend.
336+
*/
337+
pm_runtime_forbid(bdev->dev);
338+
fallthrough;
339+
case 0x05ff:
340+
case 0x05fe:
341+
/* Firmware debug logging */
342+
return hci_recv_diag(hdev, skb);
343+
}
344+
345+
return hci_recv_frame(hdev, skb);
346+
}
347+
327348
static const struct h4_recv_pkt mtk_recv_pkts[] = {
328-
{ H4_RECV_ACL, .recv = hci_recv_frame },
349+
{ H4_RECV_ACL, .recv = btmtksdio_recv_acl },
329350
{ H4_RECV_SCO, .recv = hci_recv_frame },
330351
{ H4_RECV_EVENT, .recv = btmtksdio_recv_event },
331352
};

0 commit comments

Comments
 (0)