Lines Matching refs:sock
5 * AF_SMC protocol family socket handler keeping the AF_INET sock address type
32 #include <net/sock.h>
110 static void smc_set_keepalive(struct sock *sk, int val)
117 static struct sock *smc_tcp_syn_recv_sock(const struct sock *sk,
125 struct sock *child;
138 /* passthrough to original syn recv sock fct */
157 static bool smc_hs_congested(const struct sock *sk)
180 int smc_hash_sk(struct sock *sk)
196 void smc_unhash_sk(struct sock *sk)
211 static void smc_release_cb(struct sock *sk)
249 struct sock *clcsk = smc->clcsock->sk;
273 struct sock *sk = &smc->sk;
311 static int smc_release(struct socket *sock)
313 struct sock *sk = sock->sk;
334 * sock lock for child sockets again
348 sock->sk = NULL;
357 static void smc_destruct(struct sock *sk)
365 static struct sock *smc_sock_alloc(struct net *net, struct socket *sock,
370 struct sock *sk;
377 sock_init_data(sock, sk); /* sets sk_refcnt to 1 */
397 static int smc_bind(struct socket *sock, struct sockaddr *uaddr,
401 struct sock *sk = sock->sk;
460 static void smc_adjust_sock_bufsizes(struct sock *nsk, struct sock *osk,
488 static void smc_copy_sock_settings(struct sock *nsk, struct sock *osk,
823 static void smc_fback_forward_wakeup(struct smc_sock *smc, struct sock *clcsk,
824 void (*clcsock_callback)(struct sock *sk))
845 static void smc_fback_state_change(struct sock *clcsk)
857 static void smc_fback_data_ready(struct sock *clcsk)
869 static void smc_fback_write_space(struct sock *clcsk)
881 static void smc_fback_error_report(struct sock *clcsk)
895 struct sock *clcsk = smc->clcsock->sk;
1639 static int smc_connect(struct socket *sock, struct sockaddr *addr,
1642 struct sock *sk = sock->sk;
1655 switch (sock->state) {
1667 sock->state = SS_CONNECTING;
1676 sock->state = SS_UNCONNECTED;
1696 sock->state = rc ? SS_CONNECTING : SS_CONNECTED;
1699 sock_hold(&smc->sk); /* sock put in passive closing */
1713 sock->state = SS_CONNECTED;
1723 struct sock *lsk = &lsmc->sk;
1724 struct sock *new_sk;
1778 /* add a just created sock to the accept queue of the listen sock as
1781 static void smc_accept_enqueue(struct sock *parent, struct sock *sk)
1793 static void smc_accept_unlink(struct sock *sk)
1804 /* remove a sock from the accept queue to bind it to a new socket created
1807 struct sock *smc_accept_dequeue(struct sock *parent,
1811 struct sock *new_sk;
1814 new_sk = (struct sock *)isk;
1839 /* clean up for a created but never accepted sock */
1840 void smc_close_non_accepted(struct sock *sk)
1911 struct sock *newsmcsk = &new_smc->sk;
1932 struct sock *newsmcsk = &new_smc->sk;
1943 struct sock *newsmcsk = &new_smc->sk;
2539 struct sock *lsk = &lsmc->sk;
2570 static void smc_clcsock_data_ready(struct sock *listen_clcsock)
2588 static int smc_listen(struct socket *sock, int backlog)
2590 struct sock *sk = sock->sk;
2599 smc->connect_nonblock || sock->state != SS_UNCONNECTED)
2653 static int smc_accept(struct socket *sock, struct socket *new_sock,
2656 struct sock *sk = sock->sk, *nsk;
2705 struct sock *clcsk = smc_sk(nsk)->clcsock->sk;
2723 static int smc_getname(struct socket *sock, struct sockaddr *addr,
2728 if (peer && (sock->sk->sk_state != SMC_ACTIVE) &&
2729 (sock->sk->sk_state != SMC_APPCLOSEWAIT1))
2732 smc = smc_sk(sock->sk);
2737 static int smc_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
2739 struct sock *sk = sock->sk;
2775 static int smc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
2778 struct sock *sk = sock->sk;
2812 static __poll_t smc_accept_poll(struct sock *parent)
2825 static __poll_t smc_poll(struct file *file, struct socket *sock,
2828 struct sock *sk = sock->sk;
2835 smc = smc_sk(sock->sk);
2837 /* delegate to CLC child sock */
2842 sock_poll_wait(file, sock, wait);
2878 static int smc_shutdown(struct socket *sock, int how)
2880 struct sock *sk = sock->sk;
2894 if (sock->state == SS_CONNECTING) {
2896 sock->state = SS_CONNECTED;
2902 sock->state = SS_DISCONNECTING;
2945 sock->state = SS_UNCONNECTED;
2947 sock->state = SS_DISCONNECTING;
2953 static int __smc_getsockopt(struct socket *sock, int level, int optname,
2959 smc = smc_sk(sock->sk);
2985 static int __smc_setsockopt(struct socket *sock, int level, int optname,
2988 struct sock *sk = sock->sk;
3018 static int smc_setsockopt(struct socket *sock, int level, int optname,
3021 struct sock *sk = sock->sk;
3028 return __smc_setsockopt(sock, level, optname, optval, optlen);
3105 static int smc_getsockopt(struct socket *sock, int level, int optname,
3112 return __smc_getsockopt(sock, level, optname, optval, optlen);
3114 smc = smc_sk(sock->sk);
3131 static int smc_ioctl(struct socket *sock, unsigned int cmd,
3139 smc = smc_sk(sock->sk);
3218 static ssize_t smc_splice_read(struct socket *sock, loff_t *ppos,
3222 struct sock *sk = sock->sk;
3286 static int __smc_create(struct net *net, struct socket *sock, int protocol,
3291 struct sock *sk;
3295 if (sock->type != SOCK_STREAM)
3303 sock->ops = &smc_sock_ops;
3304 sock->state = SS_UNCONNECTED;
3305 sk = smc_sock_alloc(net, sock, protocol);
3344 static int smc_create(struct net *net, struct socket *sock, int protocol,
3347 return __smc_create(net, sock, protocol, kern, NULL);
3356 static int smc_ulp_init(struct sock *sk)
3398 static void smc_ulp_clone(const struct request_sock *req, struct sock *newsk,