File Index
Files and directories
Sign in
FILE

transport.h

File preview with syntax highlighting.

linux-6.19.14/include/net/9p/transport.h C
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Transport Definition
 4 *
 5 *  Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
 6 *  Copyright (C) 2004-2008 by Eric Van Hensbergen <ericvh@gmail.com>
 7 */
 8
 9#ifndef NET_9P_TRANSPORT_H
10#define NET_9P_TRANSPORT_H
11
12#include <linux/module.h>
13
14#define P9_DEF_MIN_RESVPORT	(665U)
15#define P9_DEF_MAX_RESVPORT	(1023U)
16
17#define P9_FD_PORT 564
18
19#define P9_RDMA_PORT		5640
20#define P9_RDMA_SQ_DEPTH	32
21#define P9_RDMA_RQ_DEPTH	32
22#define P9_RDMA_TIMEOUT		30000		/* 30 seconds */
23
24/**
25 * struct p9_trans_module - transport module interface
26 * @list: used to maintain a list of currently available transports
27 * @name: the human-readable name of the transport
28 * @maxsize: transport provided maximum packet size
29 * @pooled_rbuffers: currently only set for RDMA transport which pulls the
30 *                   response buffers from a shared pool, and accordingly
31 *                   we're less flexible when choosing the response message
32 *                   size in this case
33 * @def: set if this transport should be considered the default
34 * @supports_vmalloc: set if this transport can work with vmalloc'd buffers
35 *                    (non-physically contiguous memory). Transports requiring
36 *                    DMA should leave this as false.
37 * @create: member function to create a new connection on this transport
38 * @close: member function to discard a connection on this transport
39 * @request: member function to issue a request to the transport
40 * @cancel: member function to cancel a request (if it hasn't been sent)
41 * @cancelled: member function to notify that a cancelled request will not
42 *             receive a reply
43 *
44 * This is the basic API for a transport module which is registered by the
45 * transport module with the 9P core network module and used by the client
46 * to instantiate a new connection on a transport.
47 *
48 * The transport module list is protected by v9fs_trans_lock.
49 */
50
51struct p9_trans_module {
52	struct list_head list;
53	char *name;		/* name of transport */
54	int maxsize;		/* max message size of transport */
55	bool pooled_rbuffers;
56	bool def;		/* this transport should be default */
57	bool supports_vmalloc;	/* can work with vmalloc'd buffers */
58	struct module *owner;
59	int (*create)(struct p9_client *client,
60		      struct fs_context *fc);
61	void (*close)(struct p9_client *client);
62	int (*request)(struct p9_client *client, struct p9_req_t *req);
63	int (*cancel)(struct p9_client *client, struct p9_req_t *req);
64	int (*cancelled)(struct p9_client *client, struct p9_req_t *req);
65	int (*zc_request)(struct p9_client *client, struct p9_req_t *req,
66			  struct iov_iter *uidata, struct iov_iter *uodata,
67			  int inlen, int outlen, int in_hdr_len);
68	int (*show_options)(struct seq_file *m, struct p9_client *client);
69};
70
71void v9fs_register_trans(struct p9_trans_module *m);
72void v9fs_unregister_trans(struct p9_trans_module *m);
73struct p9_trans_module *v9fs_get_trans_by_name(const char *s);
74struct p9_trans_module *v9fs_get_default_trans(void);
75void v9fs_put_trans(struct p9_trans_module *m);
76
77#define MODULE_ALIAS_9P(transport) \
78	MODULE_ALIAS("9p-" transport)
79
80#endif /* NET_9P_TRANSPORT_H */
~/ Read-only file preview.