summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2017-10-04 17:17:43 +0000
committerRobert Mustacchi <rm@joyent.com>2018-05-24 17:13:14 +0000
commit32ece1f96d76b7ae0165091c2bc2a3cdce36971b (patch)
tree814c4e4e95e1e9d08298985bf709ae553a1c9a80 /usr/src/uts/common
parentfcd69270d3e30d8121da73f26d9d8aec4375ecd4 (diff)
downloadillumos-joyent-32ece1f96d76b7ae0165091c2bc2a3cdce36971b.tar.gz
9104 smbios(1M) should display PSU info
9105 smbios(1M) processor table info can be confusing Reviewed by: Tim Kordas <tim.kordas@joyent.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/sys/smbios.h51
-rw-r--r--usr/src/uts/common/sys/smbios_impl.h9
2 files changed, 59 insertions, 1 deletions
diff --git a/usr/src/uts/common/sys/smbios.h b/usr/src/uts/common/sys/smbios.h
index 858df1a586..094017f1da 100644
--- a/usr/src/uts/common/sys/smbios.h
+++ b/usr/src/uts/common/sys/smbios.h
@@ -1351,6 +1351,50 @@ typedef struct smbios_ipmi {
#define SMB_IPMI_F_INTREDGE 0x08 /* intr is edge triggered (else lvl) */
/*
+ * SMBIOS System Power Supply Information. See DSP0134 7.40 for more
+ * information.
+ */
+typedef struct smbios_powersup {
+ uint32_t smbps_group; /* group ID */
+ uint64_t smbps_maxout; /* max output in milliwatts */
+ uint32_t smbps_flags; /* see below */
+ uint8_t smbps_ivrs; /* input voltage range switching type */
+ uint8_t smbps_status; /* PSU status */
+ uint8_t smbps_pstype; /* PSU type */
+ id_t smbps_vprobe; /* voltage probe handle */
+ id_t smbps_cooldev; /* cooling device handle */
+ id_t smbps_iprobe; /* current probe handle */
+} smbios_powersup_t;
+
+/* smbpfs_flags */
+#define SMB_POWERSUP_F_HOT 0x01 /* PSU is hot-replaceable */
+#define SMB_POWERSUP_F_PRESENT 0x02 /* PSU is present */
+#define SMB_POWERSUP_F_UNPLUG 0x04 /* PSU is unplugged from outlet */
+
+/* Values for smbps_ivrs */
+#define SMB_POWERSUP_I_OTHER 0x01 /* other */
+#define SMB_POWERSUP_I_UNKNOWN 0x02 /* unknown */
+#define SMB_POWERSUP_I_MANUAL 0x03 /* manual */
+#define SMB_POWERSUP_I_AUTO 0x04 /* auto-switch */
+#define SMB_POWERSUP_I_WIDE 0x05 /* wide range */
+#define SMB_POWERSUP_I_NA 0x06 /* not applicable */
+
+#define SMB_POWERSUP_S_OTHER 0x01 /* other */
+#define SMB_POWERSUP_S_UNKNOWN 0x02 /* unknown */
+#define SMB_POWERSUP_S_OK 0x03 /* OK */
+#define SMB_POWERSUP_S_NONCRIT 0x04 /* non-critical */
+#define SMB_POWERSUP_S_CRIT 0x05 /* critical; PSU failed */
+
+#define SMB_POWERSUP_T_OTHER 0x01 /* other */
+#define SMB_POWERSUP_T_UNKNOWN 0x02 /* unknown */
+#define SMB_POWERSUP_T_LINEAR 0x03 /* linear */
+#define SMB_POWERSUP_T_SWITCH 0x04 /* switching */
+#define SMB_POWERSUP_T_BAT 0x05 /* battery */
+#define SMB_POWERSUP_T_UPS 0x06 /* UPS */
+#define SMB_POWERSUP_T_CONV 0x07 /* converter */
+#define SMB_POWERSUP_T_REGL 0x08 /* regulator */
+
+/*
* SMBIOS Onboard Devices Extended Information. See DSP0134 Section 7.42
* for more information.
*/
@@ -1507,6 +1551,7 @@ extern int smbios_info_memdevmap(smbios_hdl_t *, id_t, smbios_memdevmap_t *);
extern id_t smbios_info_hwsec(smbios_hdl_t *, smbios_hwsec_t *);
extern id_t smbios_info_boot(smbios_hdl_t *, smbios_boot_t *);
extern id_t smbios_info_ipmi(smbios_hdl_t *, smbios_ipmi_t *);
+extern int smbios_info_powersup(smbios_hdl_t *, id_t, smbios_powersup_t *);
extern int smbios_info_pciexrc(smbios_hdl_t *, id_t, smbios_pciexrc_t *);
extern const char *smbios_psn(smbios_hdl_t *);
@@ -1555,6 +1600,12 @@ extern const char *smbios_ipmi_flag_name(uint_t);
extern const char *smbios_ipmi_flag_desc(uint_t);
extern const char *smbios_ipmi_type_desc(uint_t);
+extern const char *smbios_powersup_flag_name(uint_t);
+extern const char *smbios_powersup_flag_desc(uint_t);
+extern const char *smbios_powersup_input_desc(uint_t);
+extern const char *smbios_powersup_status_desc(uint_t);
+extern const char *smbios_powersup_type_desc(uint_t);
+
extern const char *smbios_hwsec_desc(uint_t);
extern const char *smbios_memarray_loc_desc(uint_t);
diff --git a/usr/src/uts/common/sys/smbios_impl.h b/usr/src/uts/common/sys/smbios_impl.h
index 404be225a3..ea11aea2c1 100644
--- a/usr/src/uts/common/sys/smbios_impl.h
+++ b/usr/src/uts/common/sys/smbios_impl.h
@@ -21,7 +21,7 @@
/*
* Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
- * Copyright 2016 Joyent, Inc.
+ * Copyright (c) 2017, Joyent, Inc.
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -398,6 +398,13 @@ typedef struct smb_powersup {
uint16_t smbpsup_iprobe; /* current probe handle */
} smb_powersup_t;
+#define SMB_PSU_CHARS_ISHOT(x) ((x) & 0x01)
+#define SMB_PSU_CHARS_ISPRES(x) ((x) & 0x02)
+#define SMB_PSU_CHARS_ISUNPLUG(x) ((x) & 0x04)
+#define SMB_PSU_CHARS_IVRS(x) (((x) >> 3) & 0xf)
+#define SMB_PSU_CHARS_STATUS(x) (((x) >> 7) & 0x7)
+#define SMB_PSU_CHARS_TYPE(x) (((x) >> 10) & 0xf)
+
typedef struct smb_obdev_ext {
smb_header_t smbobe_hdr; /* structure header */
uint8_t smbobe_name; /* reference designation */