diff options
Diffstat (limited to 'fs/9p/mux.h')
-rw-r--r-- | fs/9p/mux.h | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/fs/9p/mux.h b/fs/9p/mux.h index 4994cb10badf..9473b84f24b2 100644 --- a/fs/9p/mux.h +++ b/fs/9p/mux.h | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Multiplexer Definitions | 4 | * Multiplexer Definitions |
5 | * | 5 | * |
6 | * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net> | ||
6 | * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> | 7 | * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
@@ -23,19 +24,35 @@ | |||
23 | * | 24 | * |
24 | */ | 25 | */ |
25 | 26 | ||
26 | /* structure to manage each RPC transaction */ | 27 | struct v9fs_mux_data; |
27 | 28 | ||
28 | struct v9fs_rpcreq { | 29 | /** |
29 | struct v9fs_fcall *tcall; | 30 | * v9fs_mux_req_callback - callback function that is called when the |
30 | struct v9fs_fcall *rcall; | 31 | * response of a request is received. The callback is called from |
31 | int err; /* error code if response failed */ | 32 | * a workqueue and shouldn't block. |
33 | * | ||
34 | * @a - the pointer that was specified when the request was send to be | ||
35 | * passed to the callback | ||
36 | * @tc - request call | ||
37 | * @rc - response call | ||
38 | * @err - error code (non-zero if error occured) | ||
39 | */ | ||
40 | typedef void (*v9fs_mux_req_callback)(void *a, struct v9fs_fcall *tc, | ||
41 | struct v9fs_fcall *rc, int err); | ||
42 | |||
43 | int v9fs_mux_global_init(void); | ||
44 | void v9fs_mux_global_exit(void); | ||
32 | 45 | ||
33 | /* XXX - could we put scatter/gather buffers here? */ | 46 | struct v9fs_mux_data *v9fs_mux_init(struct v9fs_transport *trans, int msize, |
47 | unsigned char *extended); | ||
48 | void v9fs_mux_destroy(struct v9fs_mux_data *); | ||
34 | 49 | ||
35 | struct list_head next; | 50 | int v9fs_mux_send(struct v9fs_mux_data *m, struct v9fs_fcall *tc); |
36 | }; | 51 | struct v9fs_fcall *v9fs_mux_recv(struct v9fs_mux_data *m); |
52 | int v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc, struct v9fs_fcall **rc); | ||
53 | int v9fs_mux_rpcnb(struct v9fs_mux_data *m, struct v9fs_fcall *tc, | ||
54 | v9fs_mux_req_callback cb, void *a); | ||
37 | 55 | ||
38 | int v9fs_mux_init(struct v9fs_session_info *v9ses, const char *dev_name); | 56 | void v9fs_mux_flush(struct v9fs_mux_data *m, int sendflush); |
39 | long v9fs_mux_rpc(struct v9fs_session_info *v9ses, | 57 | void v9fs_mux_cancel(struct v9fs_mux_data *m, int err); |
40 | struct v9fs_fcall *tcall, struct v9fs_fcall **rcall); | 58 | int v9fs_errstr2errno(char *errstr, int len); |
41 | void v9fs_mux_cancel_requests(struct v9fs_session_info *v9ses, int err); | ||