Lines Matching refs:sock
23 #include <net/sock.h>
47 struct sock sk; /* must be first member */
92 static void caif_read_lock(struct sock *sk)
99 static void caif_read_unlock(struct sock *sk)
112 static void caif_flow_ctrl(struct sock *sk, int mode)
121 * Copied from sock.c:sock_queue_rcv_skb(), but changed so packets are
124 static void caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
254 static void caif_check_flow_release(struct sock *sk)
271 static int caif_seqpkt_recvmsg(struct socket *sock, struct msghdr *m,
275 struct sock *sk = sock->sk;
309 static long caif_stream_data_wait(struct sock *sk, long timeo)
347 static int caif_stream_recvmsg(struct socket *sock, struct msghdr *msg,
350 struct sock *sk = sock->sk;
461 * Copied from sock.c:sock_wait_for_wmem, but change to wait for
467 struct sock *sk = &cf_sk->sk;
518 static int caif_seqpkt_sendmsg(struct socket *sock, struct msghdr *msg,
521 struct sock *sk = sock->sk;
594 static int caif_stream_sendmsg(struct socket *sock, struct msghdr *msg,
597 struct sock *sk = sock->sk;
673 static int setsockopt(struct socket *sock, int lvl, int opt, sockptr_t ov,
676 struct sock *sk = sock->sk;
742 * o sock->state: holds the SS_* socket state and is updated by connect and
745 static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
748 struct sock *sk = sock->sk;
766 switch (sock->state) {
774 sock->state = SS_CONNECTED;
805 sock->state = SS_UNCONNECTED;
816 sock->state = SS_CONNECTING;
882 sock->state = SS_UNCONNECTED;
888 sock->state = SS_CONNECTED;
899 static int caif_release(struct socket *sock)
901 struct sock *sk = sock->sk;
912 * this ensures no packets when sock is dead.
917 sock->sk = NULL;
939 struct socket *sock, poll_table *wait)
941 struct sock *sk = sock->sk;
945 sock_poll_wait(file, sock, wait);
1012 static void caif_sock_destructor(struct sock *sk)
1027 static int caif_create(struct net *net, struct socket *sock, int protocol,
1030 struct sock *sk = NULL;
1042 * The sock->type specifies the socket type to use.
1047 if (sock->type == SOCK_SEQPACKET)
1048 sock->ops = &caif_seqpacket_ops;
1049 else if (sock->type == SOCK_STREAM)
1050 sock->ops = &caif_stream_ops;
1059 * initialization makes sure that sock->state is not uninitialized.
1088 /* Initialize the nozero default sock structure data. */
1089 sock_init_data(sock, sk);