diff options
author | Mat Martineau <mathewm@codeaurora.org> | 2012-10-23 18:24:09 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-10-23 22:01:53 -0400 |
commit | b1a130b7d372c5ccc2001d4ee08928b5324f0a76 (patch) | |
tree | 8b436e6b47ead2474ef865c9c210e3fed588962c /net/bluetooth/l2cap_core.c | |
parent | 5909cf30f380d13bb59e81e4cb17c3714cb94e68 (diff) |
Bluetooth: Lookup channel structure based on DCID
Processing a move channel request involves getting the channel
structure using the destination channel ID. Previous code could only
look up using the source channel ID.
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 31750945298b..03daae8ab269 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -100,6 +100,23 @@ static struct l2cap_chan *l2cap_get_chan_by_scid(struct l2cap_conn *conn, | |||
100 | return c; | 100 | return c; |
101 | } | 101 | } |
102 | 102 | ||
103 | /* Find channel with given DCID. | ||
104 | * Returns locked channel. | ||
105 | */ | ||
106 | static struct l2cap_chan *l2cap_get_chan_by_dcid(struct l2cap_conn *conn, | ||
107 | u16 cid) | ||
108 | { | ||
109 | struct l2cap_chan *c; | ||
110 | |||
111 | mutex_lock(&conn->chan_lock); | ||
112 | c = __l2cap_get_chan_by_dcid(conn, cid); | ||
113 | if (c) | ||
114 | l2cap_chan_lock(c); | ||
115 | mutex_unlock(&conn->chan_lock); | ||
116 | |||
117 | return c; | ||
118 | } | ||
119 | |||
103 | static struct l2cap_chan *__l2cap_get_chan_by_ident(struct l2cap_conn *conn, | 120 | static struct l2cap_chan *__l2cap_get_chan_by_ident(struct l2cap_conn *conn, |
104 | u8 ident) | 121 | u8 ident) |
105 | { | 122 | { |