Commit | Line | Data |
---|---|---|
426cc91a EVH |
1 | /* |
2 | * linux/fs/9p/mux.h | |
3 | * | |
4 | * Multiplexer Definitions | |
5 | * | |
3cf6429a | 6 | * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net> |
426cc91a EVH |
7 | * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
42e8c509 EVH |
10 | * it under the terms of the GNU General Public License version 2 |
11 | * as published by the Free Software Foundation. | |
426cc91a EVH |
12 | * |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to: | |
20 | * Free Software Foundation | |
21 | * 51 Franklin Street, Fifth Floor | |
22 | * Boston, MA 02111-1301 USA | |
23 | * | |
24 | */ | |
25 | ||
3cf6429a | 26 | struct v9fs_mux_data; |
41e5a6ac | 27 | struct v9fs_req; |
426cc91a | 28 | |
3cf6429a LI |
29 | /** |
30 | * v9fs_mux_req_callback - callback function that is called when the | |
31 | * response of a request is received. The callback is called from | |
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 | */ | |
41e5a6ac | 40 | typedef void (*v9fs_mux_req_callback)(struct v9fs_req *req, void *a); |
3cf6429a | 41 | |
1dac06b2 | 42 | int v9fs_mux_global_init(void); |
3cf6429a | 43 | void v9fs_mux_global_exit(void); |
426cc91a | 44 | |
3cf6429a LI |
45 | struct v9fs_mux_data *v9fs_mux_init(struct v9fs_transport *trans, int msize, |
46 | unsigned char *extended); | |
47 | void v9fs_mux_destroy(struct v9fs_mux_data *); | |
426cc91a | 48 | |
3cf6429a LI |
49 | int v9fs_mux_send(struct v9fs_mux_data *m, struct v9fs_fcall *tc); |
50 | struct v9fs_fcall *v9fs_mux_recv(struct v9fs_mux_data *m); | |
51 | int v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc, struct v9fs_fcall **rc); | |
426cc91a | 52 | |
3cf6429a LI |
53 | void v9fs_mux_flush(struct v9fs_mux_data *m, int sendflush); |
54 | void v9fs_mux_cancel(struct v9fs_mux_data *m, int err); | |
1dac06b2 | 55 | int v9fs_errstr2errno(char *errstr, int len); |