diff options
Diffstat (limited to 'net/bluetooth/a2mp.c')
-rw-r--r-- | net/bluetooth/a2mp.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index 5a04eb1a7e57..5f123c3320a7 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <net/bluetooth/hci_core.h> | 16 | #include <net/bluetooth/hci_core.h> |
17 | #include <net/bluetooth/l2cap.h> | 17 | #include <net/bluetooth/l2cap.h> |
18 | 18 | ||
19 | #include "hci_request.h" | ||
19 | #include "a2mp.h" | 20 | #include "a2mp.h" |
20 | #include "amp.h" | 21 | #include "amp.h" |
21 | 22 | ||
@@ -286,11 +287,21 @@ static int a2mp_change_notify(struct amp_mgr *mgr, struct sk_buff *skb, | |||
286 | return 0; | 287 | return 0; |
287 | } | 288 | } |
288 | 289 | ||
290 | static void read_local_amp_info_complete(struct hci_dev *hdev, u8 status, | ||
291 | u16 opcode) | ||
292 | { | ||
293 | BT_DBG("%s status 0x%2.2x", hdev->name, status); | ||
294 | |||
295 | a2mp_send_getinfo_rsp(hdev); | ||
296 | } | ||
297 | |||
289 | static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb, | 298 | static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb, |
290 | struct a2mp_cmd *hdr) | 299 | struct a2mp_cmd *hdr) |
291 | { | 300 | { |
292 | struct a2mp_info_req *req = (void *) skb->data; | 301 | struct a2mp_info_req *req = (void *) skb->data; |
293 | struct hci_dev *hdev; | 302 | struct hci_dev *hdev; |
303 | struct hci_request hreq; | ||
304 | int err = 0; | ||
294 | 305 | ||
295 | if (le16_to_cpu(hdr->len) < sizeof(*req)) | 306 | if (le16_to_cpu(hdr->len) < sizeof(*req)) |
296 | return -EINVAL; | 307 | return -EINVAL; |
@@ -311,7 +322,11 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb, | |||
311 | } | 322 | } |
312 | 323 | ||
313 | set_bit(READ_LOC_AMP_INFO, &mgr->state); | 324 | set_bit(READ_LOC_AMP_INFO, &mgr->state); |
314 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_AMP_INFO, 0, NULL); | 325 | hci_req_init(&hreq, hdev); |
326 | hci_req_add(&hreq, HCI_OP_READ_LOCAL_AMP_INFO, 0, NULL); | ||
327 | err = hci_req_run(&hreq, read_local_amp_info_complete); | ||
328 | if (err < 0) | ||
329 | a2mp_send_getinfo_rsp(hdev); | ||
315 | 330 | ||
316 | done: | 331 | done: |
317 | if (hdev) | 332 | if (hdev) |