/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Transport Definition3*4* Copyright (C) 2005 by Latchesar Ionkov <[email protected]>5* Copyright (C) 2004-2008 by Eric Van Hensbergen <[email protected]>6*/78#ifndef NET_9P_TRANSPORT_H9#define NET_9P_TRANSPORT_H1011#include <linux/module.h>1213#define P9_DEF_MIN_RESVPORT (665U)14#define P9_DEF_MAX_RESVPORT (1023U)1516/**17* struct p9_trans_module - transport module interface18* @list: used to maintain a list of currently available transports19* @name: the human-readable name of the transport20* @maxsize: transport provided maximum packet size21* @pooled_rbuffers: currently only set for RDMA transport which pulls the22* response buffers from a shared pool, and accordingly23* we're less flexible when choosing the response message24* size in this case25* @def: set if this transport should be considered the default26* @create: member function to create a new connection on this transport27* @close: member function to discard a connection on this transport28* @request: member function to issue a request to the transport29* @cancel: member function to cancel a request (if it hasn't been sent)30* @cancelled: member function to notify that a cancelled request will not31* receive a reply32*33* This is the basic API for a transport module which is registered by the34* transport module with the 9P core network module and used by the client35* to instantiate a new connection on a transport.36*37* The transport module list is protected by v9fs_trans_lock.38*/3940struct p9_trans_module {41struct list_head list;42char *name; /* name of transport */43int maxsize; /* max message size of transport */44bool pooled_rbuffers;45int def; /* this transport should be default */46struct module *owner;47int (*create)(struct p9_client *client,48const char *devname, char *args);49void (*close)(struct p9_client *client);50int (*request)(struct p9_client *client, struct p9_req_t *req);51int (*cancel)(struct p9_client *client, struct p9_req_t *req);52int (*cancelled)(struct p9_client *client, struct p9_req_t *req);53int (*zc_request)(struct p9_client *client, struct p9_req_t *req,54struct iov_iter *uidata, struct iov_iter *uodata,55int inlen, int outlen, int in_hdr_len);56int (*show_options)(struct seq_file *m, struct p9_client *client);57};5859void v9fs_register_trans(struct p9_trans_module *m);60void v9fs_unregister_trans(struct p9_trans_module *m);61struct p9_trans_module *v9fs_get_trans_by_name(const char *s);62struct p9_trans_module *v9fs_get_default_trans(void);63void v9fs_put_trans(struct p9_trans_module *m);6465#define MODULE_ALIAS_9P(transport) \66MODULE_ALIAS("9p-" transport)6768#endif /* NET_9P_TRANSPORT_H */697071