Skip to contentSkip to conversation

Bluetooth: btbcm: Send HCI Reset before sending Apple specific commands

PATCH Applied Marcel Holtmann 2 participants 2 messages Oct 3, 2015 – Oct 5, 2015 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: btbcm: Send HCI Reset before sending Apple specific commands

The commit 7bee8b08c428 allows the Read Verbose Config Info to fail gracefully and not cause the controller setup to abort. It seems the reason that command failed in the first place was the missing HCI Reset to bring the controller in full Bluetooth mode.

Apple Bluetooth controllers start out in HID mode and when in that mode the Read Verbose Config Info command is not allowed. Sending HCI Reset switches the controller into full HCI mode.

---
 drivers/bluetooth/btbcm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/bluetooth/btbcm.c +8 -2
index 02ed816a18f9..ad7371da5aaa 100644
@@ -475,12 +475,18 @@ EXPORT_SYMBOL_GPL(btbcm_setup_patchram);
 int btbcm_setup_apple(struct hci_dev *hdev)
 {
 	struct sk_buff *skb;
+	int err;
+
+	/* Reset */
+	err = btbcm_reset(hdev);
+	if (err)
+		return err;
 
 	/* Read Verbose Config Version Info */
 	skb = btbcm_read_verbose_config(hdev);
 	if (!IS_ERR(skb)) {
-		BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name, skb->data[1],
-			get_unaligned_le16(skb->data + 5));
+		BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name,
+			skb->data[1], get_unaligned_le16(skb->data + 5));
 		kfree_skb(skb);
 	}
 
Signature · 1 line
2.4.3
#1 lore raw

Hi Marcel,

Quoted 5 lines · Marcel Holtmann

The commit 7bee8b08c428 allows the Read Verbose Config Info to fail gracefully and not cause the controller setup to abort. It seems the reason that command failed in the first place was the missing HCI Reset to bring the controller in full Bluetooth mode.

Quoted 8 lines

Apple Bluetooth controllers start out in HID mode and when in that mode the Read Verbose Config Info command is not allowed. Sending HCI Reset switches the controller into full HCI mode.

---
 drivers/bluetooth/btbcm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Applied to bluetooth-next. Thanks.

Johan