Bluetooth: Move synchronous request handling into hci_request.c
[linux-2.6-block.git] / net / bluetooth / hci_request.h
index 25c7f1305dcbcb273816c15c95097f2a1ed2c1f2..6e6bad4ca4ab7e7ed5534da54fd3528743834fa2 100644 (file)
@@ -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);