1 1.1 riastrad /* $NetBSD: if0001.h,v 1.2 2021/12/18 23:45:33 riastradh Exp $ */ 2 1.1 riastrad 3 1.1 riastrad /* SPDX-License-Identifier: MIT */ 4 1.1 riastrad #ifndef __NVIF_IF0001_H__ 5 1.1 riastrad #define __NVIF_IF0001_H__ 6 1.1 riastrad 7 1.1 riastrad #define NVIF_CONTROL_PSTATE_INFO 0x00 8 1.1 riastrad #define NVIF_CONTROL_PSTATE_ATTR 0x01 9 1.1 riastrad #define NVIF_CONTROL_PSTATE_USER 0x02 10 1.1 riastrad 11 1.1 riastrad struct nvif_control_pstate_info_v0 { 12 1.1 riastrad __u8 version; 13 1.1 riastrad __u8 count; /* out: number of power states */ 14 1.1 riastrad #define NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE (-1) 15 1.1 riastrad #define NVIF_CONTROL_PSTATE_INFO_V0_USTATE_PERFMON (-2) 16 1.1 riastrad __s8 ustate_ac; /* out: target pstate index */ 17 1.1 riastrad __s8 ustate_dc; /* out: target pstate index */ 18 1.1 riastrad __s8 pwrsrc; /* out: current power source */ 19 1.1 riastrad #define NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN (-1) 20 1.1 riastrad #define NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_PERFMON (-2) 21 1.1 riastrad __s8 pstate; /* out: current pstate index */ 22 1.1 riastrad __u8 pad06[2]; 23 1.1 riastrad }; 24 1.1 riastrad 25 1.1 riastrad struct nvif_control_pstate_attr_v0 { 26 1.1 riastrad __u8 version; 27 1.1 riastrad #define NVIF_CONTROL_PSTATE_ATTR_V0_STATE_CURRENT (-1) 28 1.1 riastrad __s8 state; /* in: index of pstate to query 29 1.1 riastrad * out: pstate identifier 30 1.1 riastrad */ 31 1.1 riastrad __u8 index; /* in: index of attribute to query 32 1.1 riastrad * out: index of next attribute, or 0 if no more 33 1.1 riastrad */ 34 1.1 riastrad __u8 pad03[5]; 35 1.1 riastrad __u32 min; 36 1.1 riastrad __u32 max; 37 1.1 riastrad char name[32]; 38 1.1 riastrad char unit[16]; 39 1.1 riastrad }; 40 1.1 riastrad 41 1.1 riastrad struct nvif_control_pstate_user_v0 { 42 1.1 riastrad __u8 version; 43 1.1 riastrad #define NVIF_CONTROL_PSTATE_USER_V0_STATE_UNKNOWN (-1) 44 1.1 riastrad #define NVIF_CONTROL_PSTATE_USER_V0_STATE_PERFMON (-2) 45 1.1 riastrad __s8 ustate; /* in: pstate identifier */ 46 1.1 riastrad __s8 pwrsrc; /* in: target power source */ 47 1.1 riastrad __u8 pad03[5]; 48 1.1 riastrad }; 49 1.1 riastrad #endif 50