diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-15 04:03:18 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-12-05 10:05:35 -0500 |
commit | 837776f7904024df451422f32b09c67e88ae2aa2 (patch) | |
tree | ab66fbb6cfb9e53c4e5a771a7a7a9984c3bc9d33 /net/bluetooth | |
parent | 3af8ace653c83c663d4b97c6ea7f01463d366bf9 (diff) |
Bluetooth: Introduce L2CAP channel callback for suspending
Setting the BT_SK_SUSPEND socket flag from the L2CAP core is causing a
dependency on the socket. So instead of doing that, use a channel
callback into the socket handling to suspend.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 01d65bc99b0c..a51844a8c5eb 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -1345,6 +1345,14 @@ static long l2cap_sock_get_sndtimeo_cb(struct l2cap_chan *chan) | |||
1345 | return sk->sk_sndtimeo; | 1345 | return sk->sk_sndtimeo; |
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | static void l2cap_sock_suspend_cb(struct l2cap_chan *chan) | ||
1349 | { | ||
1350 | struct sock *sk = chan->data; | ||
1351 | |||
1352 | set_bit(BT_SK_SUSPEND, &bt_sk(sk)->flags); | ||
1353 | sk->sk_state_change(sk); | ||
1354 | } | ||
1355 | |||
1348 | static struct l2cap_ops l2cap_chan_ops = { | 1356 | static struct l2cap_ops l2cap_chan_ops = { |
1349 | .name = "L2CAP Socket Interface", | 1357 | .name = "L2CAP Socket Interface", |
1350 | .new_connection = l2cap_sock_new_connection_cb, | 1358 | .new_connection = l2cap_sock_new_connection_cb, |
@@ -1355,6 +1363,7 @@ static struct l2cap_ops l2cap_chan_ops = { | |||
1355 | .ready = l2cap_sock_ready_cb, | 1363 | .ready = l2cap_sock_ready_cb, |
1356 | .defer = l2cap_sock_defer_cb, | 1364 | .defer = l2cap_sock_defer_cb, |
1357 | .resume = l2cap_sock_resume_cb, | 1365 | .resume = l2cap_sock_resume_cb, |
1366 | .suspend = l2cap_sock_suspend_cb, | ||
1358 | .set_shutdown = l2cap_sock_set_shutdown_cb, | 1367 | .set_shutdown = l2cap_sock_set_shutdown_cb, |
1359 | .get_sndtimeo = l2cap_sock_get_sndtimeo_cb, | 1368 | .get_sndtimeo = l2cap_sock_get_sndtimeo_cb, |
1360 | .alloc_skb = l2cap_sock_alloc_skb_cb, | 1369 | .alloc_skb = l2cap_sock_alloc_skb_cb, |