summaryrefslogtreecommitdiff
path: root/net/bluetooth/hci_request.h
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-11-10 09:44:54 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-11-19 17:50:28 +0100
commitbe91cd05704d5a547de086d0e61c249ee62d2e13 (patch)
tree2f6331d2e90708233041085adac56fc4a985efa9 /net/bluetooth/hci_request.h
parent030e7f8141a262e32dc064d7cf12377d769d45c2 (diff)
Bluetooth: Move synchronous request handling into hci_request.c
hci_request.c is a more natural place for the synchronous request handling. Furthermore, we will soon need access to some of the previously private-to-hci_core.c functions from hci_request.c. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_request.h')
-rw-r--r--net/bluetooth/hci_request.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/bluetooth/hci_request.h b/net/bluetooth/hci_request.h
index 25c7f1305dcb..6e6bad4ca4ab 100644
--- a/net/bluetooth/hci_request.h
+++ b/net/bluetooth/hci_request.h
@@ -20,6 +20,9 @@
SOFTWARE IS DISCLAIMED.
*/
+#define hci_req_lock(d) mutex_lock(&d->req_lock)
+#define hci_req_unlock(d) mutex_unlock(&d->req_lock)
+
struct hci_request {
struct hci_dev *hdev;
struct sk_buff_head cmd_q;
@@ -41,6 +44,14 @@ void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status,
hci_req_complete_t *req_complete,
hci_req_complete_skb_t *req_complete_skb);
+int hci_req_sync(struct hci_dev *hdev, void (*req)(struct hci_request *req,
+ unsigned long opt),
+ unsigned long opt, __u32 timeout);
+int __hci_req_sync(struct hci_dev *hdev, void (*func)(struct hci_request *req,
+ unsigned long opt),
+ unsigned long opt, __u32 timeout);
+void hci_req_cancel(struct hci_dev *hdev, int err);
+
struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen,
const void *param);