2016-06-18 08:59:58 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2016-06-18 08:59:58 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
2016-09-06 16:44:05 +00:00
|
|
|
#ifndef _EXT_XNVCTRL_H
|
|
|
|
#define _EXT_XNVCTRL_H
|
2016-06-18 08:59:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stuff from X11/Xlib.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef void *(*XOPENDISPLAY) (char *);
|
|
|
|
typedef int (*XCLOSEDISPLAY) (void *);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Declarations from NVCtrl.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define NV_CTRL_TARGET_TYPE_GPU 1
|
|
|
|
#define NV_CTRL_TARGET_TYPE_COOLER 5 /* e.g., fan */
|
|
|
|
|
|
|
|
#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL 319 /* RW-G */
|
|
|
|
#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE 0
|
|
|
|
#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE 1
|
|
|
|
|
|
|
|
#define NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL 417 /* R--C */
|
|
|
|
#define NV_CTRL_THERMAL_COOLER_LEVEL 320 /* RW-C */
|
|
|
|
|
2016-12-27 18:20:27 +00:00
|
|
|
/*
|
|
|
|
* NV_CTRL_PCI_BUS - Returns the PCI bus number the specified device is using.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define NV_CTRL_PCI_BUS 239 /* R--GI */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NV_CTRL_PCI_DEVICE - Returns the PCI device number the specified device is
|
|
|
|
* using.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define NV_CTRL_PCI_DEVICE 240 /* R--GI */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NV_CTRL_PCI_FUNCTION - Returns the PCI function number the specified device
|
|
|
|
* is using.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define NV_CTRL_PCI_FUNCTION 241 /* R--GI */
|
|
|
|
|
2016-06-18 08:59:58 +00:00
|
|
|
/*
|
|
|
|
* NV_CTRL_GPU_CORE_THRESHOLD reflects the temperature at which the
|
|
|
|
* GPU is throttled to prevent overheating.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define NV_CTRL_GPU_CORE_THRESHOLD 61 /* R--G */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* hashcat stuff from here
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef int HM_ADAPTER_XNVCTRL;
|
|
|
|
|
2016-11-29 21:39:22 +00:00
|
|
|
#if defined(_WIN32) || defined(__WIN32__)
|
2016-06-18 08:59:58 +00:00
|
|
|
#define XNVCTRL_API_CALL __stdcall
|
|
|
|
#else
|
|
|
|
#define XNVCTRL_API_CALL
|
|
|
|
#endif
|
|
|
|
|
2016-12-27 18:20:27 +00:00
|
|
|
typedef int (*XNVCTRL_API_CALL XNVCTRLQUERYTARGETCOUNT) (void *, int, int *);
|
2016-06-18 08:59:58 +00:00
|
|
|
typedef int (*XNVCTRL_API_CALL XNVCTRLQUERYTARGETATTRIBUTE) (void *, int, int, unsigned int, unsigned int, int *);
|
|
|
|
typedef void (*XNVCTRL_API_CALL XNVCTRLSETTARGETATTRIBUTE) (void *, int, int, unsigned int, unsigned int, int);
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (_POSIX)
|
2016-09-05 19:47:26 +00:00
|
|
|
typedef void *XNVCTRL_LIB;
|
|
|
|
#else
|
|
|
|
typedef HINSTANCE XNVCTRL_LIB;
|
|
|
|
#endif
|
|
|
|
|
2016-10-01 09:54:00 +00:00
|
|
|
typedef struct hm_xnvctrl_lib
|
2016-06-18 08:59:58 +00:00
|
|
|
{
|
|
|
|
void *dpy;
|
|
|
|
|
|
|
|
XNVCTRL_LIB lib_x11;
|
|
|
|
XNVCTRL_LIB lib_xnvctrl;
|
|
|
|
|
|
|
|
XOPENDISPLAY XOpenDisplay;
|
|
|
|
XCLOSEDISPLAY XCloseDisplay;
|
|
|
|
|
2016-12-27 18:20:27 +00:00
|
|
|
XNVCTRLQUERYTARGETCOUNT XNVCTRLQueryTargetCount;
|
2016-06-18 08:59:58 +00:00
|
|
|
XNVCTRLQUERYTARGETATTRIBUTE XNVCTRLQueryTargetAttribute;
|
|
|
|
XNVCTRLSETTARGETATTRIBUTE XNVCTRLSetTargetAttribute;
|
|
|
|
|
|
|
|
} hm_xnvctrl_lib_t;
|
|
|
|
|
2016-09-05 19:47:26 +00:00
|
|
|
typedef hm_xnvctrl_lib_t XNVCTRL_PTR;
|
2016-06-18 08:59:58 +00:00
|
|
|
|
2016-09-06 16:44:05 +00:00
|
|
|
#endif // _EXT_XNVCTRL_H
|