Re: [PATCH v2] Bluetooth: btqcomsmd: BD address setup
From: Loic Poulain <hidden>
Date: 2017-09-04 10:43:36
Hi Marcel On 4 September 2017 at 09:39, Marcel Holtmann [off-list ref] wrote:
Hi Loic,quoted
Bluetooth BD address can be retrieved in the same way as for wcnss-wlan MAC address. This patch mainly stores the local-mac-address property and sets the BD address during hci device setup. If the default BD address is detected, mark the device as unconfigured. Signed-off-by: Loic Poulain <redacted> --- drivers/bluetooth/btqcomsmd.c | 63 +++++++++++++++++++++++++++++++++++++++++++quoted
1 file changed, 63 insertions(+) v2: Set device as unconfigured if default address detected Add warning if BD addr retrieved from DTdiff --git a/drivers/bluetooth/btqcomsmd.cb/drivers/bluetooth/btqcomsmd.cquoted
index d00c4fd..e07df69 100644--- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c@@ -15,6 +15,8 @@#include <linux/module.h> #include <linux/slab.h> #include <linux/rpmsg.h> +#include <linux/of.h> + #include <linux/soc/qcom/wcnss_ctrl.h> #include <linux/platform_device.h>@@ -23,9 +25,12 @@#include "btqca.h" +#define BDADDR_QCOMSMD (&(bdaddr_t) {{0xAD, 0x5A, 0x00, 0x00, 0x00,0x00}})quoted
+ struct btqcomsmd { struct hci_dev *hdev; + const bdaddr_t *addr;so lets use bdaddr here. And frankly I would really just use bdaddr_t bdaddr here. You have to swap the address anyway since we use local-mac-address. Unless of course we start using local-bd-address as DT property. Remember that even a WiFi address must be different from a Bluetooth address. You can not use the same. So the boot loader needs to understand that this is the Bluetooth address and not the WiFi address.
Yes the bootloader seems to set the same address as the wlan one but with last bit flipped. However I agree that this property should be updated with bt specific naming to avoid confusion. Regards, Loic