diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-09-27 10:26:14 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-09-27 16:13:54 -0400 |
commit | 0d868de9d8760c76f6d4c6c777935c05ef272caa (patch) | |
tree | 10103849d3b23c493d762288628121331da536b4 | |
parent | cb8488c0b60a947c0ef4a1a94573a7fefd3f20b4 (diff) |
Bluetooth: A2MP: Process A2MP Getinfo Rsp
Process A2MP Getinfo Response, send Get AMP Assoc Req.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r-- | net/bluetooth/a2mp.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index 0125417695eb..594df9643365 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c | |||
@@ -271,6 +271,35 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb, | |||
271 | return 0; | 271 | return 0; |
272 | } | 272 | } |
273 | 273 | ||
274 | static int a2mp_getinfo_rsp(struct amp_mgr *mgr, struct sk_buff *skb, | ||
275 | struct a2mp_cmd *hdr) | ||
276 | { | ||
277 | struct a2mp_info_rsp *rsp = (struct a2mp_info_rsp *) skb->data; | ||
278 | struct a2mp_amp_assoc_req req; | ||
279 | struct amp_ctrl *ctrl; | ||
280 | |||
281 | if (le16_to_cpu(hdr->len) < sizeof(*rsp)) | ||
282 | return -EINVAL; | ||
283 | |||
284 | BT_DBG("id %d status 0x%2.2x", rsp->id, rsp->status); | ||
285 | |||
286 | if (rsp->status) | ||
287 | return -EINVAL; | ||
288 | |||
289 | ctrl = amp_ctrl_add(mgr); | ||
290 | if (!ctrl) | ||
291 | return -ENOMEM; | ||
292 | |||
293 | ctrl->id = rsp->id; | ||
294 | |||
295 | req.id = rsp->id; | ||
296 | a2mp_send(mgr, A2MP_GETAMPASSOC_REQ, __next_ident(mgr), sizeof(req), | ||
297 | &req); | ||
298 | |||
299 | skb_pull(skb, sizeof(*rsp)); | ||
300 | return 0; | ||
301 | } | ||
302 | |||
274 | static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb, | 303 | static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb, |
275 | struct a2mp_cmd *hdr) | 304 | struct a2mp_cmd *hdr) |
276 | { | 305 | { |
@@ -469,8 +498,11 @@ static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) | |||
469 | err = a2mp_discover_rsp(mgr, skb, hdr); | 498 | err = a2mp_discover_rsp(mgr, skb, hdr); |
470 | break; | 499 | break; |
471 | 500 | ||
472 | case A2MP_CHANGE_RSP: | ||
473 | case A2MP_GETINFO_RSP: | 501 | case A2MP_GETINFO_RSP: |
502 | err = a2mp_getinfo_rsp(mgr, skb, hdr); | ||
503 | break; | ||
504 | |||
505 | case A2MP_CHANGE_RSP: | ||
474 | case A2MP_GETAMPASSOC_RSP: | 506 | case A2MP_GETAMPASSOC_RSP: |
475 | case A2MP_CREATEPHYSLINK_RSP: | 507 | case A2MP_CREATEPHYSLINK_RSP: |
476 | case A2MP_DISCONNPHYSLINK_RSP: | 508 | case A2MP_DISCONNPHYSLINK_RSP: |