aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/l2cap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/bluetooth/l2cap.h')
-rw-r--r--include/net/bluetooth/l2cap.h20
1 files changed, 3 insertions, 17 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index a7679f8913d2..7ed8e356425a 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -433,11 +433,10 @@ struct l2cap_chan {
433 struct sock *sk; 433 struct sock *sk;
434 434
435 struct l2cap_conn *conn; 435 struct l2cap_conn *conn;
436 struct kref kref;
436 437
437 __u8 state; 438 __u8 state;
438 439
439 atomic_t refcnt;
440
441 __le16 psm; 440 __le16 psm;
442 __u16 dcid; 441 __u16 dcid;
443 __u16 scid; 442 __u16 scid;
@@ -671,20 +670,8 @@ enum {
671 L2CAP_EV_RECV_FRAME, 670 L2CAP_EV_RECV_FRAME,
672}; 671};
673 672
674static inline void l2cap_chan_hold(struct l2cap_chan *c) 673void l2cap_chan_hold(struct l2cap_chan *c);
675{ 674void l2cap_chan_put(struct l2cap_chan *c);
676 BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt));
677
678 atomic_inc(&c->refcnt);
679}
680
681static inline void l2cap_chan_put(struct l2cap_chan *c)
682{
683 BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt));
684
685 if (atomic_dec_and_test(&c->refcnt))
686 kfree(c);
687}
688 675
689static inline void l2cap_chan_lock(struct l2cap_chan *chan) 676static inline void l2cap_chan_lock(struct l2cap_chan *chan)
690{ 677{
@@ -771,7 +758,6 @@ int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid);
771 758
772struct l2cap_chan *l2cap_chan_create(void); 759struct l2cap_chan *l2cap_chan_create(void);
773void l2cap_chan_close(struct l2cap_chan *chan, int reason); 760void l2cap_chan_close(struct l2cap_chan *chan, int reason);
774void l2cap_chan_destroy(struct l2cap_chan *chan);
775int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, 761int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
776 bdaddr_t *dst, u8 dst_type); 762 bdaddr_t *dst, u8 dst_type);
777int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, 763int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len,