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

Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading

The Broadcom controller on aries S5PV210 boards sends out a couple of
unknown packets after the firmware is loaded. This will cause
logging of errors such as:
Bluetooth: hci0: Frame reassembly failed (-84)

This is probably also the case with other boards, as there are related
Android userspace patches for custom ROMs such as
https://review.lineageos.org/#/c/LineageOS/android_system_bt/+/142721/
Since this appears to be intended behaviour, treated them as diagnostic
packets.

Note that this is another variant of commit 01d5e44ace8a
("Bluetooth: hci_bcm: Handle empty packet after firmware loading")

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Jonathan Bakker and committed by
Marcel Holtmann
22bba805 e3ca60d0

+22
+22
drivers/bluetooth/hci_bcm.c
··· 52 52 #define BCM_LM_DIAG_PKT 0x07 53 53 #define BCM_LM_DIAG_SIZE 63 54 54 55 + #define BCM_TYPE49_PKT 0x31 56 + #define BCM_TYPE49_SIZE 0 57 + 58 + #define BCM_TYPE52_PKT 0x34 59 + #define BCM_TYPE52_SIZE 0 60 + 55 61 #define BCM_AUTOSUSPEND_DELAY 5000 /* default autosleep delay */ 56 62 57 63 #define BCM_NUM_SUPPLIES 2 ··· 601 595 .lsize = 0, \ 602 596 .maxlen = BCM_NULL_SIZE 603 597 598 + #define BCM_RECV_TYPE49 \ 599 + .type = BCM_TYPE49_PKT, \ 600 + .hlen = BCM_TYPE49_SIZE, \ 601 + .loff = 0, \ 602 + .lsize = 0, \ 603 + .maxlen = BCM_TYPE49_SIZE 604 + 605 + #define BCM_RECV_TYPE52 \ 606 + .type = BCM_TYPE52_PKT, \ 607 + .hlen = BCM_TYPE52_SIZE, \ 608 + .loff = 0, \ 609 + .lsize = 0, \ 610 + .maxlen = BCM_TYPE52_SIZE 611 + 604 612 static const struct h4_recv_pkt bcm_recv_pkts[] = { 605 613 { H4_RECV_ACL, .recv = hci_recv_frame }, 606 614 { H4_RECV_SCO, .recv = hci_recv_frame }, 607 615 { H4_RECV_EVENT, .recv = hci_recv_frame }, 608 616 { BCM_RECV_LM_DIAG, .recv = hci_recv_diag }, 609 617 { BCM_RECV_NULL, .recv = hci_recv_diag }, 618 + { BCM_RECV_TYPE49, .recv = hci_recv_diag }, 619 + { BCM_RECV_TYPE52, .recv = hci_recv_diag }, 610 620 }; 611 621 612 622 static int bcm_recv(struct hci_uart *hu, const void *data, int count)