unify {de,}mangle_poll(), get rid of kernel-side POLL...
[cris-mirror.git] / include / linux / sunrpc / xprtsock.h
blobae0f99b9b965cca7b2012e527bd7f0413a5e750c
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * linux/include/linux/sunrpc/xprtsock.h
5 * Declarations for the RPC transport socket provider.
6 */
8 #ifndef _LINUX_SUNRPC_XPRTSOCK_H
9 #define _LINUX_SUNRPC_XPRTSOCK_H
11 #ifdef __KERNEL__
13 int init_socket_xprt(void);
14 void cleanup_socket_xprt(void);
16 #define RPC_MIN_RESVPORT (1U)
17 #define RPC_MAX_RESVPORT (65535U)
18 #define RPC_DEF_MIN_RESVPORT (665U)
19 #define RPC_DEF_MAX_RESVPORT (1023U)
21 struct sock_xprt {
22 struct rpc_xprt xprt;
25 * Network layer
27 struct socket * sock;
28 struct sock * inet;
31 * State of TCP reply receive
33 __be32 tcp_fraghdr,
34 tcp_xid,
35 tcp_calldir;
37 u32 tcp_offset,
38 tcp_reclen;
40 unsigned long tcp_copied,
41 tcp_flags;
44 * Connection of transports
46 unsigned long sock_state;
47 struct delayed_work connect_worker;
48 struct work_struct recv_worker;
49 struct mutex recv_mutex;
50 struct sockaddr_storage srcaddr;
51 unsigned short srcport;
54 * UDP socket buffer size parameters
56 size_t rcvsize,
57 sndsize;
59 struct rpc_timeout tcp_timeout;
62 * Saved socket callback addresses
64 void (*old_data_ready)(struct sock *);
65 void (*old_state_change)(struct sock *);
66 void (*old_write_space)(struct sock *);
67 void (*old_error_report)(struct sock *);
71 * TCP receive state flags
73 #define TCP_RCV_LAST_FRAG (1UL << 0)
74 #define TCP_RCV_COPY_FRAGHDR (1UL << 1)
75 #define TCP_RCV_COPY_XID (1UL << 2)
76 #define TCP_RCV_COPY_DATA (1UL << 3)
77 #define TCP_RCV_READ_CALLDIR (1UL << 4)
78 #define TCP_RCV_COPY_CALLDIR (1UL << 5)
81 * TCP RPC flags
83 #define TCP_RPC_REPLY (1UL << 6)
85 #define XPRT_SOCK_CONNECTING 1U
86 #define XPRT_SOCK_DATA_READY (2)
87 #define XPRT_SOCK_UPD_TIMEOUT (3)
89 #endif /* __KERNEL__ */
91 #endif /* _LINUX_SUNRPC_XPRTSOCK_H */