diff options
Diffstat (limited to 'include/net/bluetooth/l2cap.h')
| -rw-r--r-- | include/net/bluetooth/l2cap.h | 20 |
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 | ||
| 674 | static inline void l2cap_chan_hold(struct l2cap_chan *c) | 673 | void l2cap_chan_hold(struct l2cap_chan *c); |
| 675 | { | 674 | void 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 | |||
| 681 | static 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 | ||
| 689 | static inline void l2cap_chan_lock(struct l2cap_chan *chan) | 676 | static 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 | ||
| 772 | struct l2cap_chan *l2cap_chan_create(void); | 759 | struct l2cap_chan *l2cap_chan_create(void); |
| 773 | void l2cap_chan_close(struct l2cap_chan *chan, int reason); | 760 | void l2cap_chan_close(struct l2cap_chan *chan, int reason); |
| 774 | void l2cap_chan_destroy(struct l2cap_chan *chan); | ||
| 775 | int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, | 761 | int 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); |
| 777 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, | 763 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, |
