Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369005
b: refs/heads/master
c: 71c76a1
h: refs/heads/master
i:
  369003: 086bd10
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Mar 8, 2013
1 parent 8b260e6 commit 3558897
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ca3a9d06e87e09d2f852397f1fbf7c442c921b5
refs/heads/master: 71c76a170e979d60e01bd093c9b79e3adeb710cc
1 change: 1 addition & 0 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,7 @@ struct hci_request {

void hci_req_init(struct hci_request *req, struct hci_dev *hdev);
int hci_req_run(struct hci_request *req, hci_req_complete_t complete);
int hci_req_add(struct hci_request *req, u16 opcode, u32 plen, void *param);

int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param);
void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags);
Expand Down
22 changes: 22 additions & 0 deletions trunk/net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2517,6 +2517,28 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param)
return 0;
}

/* Queue a command to an asynchronous HCI request */
int hci_req_add(struct hci_request *req, u16 opcode, u32 plen, void *param)
{
struct hci_dev *hdev = req->hdev;
struct sk_buff *skb;

BT_DBG("%s opcode 0x%4.4x plen %d", hdev->name, opcode, plen);

skb = hci_prepare_cmd(hdev, opcode, plen, param);
if (!skb) {
BT_ERR("%s no memory for command", hdev->name);
return -ENOMEM;
}

if (skb_queue_empty(&req->cmd_q))
bt_cb(skb)->req.start = true;

skb_queue_tail(&req->cmd_q, skb);

return 0;
}

/* Get data from the previously sent command */
void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode)
{
Expand Down

0 comments on commit 3558897

Please sign in to comment.