Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 740011cf authored by Sean Wang's avatar Sean Wang Committed by Marcel Holtmann
Browse files

Bluetooth: Add new quirk for non-persistent setup settings



Add a new quirk HCI_QUIRK_NON_PERSISTENT_SETUP allowing that a quirk that
runs setup() after every open() and not just after the first open().

Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 85a721a8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -183,6 +183,15 @@ enum {
	 * during the hdev->setup vendor callback.
	 */
	HCI_QUIRK_NON_PERSISTENT_DIAG,

	/* When this quirk is set, setup() would be run after every
	 * open() and not just after the first open().
	 *
	 * This quirk can be set before hci_register_dev is called or
	 * during the hdev->setup vendor callback.
	 *
	 */
	HCI_QUIRK_NON_PERSISTENT_SETUP,
};

/* HCI device flags */
+2 −1
Original line number Diff line number Diff line
@@ -1415,7 +1415,8 @@ static int hci_dev_do_open(struct hci_dev *hdev)
	atomic_set(&hdev->cmd_cnt, 1);
	set_bit(HCI_INIT, &hdev->flags);

	if (hci_dev_test_flag(hdev, HCI_SETUP)) {
	if (hci_dev_test_flag(hdev, HCI_SETUP) ||
	    test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
		hci_sock_dev_event(hdev, HCI_DEV_SETUP);

		if (hdev->setup)