diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-02-21 05:54:56 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-23 06:06:58 -0500 |
commit | c03b355ea2938495bbdf25a4645be545be8890f4 (patch) | |
tree | c3f0516e08150f724a84787330439729f1f38c1b /include/net | |
parent | 3df91ea20e744344100b10ae69a17211fcf5b207 (diff) |
Bluetooth: Add l2cap_chan_lock
Channel lock will be used to lock L2CAP channels which are locked
currently by socket locks.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
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 'include/net')
-rw-r--r-- | include/net/bluetooth/l2cap.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index bbb0e214e51d..d6d8ec8eb8cf 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -497,6 +497,7 @@ struct l2cap_chan { | |||
497 | 497 | ||
498 | void *data; | 498 | void *data; |
499 | struct l2cap_ops *ops; | 499 | struct l2cap_ops *ops; |
500 | struct mutex lock; | ||
500 | }; | 501 | }; |
501 | 502 | ||
502 | struct l2cap_ops { | 503 | struct l2cap_ops { |
@@ -609,6 +610,16 @@ static inline void l2cap_chan_put(struct l2cap_chan *c) | |||
609 | kfree(c); | 610 | kfree(c); |
610 | } | 611 | } |
611 | 612 | ||
613 | static inline void l2cap_chan_lock(struct l2cap_chan *chan) | ||
614 | { | ||
615 | mutex_lock(&chan->lock); | ||
616 | } | ||
617 | |||
618 | static inline void l2cap_chan_unlock(struct l2cap_chan *chan) | ||
619 | { | ||
620 | mutex_unlock(&chan->lock); | ||
621 | } | ||
622 | |||
612 | static inline void l2cap_set_timer(struct l2cap_chan *chan, | 623 | static inline void l2cap_set_timer(struct l2cap_chan *chan, |
613 | struct delayed_work *work, long timeout) | 624 | struct delayed_work *work, long timeout) |
614 | { | 625 | { |