diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-02-22 10:11:55 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-23 06:07:02 -0500 |
commit | 643162a8e2c15a1c1983a0063d9941240b3bde30 (patch) | |
tree | 0b21ed045654d47f055d249b265f59c4ab3e87d6 /net/bluetooth/l2cap_core.c | |
parent | 388fc8faf200f80159353eb86cde4ab75d0a0bbd (diff) |
Bluetooth: Add unlocked __l2cap_chan_add function
Add unlocked L2CAP channel add function. Unlocked version will
be used in later patches.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Reviewed-by: Ulisses Furquim <ulisses@profusion.mobi>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index c0640b73c628..0e4f4cb2acbb 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -300,7 +300,7 @@ void l2cap_chan_destroy(struct l2cap_chan *chan) | |||
300 | l2cap_chan_put(chan); | 300 | l2cap_chan_put(chan); |
301 | } | 301 | } |
302 | 302 | ||
303 | static void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan) | 303 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan) |
304 | { | 304 | { |
305 | BT_DBG("conn %p, psm 0x%2.2x, dcid 0x%4.4x", conn, | 305 | BT_DBG("conn %p, psm 0x%2.2x, dcid 0x%4.4x", conn, |
306 | chan->psm, chan->dcid); | 306 | chan->psm, chan->dcid); |
@@ -346,8 +346,13 @@ static void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan) | |||
346 | 346 | ||
347 | l2cap_chan_hold(chan); | 347 | l2cap_chan_hold(chan); |
348 | 348 | ||
349 | mutex_lock(&conn->chan_lock); | ||
350 | list_add(&chan->list, &conn->chan_l); | 349 | list_add(&chan->list, &conn->chan_l); |
350 | } | ||
351 | |||
352 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan) | ||
353 | { | ||
354 | mutex_lock(&conn->chan_lock); | ||
355 | __l2cap_chan_add(conn, chan); | ||
351 | mutex_unlock(&conn->chan_lock); | 356 | mutex_unlock(&conn->chan_lock); |
352 | } | 357 | } |
353 | 358 | ||