Commit 0ad184ef authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

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: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent af202f84
...@@ -107,8 +107,8 @@ static int vhci_create_device(struct vhci_data *data, __u8 opcode) ...@@ -107,8 +107,8 @@ static int vhci_create_device(struct vhci_data *data, __u8 opcode)
if (dev_type != HCI_BREDR && dev_type != HCI_AMP) if (dev_type != HCI_BREDR && dev_type != HCI_AMP)
return -EINVAL; return -EINVAL;
/* bits 2-6 are reserved (must be zero) */ /* bits 2-5 are reserved (must be zero) */
if (opcode & 0x7c) if (opcode & 0x3c)
return -EINVAL; return -EINVAL;
skb = bt_skb_alloc(4, GFP_KERNEL); skb = bt_skb_alloc(4, GFP_KERNEL);
...@@ -132,6 +132,10 @@ static int vhci_create_device(struct vhci_data *data, __u8 opcode) ...@@ -132,6 +132,10 @@ static int vhci_create_device(struct vhci_data *data, __u8 opcode)
hdev->flush = vhci_flush; hdev->flush = vhci_flush;
hdev->send = vhci_send_frame; hdev->send = vhci_send_frame;
/* bit 6 is for external configuration */
if (opcode & 0x40)
set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks);
/* bit 7 is for raw device */ /* bit 7 is for raw device */
if (opcode & 0x80) if (opcode & 0x80)
set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment