diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-05-29 06:59:08 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:12 -0400 |
commit | 21dbd2ce35f6d2b4aa5363be6c839cdb50644e11 (patch) | |
tree | a80b7735525bd1c999396ddefff5849ce16e2c0c /net/bluetooth/a2mp.c | |
parent | 6b44d9b8d96b37f72ccd7335b32f386a67b7f1f4 (diff) |
Bluetooth: A2MP: Process A2MP Command Reject
Placeholder for future A2MP Command Reject handler.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/a2mp.c')
-rw-r--r-- | net/bluetooth/a2mp.c | 19 |
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 */ | ||
67 | static 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 */ |
67 | static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) | 83 | static 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: |