~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sparc/include/uapi/asm/envctrl.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 /*
  3  *
  4  * envctrl.h: Definitions for access to the i2c environment
  5  *            monitoring on Ultrasparc systems.
  6  *
  7  * Copyright (C) 1998  Eddie C. Dost  (ecd@skynet.be)
  8  * Copyright (C) 2000  Vinh Truong  (vinh.truong@eng.sun.com)
  9  * VT - Add all ioctl commands and environment status definitions
 10  * VT - Add application note
 11  */
 12 #ifndef _SPARC64_ENVCTRL_H
 13 #define _SPARC64_ENVCTRL_H 1
 14 
 15 #include <linux/ioctl.h>
 16 
 17 /* Application note:
 18  *
 19  * The driver supports 4 operations: open(), close(), ioctl(), read()
 20  * The device name is /dev/envctrl.
 21  * Below is sample usage:
 22  *
 23  *      fd = open("/dev/envtrl", O_RDONLY);
 24  *      if (ioctl(fd, ENVCTRL_READ_SHUTDOWN_TEMPERATURE, 0) < 0)
 25  *              printf("error\n");
 26  *      ret = read(fd, buf, 10);
 27  *      close(fd);
 28  *
 29  * Notice in the case of cpu voltage and temperature, the default is
 30  * cpu0.  If we need to know the info of cpu1, cpu2, cpu3, we need to
 31  * pass in cpu number in ioctl() last parameter.  For example, to
 32  * get the voltage of cpu2:
 33  *
 34  *      ioctlbuf[0] = 2;
 35  *      if (ioctl(fd, ENVCTRL_READ_CPU_VOLTAGE, ioctlbuf) < 0)
 36  *              printf("error\n");
 37  *      ret = read(fd, buf, 10);
 38  *
 39  * All the return values are in ascii.  So check read return value
 40  * and do appropriate conversions in your application.
 41  */
 42 
 43 /* IOCTL commands */
 44 
 45 /* Note: these commands reflect possible monitor features.
 46  * Some boards choose to support some of the features only.
 47  */
 48 #define ENVCTRL_RD_CPU_TEMPERATURE      _IOR('p', 0x40, int)
 49 #define ENVCTRL_RD_CPU_VOLTAGE          _IOR('p', 0x41, int)
 50 #define ENVCTRL_RD_FAN_STATUS           _IOR('p', 0x42, int)
 51 #define ENVCTRL_RD_WARNING_TEMPERATURE  _IOR('p', 0x43, int)
 52 #define ENVCTRL_RD_SHUTDOWN_TEMPERATURE _IOR('p', 0x44, int)
 53 #define ENVCTRL_RD_VOLTAGE_STATUS       _IOR('p', 0x45, int)
 54 #define ENVCTRL_RD_SCSI_TEMPERATURE     _IOR('p', 0x46, int)
 55 #define ENVCTRL_RD_ETHERNET_TEMPERATURE _IOR('p', 0x47, int)
 56 #define ENVCTRL_RD_MTHRBD_TEMPERATURE   _IOR('p', 0x48, int)
 57 
 58 #define ENVCTRL_RD_GLOBALADDRESS        _IOR('p', 0x49, int)
 59 
 60 /* Read return values for a voltage status request. */
 61 #define ENVCTRL_VOLTAGE_POWERSUPPLY_GOOD        0x01
 62 #define ENVCTRL_VOLTAGE_BAD                     0x02
 63 #define ENVCTRL_POWERSUPPLY_BAD                 0x03
 64 #define ENVCTRL_VOLTAGE_POWERSUPPLY_BAD         0x04
 65 
 66 /* Read return values for a fan status request.
 67  * A failure match means either the fan fails or
 68  * the fan is not connected.  Some boards have optional
 69  * connectors to connect extra fans.
 70  *
 71  * There are maximum 8 monitor fans.  Some are cpu fans
 72  * some are system fans.  The mask below only indicates
 73  * fan by order number.
 74  * Below is a sample application:
 75  *
 76  *      if (ioctl(fd, ENVCTRL_READ_FAN_STATUS, 0) < 0) {
 77  *              printf("ioctl fan failed\n");
 78  *      }
 79  *      if (read(fd, rslt, 1) <= 0) {
 80  *              printf("error or fan not monitored\n");
 81  *      } else {
 82  *              if (rslt[0] == ENVCTRL_ALL_FANS_GOOD) {
 83  *                      printf("all fans good\n");
 84  *      } else if (rslt[0] == ENVCTRL_ALL_FANS_BAD) {
 85  *              printf("all fans bad\n");
 86  *      } else {
 87  *              if (rslt[0] & ENVCTRL_FAN0_FAILURE_MASK) {
 88  *                      printf("fan 0 failed or not connected\n");
 89  *      }
 90  *      ......
 91  */
 92 
 93 #define ENVCTRL_ALL_FANS_GOOD                   0x00
 94 #define ENVCTRL_FAN0_FAILURE_MASK               0x01
 95 #define ENVCTRL_FAN1_FAILURE_MASK               0x02
 96 #define ENVCTRL_FAN2_FAILURE_MASK               0x04
 97 #define ENVCTRL_FAN3_FAILURE_MASK               0x08
 98 #define ENVCTRL_FAN4_FAILURE_MASK               0x10
 99 #define ENVCTRL_FAN5_FAILURE_MASK               0x20
100 #define ENVCTRL_FAN6_FAILURE_MASK               0x40
101 #define ENVCTRL_FAN7_FAILURE_MASK               0x80
102 #define ENVCTRL_ALL_FANS_BAD                    0xFF
103 
104 #endif /* !(_SPARC64_ENVCTRL_H) */
105 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php