diff options
Diffstat (limited to 'net/bluetooth/hci_request.h')
-rw-r--r-- | net/bluetooth/hci_request.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/net/bluetooth/hci_request.h b/net/bluetooth/hci_request.h index 25c7f1305dcb..6b9e59f7f7a9 100644 --- a/net/bluetooth/hci_request.h +++ b/net/bluetooth/hci_request.h | |||
@@ -20,6 +20,9 @@ | |||
20 | SOFTWARE IS DISCLAIMED. | 20 | SOFTWARE IS DISCLAIMED. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define hci_req_sync_lock(hdev) mutex_lock(&hdev->req_lock) | ||
24 | #define hci_req_sync_unlock(hdev) mutex_unlock(&hdev->req_lock) | ||
25 | |||
23 | struct hci_request { | 26 | struct hci_request { |
24 | struct hci_dev *hdev; | 27 | struct hci_dev *hdev; |
25 | struct sk_buff_head cmd_q; | 28 | struct sk_buff_head cmd_q; |
@@ -41,21 +44,37 @@ void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status, | |||
41 | hci_req_complete_t *req_complete, | 44 | hci_req_complete_t *req_complete, |
42 | hci_req_complete_skb_t *req_complete_skb); | 45 | hci_req_complete_skb_t *req_complete_skb); |
43 | 46 | ||
47 | int hci_req_sync(struct hci_dev *hdev, int (*req)(struct hci_request *req, | ||
48 | unsigned long opt), | ||
49 | unsigned long opt, u32 timeout, u8 *hci_status); | ||
50 | int __hci_req_sync(struct hci_dev *hdev, int (*func)(struct hci_request *req, | ||
51 | unsigned long opt), | ||
52 | unsigned long opt, u32 timeout, u8 *hci_status); | ||
53 | void hci_req_sync_cancel(struct hci_dev *hdev, int err); | ||
54 | |||
44 | struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen, | 55 | struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen, |
45 | const void *param); | 56 | const void *param); |
46 | 57 | ||
47 | void hci_req_add_le_scan_disable(struct hci_request *req); | 58 | void hci_req_add_le_scan_disable(struct hci_request *req); |
48 | void hci_req_add_le_passive_scan(struct hci_request *req); | 59 | void hci_req_add_le_passive_scan(struct hci_request *req); |
49 | 60 | ||
61 | /* Returns true if HCI commands were queued */ | ||
62 | bool hci_req_stop_discovery(struct hci_request *req); | ||
63 | |||
50 | void hci_update_page_scan(struct hci_dev *hdev); | 64 | void hci_update_page_scan(struct hci_dev *hdev); |
51 | void __hci_update_page_scan(struct hci_request *req); | 65 | void __hci_update_page_scan(struct hci_request *req); |
52 | 66 | ||
53 | int hci_update_random_address(struct hci_request *req, bool require_privacy, | 67 | int hci_update_random_address(struct hci_request *req, bool require_privacy, |
54 | u8 *own_addr_type); | 68 | u8 *own_addr_type); |
55 | 69 | ||
56 | void hci_update_background_scan(struct hci_dev *hdev); | ||
57 | void __hci_update_background_scan(struct hci_request *req); | ||
58 | |||
59 | int hci_abort_conn(struct hci_conn *conn, u8 reason); | 70 | int hci_abort_conn(struct hci_conn *conn, u8 reason); |
60 | void __hci_abort_conn(struct hci_request *req, struct hci_conn *conn, | 71 | void __hci_abort_conn(struct hci_request *req, struct hci_conn *conn, |
61 | u8 reason); | 72 | u8 reason); |
73 | |||
74 | static inline void hci_update_background_scan(struct hci_dev *hdev) | ||
75 | { | ||
76 | queue_work(hdev->req_workqueue, &hdev->bg_scan_update); | ||
77 | } | ||
78 | |||
79 | void hci_request_setup(struct hci_dev *hdev); | ||
80 | void hci_request_cancel_all(struct hci_dev *hdev); | ||