/*1* include/net/9p/transport.h2*3* Transport Definition4*5* Copyright (C) 2005 by Latchesar Ionkov <[email protected]>6* Copyright (C) 2004-2008 by Eric Van Hensbergen <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License version 210* as published by the Free Software Foundation.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to:19* Free Software Foundation20* 51 Franklin Street, Fifth Floor21* Boston, MA 02111-1301 USA22*23*/2425#ifndef NET_9P_TRANSPORT_H26#define NET_9P_TRANSPORT_H2728#define P9_TRANS_PREF_PAYLOAD_MASK 0x12930/* Default. Add Payload to PDU before sending it down to transport layer */31#define P9_TRANS_PREF_PAYLOAD_DEF 0x032/* Send pay load separately to transport layer along with PDU.*/33#define P9_TRANS_PREF_PAYLOAD_SEP 0x13435/**36* struct p9_trans_module - transport module interface37* @list: used to maintain a list of currently available transports38* @name: the human-readable name of the transport39* @maxsize: transport provided maximum packet size40* @pref: Preferences of this transport41* @def: set if this transport should be considered the default42* @create: member function to create a new connection on this transport43* @close: member function to discard a connection on this transport44* @request: member function to issue a request to the transport45* @cancel: member function to cancel a request (if it hasn't been sent)46*47* This is the basic API for a transport module which is registered by the48* transport module with the 9P core network module and used by the client49* to instantiate a new connection on a transport.50*51* The transport module list is protected by v9fs_trans_lock.52*/5354struct p9_trans_module {55struct list_head list;56char *name; /* name of transport */57int maxsize; /* max message size of transport */58int pref; /* Preferences of this transport */59int def; /* this transport should be default */60struct module *owner;61int (*create)(struct p9_client *, const char *, char *);62void (*close) (struct p9_client *);63int (*request) (struct p9_client *, struct p9_req_t *req);64int (*cancel) (struct p9_client *, struct p9_req_t *req);65};6667void v9fs_register_trans(struct p9_trans_module *m);68void v9fs_unregister_trans(struct p9_trans_module *m);69struct p9_trans_module *v9fs_get_trans_by_name(const substring_t *name);70struct p9_trans_module *v9fs_get_default_trans(void);71void v9fs_put_trans(struct p9_trans_module *m);72#endif /* NET_9P_TRANSPORT_H */737475