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

Commit e2bef384 authored by Rajat Jain's avatar Rajat Jain Committed by Marcel Holtmann
Browse files

Bluetooth: Allow driver specific cmd timeout handling



Add a hook to allow the BT driver to do device or command specific
handling in case of timeouts. This is to be used by Intel driver to
reset the device after certain number of timeouts.

Signed-off-by: default avatarRajat Jain <rajatja@google.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent b4dfbbd1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -437,6 +437,7 @@ struct hci_dev {
	int (*post_init)(struct hci_dev *hdev);
	int (*set_diag)(struct hci_dev *hdev, bool enable);
	int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr);
	void (*cmd_timeout)(struct hci_dev *hdev);
};

#define HCI_PHY_HANDLE(handle)	(handle & 0xff)
+3 −0
Original line number Diff line number Diff line
@@ -2578,6 +2578,9 @@ static void hci_cmd_timeout(struct work_struct *work)
		bt_dev_err(hdev, "command tx timeout");
	}

	if (hdev->cmd_timeout)
		hdev->cmd_timeout(hdev);

	atomic_set(&hdev->cmd_cnt, 1);
	queue_work(hdev->workqueue, &hdev->cmd_work);
}