summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-10-15 19:24:48 -0300
committerMarcel Holtmann <marcel@holtmann.org>2013-10-15 16:42:44 -0700
commit5ec1bbe549d939ff1ef88e2cc22b2c3b95d76401 (patch)
tree877df523bdb1b892675bee1f5aa9bb939a811e5c /net/bluetooth/l2cap_sock.c
parent8d836d71e2223b8961b21112bb4ce89ef8231682 (diff)
downloadlinux-5ec1bbe549d939ff1ef88e2cc22b2c3b95d76401.tar.gz
linux-5ec1bbe549d939ff1ef88e2cc22b2c3b95d76401.tar.bz2
linux-5ec1bbe549d939ff1ef88e2cc22b2c3b95d76401.zip
Bluetooth: Add chan->ops->set_shutdown()
We need to remove all direct access of struct sock from L2CAP core. This change is pretty simple and just add a new L2CAP channel callback to do the work in the L2CAP socket side. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index ffa78d3cd8ac..301f25b9b521 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1136,6 +1136,15 @@ static void l2cap_sock_resume_cb(struct l2cap_chan *chan)
sk->sk_state_change(sk);
}
+static void l2cap_sock_set_shutdown_cb(struct l2cap_chan *chan)
+{
+ struct sock *sk = chan->data;
+
+ lock_sock(sk);
+ sk->sk_shutdown = SHUTDOWN_MASK;
+ release_sock(sk);
+}
+
static long l2cap_sock_get_sndtimeo_cb(struct l2cap_chan *chan)
{
struct sock *sk = chan->data;
@@ -1153,6 +1162,7 @@ static struct l2cap_ops l2cap_chan_ops = {
.ready = l2cap_sock_ready_cb,
.defer = l2cap_sock_defer_cb,
.resume = l2cap_sock_resume_cb,
+ .set_shutdown = l2cap_sock_set_shutdown_cb,
.get_sndtimeo = l2cap_sock_get_sndtimeo_cb,
.alloc_skb = l2cap_sock_alloc_skb_cb,
};