xref: /openbmc/linux/drivers/gpu/drm/nouveau/include/nvif/ioctl.h (revision b24413180f5600bcb3bb70fbed5cf186b60864bd)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVIF_IOCTL_H__
3 #define __NVIF_IOCTL_H__
4 
5 #define NVIF_VERSION_LATEST                               0x0000000000000000ULL
6 
7 struct nvif_ioctl_v0 {
8 	__u8  version;
9 #define NVIF_IOCTL_V0_NOP                                                  0x00
10 #define NVIF_IOCTL_V0_SCLASS                                               0x01
11 #define NVIF_IOCTL_V0_NEW                                                  0x02
12 #define NVIF_IOCTL_V0_DEL                                                  0x03
13 #define NVIF_IOCTL_V0_MTHD                                                 0x04
14 #define NVIF_IOCTL_V0_RD                                                   0x05
15 #define NVIF_IOCTL_V0_WR                                                   0x06
16 #define NVIF_IOCTL_V0_MAP                                                  0x07
17 #define NVIF_IOCTL_V0_UNMAP                                                0x08
18 #define NVIF_IOCTL_V0_NTFY_NEW                                             0x09
19 #define NVIF_IOCTL_V0_NTFY_DEL                                             0x0a
20 #define NVIF_IOCTL_V0_NTFY_GET                                             0x0b
21 #define NVIF_IOCTL_V0_NTFY_PUT                                             0x0c
22 	__u8  type;
23 	__u8  pad02[4];
24 #define NVIF_IOCTL_V0_OWNER_NVIF                                           0x00
25 #define NVIF_IOCTL_V0_OWNER_ANY                                            0xff
26 	__u8  owner;
27 #define NVIF_IOCTL_V0_ROUTE_NVIF                                           0x00
28 #define NVIF_IOCTL_V0_ROUTE_HIDDEN                                         0xff
29 	__u8  route;
30 	__u64 token;
31 	__u64 object;
32 	__u8  data[];		/* ioctl data (below) */
33 };
34 
35 struct nvif_ioctl_nop_v0 {
36 	__u64 version;
37 };
38 
39 struct nvif_ioctl_sclass_v0 {
40 	/* nvif_ioctl ... */
41 	__u8  version;
42 	__u8  count;
43 	__u8  pad02[6];
44 	struct nvif_ioctl_sclass_oclass_v0 {
45 		__s32 oclass;
46 		__s16 minver;
47 		__s16 maxver;
48 	} oclass[];
49 };
50 
51 struct nvif_ioctl_new_v0 {
52 	/* nvif_ioctl ... */
53 	__u8  version;
54 	__u8  pad01[6];
55 	__u8  route;
56 	__u64 token;
57 	__u64 object;
58 	__u32 handle;
59 	__s32 oclass;
60 	__u8  data[];		/* class data (class.h) */
61 };
62 
63 struct nvif_ioctl_del {
64 };
65 
66 struct nvif_ioctl_rd_v0 {
67 	/* nvif_ioctl ... */
68 	__u8  version;
69 	__u8  size;
70 	__u8  pad02[2];
71 	__u32 data;
72 	__u64 addr;
73 };
74 
75 struct nvif_ioctl_wr_v0 {
76 	/* nvif_ioctl ... */
77 	__u8  version;
78 	__u8  size;
79 	__u8  pad02[2];
80 	__u32 data;
81 	__u64 addr;
82 };
83 
84 struct nvif_ioctl_map_v0 {
85 	/* nvif_ioctl ... */
86 	__u8  version;
87 	__u8  pad01[3];
88 	__u32 length;
89 	__u64 handle;
90 };
91 
92 struct nvif_ioctl_unmap {
93 };
94 
95 struct nvif_ioctl_ntfy_new_v0 {
96 	/* nvif_ioctl ... */
97 	__u8  version;
98 	__u8  event;
99 	__u8  index;
100 	__u8  pad03[5];
101 	__u8  data[];		/* event request data (event.h) */
102 };
103 
104 struct nvif_ioctl_ntfy_del_v0 {
105 	/* nvif_ioctl ... */
106 	__u8  version;
107 	__u8  index;
108 	__u8  pad02[6];
109 };
110 
111 struct nvif_ioctl_ntfy_get_v0 {
112 	/* nvif_ioctl ... */
113 	__u8  version;
114 	__u8  index;
115 	__u8  pad02[6];
116 };
117 
118 struct nvif_ioctl_ntfy_put_v0 {
119 	/* nvif_ioctl ... */
120 	__u8  version;
121 	__u8  index;
122 	__u8  pad02[6];
123 };
124 
125 struct nvif_ioctl_mthd_v0 {
126 	/* nvif_ioctl ... */
127 	__u8  version;
128 	__u8  method;
129 	__u8  pad02[6];
130 	__u8  data[];		/* method data (class.h) */
131 };
132 
133 #endif
134