aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/9p/transport.h
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@opteron.(none)>2007-10-17 14:31:07 -0500
committerEric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com>2007-10-17 14:31:07 -0500
commita80d923e1321a7ed69a0918de37e39871bb536a0 (patch)
tree8294e5f14a0e938ae4675ef912a32fbade0f832b /include/net/9p/transport.h
parent[MIPS] IP22: Fix hang due to messing with timer interrupt handler (diff)
downloadlinux-dev-a80d923e1321a7ed69a0918de37e39871bb536a0.tar.xz
linux-dev-a80d923e1321a7ed69a0918de37e39871bb536a0.zip
9p: Make transports dynamic
This patch abstracts out the interfaces to underlying transports so that new transports can be added as modules. This should also allow kernel configuration of transports without ifdef-hell. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'include/net/9p/transport.h')
-rw-r--r--include/net/9p/transport.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 462d42279fb0..7c68b3e8e78c 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -26,24 +26,29 @@
#ifndef NET_9P_TRANSPORT_H
#define NET_9P_TRANSPORT_H
-enum p9_transport_status {
+enum p9_trans_status {
Connected,
Disconnected,
Hung,
};
-struct p9_transport {
- enum p9_transport_status status;
+struct p9_trans {
+ enum p9_trans_status status;
void *priv;
+ int (*write) (struct p9_trans *, void *, int);
+ int (*read) (struct p9_trans *, void *, int);
+ void (*close) (struct p9_trans *);
+ unsigned int (*poll)(struct p9_trans *, struct poll_table_struct *);
+};
- int (*write) (struct p9_transport *, void *, int);
- int (*read) (struct p9_transport *, void *, int);
- void (*close) (struct p9_transport *);
- unsigned int (*poll)(struct p9_transport *, struct poll_table_struct *);
+struct p9_trans_module {
+ struct list_head list;
+ char *name; /* name of transport */
+ int maxsize; /* max message size of transport */
+ int def; /* this transport should be default */
+ struct p9_trans * (*create)(const char *devname, char *options);
};
-struct p9_transport *p9_trans_create_tcp(const char *addr, int port);
-struct p9_transport *p9_trans_create_unix(const char *addr);
-struct p9_transport *p9_trans_create_fd(int rfd, int wfd);
+void v9fs_register_trans(struct p9_trans_module *m);
#endif /* NET_9P_TRANSPORT_H */