xref: /illumos-gate/usr/src/uts/common/sys/vio9p.h (revision 621b6cf75a027e4c06f2a1b3207abb5f24539b14)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2022 Oxide Computer Company
14  */
15 
16 #ifndef _SYS_VIO9P_H
17 #define	_SYS_VIO9P_H
18 
19 /*
20  * VIRTIO 9P DRIVER
21  */
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*
28  * If the hypervisor supports mount tags through the VIRTIO_9P_F_MOUNT_TAG
29  * feature, they will have at most this many bytes:
30  */
31 #define	VIRTIO_9P_TAGLEN		32
32 
33 /*
34  * ioctl(2) support for 9P channel devices:
35  */
36 #define	VIO9P_IOC_BASE			(('9' << 16) | ('P' << 8))
37 #define	VIO9P_IOC_MOUNT_TAG		(VIO9P_IOC_BASE | 0x01)
38 
39 /*
40  * Buffer size for the VIO9P_IOC_MOUNT_TAG ioctl, which includes one byte
41  * beyond the maximum tag length for NUL termination:
42  */
43 #define	VIO9P_MOUNT_TAG_SIZE		(VIRTIO_9P_TAGLEN + 1)
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif /* _SYS_VIO9P_H */
50