/* 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#define P9_FD_PORT 5641718#define P9_RDMA_PORT 564019#define P9_RDMA_SQ_DEPTH 3220#define P9_RDMA_RQ_DEPTH 3221#define P9_RDMA_TIMEOUT 30000 /* 30 seconds */2223/**24* struct p9_trans_module - transport module interface25* @list: used to maintain a list of currently available transports26* @name: the human-readable name of the transport27* @maxsize: transport provided maximum packet size28* @pooled_rbuffers: currently only set for RDMA transport which pulls the29* response buffers from a shared pool, and accordingly30* we're less flexible when choosing the response message31* size in this case32* @def: set if this transport should be considered the default33* @supports_vmalloc: set if this transport can work with vmalloc'd buffers34* (non-physically contiguous memory). Transports requiring35* DMA should leave this as false.36* @create: member function to create a new connection on this transport37* @close: member function to discard a connection on this transport38* @request: member function to issue a request to the transport39* @cancel: member function to cancel a request (if it hasn't been sent)40* @cancelled: member function to notify that a cancelled request will not41* receive a reply42*43* This is the basic API for a transport module which is registered by the44* transport module with the 9P core network module and used by the client45* to instantiate a new connection on a transport.46*47* The transport module list is protected by v9fs_trans_lock.48*/4950struct p9_trans_module {51struct list_head list;52char *name; /* name of transport */53int maxsize; /* max message size of transport */54bool pooled_rbuffers;55bool def; /* this transport should be default */56bool supports_vmalloc; /* can work with vmalloc'd buffers */57struct module *owner;58int (*create)(struct p9_client *client,59struct fs_context *fc);60void (*close)(struct p9_client *client);61int (*request)(struct p9_client *client, struct p9_req_t *req);62int (*cancel)(struct p9_client *client, struct p9_req_t *req);63int (*cancelled)(struct p9_client *client, struct p9_req_t *req);64int (*zc_request)(struct p9_client *client, struct p9_req_t *req,65struct iov_iter *uidata, struct iov_iter *uodata,66int inlen, int outlen, int in_hdr_len);67int (*show_options)(struct seq_file *m, struct p9_client *client);68};6970void v9fs_register_trans(struct p9_trans_module *m);71void v9fs_unregister_trans(struct p9_trans_module *m);72struct p9_trans_module *v9fs_get_trans_by_name(const char *s);73struct p9_trans_module *v9fs_get_default_trans(void);74void v9fs_put_trans(struct p9_trans_module *m);7576#define MODULE_ALIAS_9P(transport) \77MODULE_ALIAS("9p-" transport)7879#endif /* NET_9P_TRANSPORT_H */808182