Skip to content

Commit 66c3933

Browse files
jhovoldVudentz
authored andcommitted
Bluetooth: qca: fix wcn3991 device address check
Qualcomm Bluetooth controllers may not have been provisioned with a valid device address and instead end up using the default address 00:00:00:00:5a:ad. This address is now used to determine if a controller has a valid address or if one needs to be provided through devicetree or by user space before the controller can be used. It turns out that the WCN3991 controllers used in Chromium Trogdor machines use a different default address, 39:98:00:00:5a:ad, which also needs to be marked as invalid so that the correct address is fetched from the devicetree. Qualcomm has unfortunately not yet provided any answers as to whether the 39:98 encodes a hardware id and if there are other variants of the default address that needs to be handled by the driver. For now, add the Trogdor WCN3991 default address to the device address check to avoid having these controllers start with the default address instead of their assigned addresses. Fixes: 32868e1 ("Bluetooth: qca: fix invalid device address check") Cc: [email protected] # 6.5 Cc: Doug Anderson <[email protected]> Cc: Janaki Ramaiah Thota <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Tested-by: Douglas Anderson <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 483bc08 commit 66c3933

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/bluetooth/btqca.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define VERSION "0.1"
1717

1818
#define QCA_BDADDR_DEFAULT (&(bdaddr_t) {{ 0xad, 0x5a, 0x00, 0x00, 0x00, 0x00 }})
19+
#define QCA_BDADDR_WCN3991 (&(bdaddr_t) {{ 0xad, 0x5a, 0x00, 0x00, 0x98, 0x39 }})
1920

2021
int qca_read_soc_version(struct hci_dev *hdev, struct qca_btsoc_version *ver,
2122
enum qca_btsoc_type soc_type)
@@ -638,8 +639,10 @@ static int qca_check_bdaddr(struct hci_dev *hdev)
638639
}
639640

640641
bda = (struct hci_rp_read_bd_addr *)skb->data;
641-
if (!bacmp(&bda->bdaddr, QCA_BDADDR_DEFAULT))
642+
if (!bacmp(&bda->bdaddr, QCA_BDADDR_DEFAULT) ||
643+
!bacmp(&bda->bdaddr, QCA_BDADDR_WCN3991)) {
642644
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
645+
}
643646

644647
kfree_skb(skb);
645648

0 commit comments

Comments
 (0)