1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 
24 #pragma once
25 
26 #include <nvtypes.h>
27 
28 //
29 // This file was generated with FINN, an NVIDIA coding tool.
30 // Source file:      ctrl/ctrl0020.finn
31 //
32 
33 #include "ctrl/ctrlxxxx.h"
34 #define NV0020_CTRL_CMD(cat,idx)  \
35     NVXXXX_CTRL_CMD(0x0020, NV0020_CTRL_##cat, idx)
36 
37 /* NV0020_GPU_MANAGEMENT command categories (6bits) */
38 #define NV0020_CTRL_RESERVED      (0x00)
39 #define NV0020_CTRL_GPU_MGMT      (0x01)
40 
41 /*
42  * NV0020_CTRL_CMD_NULL
43  *
44  * This command does nothing.
45  * This command does not take any parameters.
46  *
47  * Possible status values returned are:
48  *   NV_OK
49  */
50 #define NV0020_CTRL_CMD_NULL      (0x200000) /* finn: Evaluated from "(FINN_NV0020_GPU_MANAGEMENT_RESERVED_INTERFACE_ID << 8) | 0x0" */
51 
52 /* Maximum possible number of bytes of GID information */
53 #define NV0020_GPU_MAX_GID_LENGTH (0x00000100)
54 
55 /*
56  * NV0020_CTRL_CMD_GPU_MGMT_SET_SHUTDOWN_STATE
57  *
58  * This command modifies GPU zero power state for the desired GPU in the
59  * database. This state is set by a privileged client, after the GPU is
60  * completely unregistered from RM as well as PCI subsystem. On Linux,
61  * clients perform this operation through pci-sysfs.
62  * This control call requires admin privileges.
63  *
64  *   uuid (INPUT)
65  *     The UUID of the gpu.
66  *     Supports binary format and SHA-1 type.
67  *
68  * Possible status values returned are:
69  *    NV_OK
70  *    NV_ERR_INVALID_ARGUMENT
71  */
72 #define NV0020_CTRL_CMD_GPU_MGMT_SET_SHUTDOWN_STATE (0x200101) /* finn: Evaluated from "(FINN_NV0020_GPU_MANAGEMENT_GPU_MGMT_INTERFACE_ID << 8) | NV0020_CTRL_GPU_MGMT_SET_SHUTDOWN_STATE_PARAMS_MESSAGE_ID" */
73 
74 #define NV0020_CTRL_GPU_MGMT_SET_SHUTDOWN_STATE_PARAMS_MESSAGE_ID (0x1U)
75 
76 typedef struct NV0020_CTRL_GPU_MGMT_SET_SHUTDOWN_STATE_PARAMS {
77     NvU8 uuid[NV0020_GPU_MAX_GID_LENGTH];
78 } NV0020_CTRL_GPU_MGMT_SET_SHUTDOWN_STATE_PARAMS;
79 
80 /* _ctrl0020_h_ */
81