aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/a2mp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/a2mp.c')
-rw-r--r--net/bluetooth/a2mp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index 0726c9fe005c..188b42120074 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -63,6 +63,22 @@ static void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len,
63 kfree(cmd); 63 kfree(cmd);
64} 64}
65 65
66/* Processing A2MP messages */
67static int a2mp_command_rej(struct amp_mgr *mgr, struct sk_buff *skb,
68 struct a2mp_cmd *hdr)
69{
70 struct a2mp_cmd_rej *rej = (void *) skb->data;
71
72 if (le16_to_cpu(hdr->len) < sizeof(*rej))
73 return -EINVAL;
74
75 BT_DBG("ident %d reason %d", hdr->ident, le16_to_cpu(rej->reason));
76
77 skb_pull(skb, sizeof(*rej));
78
79 return 0;
80}
81
66/* Handle A2MP signalling */ 82/* Handle A2MP signalling */
67static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) 83static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
68{ 84{
@@ -89,6 +105,9 @@ static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
89 105
90 switch (hdr->code) { 106 switch (hdr->code) {
91 case A2MP_COMMAND_REJ: 107 case A2MP_COMMAND_REJ:
108 a2mp_command_rej(mgr, skb, hdr);
109 break;
110
92 case A2MP_DISCOVER_REQ: 111 case A2MP_DISCOVER_REQ:
93 case A2MP_CHANGE_NOTIFY: 112 case A2MP_CHANGE_NOTIFY:
94 case A2MP_GETINFO_REQ: 113 case A2MP_GETINFO_REQ: