]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading
authorJonathan Bakker <xc-racer2@live.ca>
Wed, 19 Dec 2018 11:22:28 +0000 (12:22 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:32 +0000 (14:21 -0300)
BugLink: https://bugs.launchpad.net/bugs/1855787
[ Upstream commit 22bba80500fdf624a7cfbb65fdfa97a038ae224d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/bluetooth/hci_bcm.c

index 238263db8604ab36e9def14201b55067597ebd14..383768cdedfc63270dddea14024d15a28d630738 100644 (file)
 #define BCM_LM_DIAG_PKT 0x07
 #define BCM_LM_DIAG_SIZE 63
 
+#define BCM_TYPE49_PKT 0x31
+#define BCM_TYPE49_SIZE 0
+
+#define BCM_TYPE52_PKT 0x34
+#define BCM_TYPE52_SIZE 0
+
 #define BCM_AUTOSUSPEND_DELAY  5000 /* default autosleep delay */
 
 /* device driver resources */
@@ -494,12 +500,28 @@ finalize:
        .lsize = 0, \
        .maxlen = BCM_NULL_SIZE
 
+#define BCM_RECV_TYPE49 \
+       .type = BCM_TYPE49_PKT, \
+       .hlen = BCM_TYPE49_SIZE, \
+       .loff = 0, \
+       .lsize = 0, \
+       .maxlen = BCM_TYPE49_SIZE
+
+#define BCM_RECV_TYPE52 \
+       .type = BCM_TYPE52_PKT, \
+       .hlen = BCM_TYPE52_SIZE, \
+       .loff = 0, \
+       .lsize = 0, \
+       .maxlen = BCM_TYPE52_SIZE
+
 static const struct h4_recv_pkt bcm_recv_pkts[] = {
        { H4_RECV_ACL,      .recv = hci_recv_frame },
        { H4_RECV_SCO,      .recv = hci_recv_frame },
        { H4_RECV_EVENT,    .recv = hci_recv_frame },
        { BCM_RECV_LM_DIAG, .recv = hci_recv_diag  },
        { BCM_RECV_NULL,    .recv = hci_recv_diag  },
+       { BCM_RECV_TYPE49,  .recv = hci_recv_diag  },
+       { BCM_RECV_TYPE52,  .recv = hci_recv_diag  },
 };
 
 static int bcm_recv(struct hci_uart *hu, const void *data, int count)