1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef __local_pwn_H__
17 #define __local_pwn_H__
18 
19 #define SIOCIWFIRSTPRIV 0x8BE0
20 #define SIOCGIWNAME     0x8B01
21 #define IOCTL_SET_STRUCT_FOR_EM         (SIOCIWFIRSTPRIV + 11)
22 #define PRIV_CUSTOM_BWCS_CMD            13
23 #define PRIV_CMD_OID                    15
24 #define PRIV_CMD_SW_CTRL                20
25 #define PRIV_CMD_WSC_PROBE_REQ          22
26 
27 enum host1x_class {
28         HOST1X_CLASS_HOST1X = 0x1,
29         HOST1X_CLASS_NVENC = 0x21,
30         HOST1X_CLASS_VI = 0x30,
31         HOST1X_CLASS_ISPA = 0x32,
32         HOST1X_CLASS_ISPB = 0x34,
33         HOST1X_CLASS_GR2D = 0x51,
34         HOST1X_CLASS_GR2D_SB = 0x52,
35         HOST1X_CLASS_VIC = 0x5D,
36         HOST1X_CLASS_GR3D = 0x60,
37         HOST1X_CLASS_NVJPG = 0xC0,
38         HOST1X_CLASS_NVDEC = 0xF0,
39 };
40 
41 #define DRM_COMMAND_BASE                0x40
42 #define DRM_COMMAND_END                 0xA0
43 
44 #define DRM_TEGRA_OPEN_CHANNEL          0x05
45 #define DRM_TEGRA_CLOSE_CHANNEL         0x06
46 
47 struct drm_tegra_open_channel {
48         __u32 client;
49         __u32 pad;
50         __u64 context;
51 };
52 
53 struct drm_tegra_close_channel {
54         __u64 context;
55 };
56 
57 #define DRM_IOCTL_BASE                  'd'
58 #define DRM_IOWR(nr,type)               _IOWR(DRM_IOCTL_BASE,nr,type)
59 #define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
60 #define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_open_channel)
61 
62 #endif
63