netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ismael Ferreras Morezuelas <swyterzone@gmail.com>
To: marcel@holtmann.org, johan.hedberg@gmail.com,
	luiz.dentz@gmail.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, luiz.von.dentz@intel.com,
	quic_zijuhu@quicinc.com, hdegoede@redhat.com,
	swyterzone@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org,
	netdev@vger.kernel.org
Subject: [PATCH 2/3] Bluetooth: btusb: Add a setup message for CSR dongles showing the Read Local Information values
Date: Sat, 29 Oct 2022 22:24:53 +0200	[thread overview]
Message-ID: <20221029202454.25651-2-swyterzone@gmail.com> (raw)
In-Reply-To: <20221029202454.25651-1-swyterzone@gmail.com>

The rationale of showing this is that it's potentially critical information to diagnose
and find more CSR compatibility bugs in the future and it will save a lot of headaches.

We can't ask normal people to run btmon, but infinitely more users already post their dmesg.
Because in many cases the device doesn't go up, most of the tools won't show these either.

Given that clones come from a wide array of vendors (some are actually Barrot,
some are something else) and these numbers are what let us find differences between
actual and fake ones, it will be immensely helpful to scour the Internet looking
for this pattern and building an actual database to find correlations and
improve the checks. I can't buy a sack of clones and do it myself.

Cc: stable@vger.kernel.org
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ismael Ferreras Morezuelas <swyterzone@gmail.com>
---
 drivers/bluetooth/btusb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 1360b2163ec5..8f34bf195bae 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2112,6 +2112,11 @@ static int btusb_setup_csr(struct hci_dev *hdev)
 
 	rp = (struct hci_rp_read_local_version *)skb->data;
 
+	bt_dev_info(hdev, "CSR: Setting up dongle with HCI ver=%u rev=%04x; LMP ver=%u subver=%04x; manufacturer=%u",
+		le16_to_cpu(rp->hci_ver), le16_to_cpu(rp->hci_rev),
+		le16_to_cpu(rp->lmp_ver), le16_to_cpu(rp->lmp_subver),
+		le16_to_cpu(rp->manufacturer));
+
 	/* Detect a wide host of Chinese controllers that aren't CSR.
 	 *
 	 * Known fake bcdDevices: 0x0100, 0x0134, 0x1915, 0x2520, 0x7558, 0x8891
-- 
2.38.1


  reply	other threads:[~2022-10-29 20:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29 20:24 [PATCH 1/3] Bluetooth: btusb: Fix Chinese CSR dongles again by re-adding ERR_DATA_REPORTING quirk Ismael Ferreras Morezuelas
2022-10-29 20:24 ` Ismael Ferreras Morezuelas [this message]
2022-10-29 20:24 ` [PATCH 3/3] Bluetooth: btusb: Add a parameter to let users disable the fake CSR force-suspend hack Ismael Ferreras Morezuelas
2022-11-09 20:49   ` Luiz Augusto von Dentz
2022-11-09 21:30     ` Swyter
2022-11-09 22:39       ` Luiz Augusto von Dentz
2022-11-09 23:10         ` Swyter
2022-11-10 11:16         ` Hans de Goede
2022-11-26 23:26         ` Ismael Ferreras Morezuelas
2022-10-30  9:59 ` [PATCH 1/3] Bluetooth: btusb: Fix Chinese CSR dongles again by re-adding ERR_DATA_REPORTING quirk Hans de Goede

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=20221029202454.25651-2-swyterzone@gmail.com \
    --to=swyterzone@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hdegoede@redhat.com \
    --cc=johan.hedberg@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=quic_zijuhu@quicinc.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;
as well as URLs for NNTP newsgroup(s).