Commit b48596d1 authored by Luiz Augusto von Dentz's avatar Luiz Augusto von Dentz Committed by Marcel Holtmann

Bluetooth: L2CAP: Add get_peer_pid callback

This adds a callback to read the socket pid.
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 2d186fcd
...@@ -660,6 +660,7 @@ struct l2cap_ops { ...@@ -660,6 +660,7 @@ struct l2cap_ops {
void (*suspend) (struct l2cap_chan *chan); void (*suspend) (struct l2cap_chan *chan);
void (*set_shutdown) (struct l2cap_chan *chan); void (*set_shutdown) (struct l2cap_chan *chan);
long (*get_sndtimeo) (struct l2cap_chan *chan); long (*get_sndtimeo) (struct l2cap_chan *chan);
struct pid *(*get_peer_pid) (struct l2cap_chan *chan);
struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
unsigned long hdr_len, unsigned long hdr_len,
unsigned long len, int nb); unsigned long len, int nb);
......
...@@ -1504,6 +1504,13 @@ static long l2cap_sock_get_sndtimeo_cb(struct l2cap_chan *chan) ...@@ -1504,6 +1504,13 @@ static long l2cap_sock_get_sndtimeo_cb(struct l2cap_chan *chan)
return sk->sk_sndtimeo; return sk->sk_sndtimeo;
} }
static struct pid *l2cap_sock_get_peer_pid_cb(struct l2cap_chan *chan)
{
struct sock *sk = chan->data;
return sk->sk_peer_pid;
}
static void l2cap_sock_suspend_cb(struct l2cap_chan *chan) static void l2cap_sock_suspend_cb(struct l2cap_chan *chan)
{ {
struct sock *sk = chan->data; struct sock *sk = chan->data;
...@@ -1525,6 +1532,7 @@ static const struct l2cap_ops l2cap_chan_ops = { ...@@ -1525,6 +1532,7 @@ static const struct l2cap_ops l2cap_chan_ops = {
.suspend = l2cap_sock_suspend_cb, .suspend = l2cap_sock_suspend_cb,
.set_shutdown = l2cap_sock_set_shutdown_cb, .set_shutdown = l2cap_sock_set_shutdown_cb,
.get_sndtimeo = l2cap_sock_get_sndtimeo_cb, .get_sndtimeo = l2cap_sock_get_sndtimeo_cb,
.get_peer_pid = l2cap_sock_get_peer_pid_cb,
.alloc_skb = l2cap_sock_alloc_skb_cb, .alloc_skb = l2cap_sock_alloc_skb_cb,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment