blob: e90bfd32ea42335ebd411e0d82423b34a38e5d0d [file] [log] [blame]
Eric Van Hensbergen426cc912005-09-09 13:04:22 -07001/*
2 * linux/fs/9p/mux.h
3 *
4 * Multiplexer Definitions
5 *
Latchesar Ionkov3cf64292006-01-08 01:04:58 -08006 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
Eric Van Hensbergen426cc912005-09-09 13:04:22 -07007 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
Eric Van Hensbergen42e8c502006-03-25 03:07:28 -080010 * it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation.
Eric Van Hensbergen426cc912005-09-09 13:04:22 -070012 *
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
Latchesar Ionkov3cf64292006-01-08 01:04:58 -080026struct v9fs_mux_data;
Eric Van Hensbergen426cc912005-09-09 13:04:22 -070027
Latchesar Ionkov3cf64292006-01-08 01:04:58 -080028/**
29 * v9fs_mux_req_callback - callback function that is called when the
30 * response of a request is received. The callback is called from
31 * a workqueue and shouldn't block.
32 *
33 * @a - the pointer that was specified when the request was send to be
34 * passed to the callback
35 * @tc - request call
36 * @rc - response call
37 * @err - error code (non-zero if error occured)
38 */
39typedef void (*v9fs_mux_req_callback)(void *a, struct v9fs_fcall *tc,
40 struct v9fs_fcall *rc, int err);
Eric Van Hensbergen426cc912005-09-09 13:04:22 -070041
Latchesar Ionkov1dac06b2006-01-08 01:05:02 -080042int v9fs_mux_global_init(void);
Latchesar Ionkov3cf64292006-01-08 01:04:58 -080043void v9fs_mux_global_exit(void);
Eric Van Hensbergen426cc912005-09-09 13:04:22 -070044
Latchesar Ionkov3cf64292006-01-08 01:04:58 -080045struct v9fs_mux_data *v9fs_mux_init(struct v9fs_transport *trans, int msize,
46 unsigned char *extended);
47void v9fs_mux_destroy(struct v9fs_mux_data *);
Eric Van Hensbergen426cc912005-09-09 13:04:22 -070048
Latchesar Ionkov3cf64292006-01-08 01:04:58 -080049int v9fs_mux_send(struct v9fs_mux_data *m, struct v9fs_fcall *tc);
50struct v9fs_fcall *v9fs_mux_recv(struct v9fs_mux_data *m);
51int v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc, struct v9fs_fcall **rc);
Latchesar Ionkov3cf64292006-01-08 01:04:58 -080052
53void v9fs_mux_flush(struct v9fs_mux_data *m, int sendflush);
54void v9fs_mux_cancel(struct v9fs_mux_data *m, int err);
Latchesar Ionkov1dac06b2006-01-08 01:05:02 -080055int v9fs_errstr2errno(char *errstr, int len);