diff options
Diffstat (limited to 'include/linux/sunrpc/xprt.h')
-rw-r--r-- | include/linux/sunrpc/xprt.h | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index d11cedd14f0f..30b17b3bc1a9 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -19,25 +19,11 @@ | |||
19 | 19 | ||
20 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
21 | 21 | ||
22 | extern unsigned int xprt_udp_slot_table_entries; | ||
23 | extern unsigned int xprt_tcp_slot_table_entries; | ||
24 | |||
25 | #define RPC_MIN_SLOT_TABLE (2U) | 22 | #define RPC_MIN_SLOT_TABLE (2U) |
26 | #define RPC_DEF_SLOT_TABLE (16U) | 23 | #define RPC_DEF_SLOT_TABLE (16U) |
27 | #define RPC_MAX_SLOT_TABLE (128U) | 24 | #define RPC_MAX_SLOT_TABLE (128U) |
28 | 25 | ||
29 | /* | 26 | /* |
30 | * Parameters for choosing a free port | ||
31 | */ | ||
32 | extern unsigned int xprt_min_resvport; | ||
33 | extern unsigned int xprt_max_resvport; | ||
34 | |||
35 | #define RPC_MIN_RESVPORT (1U) | ||
36 | #define RPC_MAX_RESVPORT (65535U) | ||
37 | #define RPC_DEF_MIN_RESVPORT (665U) | ||
38 | #define RPC_DEF_MAX_RESVPORT (1023U) | ||
39 | |||
40 | /* | ||
41 | * This describes a timeout strategy | 27 | * This describes a timeout strategy |
42 | */ | 28 | */ |
43 | struct rpc_timeout { | 29 | struct rpc_timeout { |
@@ -53,6 +39,10 @@ enum rpc_display_format_t { | |||
53 | RPC_DISPLAY_PORT, | 39 | RPC_DISPLAY_PORT, |
54 | RPC_DISPLAY_PROTO, | 40 | RPC_DISPLAY_PROTO, |
55 | RPC_DISPLAY_ALL, | 41 | RPC_DISPLAY_ALL, |
42 | RPC_DISPLAY_HEX_ADDR, | ||
43 | RPC_DISPLAY_HEX_PORT, | ||
44 | RPC_DISPLAY_UNIVERSAL_ADDR, | ||
45 | RPC_DISPLAY_NETID, | ||
56 | RPC_DISPLAY_MAX, | 46 | RPC_DISPLAY_MAX, |
57 | }; | 47 | }; |
58 | 48 | ||
@@ -196,14 +186,22 @@ struct rpc_xprt { | |||
196 | char * address_strings[RPC_DISPLAY_MAX]; | 186 | char * address_strings[RPC_DISPLAY_MAX]; |
197 | }; | 187 | }; |
198 | 188 | ||
199 | struct rpc_xprtsock_create { | 189 | struct xprt_create { |
200 | int proto; /* IPPROTO_UDP or IPPROTO_TCP */ | 190 | int ident; /* XPRT_TRANSPORT identifier */ |
201 | struct sockaddr * srcaddr; /* optional local address */ | 191 | struct sockaddr * srcaddr; /* optional local address */ |
202 | struct sockaddr * dstaddr; /* remote peer address */ | 192 | struct sockaddr * dstaddr; /* remote peer address */ |
203 | size_t addrlen; | 193 | size_t addrlen; |
204 | struct rpc_timeout * timeout; /* optional timeout parameters */ | 194 | struct rpc_timeout * timeout; /* optional timeout parameters */ |
205 | }; | 195 | }; |
206 | 196 | ||
197 | struct xprt_class { | ||
198 | struct list_head list; | ||
199 | int ident; /* XPRT_TRANSPORT identifier */ | ||
200 | struct rpc_xprt * (*setup)(struct xprt_create *); | ||
201 | struct module *owner; | ||
202 | char name[32]; | ||
203 | }; | ||
204 | |||
207 | /* | 205 | /* |
208 | * Transport operations used by ULPs | 206 | * Transport operations used by ULPs |
209 | */ | 207 | */ |
@@ -212,7 +210,7 @@ void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long | |||
212 | /* | 210 | /* |
213 | * Generic internal transport functions | 211 | * Generic internal transport functions |
214 | */ | 212 | */ |
215 | struct rpc_xprt * xprt_create_transport(struct rpc_xprtsock_create *args); | 213 | struct rpc_xprt *xprt_create_transport(struct xprt_create *args); |
216 | void xprt_connect(struct rpc_task *task); | 214 | void xprt_connect(struct rpc_task *task); |
217 | void xprt_reserve(struct rpc_task *task); | 215 | void xprt_reserve(struct rpc_task *task); |
218 | int xprt_reserve_xprt(struct rpc_task *task); | 216 | int xprt_reserve_xprt(struct rpc_task *task); |
@@ -235,6 +233,8 @@ static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 * | |||
235 | /* | 233 | /* |
236 | * Transport switch helper functions | 234 | * Transport switch helper functions |
237 | */ | 235 | */ |
236 | int xprt_register_transport(struct xprt_class *type); | ||
237 | int xprt_unregister_transport(struct xprt_class *type); | ||
238 | void xprt_set_retrans_timeout_def(struct rpc_task *task); | 238 | void xprt_set_retrans_timeout_def(struct rpc_task *task); |
239 | void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | 239 | void xprt_set_retrans_timeout_rtt(struct rpc_task *task); |
240 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | 240 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); |
@@ -248,14 +248,6 @@ void xprt_release_rqst_cong(struct rpc_task *task); | |||
248 | void xprt_disconnect(struct rpc_xprt *xprt); | 248 | void xprt_disconnect(struct rpc_xprt *xprt); |
249 | 249 | ||
250 | /* | 250 | /* |
251 | * Socket transport setup operations | ||
252 | */ | ||
253 | struct rpc_xprt * xs_setup_udp(struct rpc_xprtsock_create *args); | ||
254 | struct rpc_xprt * xs_setup_tcp(struct rpc_xprtsock_create *args); | ||
255 | int init_socket_xprt(void); | ||
256 | void cleanup_socket_xprt(void); | ||
257 | |||
258 | /* | ||
259 | * Reserved bit positions in xprt->state | 251 | * Reserved bit positions in xprt->state |
260 | */ | 252 | */ |
261 | #define XPRT_LOCKED (0) | 253 | #define XPRT_LOCKED (0) |