Lines Matching refs:sock
45 static void l2cap_sock_init(struct sock *sk, struct sock *parent);
46 static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
48 static void l2cap_sock_cleanup_listen(struct sock *parent);
50 bool l2cap_is_socket(struct socket *sock) in l2cap_is_socket() argument
52 return sock && sock->ops == &l2cap_sock_ops; in l2cap_is_socket()
82 static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) in l2cap_sock_bind() argument
84 struct sock *sk = sock->sk; in l2cap_sock_bind()
180 static void l2cap_sock_init_pid(struct sock *sk) in l2cap_sock_init_pid()
195 static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, in l2cap_sock_connect() argument
198 struct sock *sk = sock->sk; in l2cap_sock_connect()
287 static int l2cap_sock_listen(struct socket *sock, int backlog) in l2cap_sock_listen() argument
289 struct sock *sk = sock->sk; in l2cap_sock_listen()
346 static int l2cap_sock_accept(struct socket *sock, struct socket *newsock, in l2cap_sock_accept() argument
350 struct sock *sk = sock->sk, *nsk; in l2cap_sock_accept()
402 static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, in l2cap_sock_getname() argument
406 struct sock *sk = sock->sk; in l2cap_sock_getname()
409 BT_DBG("sock %p, sk %p", sock, sk); in l2cap_sock_getname()
452 static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, in l2cap_sock_getsockopt_old() argument
455 struct sock *sk = sock->sk; in l2cap_sock_getsockopt_old()
571 static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, in l2cap_sock_getsockopt() argument
574 struct sock *sk = sock->sk; in l2cap_sock_getsockopt()
584 return l2cap_sock_getsockopt_old(sock, optname, optval, optlen); in l2cap_sock_getsockopt()
741 static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, in l2cap_sock_setsockopt_old() argument
744 struct sock *sk = sock->sk; in l2cap_sock_setsockopt_old()
897 static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, in l2cap_sock_setsockopt() argument
900 struct sock *sk = sock->sk; in l2cap_sock_setsockopt()
913 return l2cap_sock_setsockopt_old(sock, optname, optval, optlen); in l2cap_sock_setsockopt()
1146 static int l2cap_sock_sendmsg(struct socket *sock, struct msghdr *msg, in l2cap_sock_sendmsg() argument
1149 struct sock *sk = sock->sk; in l2cap_sock_sendmsg()
1153 BT_DBG("sock %p, sk %p", sock, sk); in l2cap_sock_sendmsg()
1178 static int l2cap_sock_recvmsg(struct socket *sock, struct msghdr *msg, in l2cap_sock_recvmsg() argument
1181 struct sock *sk = sock->sk; in l2cap_sock_recvmsg()
1209 if (sock->type == SOCK_STREAM) in l2cap_sock_recvmsg()
1210 err = bt_sock_stream_recvmsg(sock, msg, len, flags); in l2cap_sock_recvmsg()
1212 err = bt_sock_recvmsg(sock, msg, len, flags); in l2cap_sock_recvmsg()
1246 static void l2cap_sock_kill(struct sock *sk) in l2cap_sock_kill()
1260 static int __l2cap_wait_ack(struct sock *sk, struct l2cap_chan *chan) in __l2cap_wait_ack()
1305 static int l2cap_sock_shutdown(struct socket *sock, int how) in l2cap_sock_shutdown() argument
1307 struct sock *sk = sock->sk; in l2cap_sock_shutdown()
1312 BT_DBG("sock %p, sk %p, how %d", sock, sk, how); in l2cap_sock_shutdown()
1407 static int l2cap_sock_release(struct socket *sock) in l2cap_sock_release() argument
1409 struct sock *sk = sock->sk; in l2cap_sock_release()
1413 BT_DBG("sock %p, sk %p", sock, sk); in l2cap_sock_release()
1421 err = l2cap_sock_shutdown(sock, SHUT_RDWR); in l2cap_sock_release()
1436 static void l2cap_sock_cleanup_listen(struct sock *parent) in l2cap_sock_cleanup_listen()
1438 struct sock *sk; in l2cap_sock_cleanup_listen()
1464 struct sock *sk, *parent = chan->data; in l2cap_sock_new_connection_cb()
1495 struct sock *sk = chan->data; in l2cap_sock_recv_cb()
1540 struct sock *sk = chan->data; in l2cap_sock_close_cb()
1550 struct sock *sk = chan->data; in l2cap_sock_teardown_cb()
1551 struct sock *parent; in l2cap_sock_teardown_cb()
1605 struct sock *sk = chan->data; in l2cap_sock_state_change_cb()
1617 struct sock *sk = chan->data; in l2cap_sock_alloc_skb_cb()
1645 struct sock *sk = chan->data; in l2cap_sock_ready_cb()
1646 struct sock *parent; in l2cap_sock_ready_cb()
1665 struct sock *parent, *sk = chan->data; in l2cap_sock_defer_cb()
1678 struct sock *sk = chan->data; in l2cap_sock_resume_cb()
1691 struct sock *sk = chan->data; in l2cap_sock_set_shutdown_cb()
1700 struct sock *sk = chan->data; in l2cap_sock_get_sndtimeo_cb()
1707 struct sock *sk = chan->data; in l2cap_sock_get_peer_pid_cb()
1714 struct sock *sk = chan->data; in l2cap_sock_suspend_cb()
1722 struct sock *sk = chan->data; in l2cap_sock_filter()
1751 static void l2cap_sock_destruct(struct sock *sk) in l2cap_sock_destruct()
1782 static void l2cap_sock_init(struct sock *sk, struct sock *parent) in l2cap_sock_init()
1854 static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, in l2cap_sock_alloc() argument
1857 struct sock *sk; in l2cap_sock_alloc()
1864 sock_init_data(sock, sk); in l2cap_sock_alloc()
1888 static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol, in l2cap_sock_create() argument
1891 struct sock *sk; in l2cap_sock_create()
1893 BT_DBG("sock %p", sock); in l2cap_sock_create()
1895 sock->state = SS_UNCONNECTED; in l2cap_sock_create()
1897 if (sock->type != SOCK_SEQPACKET && sock->type != SOCK_STREAM && in l2cap_sock_create()
1898 sock->type != SOCK_DGRAM && sock->type != SOCK_RAW) in l2cap_sock_create()
1901 if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW)) in l2cap_sock_create()
1904 sock->ops = &l2cap_sock_ops; in l2cap_sock_create()
1906 sk = l2cap_sock_alloc(net, sock, protocol, GFP_ATOMIC, kern); in l2cap_sock_create()