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