From: Johan Hovold <johan@kernel.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Matthias Kaehlcke <mka@chromium.org>,
Johan Hovold <johan+linaro@kernel.org>,
Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Bjorn Andersson <quic_bjorande@quicinc.com>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Balakrishna Godavarthi <quic_bgodavar@quicinc.com>,
Doug Anderson <dianders@google.com>,
Stephen Boyd <swboyd@google.com>
Subject: Re: [PATCH] Bluetooth: qca: fix device-address endianness
Date: Thu, 18 Jan 2024 09:40:35 +0100 [thread overview]
Message-ID: <ZajkA6oxtMcxKY4X@hovoldconsulting.com> (raw)
In-Reply-To: <CABBYNZJ_EAuGEdeW+vZzXu20nVqLkLwiQbYQ9XzoABxQ5rAzdQ@mail.gmail.com>
On Wed, Jan 17, 2024 at 05:49:07PM -0500, Luiz Augusto von Dentz wrote:
> On Wed, Jan 10, 2024 at 3:12 AM Johan Hovold <johan@kernel.org> wrote:
> > On Tue, Jan 09, 2024 at 05:54:01PM +0000, Matthias Kaehlcke wrote:
> > > hciconfig
> > > hci0: Type: Primary Bus: UART
> > > BD Address: 8C:FD:F0:40:15:DC ACL MTU: 1024:8 SCO MTU: 240:8
> > > UP RUNNING
> > > RX bytes:1700 acl:0 sco:0 events:95 errors:0
> > > TX bytes:128949 acl:0 sco:0 commands:578 errors:0
> >
> > And any user space tool overriding the address would currently need to
> > provide the address in reverse order on Qualcomm platforms like this
> > one (e.g. if generating the address for privacy reasons).
>
> Perhaps we could attempt to resolve the address byteorder, in
> userspace we use hwdb_get_company to resolve the company but since
> this shall only really care about Qualcomm range(s) perhaps we can
> hardcode them check in which order the address is, that said if the
> device is configured with a Static Random Address then that would not
> work, but that is only really possible for BLE only devices.
It's not just Qualcomm ranges; The Lenovo ThinkPad X13s that I noticed
this on has been assigned a Wistron OUI, for example.
We're still hoping to learn how to retrieve this address (from the
secure world firmware) so that we can set it directly from the driver,
but for now it needs to be set using btmgmt (or the local-bd-address
devicetree property).
As was discussed here:
https://github.com/bluez/bluez/issues/107
it would be useful to teach bluetoothd to (generate and) set an address
for devices that lack (accessible) persistent storage. And any such
generic tool would need to work using the standard interfaces and the
address endianness that those interfaces expect.
And from skimming the Bluetooth spec, I was under the impression that
random addresses applied also to non-BLE devices (e.g. requiring the two
most-significants bits to be 1).
But to summarise, I don't really see any way around fixing the Qualcomm
driver.
Johan
next prev parent reply other threads:[~2024-01-18 8:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-27 18:03 [PATCH] Bluetooth: qca: fix device-address endianness Johan Hovold
2023-12-28 6:08 ` Nikita Travkin
2024-01-09 16:50 ` Matthias Kaehlcke
2024-01-09 17:12 ` Johan Hovold
2024-01-09 17:54 ` Matthias Kaehlcke
2024-01-10 8:12 ` Johan Hovold
2024-01-17 21:52 ` Doug Anderson
2024-01-18 8:17 ` Johan Hovold
2024-01-17 22:49 ` Luiz Augusto von Dentz
2024-01-18 8:40 ` Johan Hovold [this message]
2024-01-18 15:30 ` Luiz Augusto von Dentz
2024-01-19 15:59 ` Johan Hovold
2024-02-13 14:41 ` Johan Hovold
2024-02-13 15:55 ` Matthias Kaehlcke
2024-02-13 16:03 ` Johan Hovold
2024-02-13 16:18 ` Matthias Kaehlcke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZajkA6oxtMcxKY4X@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=dianders@google.com \
--cc=johan+linaro@kernel.org \
--cc=johan.hedberg@gmail.com \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=mka@chromium.org \
--cc=quic_bgodavar@quicinc.com \
--cc=quic_bjorande@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=swboyd@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox