Skip to content

Commit e2bef38

Browse files
Rajat Jainholtmann
authored andcommitted
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: Rajat Jain <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent b4dfbbd commit e2bef38

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/net/bluetooth/hci_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ struct hci_dev {
437437
int (*post_init)(struct hci_dev *hdev);
438438
int (*set_diag)(struct hci_dev *hdev, bool enable);
439439
int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr);
440+
void (*cmd_timeout)(struct hci_dev *hdev);
440441
};
441442

442443
#define HCI_PHY_HANDLE(handle) (handle & 0xff)

net/bluetooth/hci_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2578,6 +2578,9 @@ static void hci_cmd_timeout(struct work_struct *work)
25782578
bt_dev_err(hdev, "command tx timeout");
25792579
}
25802580

2581+
if (hdev->cmd_timeout)
2582+
hdev->cmd_timeout(hdev);
2583+
25812584
atomic_set(&hdev->cmd_cnt, 1);
25822585
queue_work(hdev->workqueue, &hdev->cmd_work);
25832586
}

0 commit comments

Comments
 (0)