| .. | .. |
|---|
| 8 | 8 | #ifndef _LINUX_SUNRPC_XPRTSOCK_H |
|---|
| 9 | 9 | #define _LINUX_SUNRPC_XPRTSOCK_H |
|---|
| 10 | 10 | |
|---|
| 11 | | -#ifdef __KERNEL__ |
|---|
| 12 | | - |
|---|
| 13 | 11 | int init_socket_xprt(void); |
|---|
| 14 | 12 | void cleanup_socket_xprt(void); |
|---|
| 13 | +unsigned short get_srcport(struct rpc_xprt *); |
|---|
| 15 | 14 | |
|---|
| 16 | 15 | #define RPC_MIN_RESVPORT (1U) |
|---|
| 17 | 16 | #define RPC_MAX_RESVPORT (65535U) |
|---|
| .. | .. |
|---|
| 26 | 25 | */ |
|---|
| 27 | 26 | struct socket * sock; |
|---|
| 28 | 27 | struct sock * inet; |
|---|
| 28 | + struct file * file; |
|---|
| 29 | 29 | |
|---|
| 30 | 30 | /* |
|---|
| 31 | 31 | * State of TCP reply receive |
|---|
| 32 | 32 | */ |
|---|
| 33 | | - __be32 tcp_fraghdr, |
|---|
| 34 | | - tcp_xid, |
|---|
| 35 | | - tcp_calldir; |
|---|
| 33 | + struct { |
|---|
| 34 | + struct { |
|---|
| 35 | + __be32 fraghdr, |
|---|
| 36 | + xid, |
|---|
| 37 | + calldir; |
|---|
| 38 | + } __attribute__((packed)); |
|---|
| 36 | 39 | |
|---|
| 37 | | - u32 tcp_offset, |
|---|
| 38 | | - tcp_reclen; |
|---|
| 40 | + u32 offset, |
|---|
| 41 | + len; |
|---|
| 39 | 42 | |
|---|
| 40 | | - unsigned long tcp_copied, |
|---|
| 41 | | - tcp_flags; |
|---|
| 43 | + unsigned long copied; |
|---|
| 44 | + } recv; |
|---|
| 45 | + |
|---|
| 46 | + /* |
|---|
| 47 | + * State of TCP transmit queue |
|---|
| 48 | + */ |
|---|
| 49 | + struct { |
|---|
| 50 | + u32 offset; |
|---|
| 51 | + } xmit; |
|---|
| 42 | 52 | |
|---|
| 43 | 53 | /* |
|---|
| 44 | 54 | * Connection of transports |
|---|
| 45 | 55 | */ |
|---|
| 46 | 56 | unsigned long sock_state; |
|---|
| 47 | 57 | struct delayed_work connect_worker; |
|---|
| 58 | + struct work_struct error_worker; |
|---|
| 48 | 59 | struct work_struct recv_worker; |
|---|
| 49 | 60 | struct mutex recv_mutex; |
|---|
| 50 | 61 | struct sockaddr_storage srcaddr; |
|---|
| 51 | 62 | unsigned short srcport; |
|---|
| 63 | + int xprt_err; |
|---|
| 52 | 64 | |
|---|
| 53 | 65 | /* |
|---|
| 54 | 66 | * UDP socket buffer size parameters |
|---|
| .. | .. |
|---|
| 68 | 80 | }; |
|---|
| 69 | 81 | |
|---|
| 70 | 82 | /* |
|---|
| 71 | | - * TCP receive state flags |
|---|
| 72 | | - */ |
|---|
| 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) |
|---|
| 79 | | - |
|---|
| 80 | | -/* |
|---|
| 81 | 83 | * TCP RPC flags |
|---|
| 82 | 84 | */ |
|---|
| 83 | | -#define TCP_RPC_REPLY (1UL << 6) |
|---|
| 84 | | - |
|---|
| 85 | 85 | #define XPRT_SOCK_CONNECTING 1U |
|---|
| 86 | 86 | #define XPRT_SOCK_DATA_READY (2) |
|---|
| 87 | 87 | #define XPRT_SOCK_UPD_TIMEOUT (3) |
|---|
| 88 | | - |
|---|
| 89 | | -#endif /* __KERNEL__ */ |
|---|
| 88 | +#define XPRT_SOCK_WAKE_ERROR (4) |
|---|
| 89 | +#define XPRT_SOCK_WAKE_WRITE (5) |
|---|
| 90 | +#define XPRT_SOCK_WAKE_PENDING (6) |
|---|
| 91 | +#define XPRT_SOCK_WAKE_DISCONNECT (7) |
|---|
| 92 | +#define XPRT_SOCK_CONNECT_SENT (8) |
|---|
| 90 | 93 | |
|---|
| 91 | 94 | #endif /* _LINUX_SUNRPC_XPRTSOCK_H */ |
|---|