Skip to content

Commit 0ad184e

Browse files
holtmannjhedberg
authored andcommitted
Bluetooth: Support HCI_QUIRK_EXTERNAL_CONFIG for hci_vhci driver
This adds support for configuring the hci_vhci virtual controllers to require a setup stage using HCI_QUIRK_EXTERNAL_CONFIG. With this option the virtual controller will start out as unconfigured. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent af202f8 commit 0ad184e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎drivers/bluetooth/hci_vhci.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ static int vhci_create_device(struct vhci_data *data, __u8 opcode)
107107
if (dev_type != HCI_BREDR && dev_type != HCI_AMP)
108108
return -EINVAL;
109109

110-
/* bits 2-6 are reserved (must be zero) */
111-
if (opcode & 0x7c)
110+
/* bits 2-5 are reserved (must be zero) */
111+
if (opcode & 0x3c)
112112
return -EINVAL;
113113

114114
skb = bt_skb_alloc(4, GFP_KERNEL);
@@ -132,6 +132,10 @@ static int vhci_create_device(struct vhci_data *data, __u8 opcode)
132132
hdev->flush = vhci_flush;
133133
hdev->send = vhci_send_frame;
134134

135+
/* bit 6 is for external configuration */
136+
if (opcode & 0x40)
137+
set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks);
138+
135139
/* bit 7 is for raw device */
136140
if (opcode & 0x80)
137141
set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);

0 commit comments

Comments
 (0)