diff options
-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: |