mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
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>
This commit is contained in:
parent
3df91ea20e
commit
c03b355ea2
2 changed files with 13 additions and 0 deletions
|
|
@ -497,6 +497,7 @@ struct l2cap_chan {
|
|||
|
||||
void *data;
|
||||
struct l2cap_ops *ops;
|
||||
struct mutex lock;
|
||||
};
|
||||
|
||||
struct l2cap_ops {
|
||||
|
|
@ -609,6 +610,16 @@ static inline void l2cap_chan_put(struct l2cap_chan *c)
|
|||
kfree(c);
|
||||
}
|
||||
|
||||
static inline void l2cap_chan_lock(struct l2cap_chan *chan)
|
||||
{
|
||||
mutex_lock(&chan->lock);
|
||||
}
|
||||
|
||||
static inline void l2cap_chan_unlock(struct l2cap_chan *chan)
|
||||
{
|
||||
mutex_unlock(&chan->lock);
|
||||
}
|
||||
|
||||
static inline void l2cap_set_timer(struct l2cap_chan *chan,
|
||||
struct delayed_work *work, long timeout)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue