xref: /linux/include/uapi/fwctl/fwctl.h (revision 0e79a47fb197b6937709a2af2a138c526a9bc374)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES.
3  */
4 #ifndef _UAPI_FWCTL_H
5 #define _UAPI_FWCTL_H
6 
7 #define FWCTL_TYPE 0x9A
8 
9 /**
10  * DOC: General ioctl format
11  *
12  * The ioctl interface follows a general format to allow for extensibility. Each
13  * ioctl is passed a structure pointer as the argument providing the size of
14  * the structure in the first u32. The kernel checks that any structure space
15  * beyond what it understands is 0. This allows userspace to use the backward
16  * compatible portion while consistently using the newer, larger, structures.
17  *
18  * ioctls use a standard meaning for common errnos:
19  *
20  *  - ENOTTY: The IOCTL number itself is not supported at all
21  *  - E2BIG: The IOCTL number is supported, but the provided structure has
22  *    non-zero in a part the kernel does not understand.
23  *  - EOPNOTSUPP: The IOCTL number is supported, and the structure is
24  *    understood, however a known field has a value the kernel does not
25  *    understand or support.
26  *  - EINVAL: Everything about the IOCTL was understood, but a field is not
27  *    correct.
28  *  - ENOMEM: Out of memory.
29  *  - ENODEV: The underlying device has been hot-unplugged and the FD is
30  *            orphaned.
31  *
32  * As well as additional errnos, within specific ioctls.
33  */
34 enum {
35 	FWCTL_CMD_BASE = 0,
36 };
37 
38 #endif
39