printf: Remove unused 'bprintf'
[drm/drm-misc.git] / include / linux / sunrpc / xprtsock.h
blob700a1e6c047c09f6b28fb7dfb4b442b0b174fb25
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 int init_socket_xprt(void);
12 void cleanup_socket_xprt(void);
14 #define RPC_MIN_RESVPORT (1U)
15 #define RPC_MAX_RESVPORT (65535U)
16 #define RPC_DEF_MIN_RESVPORT (665U)
17 #define RPC_DEF_MAX_RESVPORT (1023U)
19 struct sock_xprt {
20 struct rpc_xprt xprt;
23 * Network layer
25 struct socket * sock;
26 struct sock * inet;
27 struct file * file;
30 * State of TCP reply receive
32 struct {
33 struct {
34 __be32 fraghdr,
35 xid,
36 calldir;
37 } __attribute__((packed));
39 u32 offset,
40 len;
42 unsigned long copied;
43 } recv;
46 * State of TCP transmit queue
48 struct {
49 u32 offset;
50 } xmit;
53 * Connection of transports
55 unsigned long sock_state;
56 struct delayed_work connect_worker;
57 struct work_struct error_worker;
58 struct work_struct recv_worker;
59 struct mutex recv_mutex;
60 struct completion handshake_done;
61 struct sockaddr_storage srcaddr;
62 unsigned short srcport;
63 int xprt_err;
64 struct rpc_clnt *clnt;
67 * UDP socket buffer size parameters
69 size_t rcvsize,
70 sndsize;
72 struct rpc_timeout tcp_timeout;
75 * Saved socket callback addresses
77 void (*old_data_ready)(struct sock *);
78 void (*old_state_change)(struct sock *);
79 void (*old_write_space)(struct sock *);
80 void (*old_error_report)(struct sock *);
84 * TCP RPC flags
86 #define XPRT_SOCK_CONNECTING 1U
87 #define XPRT_SOCK_DATA_READY (2)
88 #define XPRT_SOCK_UPD_TIMEOUT (3)
89 #define XPRT_SOCK_WAKE_ERROR (4)
90 #define XPRT_SOCK_WAKE_WRITE (5)
91 #define XPRT_SOCK_WAKE_PENDING (6)
92 #define XPRT_SOCK_WAKE_DISCONNECT (7)
93 #define XPRT_SOCK_CONNECT_SENT (8)
94 #define XPRT_SOCK_NOSPACE (9)
95 #define XPRT_SOCK_IGNORE_RECV (10)
97 #endif /* _LINUX_SUNRPC_XPRTSOCK_H */