From b7bdf2d7f19c3346c36bb9e0266111fce921b8c5 Mon Sep 17 00:00:00 2001 From: Nick Oestergaard Date: Mon, 9 Jul 2018 16:17:30 +0200 Subject: [PATCH] [9610] wlbt: Let kernel driver present a fallback bdaddr A new kernel module parameter with a suggested address that the host stack can use as a fallback. We use the SOC ID as is used if there is no android stack, i.e. btcli. This will make sure we do not touch that stack and the address will be the same in btcli as is used by the stack. SCSC-Bug-Id: SSB-41759 Change-Id: Iff679b464622920e01fe617f32ee98ab23fdf1d8 Signed-off-by: Nick Oestergaard --- drivers/misc/samsung/scsc_bt/scsc_bt_module.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/misc/samsung/scsc_bt/scsc_bt_module.c b/drivers/misc/samsung/scsc_bt/scsc_bt_module.c index 9288084ef49d..0de645d2b4e0 100755 --- a/drivers/misc/samsung/scsc_bt/scsc_bt_module.c +++ b/drivers/misc/samsung/scsc_bt/scsc_bt_module.c @@ -74,6 +74,9 @@ static int ant_service_start_count; #endif static u64 bluetooth_address; +#ifdef CONFIG_ARCH_EXYNOS +static char *bluetooth_address_fallback = "00:00:00:00:00:00"; +#endif static u32 bt_info_trigger; static u32 bt_info_interrupt; static u32 firmware_control; @@ -93,6 +96,12 @@ module_param(bluetooth_address, ullong, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(bluetooth_address, "Bluetooth address"); +#ifdef CONFIG_ARCH_EXYNOS +module_param(bluetooth_address_fallback, charp, 0444); +MODULE_PARM_DESC(bluetooth_address_fallback, + "Bluetooth address as proposed by the driver"); +#endif + module_param(service_start_count, int, S_IRUGO); MODULE_PARM_DESC(service_start_count, "Track how many times the BT service has been started"); @@ -1979,6 +1988,16 @@ static int __init scsc_bt_module_init(void) spin_lock_init(&bt_service.avdtp_detect.lock); spin_lock_init(&bt_service.avdtp_detect.fw_write_lock); +#ifdef CONFIG_ARCH_EXYNOS + sprintf(bluetooth_address_fallback, "%02X:%02X:%02X:%02X:%02X:%02X", + (exynos_soc_info.unique_id & 0x000000FF0000) >> 16, + (exynos_soc_info.unique_id & 0x00000000FF00) >> 8, + (exynos_soc_info.unique_id & 0x0000000000FF) >> 0, + (exynos_soc_info.unique_id & 0xFF0000000000) >> 40, + (exynos_soc_info.unique_id & 0x00FF00000000) >> 32, + (exynos_soc_info.unique_id & 0x0000FF000000) >> 24); +#endif + #ifdef CONFIG_SCSC_ANT SCSC_TAG_DEBUG(BT_COMMON, "dev=%u class=%p\n", ant_service.device, common_service.class); -- 2.20.1