diff options
author | Sean Wang <sean.wang@mediatek.com> | 2021-11-20 01:25:46 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2021-11-24 18:08:29 +0300 |
commit | db57b625912abc755b3172f59b13b947db69cc4c (patch) | |
tree | 67cdb3a401e2915936fcb2f209ef54bde99c0721 /drivers/bluetooth/btmtksdio.c | |
parent | d156250018ab5adbcfcc9ea90455d5fba5df6769 (diff) | |
download | linux-db57b625912abc755b3172f59b13b947db69cc4c.tar.xz |
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 <mark-yw.chen@mediatek.com>
Signed-off-by: Mark-yw Chen <mark-yw.chen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btmtksdio.c')
-rw-r--r-- | drivers/bluetooth/btmtksdio.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index ce6a6c00ff98..93c47796ecfd 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -324,8 +324,29 @@ err_out: return err; } +static int btmtksdio_recv_acl(struct hci_dev *hdev, struct sk_buff *skb) +{ + struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); + u16 handle = le16_to_cpu(hci_acl_hdr(skb)->handle); + + switch (handle) { + case 0xfc6f: + /* Firmware dump from device: when the firmware hangs, the + * device can no longer suspend and thus disable auto-suspend. + */ + pm_runtime_forbid(bdev->dev); + fallthrough; + case 0x05ff: + case 0x05fe: + /* Firmware debug logging */ + return hci_recv_diag(hdev, skb); + } + + return hci_recv_frame(hdev, skb); +} + static const struct h4_recv_pkt mtk_recv_pkts[] = { - { H4_RECV_ACL, .recv = hci_recv_frame }, + { H4_RECV_ACL, .recv = btmtksdio_recv_acl }, { H4_RECV_SCO, .recv = hci_recv_frame }, { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, }; |