Several vendor drivers have a requirement to send a synchronous raw HCI reset with HCI_INIT_TIMEOUT. Add a dedicated __hci_reset_sync() for them to use.
Unified · Split
| @@ -59,6 +59,7 @@ int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen, · 58 unmodified lines | |||
| 59 | int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen, | 59 | int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen, |
| 60 | const void *param, u8 event, u32 timeout, | 60 | const void *param, u8 event, u32 timeout, |
| 61 | struct sock *sk); | 61 | struct sock *sk); |
| 62 | int __hci_reset_sync(struct hci_dev *hdev); | ||
| 62 | int hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen, | 63 | int hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen, |
| 63 | const void *param, u32 timeout); | 64 | const void *param, u32 timeout); |
| 64 | 65 | ||
| @@ -3766,6 +3766,14 @@ int hci_reset_sync(struct hci_dev *hdev) · 3765 unmodified lines | |||
| 3766 | return 0; | 3766 | return 0; |
| 3767 | } | 3767 | } |
| 3768 | 3768 | ||
| 3769 | /* Send a raw HCI reset for use by vendor drivers */ | ||
| 3770 | int __hci_reset_sync(struct hci_dev *hdev) | ||
| 3771 | { | ||
| 3772 | return __hci_cmd_sync_status(hdev, HCI_OP_RESET, 0, NULL, | ||
| 3773 | HCI_INIT_TIMEOUT); | ||
| 3774 | } | ||
| 3775 | EXPORT_SYMBOL(__hci_reset_sync); | ||
| 3776 | |||
| 3769 | static int hci_init0_sync(struct hci_dev *hdev) | 3777 | static int hci_init0_sync(struct hci_dev *hdev) |
| 3770 | { | 3778 | { |
| 3771 | int err; | 3779 | int err; |