Skip to content

Commit eb8c101

Browse files
Mattijs Korpershoekholtmann
authored andcommitted
Bluetooth: hci_core: fix init for HCI_USER_CHANNEL
During the setup() stage, HCI device drivers expect the chip to acknowledge its setup() completion via vendor specific frames. If userspace opens() such HCI device in HCI_USER_CHANNEL [1] mode, the vendor specific frames are never tranmitted to the driver, as they are filtered in hci_rx_work(). Allow HCI devices which operate in HCI_USER_CHANNEL mode to receive frames if the HCI device is is HCI_INIT state. [1] https://www.spinics.net/lists/linux-bluetooth/msg37345.html Fixes: 2350018 ("Bluetooth: Introduce new HCI socket channel for user operation") Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 4c371bb commit eb8c101

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎net/bluetooth/hci_core.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4440,7 +4440,14 @@ static void hci_rx_work(struct work_struct *work)
44404440
hci_send_to_sock(hdev, skb);
44414441
}
44424442

4443-
if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) {
4443+
/* If the device has been opened in HCI_USER_CHANNEL,
4444+
* the userspace has exclusive access to device.
4445+
* When device is HCI_INIT, we still need to process
4446+
* the data packets to the driver in order
4447+
* to complete its setup().
4448+
*/
4449+
if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
4450+
!test_bit(HCI_INIT, &hdev->flags)) {
44444451
kfree_skb(skb);
44454452
continue;
44464453
}

0 commit comments

Comments
 (0)