84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws/*
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * CDDL HEADER START
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * The contents of this file are subject to the terms of the
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier * Common Development and Distribution License (the "License").
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier * You may not use this file except in compliance with the License.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * or http://www.opensolaris.org/os/licensing.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * See the License for the specific language governing permissions
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * and limitations under the License.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * When distributing Covered Code, include this CDDL HEADER in each
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * If applicable, add the following below this CDDL HEADER, with the
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * fields enclosed by brackets "[]" replaced with your own identifying
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * information: Portions Copyright [yyyy] [name of copyright owner]
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * CDDL HEADER END
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws/*
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent * Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi * Copyright 2015 Joyent, Inc.
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * Use is subject to license terms.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws/*
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * This header file defines the implementation structures for the SMBIOS access
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * library, libsmbios, and an equivalent kernel module. Clients should use
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * the <smbios.h> or <sys/smbios.h> header files to access DMTF SMBIOS
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * information, NOT these underlying implementation structures from the spec.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * In short, do not user this header file or these routines for any purpose.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#ifndef _SYS_SMBIOS_IMPL_H
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define _SYS_SMBIOS_IMPL_H
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#include <sys/smbios.h>
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#include <sys/sysmacros.h>
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#ifdef _KERNEL
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#include <sys/systm.h>
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#else
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#include <strings.h>
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#include <stddef.h>
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#endif
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#ifdef __cplusplus
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern "C" {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#endif
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#pragma pack(1)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_header {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbh_type; /* structure type (SMB_TYPE_* value) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbh_len; /* length in bytes of formatted area */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbh_hdl; /* structure handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_header_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_bios {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbbi_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbi_vendor; /* bios vendor string */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbi_version; /* bios version string */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbbi_segment; /* segment location of bios address */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbi_reldate; /* bios release date */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbi_romsize; /* bios rom size (64k * (n + 1)) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint64_t smbbi_cflags; /* bios characteristics */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbi_xcflags[1]; /* bios characteristics extensions */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_bios_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_system {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbsi_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsi_manufacturer; /* manufacturer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsi_product; /* product name */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsi_version; /* version */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsi_serial; /* serial number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsi_uuid[16]; /* UUID */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsi_wakeup; /* wake-up type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsi_sku; /* SKU number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsi_family; /* family */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_system_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_bboard {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbbb_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_manufacturer; /* manufacturer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_product; /* product name */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_version; /* version */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_serial; /* serial number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_asset; /* asset tag */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_flags; /* feature flags */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_location; /* location in chassis */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbbb_chassis; /* chassis handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_type; /* board type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbb_cn; /* number of contained handles */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbbb_cv[1]; /* array of contained handles */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_bboard_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_chassis {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbch_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_manufacturer; /* manufacturer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_type; /* type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_version; /* version */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_serial; /* serial number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_asset; /* asset tag */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_bustate; /* boot-up state */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_psstate; /* power supply state */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_thstate; /* thermal state */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_security; /* security state */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbch_oemdata; /* OEM-specific data */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_uheight; /* enclosure height */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_cords; /* number of power cords */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_cn; /* number of contained records */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_cm; /* size of contained records */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbch_cv[1]; /* array of contained records */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_chassis_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent/* WARNING: the argument is evaluated three times! */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent#define SMB_CH_SKU(smbcp) ((char *) \
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent (smbcp)->smbch_cv + ((smbcp)->smbch_cn * (smbcp)->smbch_cm))
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_CHT_LOCK 0x80 /* lock bit within smbch_type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_processor {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbpr_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_socket; /* socket designation */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_type; /* processor type (see <smbios.h>) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_family; /* processor family (see <smbios.h>) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_manufacturer; /* manufacturer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint64_t smbpr_cpuid; /* processor cpuid information */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_version; /* version */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_voltage; /* voltage */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpr_clkspeed; /* external clock speed in MHz */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpr_maxspeed; /* maximum speed in MHz */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpr_curspeed; /* current speed in MHz */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_status; /* status (see <smbios.h>) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_upgrade; /* upgrade */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpr_l1cache; /* L1 cache handle (if any) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpr_l2cache; /* L2 cache handle (if any) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpr_l3cache; /* L3 cache handle (if any) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_serial; /* serial number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_asset; /* asset tag */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_part; /* part number */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint8_t smbpr_corecount; /* number of cores per socket */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint8_t smbpr_coresenabled; /* number of enabled cores per socket */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint8_t smbpr_threadcount; /* number of threads per socket */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint16_t smbpr_cflags; /* cpu characteristics (see <smbios.h>) */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint16_t smbpr_family2; /* processor family2 (see <smbios.h>) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint16_t smbpr_corecount2; /* second number of cores per socket */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint16_t smbpr_coresenabled2; /* second number of enabled cores */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint16_t smbpr_threadcount2; /* second number of enabled threads */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_processor_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_cache {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbca_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbca_socket; /* socket designation */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbca_config; /* cache configuration */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbca_maxsize; /* maximum installed size */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbca_size; /* installed size */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbca_stype; /* supported SRAM type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbca_ctype; /* current SRAM type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbca_speed; /* speed in nanoseconds */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbca_etype; /* error correction type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbca_ltype; /* logical cache type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbca_assoc; /* associativity */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_cache_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
e4586ebf2f01666696316c178da243993b1a0c04mws/*
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent * Convert encoded cache size to bytes: DSP0134 Section 7.8 explains the
e4586ebf2f01666696316c178da243993b1a0c04mws * encoding. The highest bit is 0 for 1k units, 1 for 64k units, and this
e4586ebf2f01666696316c178da243993b1a0c04mws * macro decodes the value into bytes for exporting to our clients.
e4586ebf2f01666696316c178da243993b1a0c04mws */
e4586ebf2f01666696316c178da243993b1a0c04mws#define SMB_CACHE_SIZE(s) (((s) & 0x8000) ? \
e4586ebf2f01666696316c178da243993b1a0c04mws ((uint32_t)((s) & 0x7FFF) * 64 * 1024) : ((uint32_t)(s) * 1024))
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_CACHE_CFG_MODE(c) (((c) >> 8) & 3)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_CACHE_CFG_ENABLED(c) (((c) >> 7) & 1)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_CACHE_CFG_LOCATION(c) (((c) >> 5) & 3)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_CACHE_CFG_SOCKETED(c) (((c) >> 3) & 1)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_CACHE_CFG_LEVEL(c) (((c) & 7) + 1)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_port {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbpo_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpo_iref; /* internal reference designator */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpo_itype; /* internal connector type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpo_eref; /* external reference designator */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpo_etype; /* external connector type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpo_ptype; /* port type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_port_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_slot {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbsl_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsl_name; /* reference designation */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsl_type; /* slot type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsl_width; /* slot data bus width */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsl_usage; /* current usage */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsl_length; /* slot length */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbsl_id; /* slot ID */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsl_ch1; /* slot characteristics 1 */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsl_ch2; /* slot characteristics 2 */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint16_t smbsl_sg; /* segment group number */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbsl_bus; /* bus number */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbsl_df; /* device/function number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_slot_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_obdev {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbob_type; /* encoded type and enable bit */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint8_t smbob_name; /* description string */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_obdev_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_OBT_ENABLED 0x80 /* enable bit within smbob_type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_strtab {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbtb_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbtb_count; /* number of strings */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_strtab_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_lang {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smblang_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smblang_num; /* number of installed languages */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smblang_flags; /* flags */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smblang_resv[15]; /* reserved for future use */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smblang_cur; /* current language string */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_lang_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_sel {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbsel_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbsel_len; /* log area length */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbsel_hdroff; /* header offset */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbsel_dataoff; /* data offset */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsel_method; /* access method */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsel_status; /* status flags */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbsel_token; /* change token */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbsel_addr; /* access method address */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsel_format; /* header format */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsel_typec; /* number of type descriptors */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsel_typesz; /* size of each type descriptor */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsel_typev[1]; /* array of type descriptors */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_sel_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_memarray {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbmarr_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmarr_loc; /* location */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmarr_use; /* use */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmarr_ecc; /* error detect/correct mechanism */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbmarr_cap; /* maximum capacity */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmarr_err; /* error handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmarr_ndevs; /* number of slots or sockets */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint64_t smbmarr_extcap; /* extended maximum capacity */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_memarray_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_memarrmap {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbamap_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbamap_start; /* starting address in kilobytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbamap_end; /* ending address in kilobytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbamap_array; /* physical memory array handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbamap_width; /* partition width */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint64_t smbamap_extstart; /* extended starting address in bytes */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint64_t smbamap_extend; /* extended ending address in bytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_memarrmap_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_memdevice {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbmdev_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmdev_array; /* array handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmdev_error; /* error handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmdev_twidth; /* total width */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmdev_dwidth; /* data width */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmdev_size; /* size in either K or MB */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_form; /* form factor */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_set; /* device set */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_dloc; /* device locator */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_bloc; /* bank locator */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_type; /* memory type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmdev_flags; /* detail flags */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmdev_speed; /* speed in MHz */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_manufacturer; /* manufacturer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_serial; /* serial number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_asset; /* asset tag */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmdev_part; /* part number */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint8_t smbmdev_attrs; /* attributes */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint32_t smbmdev_extsize; /* extended size */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint16_t smbmdev_clkspeed; /* configured clock speed */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint16_t smbmdev_minvolt; /* minimum voltage */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint16_t smbmdev_maxvolt; /* maximum voltage */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint16_t smbmdev_confvolt; /* configured voltage */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_memdevice_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_MDS_KBYTES 0x8000 /* size in specified in kilobytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_memdevmap {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbdmap_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbdmap_start; /* starting address in kilobytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbdmap_end; /* ending address in kilobytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbdmap_device; /* memory device handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbdmap_array; /* memory array mapped address handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbdmap_rpos; /* row position */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbdmap_ipos; /* interleave position */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbdmap_idepth; /* interleave depth */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint64_t smbdmap_extstart; /* extended starting address */
4e901881a1e657e1cbf12d7ef9b476ec373e7939Dale Ghent uint64_t smbdmap_extend; /* extended ending address */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_memdevmap_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_battery {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbbat_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_loc; /* location */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_manufacturer; /* manufacturer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_date; /* manufacture date */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_serial; /* serial number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_devname; /* device name */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_chem; /* device chemistry */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbbat_cap; /* design capacity in mW hours */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbbat_volt; /* design voltage in mV */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_version; /* SBDS version string */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_err; /* error percentage */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbbat_ssn; /* SBDS serial number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbbat_sdate; /* SBDS manufacture date */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_schem; /* SBDS chemistry string */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbat_mult; /* design capacity multiplier */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbbat_oemdata; /* OEM-specific data */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_battery_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_hwsec {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbhs_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbhs_settings; /* settings byte */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_hwsec_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_HWS_PWR_PS(x) (((x) & 0xC0) >> 6)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_HWS_KBD_PS(x) (((x) & 0x30) >> 4)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_HWS_ADM_PS(x) (((x) & 0x0C) >> 2)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_HWS_PAN_PS(x) (((x) & 0x03) >> 0)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_boot {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbbo_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbo_pad[6]; /* reserved for future use */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbo_status[1]; /* variable-length status buffer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_boot_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_ipmi {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbipm_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbipm_type; /* interface type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbipm_spec; /* specification revision */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbipm_i2c; /* i2C slave address */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbipm_bus; /* NV storage device bus ID */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint64_t smbipm_addr; /* base address */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbipm_info; /* base address modifier/intr info */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbipm_intr; /* interrupt number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_ipmi_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_SPEC_MAJOR(x) (((x) & 0xF0) >> 4)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_SPEC_MINOR(x) ((x) & 0x0F)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_ADDR_IO 1ULL
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_INFO_REGS(x) (((x) & 0xC0) >> 6)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_INFO_LSB(x) (((x) & 0x10) >> 4)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_INFO_ISPEC(x) (((x) & 0x08) >> 3)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_INFO_IPOL(x) (((x) & 0x02) >> 1)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_INFO_IMODE(x) (((x) & 0x01) >> 0)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_REGS_1B 0
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_REGS_4B 1
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_REGS_16B 2
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_IPOL_LO 0
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_IPOL_HI 1
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_IMODE_EDGE 0
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_IPM_IMODE_LEVEL 1
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_powersup {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_header_t smbpsup_hdr; /* structure header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpsup_group; /* group id */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpsup_loc; /* location tag */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpsup_devname; /* device name */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpsup_manufacturer; /* manufacturer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpsup_serial; /* serial number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpsup_asset; /* asset tag */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpsup_part; /* part number */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpsup_rev; /* revision string */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpsup_max; /* max output in milliwatts */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpsup_char; /* characteristics */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpsup_vprobe; /* voltage probe handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpsup_cooldev; /* cooling device handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpsup_iprobe; /* current probe handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_powersup_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothiertypedef struct smb_obdev_ext {
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier smb_header_t smbobe_hdr; /* structure header */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbobe_name; /* reference designation */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbobe_dtype; /* device type */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbobe_dti; /* device type instance */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint16_t smbobe_sg; /* segment group number */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbobe_bus; /* bus number */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbobe_df; /* device/function number */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier} smb_obdev_ext_t;
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothiertypedef struct smb_processor_ext {
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier smb_header_t smbpre_hdr; /* structure header */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint16_t smbpre_processor; /* processor handle */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint8_t smbpre_fru; /* FRU indicator */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint8_t smbpre_n; /* number of APIC IDs */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint16_t smbpre_apicid[1]; /* strand initial apic id */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier} smb_processor_ext_t;
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothiertypedef struct smb_port_ext {
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier smb_header_t smbpoe_hdr; /* structure header */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint16_t smbpoe_chassis; /* chassis handle */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint16_t smbpoe_port; /* port connector handle */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbpoe_dtype; /* device type */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint16_t smbpoe_devhdl; /* device handle */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier uint8_t smbpoe_phy; /* PHY number */
03f9f63d24f0494b7d47b927090ad9045e396402Tom Pothier} smb_port_ext_t;
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothiertypedef struct smb_pciexrc {
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier smb_header_t smbpciexrc_hdr; /* structure header */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint16_t smbpciexrc_bboard; /* base board handle */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint16_t smbpciexrc_bdf; /* PCI Bus/Dev/Func */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier} smb_pciexrc_t;
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothiertypedef struct smb_memarray_ext {
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier smb_header_t smbmarre_hdr; /* structure header */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint16_t smbmarre_ma; /* memory array handle */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint16_t smbmarre_component; /* component parent handle */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint16_t smbmarre_bdf; /* PCI bus/dev/funct */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier} smb_memarray_ext_t;
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothiertypedef struct smb_memdevice_ext {
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier smb_header_t smbmdeve_hdr; /* structure header */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint16_t smbmdeve_mdev; /* memory device handle */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint8_t smbmdeve_dchan; /* DRAM channel */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint8_t smbmdeve_ncs; /* number of chip select */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier uint8_t smbmdeve_cs[1]; /* chip selects */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier} smb_memdevice_ext_t;
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#pragma pack()
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_struct {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws const smb_header_t *smbst_hdr; /* address of raw structure data */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws const uchar_t *smbst_str; /* address of string data (if any) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws const uchar_t *smbst_end; /* address of 0x0000 ending tag */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws struct smb_struct *smbst_next; /* next structure in hash chain */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t *smbst_strtab; /* string index -> offset table */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint_t smbst_strtablen; /* length of smbst_strtab */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws} smb_struct_t;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsstruct smbios_hdl {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smbios_entry_t sh_ent; /* structure table entry point */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws const void *sh_buf; /* structure table buffer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws size_t sh_buflen; /* size of structure table buffer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_struct_t *sh_structs; /* array of structure descriptors */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint_t sh_nstructs; /* number of active structures */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_struct_t **sh_hash; /* hash bucket array for descriptors */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint_t sh_hashlen; /* hash bucket array length */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws int sh_err; /* error code for smbios_errno() */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws int sh_libvers; /* library client abi version */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws int sh_smbvers; /* derived underlying format version */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint_t sh_flags; /* miscellaneous flags (see below) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws};
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_FL_DEBUG 0x1 /* print debug messages for this hdl */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_FL_BUFALLOC 0x2 /* sh_buf was allocated by library */
516627f338a630bcf9806a91aa873bbbae9a2facJonathan Matthew#define SMB_FL_TRUNC 0x4 /* smbios table is truncated */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_BIOS_DEVICE "/dev/xsvc" /* device w/ BIOS physmem */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_SMBIOS_DEVICE "/dev/smbios" /* device w/ SMBIOS image */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_RANGE_START 0xF0000 /* start of physical address range */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_RANGE_LIMIT 0xFFFFF /* limit of physical address range */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_MAJMIN(M, m) ((((M) & 0xFF) << 16) | ((m) & 0xFF))
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_MAJOR(v) (((v) & 0xFF00) >> 8)
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_MINOR(v) (((v) & 0x00FF))
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define ESMB_BASE 1000 /* base value for libsmbios errnos */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsenum {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NOTFOUND = ESMB_BASE, /* SMBIOS table not found on system */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_MAPDEV, /* failed to map SMBIOS table */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NOENT, /* failed to locate structure */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NOMEM, /* failed to allocate memory */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NOHDR, /* failed to read SMBIOS header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NOSTAB, /* failed to read SMBIOS struct table */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NOINFO, /* no common info for structure */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_SHORT, /* buffer length doesn't match header */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_CORRUPT, /* buffer struct or len is corrupt */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_VERSION, /* version not supported by library */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NOTSUP, /* feature not supported by provider */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_HEADER, /* SMBIOS header corrupt or invalid */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_OLD, /* SMBIOS version is too old for us */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NEW, /* SMBIOS version is too new for us */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_CKSUM, /* SMBIOS header checksum mismatch */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_INVAL, /* invalid function call argument */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_TYPE, /* structure type mismatch */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_UNKNOWN /* unknown error (maximum value tag) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws};
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern const smb_struct_t *smb_lookup_type(smbios_hdl_t *, uint_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern const smb_struct_t *smb_lookup_id(smbios_hdl_t *, uint_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern const char *smb_strptr(const smb_struct_t *, uint_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern int smb_gteq(smbios_hdl_t *, int);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern int smb_set_errno(smbios_hdl_t *, int);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern smbios_hdl_t *smb_open_error(smbios_hdl_t *, int *, int);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern const char *smb_strerror(int);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern void *smb_alloc(size_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern void *smb_zalloc(size_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern void smb_free(void *, size_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern void smb_dprintf(smbios_hdl_t *, const char *, ...);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern int _smb_debug;
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi/*
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi * The following series of structures represent the base versions of public
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi * structures that are used inside by the smbios routines. This allows the
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi * common code to properly know how much it should or should not bzero and how
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi * to handle additions to the spec. Types should only be added here if we need
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi * to extend the public structures in sys/smbios.h due to a change in the spec.
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi *
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi * Types here have the name smb_base_%s which corresponds to smbios_%s.
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchitypedef struct smb_base_chassis {
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbc_oemdata; /* OEM-specific data */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_lock; /* lock present? */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_type; /* type */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_bustate; /* boot-up state */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_psstate; /* power supply state */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_thstate; /* thermal state */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_security; /* security status */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_uheight; /* enclosure height in U's */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_cords; /* number of power cords */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_elems; /* number of element records (n) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbc_elemlen; /* length of contained element (m) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi} smb_base_chassis_t;
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchitypedef struct smb_base_processor {
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint64_t smbbp_cpuid; /* processor cpuid information */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbp_family; /* processor family */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbp_type; /* processor type (SMB_PRT_*) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbp_voltage; /* voltage (SMB_PRV_*) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbp_status; /* status (SMB_PRS_*) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbp_upgrade; /* upgrade (SMB_PRU_*) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbp_clkspeed; /* external clock speed in MHz */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbp_maxspeed; /* maximum speed in MHz */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbp_curspeed; /* current speed in MHz */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi id_t smbbp_l1cache; /* L1 cache handle */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi id_t smbbp_l2cache; /* L2 cache handle */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi id_t smbbp_l3cache; /* L3 cache handle */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi} smb_base_processor_t;
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchitypedef struct smb_base_memdevice {
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi id_t smbbmd_array; /* handle of physical memory array */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi id_t smbbmd_error; /* handle of memory error data */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbmd_twidth; /* total width in bits including ecc */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbmd_dwidth; /* data width in bits */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint64_t smbbmd_size; /* size in bytes (see note above) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbmd_form; /* form factor */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbmd_set; /* set (0x00=none, 0xFF=unknown) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbmd_type; /* memory type */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbmd_pad; /* padding */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbmd_flags; /* flags (see below) */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint32_t smbbmd_speed; /* speed in MHz */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi const char *smbbmd_dloc; /* physical device locator string */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi const char *smbbmd_bloc; /* physical bank locator string */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi uint8_t smbbmd_rank; /* rank */
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi} smb_base_memdevice_t;
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi
6734c4b0468cc77a7871a5dd5c23a5562557d64cRobert Mustacchi
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#ifdef __cplusplus
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws}
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#endif
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#endif /* _SYS_SMBIOS_IMPL_H */