From fff6e86f4ca4c28e7b13e3949e10fc483f3d5a3b Mon Sep 17 00:00:00 2001 From: Paolo Pisati Date: Mon, 14 Jan 2019 16:21:41 +0000 Subject: [PATCH 1/2] UBUNTU: SAUCE: btqcomsmd: introduce BT_QCOMSMD_HACK BugLink: https://bugs.launchpad.net/bugs/1810797 Signed-off-by: Paolo Pisati --- drivers/bluetooth/Kconfig | 7 +++++++ drivers/bluetooth/btqcomsmd.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 60e1c7d6986d..78f38d927e5c 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -378,4 +378,11 @@ config BT_QCOMSMD Say Y here to compile support for HCI over Qualcomm SMD into the kernel or say M to compile as a module. +config BT_QCOMSMD_HACK + bool "Don't forcefully hook hci setup()" + default n + help + Don't forcefully hook hci setup() in case a BD address wasn't + assigned to hcidev during qcomsmd_probe(). + endmenu diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c index 2c9a5fc9137d..e77a7ab7e532 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -180,7 +180,12 @@ static int btqcomsmd_probe(struct platform_device *pdev) hdev->open = btqcomsmd_open; hdev->close = btqcomsmd_close; hdev->send = btqcomsmd_send; +#ifdef CONFIG_BT_QCOMSMD_HACK + if (bacmp(&btq->bdaddr, BDADDR_ANY)) + hdev->setup = btqcomsmd_setup; +#else hdev->setup = btqcomsmd_setup; +#endif hdev->set_bdaddr = qca_set_bdaddr_rome; ret = hci_register_dev(hdev); -- 2.17.1