diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-08-11 15:06:37 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-08-14 02:49:21 -0400 |
commit | dec5b49235e2526d7aacf5b93ea48f5e30c2f7c3 (patch) | |
tree | 34883a02b209d04da0c956cec4f56d1c288c3a74 /include | |
parent | 44f1a7ab51ebe1ca189445837e0599a5edc6efb1 (diff) |
Bluetooth: Add public l2cap_conn_shutdown() API to request disconnection
Since we no-longer do special handling of SMP within l2cap_core.c we
don't have any code for calling l2cap_conn_del() when smp.c doesn't like
the data it gets. At the same time we cannot simply export
l2cap_conn_del() since it will try to lock the channels it calls into
whereas we already hold the lock in the smp.c l2cap_chan callbacks (i.e.
it'd lead to a deadlock).
This patch adds a new l2cap_conn_shutdown() API which is very similar to
l2cap_conn_del() except that it defers the call to l2cap_conn_del()
through a workqueue, thereby making it safe to use it from an L2CAP
channel callback.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/l2cap.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index bda6252e3722..40f34866b6da 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -625,6 +625,9 @@ struct l2cap_conn { | |||
625 | 625 | ||
626 | struct delayed_work info_timer; | 626 | struct delayed_work info_timer; |
627 | 627 | ||
628 | int disconn_err; | ||
629 | struct work_struct disconn_work; | ||
630 | |||
628 | struct sk_buff *rx_skb; | 631 | struct sk_buff *rx_skb; |
629 | __u32 rx_len; | 632 | __u32 rx_len; |
630 | __u8 tx_ident; | 633 | __u8 tx_ident; |
@@ -944,6 +947,7 @@ void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, | |||
944 | u8 status); | 947 | u8 status); |
945 | void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); | 948 | void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); |
946 | 949 | ||
950 | void l2cap_conn_shutdown(struct l2cap_conn *conn, int err); | ||
947 | void l2cap_conn_get(struct l2cap_conn *conn); | 951 | void l2cap_conn_get(struct l2cap_conn *conn); |
948 | void l2cap_conn_put(struct l2cap_conn *conn); | 952 | void l2cap_conn_put(struct l2cap_conn *conn); |
949 | 953 | ||