1437Smws /* 2437Smws * CDDL HEADER START 3437Smws * 4437Smws * The contents of this file are subject to the terms of the 51717Swesolows * Common Development and Distribution License (the "License"). 61717Swesolows * You may not use this file except in compliance with the License. 7437Smws * 8437Smws * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9437Smws * or http://www.opensolaris.org/os/licensing. 10437Smws * See the License for the specific language governing permissions 11437Smws * and limitations under the License. 12437Smws * 13437Smws * When distributing Covered Code, include this CDDL HEADER in each 14437Smws * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15437Smws * If applicable, add the following below this CDDL HEADER, with the 16437Smws * fields enclosed by brackets "[]" replaced with your own identifying 17437Smws * information: Portions Copyright [yyyy] [name of copyright owner] 18437Smws * 19437Smws * CDDL HEADER END 20437Smws */ 21437Smws 22437Smws /* 23*7107Ssethg * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24437Smws * Use is subject to license terms. 25437Smws */ 26437Smws 27437Smws /* 28437Smws * This header file defines the interfaces available from the SMBIOS access 29437Smws * library, libsmbios, and an equivalent kernel module. This API can be used 30437Smws * to access DMTF SMBIOS data from a device, file, or raw memory buffer. 31437Smws * This is NOT yet a public interface, although it may eventually become one in 32437Smws * the fullness of time after we gain more experience with the interfaces. 33437Smws * 34437Smws * In the meantime, be aware that any program linked with this API in this 35437Smws * release of Solaris is almost guaranteed to break in the next release. 36437Smws * 37437Smws * In short, do not user this header file or these routines for any purpose. 38437Smws */ 39437Smws 40437Smws #ifndef _SYS_SMBIOS_H 41437Smws #define _SYS_SMBIOS_H 42437Smws 43437Smws #pragma ident "%Z%%M% %I% %E% SMI" 44437Smws 45437Smws #include <sys/types.h> 46437Smws 47437Smws #ifdef __cplusplus 48437Smws extern "C" { 49437Smws #endif 50437Smws 51437Smws /* 52437Smws * SMBIOS Structure Table Entry Point. See DSP0134 2.1.1 for more information. 53437Smws * The structure table entry point is located by searching for the anchor. 54437Smws */ 551222Smws #pragma pack(1) 561222Smws 57437Smws typedef struct smbios_entry { 58437Smws char smbe_eanchor[4]; /* anchor tag (SMB_ENTRY_EANCHOR) */ 59437Smws uint8_t smbe_ecksum; /* checksum of entry point structure */ 60437Smws uint8_t smbe_elen; /* length in bytes of entry point */ 61437Smws uint8_t smbe_major; /* major version of the SMBIOS spec */ 62437Smws uint8_t smbe_minor; /* minor version of the SMBIOS spec */ 63437Smws uint16_t smbe_maxssize; /* maximum size in bytes of a struct */ 64437Smws uint8_t smbe_revision; /* entry point structure revision */ 65437Smws uint8_t smbe_format[5]; /* entry point revision-specific data */ 66437Smws char smbe_ianchor[5]; /* intermed. tag (SMB_ENTRY_IANCHOR) */ 67437Smws uint8_t smbe_icksum; /* intermed. checksum */ 68437Smws uint16_t smbe_stlen; /* length in bytes of structure table */ 69437Smws uint32_t smbe_staddr; /* physical addr of structure table */ 70437Smws uint16_t smbe_stnum; /* number of structure table entries */ 71437Smws uint8_t smbe_bcdrev; /* BCD value representing DMI version */ 72437Smws } smbios_entry_t; 73437Smws 741222Smws #pragma pack() 751222Smws 76437Smws #define SMB_ENTRY_EANCHOR "_SM_" /* structure table entry point anchor */ 77437Smws #define SMB_ENTRY_EANCHORLEN 4 /* length of entry point anchor */ 78437Smws #define SMB_ENTRY_IANCHOR "_DMI_" /* intermediate anchor string */ 79437Smws #define SMB_ENTRY_IANCHORLEN 5 /* length of intermediate anchor */ 801717Swesolows #define SMB_ENTRY_MAXLEN 255 /* maximum length of entry point */ 81437Smws 82437Smws /* 83437Smws * Structure type codes. The comments next to each type include an (R) note to 84437Smws * indicate a structure that is required as of SMBIOS v2.3 and an (O) note to 85437Smws * indicate a structure that is obsolete as of SMBIOS v2.3. 86437Smws */ 87437Smws #define SMB_TYPE_BIOS 0 /* BIOS information (R) */ 88437Smws #define SMB_TYPE_SYSTEM 1 /* system information (R) */ 89437Smws #define SMB_TYPE_BASEBOARD 2 /* base board */ 90437Smws #define SMB_TYPE_CHASSIS 3 /* system enclosure or chassis (R) */ 91437Smws #define SMB_TYPE_PROCESSOR 4 /* processor (R) */ 92437Smws #define SMB_TYPE_MEMCTL 5 /* memory controller (O) */ 93437Smws #define SMB_TYPE_MEMMOD 6 /* memory module (O) */ 94437Smws #define SMB_TYPE_CACHE 7 /* processor cache (R) */ 95437Smws #define SMB_TYPE_PORT 8 /* port connector */ 96437Smws #define SMB_TYPE_SLOT 9 /* upgradeable system slot (R) */ 97437Smws #define SMB_TYPE_OBDEVS 10 /* on-board devices */ 98437Smws #define SMB_TYPE_OEMSTR 11 /* OEM string table */ 99437Smws #define SMB_TYPE_SYSCONFSTR 12 /* system configuration string table */ 100437Smws #define SMB_TYPE_LANG 13 /* BIOS language information */ 101437Smws #define SMB_TYPE_GROUP 14 /* group associations */ 102437Smws #define SMB_TYPE_EVENTLOG 15 /* system event log */ 103437Smws #define SMB_TYPE_MEMARRAY 16 /* physical memory array (R) */ 104437Smws #define SMB_TYPE_MEMDEVICE 17 /* memory device (R) */ 105437Smws #define SMB_TYPE_MEMERR32 18 /* 32-bit memory error information */ 106437Smws #define SMB_TYPE_MEMARRAYMAP 19 /* memory array mapped address (R) */ 107437Smws #define SMB_TYPE_MEMDEVICEMAP 20 /* memory device mapped address (R) */ 108437Smws #define SMB_TYPE_POINTDEV 21 /* built-in pointing device */ 109437Smws #define SMB_TYPE_BATTERY 22 /* portable battery */ 110437Smws #define SMB_TYPE_RESET 23 /* system reset settings */ 111437Smws #define SMB_TYPE_SECURITY 24 /* hardware security settings */ 112437Smws #define SMB_TYPE_POWERCTL 25 /* system power controls */ 113437Smws #define SMB_TYPE_VPROBE 26 /* voltage probe */ 114437Smws #define SMB_TYPE_COOLDEV 27 /* cooling device */ 115437Smws #define SMB_TYPE_TPROBE 28 /* temperature probe */ 116437Smws #define SMB_TYPE_IPROBE 29 /* current probe */ 117437Smws #define SMB_TYPE_OOBRA 30 /* out-of-band remote access facility */ 118437Smws #define SMB_TYPE_BIS 31 /* boot integrity services */ 119437Smws #define SMB_TYPE_BOOT 32 /* system boot status (R) */ 120437Smws #define SMB_TYPE_MEMERR64 33 /* 64-bit memory error information */ 121437Smws #define SMB_TYPE_MGMTDEV 34 /* management device */ 122437Smws #define SMB_TYPE_MGMTDEVCP 35 /* management device component */ 123437Smws #define SMB_TYPE_MGMTDEVDATA 36 /* management device threshold data */ 124437Smws #define SMB_TYPE_MEMCHAN 37 /* memory channel */ 125437Smws #define SMB_TYPE_IPMIDEV 38 /* IPMI device information */ 126437Smws #define SMB_TYPE_POWERSUP 39 /* system power supply */ 127437Smws #define SMB_TYPE_INACTIVE 126 /* inactive table entry */ 128437Smws #define SMB_TYPE_EOT 127 /* end of table */ 129437Smws 130437Smws #define SMB_TYPE_OEM_LO 128 /* start of OEM-specific type range */ 131437Smws #define SMB_TYPE_OEM_HI 256 /* end of OEM-specific type range */ 132437Smws 133437Smws /* 134437Smws * SMBIOS Common Information. These structures do not correspond to anything 135437Smws * in the SMBIOS specification, but allow library clients to more easily read 136437Smws * information that is frequently encoded into the various SMBIOS structures. 137437Smws */ 138437Smws typedef struct smbios_info { 139437Smws const char *smbi_manufacturer; /* manufacturer */ 140437Smws const char *smbi_product; /* product name */ 141437Smws const char *smbi_version; /* version */ 142437Smws const char *smbi_serial; /* serial number */ 143437Smws const char *smbi_asset; /* asset tag */ 144437Smws const char *smbi_location; /* location tag */ 145437Smws const char *smbi_part; /* part number */ 146437Smws } smbios_info_t; 147437Smws 148437Smws typedef struct smbios_version { 149437Smws uint8_t smbv_major; /* version major number */ 150437Smws uint8_t smbv_minor; /* version minor number */ 151437Smws } smbios_version_t; 152437Smws 153437Smws /* 154437Smws * SMBIOS Bios Information. See DSP0134 Section 3.3.1 for more information. 155437Smws * smbb_romsize is converted from the implementation format into bytes. 156437Smws */ 157437Smws typedef struct smbios_bios { 158437Smws const char *smbb_vendor; /* bios vendor string */ 159437Smws const char *smbb_version; /* bios version string */ 160437Smws const char *smbb_reldate; /* bios release date */ 161437Smws uint32_t smbb_segment; /* bios address segment location */ 162437Smws uint32_t smbb_romsize; /* bios rom size in bytes */ 163437Smws uint32_t smbb_runsize; /* bios image size in bytes */ 164437Smws uint64_t smbb_cflags; /* bios characteristics */ 165437Smws const uint8_t *smbb_xcflags; /* bios characteristics extensions */ 166437Smws size_t smbb_nxcflags; /* number of smbb_xcflags[] bytes */ 167437Smws smbios_version_t smbb_biosv; /* bios version */ 168437Smws smbios_version_t smbb_ecfwv; /* bios embedded ctrl f/w version */ 169437Smws } smbios_bios_t; 170437Smws 171437Smws #define SMB_BIOSFL_RSV0 0x00000001 /* reserved bit zero */ 172437Smws #define SMB_BIOSFL_RSV1 0x00000002 /* reserved bit one */ 173437Smws #define SMB_BIOSFL_UNKNOWN 0x00000004 /* unknown */ 174437Smws #define SMB_BIOSFL_BCNOTSUP 0x00000008 /* BIOS chars not supported */ 175437Smws #define SMB_BIOSFL_ISA 0x00000010 /* ISA is supported */ 176437Smws #define SMB_BIOSFL_MCA 0x00000020 /* MCA is supported */ 177437Smws #define SMB_BIOSFL_EISA 0x00000040 /* EISA is supported */ 178437Smws #define SMB_BIOSFL_PCI 0x00000080 /* PCI is supported */ 179437Smws #define SMB_BIOSFL_PCMCIA 0x00000100 /* PCMCIA is supported */ 180437Smws #define SMB_BIOSFL_PLUGNPLAY 0x00000200 /* Plug and Play is supported */ 181437Smws #define SMB_BIOSFL_APM 0x00000400 /* APM is supported */ 182437Smws #define SMB_BIOSFL_FLASH 0x00000800 /* BIOS is Flash Upgradeable */ 183437Smws #define SMB_BIOSFL_SHADOW 0x00001000 /* BIOS shadowing is allowed */ 184437Smws #define SMB_BIOSFL_VLVESA 0x00002000 /* VL-VESA is supported */ 185437Smws #define SMB_BIOSFL_ESCD 0x00004000 /* ESCD support is available */ 186437Smws #define SMB_BIOSFL_CDBOOT 0x00008000 /* Boot from CD is supported */ 187437Smws #define SMB_BIOSFL_SELBOOT 0x00010000 /* Selectable Boot supported */ 188437Smws #define SMB_BIOSFL_ROMSOCK 0x00020000 /* BIOS ROM is socketed */ 189437Smws #define SMB_BIOSFL_PCMBOOT 0x00040000 /* Boot from PCMCIA supported */ 190437Smws #define SMB_BIOSFL_EDD 0x00080000 /* EDD Spec is supported */ 191437Smws #define SMB_BIOSFL_NEC9800 0x00100000 /* int 0x13 NEC 9800 floppy */ 192437Smws #define SMB_BIOSFL_TOSHIBA 0x00200000 /* int 0x13 Toshiba floppy */ 193437Smws #define SMB_BIOSFL_525_360K 0x00400000 /* int 0x13 5.25" 360K floppy */ 194437Smws #define SMB_BIOSFL_525_12M 0x00800000 /* int 0x13 5.25" 1.2M floppy */ 195437Smws #define SMB_BIOSFL_35_720K 0x01000000 /* int 0x13 3.5" 720K floppy */ 196437Smws #define SMB_BIOSFL_35_288M 0x02000000 /* int 0x13 3.5" 2.88M floppy */ 197437Smws #define SMB_BIOSFL_I5_PRINT 0x04000000 /* int 0x5 print screen svcs */ 198437Smws #define SMB_BIOSFL_I9_KBD 0x08000000 /* int 0x9 8042 keyboard svcs */ 199437Smws #define SMB_BIOSFL_I14_SER 0x10000000 /* int 0x14 serial svcs */ 200437Smws #define SMB_BIOSFL_I17_PRINTER 0x20000000 /* int 0x17 printer svcs */ 201437Smws #define SMB_BIOSFL_I10_CGA 0x40000000 /* int 0x10 CGA svcs */ 202437Smws #define SMB_BIOSFL_NEC_PC98 0x80000000 /* NEC PC-98 */ 203437Smws 204437Smws #define SMB_BIOSXB_1 0 /* bios extension byte 1 (3.3.1.2.1) */ 205437Smws #define SMB_BIOSXB_2 1 /* bios extension byte 2 (3.3.1.2.2) */ 206437Smws #define SMB_BIOSXB_BIOS_MAJ 2 /* bios major version */ 207437Smws #define SMB_BIOSXB_BIOS_MIN 3 /* bios minor version */ 208437Smws #define SMB_BIOSXB_ECFW_MAJ 4 /* extended ctlr f/w major version */ 209437Smws #define SMB_BIOSXB_ECFW_MIN 5 /* extended ctlr f/w minor version */ 210437Smws 211437Smws #define SMB_BIOSXB1_ACPI 0x01 /* ACPI is supported */ 212437Smws #define SMB_BIOSXB1_USBL 0x02 /* USB legacy is supported */ 213437Smws #define SMB_BIOSXB1_AGP 0x04 /* AGP is supported */ 214437Smws #define SMB_BIOSXB1_I20 0x08 /* I2O boot is supported */ 215437Smws #define SMB_BIOSXB1_LS120 0x10 /* LS-120 boot is supported */ 216437Smws #define SMB_BIOSXB1_ATZIP 0x20 /* ATAPI ZIP drive boot is supported */ 217437Smws #define SMB_BIOSXB1_1394 0x40 /* 1394 boot is supported */ 218437Smws #define SMB_BIOSXB1_SMBAT 0x80 /* Smart Battery is supported */ 219437Smws 220437Smws #define SMB_BIOSXB2_BBOOT 0x01 /* BIOS Boot Specification supported */ 221437Smws #define SMB_BIOSXB2_FKNETSVC 0x02 /* F-key Network Svc boot supported */ 222437Smws #define SMB_BIOSXB2_ETCDIST 0x04 /* Enable Targeted Content Distrib. */ 223437Smws 224437Smws /* 225437Smws * SMBIOS Bios Information. See DSP0134 Section 3.3.2 for more information. 226437Smws * The current set of smbs_wakeup values is defined after the structure. 227437Smws */ 228437Smws typedef struct smbios_system { 229437Smws const uint8_t *smbs_uuid; /* UUID byte array */ 230437Smws uint8_t smbs_uuidlen; /* UUID byte array length */ 231437Smws uint8_t smbs_wakeup; /* wake-up event */ 232437Smws const char *smbs_sku; /* SKU number */ 233437Smws const char *smbs_family; /* family */ 234437Smws } smbios_system_t; 235437Smws 236437Smws #define SMB_WAKEUP_RSV0 0x00 /* reserved */ 237437Smws #define SMB_WAKEUP_OTHER 0x01 /* other */ 238437Smws #define SMB_WAKEUP_UNKNOWN 0x02 /* unknown */ 239437Smws #define SMB_WAKEUP_APM 0x03 /* APM timer */ 240437Smws #define SMB_WAKEUP_MODEM 0x04 /* modem ring */ 241437Smws #define SMB_WAKEUP_LAN 0x05 /* LAN remote */ 242437Smws #define SMB_WAKEUP_SWITCH 0x06 /* power switch */ 243437Smws #define SMB_WAKEUP_PCIPME 0x07 /* PCI PME# */ 244437Smws #define SMB_WAKEUP_AC 0x08 /* AC power restored */ 245437Smws 246437Smws /* 247437Smws * SMBIOS Base Board description. See DSP0134 Section 3.3.3 for more 248437Smws * information. smbb_flags and smbb_type definitions are below. 249437Smws */ 250437Smws typedef struct smbios_bboard { 251437Smws id_t smbb_chassis; /* chassis containing this board */ 252437Smws uint8_t smbb_flags; /* flags (see below) */ 253437Smws uint8_t smbb_type; /* board type (see below) */ 254437Smws } smbios_bboard_t; 255437Smws 256437Smws #define SMB_BBFL_MOTHERBOARD 0x01 /* board is a motherboard */ 257437Smws #define SMB_BBFL_NEEDAUX 0x02 /* auxiliary card or daughter req'd */ 258437Smws #define SMB_BBFL_REMOVABLE 0x04 /* board is removable */ 259437Smws #define SMB_BBFL_REPLACABLE 0x08 /* board is field-replacable */ 260437Smws #define SMB_BBFL_HOTSWAP 0x10 /* board is hot-swappable */ 261437Smws 262437Smws #define SMB_BBT_UNKNOWN 0x1 /* unknown */ 263437Smws #define SMB_BBT_OTHER 0x2 /* other */ 264437Smws #define SMB_BBT_SBLADE 0x3 /* server blade */ 265437Smws #define SMB_BBT_CSWITCH 0x4 /* connectivity switch */ 266437Smws #define SMB_BBT_SMM 0x5 /* system management module */ 267437Smws #define SMB_BBT_PROC 0x6 /* processor module */ 268437Smws #define SMB_BBT_IO 0x7 /* i/o module */ 269437Smws #define SMB_BBT_MEM 0x8 /* memory module */ 270437Smws #define SMB_BBT_DAUGHTER 0x9 /* daughterboard */ 271437Smws #define SMB_BBT_MOTHER 0xA /* motherboard */ 272437Smws #define SMB_BBT_PROCMEM 0xB /* processor/memory module */ 273437Smws #define SMB_BBT_PROCIO 0xC /* processor/i/o module */ 274437Smws #define SMB_BBT_INTER 0xD /* interconnect board */ 275437Smws 276437Smws /* 277437Smws * SMBIOS Chassis description. See DSP0134 Section 3.3.4 for more information. 278437Smws * We move the lock bit of the type field into smbc_lock for easier processing. 279437Smws * NOTE: We do not currently export the contained element data for each chassis 280437Smws * as this seems useless: see DSP0134 3.3.4.4. It can be added if necessary. 281437Smws */ 282437Smws typedef struct smbios_chassis { 283437Smws uint32_t smbc_oemdata; /* OEM-specific data */ 284437Smws uint8_t smbc_lock; /* lock present? */ 285437Smws uint8_t smbc_type; /* type */ 286437Smws uint8_t smbc_bustate; /* boot-up state */ 287437Smws uint8_t smbc_psstate; /* power supply state */ 288437Smws uint8_t smbc_thstate; /* thermal state */ 289437Smws uint8_t smbc_security; /* security status */ 290437Smws uint8_t smbc_uheight; /* enclosure height in U's */ 291437Smws uint8_t smbc_cords; /* number of power cords */ 292437Smws uint8_t smbc_elems; /* number of element records */ 293437Smws } smbios_chassis_t; 294437Smws 295437Smws #define SMB_CHT_OTHER 0x01 /* other */ 296437Smws #define SMB_CHT_UNKNOWN 0x02 /* unknown */ 297437Smws #define SMB_CHT_DESKTOP 0x03 /* desktop */ 298437Smws #define SMB_CHT_LPDESKTOP 0x04 /* low-profile desktop */ 299437Smws #define SMB_CHT_PIZZA 0x05 /* pizza box */ 300437Smws #define SMB_CHT_MINITOWER 0x06 /* mini-tower */ 301437Smws #define SMB_CHT_TOWER 0x07 /* tower */ 302437Smws #define SMB_CHT_PORTABLE 0x08 /* portable */ 303437Smws #define SMB_CHT_LAPTOP 0x09 /* laptop */ 304437Smws #define SMB_CHT_NOTEBOOK 0x0A /* notebook */ 305437Smws #define SMB_CHT_HANDHELD 0x0B /* hand-held */ 306437Smws #define SMB_CHT_DOCK 0x0C /* docking station */ 307437Smws #define SMB_CHT_ALLIN1 0x0D /* all-in-one */ 308437Smws #define SMB_CHT_SUBNOTE 0x0E /* sub-notebook */ 309437Smws #define SMB_CHT_SPACESAVE 0x0F /* space-saving */ 310437Smws #define SMB_CHT_LUNCHBOX 0x10 /* lunchbox */ 311437Smws #define SMB_CHT_MAIN 0x11 /* main server chassis */ 312437Smws #define SMB_CHT_EXPANSION 0x12 /* expansion chassis */ 313437Smws #define SMB_CHT_SUB 0x13 /* sub-chassis */ 314437Smws #define SMB_CHT_BUS 0x14 /* bus expansion chassis */ 315437Smws #define SMB_CHT_PERIPHERAL 0x15 /* peripheral chassis */ 316437Smws #define SMB_CHT_RAID 0x16 /* raid chassis */ 317437Smws #define SMB_CHT_RACK 0x17 /* rack mount chassis */ 318437Smws #define SMB_CHT_SEALED 0x18 /* sealed case pc */ 319437Smws #define SMB_CHT_MULTI 0x19 /* multi-system chassis */ 320*7107Ssethg #define SMB_CHT_CPCI 0x1A /* compact PCI */ 321*7107Ssethg #define SMB_CHT_ATCA 0x1B /* advanced TCA */ 322*7107Ssethg #define SMB_CHT_BLADE 0x1C /* blade */ 323*7107Ssethg #define SMB_CHT_BLADEENC 0x1D /* blade enclosure */ 324437Smws 325437Smws #define SMB_CHST_OTHER 0x01 /* other */ 326437Smws #define SMB_CHST_UNKNOWN 0x02 /* unknown */ 327437Smws #define SMB_CHST_SAFE 0x03 /* safe */ 328437Smws #define SMB_CHST_WARNING 0x04 /* warning */ 329437Smws #define SMB_CHST_CRITICAL 0x05 /* critical */ 330437Smws #define SMB_CHST_NONREC 0x06 /* non-recoverable */ 331437Smws 332437Smws #define SMB_CHSC_OTHER 0x01 /* other */ 333437Smws #define SMB_CHSC_UNKNOWN 0x02 /* unknown */ 334437Smws #define SMB_CHSC_NONE 0x03 /* none */ 335437Smws #define SMB_CHSC_EILOCK 0x04 /* external interface locked out */ 336437Smws #define SMB_CHSC_EIENAB 0x05 /* external interface enabled */ 337437Smws 338437Smws /* 339437Smws * SMBIOS Processor description. See DSP0134 Section 3.3.5 for more details. 340437Smws * If the L1, L2, or L3 cache handle is -1, the cache information is unknown. 341437Smws * If the handle refers to something of size 0, that type of cache is absent. 342437Smws * 343437Smws * NOTE: Although SMBIOS exports a 64-bit CPUID result, this value should not 344437Smws * be used for any purpose other than BIOS debugging. Solaris itself computes 345437Smws * its own CPUID value and applies knowledge of additional errata and processor 346437Smws * specific CPUID variations, so this value should not be used for anything. 347437Smws */ 348437Smws typedef struct smbios_processor { 349437Smws uint64_t smbp_cpuid; /* processor cpuid information */ 350437Smws uint32_t smbp_family; /* processor family */ 351437Smws uint8_t smbp_type; /* processor type (SMB_PRT_*) */ 352437Smws uint8_t smbp_voltage; /* voltage (SMB_PRV_*) */ 353437Smws uint8_t smbp_status; /* status (SMB_PRS_*) */ 354437Smws uint8_t smbp_upgrade; /* upgrade (SMB_PRU_*) */ 355437Smws uint32_t smbp_clkspeed; /* external clock speed in MHz */ 356437Smws uint32_t smbp_maxspeed; /* maximum speed in MHz */ 357437Smws uint32_t smbp_curspeed; /* current speed in MHz */ 358437Smws id_t smbp_l1cache; /* L1 cache handle */ 359437Smws id_t smbp_l2cache; /* L2 cache handle */ 360437Smws id_t smbp_l3cache; /* L3 cache handle */ 361437Smws } smbios_processor_t; 362437Smws 363437Smws #define SMB_PRT_OTHER 0x01 /* other */ 364437Smws #define SMB_PRT_UNKNOWN 0x02 /* unknown */ 365437Smws #define SMB_PRT_CENTRAL 0x03 /* central processor */ 366437Smws #define SMB_PRT_MATH 0x04 /* math processor */ 367437Smws #define SMB_PRT_DSP 0x05 /* DSP processor */ 368437Smws #define SMB_PRT_VIDEO 0x06 /* video processor */ 369437Smws 370437Smws #define SMB_PRV_LEGACY(v) (!((v) & 0x80)) /* legacy voltage mode */ 371437Smws #define SMB_PRV_FIXED(v) ((v) & 0x80) /* fixed voltage mode */ 372437Smws 373437Smws #define SMB_PRV_5V 0x01 /* 5V is supported */ 374437Smws #define SMB_PRV_33V 0x02 /* 3.3V is supported */ 375437Smws #define SMB_PRV_29V 0x04 /* 2.9V is supported */ 376437Smws 377437Smws #define SMB_PRV_VOLTAGE(v) ((v) & 0x7f) 378437Smws 379437Smws #define SMB_PRSTATUS_PRESENT(s) ((s) & 0x40) /* socket is populated */ 380437Smws #define SMB_PRSTATUS_STATUS(s) ((s) & 0x07) /* status (see below) */ 381437Smws 382437Smws #define SMB_PRS_UNKNOWN 0x0 /* unknown */ 383437Smws #define SMB_PRS_ENABLED 0x1 /* enabled */ 384437Smws #define SMB_PRS_BDISABLED 0x2 /* disabled in bios user setup */ 385437Smws #define SMB_PRS_PDISABLED 0x3 /* disabled in bios from post error */ 386437Smws #define SMB_PRS_IDLE 0x4 /* waiting to be enabled */ 387437Smws #define SMB_PRS_OTHER 0x7 /* other */ 388437Smws 389437Smws #define SMB_PRU_OTHER 0x01 /* other */ 390437Smws #define SMB_PRU_UNKNOWN 0x02 /* unknown */ 391437Smws #define SMB_PRU_DAUGHTER 0x03 /* daughter board */ 392437Smws #define SMB_PRU_ZIF 0x04 /* ZIF socket */ 393437Smws #define SMB_PRU_PIGGY 0x05 /* replaceable piggy back */ 394437Smws #define SMB_PRU_NONE 0x06 /* none */ 395437Smws #define SMB_PRU_LIF 0x07 /* LIF socket */ 396437Smws #define SMB_PRU_SLOT1 0x08 /* slot 1 */ 397437Smws #define SMB_PRU_SLOT2 0x09 /* slot 2 */ 398437Smws #define SMB_PRU_370PIN 0x0A /* 370-pin socket */ 399437Smws #define SMB_PRU_SLOTA 0x0B /* slot A */ 400437Smws #define SMB_PRU_SLOTM 0x0C /* slot M */ 401437Smws #define SMB_PRU_423 0x0D /* socket 423 */ 402437Smws #define SMB_PRU_A 0x0E /* socket A (socket 462) */ 403437Smws #define SMB_PRU_478 0x0F /* socket 478 */ 404437Smws #define SMB_PRU_754 0x10 /* socket 754 */ 405437Smws #define SMB_PRU_940 0x11 /* socket 940 */ 406*7107Ssethg #define SMB_PRU_939 0x12 /* socket 939 */ 407*7107Ssethg #define SMB_PRU_MPGA604 0x13 /* mPGA604 */ 408*7107Ssethg #define SMB_PRU_LGA771 0x14 /* LGA771 */ 409*7107Ssethg #define SMB_PRU_LGA775 0x15 /* LGA775 */ 410*7107Ssethg #define SMB_PRU_S1 0x16 /* socket S1 */ 411*7107Ssethg #define SMB_PRU_AM2 0x17 /* socket AM2 */ 412*7107Ssethg #define SMB_PRU_F 0x18 /* socket F */ 413437Smws 414437Smws #define SMB_PRF_OTHER 0x01 /* other */ 415437Smws #define SMB_PRF_UNKNOWN 0x02 /* unknown */ 416437Smws #define SMB_PRF_8086 0x03 /* 8086 */ 417437Smws #define SMB_PRF_80286 0x04 /* 80286 */ 418437Smws #define SMB_PRF_I386 0x05 /* Intel 386 */ 419437Smws #define SMB_PRF_I486 0x06 /* Intel 486 */ 420437Smws #define SMB_PRF_8087 0x07 /* 8087 */ 421437Smws #define SMB_PRF_80287 0x08 /* 80287 */ 422437Smws #define SMB_PRF_80387 0x09 /* 80387 */ 423437Smws #define SMB_PRF_80487 0x0A /* 80487 */ 424437Smws #define SMB_PRF_PENTIUM 0x0B /* Pentium Family */ 425437Smws #define SMB_PRF_PENTIUMPRO 0x0C /* Pentium Pro */ 426437Smws #define SMB_PRF_PENTIUMII 0x0D /* Pentium II */ 427437Smws #define SMB_PRF_PENTIUM_MMX 0x0E /* Pentium w/ MMX */ 428437Smws #define SMB_PRF_CELERON 0x0F /* Celeron */ 429437Smws #define SMB_PRF_PENTIUMII_XEON 0x10 /* Pentium II Xeon */ 430437Smws #define SMB_PRF_PENTIUMIII 0x11 /* Pentium III */ 431437Smws #define SMB_PRF_M1 0x12 /* M1 */ 432437Smws #define SMB_PRF_M2 0x13 /* M2 */ 433437Smws #define SMB_PRF_DURON 0x18 /* AMD Duron */ 434437Smws #define SMB_PRF_K5 0x19 /* K5 */ 435437Smws #define SMB_PRF_K6 0x1A /* K6 */ 436437Smws #define SMB_PRF_K6_2 0x1B /* K6-2 */ 437437Smws #define SMB_PRF_K6_3 0x1C /* K6-3 */ 438437Smws #define SMB_PRF_ATHLON 0x1D /* Athlon */ 439437Smws #define SMB_PRF_2900 0x1E /* AMD 2900 */ 440437Smws #define SMB_PRF_K6_2PLUS 0x1F /* K6-2+ */ 441437Smws #define SMB_PRF_PPC 0x20 /* PowerPC */ 442437Smws #define SMB_PRF_PPC_601 0x21 /* PowerPC 601 */ 443437Smws #define SMB_PRF_PPC_603 0x22 /* PowerPC 603 */ 444437Smws #define SMB_PRF_PPC_603PLUS 0x23 /* PowerPC 603+ */ 445437Smws #define SMB_PRF_PPC_604 0x24 /* PowerPC 604 */ 446437Smws #define SMB_PRF_PPC_620 0x25 /* PowerPC 620 */ 447437Smws #define SMB_PRF_PPC_704 0x26 /* PowerPC x704 */ 448437Smws #define SMB_PRF_PPC_750 0x27 /* PowerPC 750 */ 449437Smws #define SMB_PRF_ALPHA 0x30 /* Alpha */ 450437Smws #define SMB_PRF_ALPHA_21064 0x31 /* Alpha 21064 */ 451437Smws #define SMB_PRF_ALPHA_21066 0x32 /* Alpha 21066 */ 452437Smws #define SMB_PRF_ALPHA_21164 0x33 /* Alpha 21164 */ 453437Smws #define SMB_PRF_ALPHA_21164PC 0x34 /* Alpha 21164PC */ 454437Smws #define SMB_PRF_ALPHA_21164A 0x35 /* Alpha 21164a */ 455437Smws #define SMB_PRF_ALPHA_21264 0x36 /* Alpha 21264 */ 456437Smws #define SMB_PRF_ALPHA_21364 0x37 /* Alpha 21364 */ 457437Smws #define SMB_PRF_MIPS 0x40 /* MIPS */ 458437Smws #define SMB_PRF_MIPS_R4000 0x41 /* MIPS R4000 */ 459437Smws #define SMB_PRF_MIPS_R4200 0x42 /* MIPS R4200 */ 460437Smws #define SMB_PRF_MIPS_R4400 0x43 /* MIPS R4400 */ 461437Smws #define SMB_PRF_MIPS_R4600 0x44 /* MIPS R4600 */ 462437Smws #define SMB_PRF_MIPS_R10000 0x45 /* MIPS R10000 */ 463437Smws #define SMB_PRF_SPARC 0x50 /* SPARC */ 464437Smws #define SMB_PRF_SUPERSPARC 0x51 /* SuperSPARC */ 465437Smws #define SMB_PRF_MICROSPARCII 0x52 /* microSPARC II */ 466437Smws #define SMB_PRF_MICROSPARCIIep 0x53 /* microSPARC IIep */ 467437Smws #define SMB_PRF_ULTRASPARC 0x54 /* UltraSPARC */ 468437Smws #define SMB_PRF_USII 0x55 /* UltraSPARC II */ 469437Smws #define SMB_PRF_USIIi 0x56 /* UltraSPARC IIi */ 470437Smws #define SMB_PRF_USIII 0x57 /* UltraSPARC III */ 471437Smws #define SMB_PRF_USIIIi 0x58 /* UltraSPARC IIIi */ 472437Smws #define SMB_PRF_68040 0x60 /* 68040 */ 473437Smws #define SMB_PRF_68XXX 0x61 /* 68XXX */ 474437Smws #define SMB_PRF_68000 0x62 /* 68000 */ 475437Smws #define SMB_PRF_68010 0x63 /* 68010 */ 476437Smws #define SMB_PRF_68020 0x64 /* 68020 */ 477437Smws #define SMB_PRF_68030 0x65 /* 68030 */ 478437Smws #define SMB_PRF_HOBBIT 0x70 /* Hobbit */ 479437Smws #define SMB_PRF_TM5000 0x78 /* Crusoe TM5000 */ 480437Smws #define SMB_PRF_TM3000 0x79 /* Crusoe TM3000 */ 481437Smws #define SMB_PRF_TM8000 0x7A /* Efficeon TM8000 */ 482437Smws #define SMB_PRF_WEITEK 0x80 /* Weitek */ 483437Smws #define SMB_PRF_ITANIC 0x82 /* Itanium */ 484437Smws #define SMB_PRF_ATHLON64 0x83 /* Athlon64 */ 485437Smws #define SMB_PRF_OPTERON 0x84 /* Opteron */ 486437Smws #define SMB_PRF_PA 0x90 /* PA-RISC */ 487437Smws #define SMB_PRF_PA8500 0x91 /* PA-RISC 8500 */ 488437Smws #define SMB_PRF_PA8000 0x92 /* PA-RISC 8000 */ 489437Smws #define SMB_PRF_PA7300LC 0x93 /* PA-RISC 7300LC */ 490437Smws #define SMB_PRF_PA7200 0x94 /* PA-RISC 7200 */ 491437Smws #define SMB_PRF_PA7100LC 0x95 /* PA-RISC 7100LC */ 492437Smws #define SMB_PRF_PA7100 0x96 /* PA-RISC 7100 */ 493437Smws #define SMB_PRF_V30 0xA0 /* V30 */ 494437Smws #define SMB_PRF_PENTIUMIII_XEON 0xB0 /* Pentium III Xeon */ 495437Smws #define SMB_PRF_PENTIUMIII_SS 0xB1 /* Pentium III with SpeedStep */ 496437Smws #define SMB_PRF_P4 0xB2 /* Pentium 4 */ 497437Smws #define SMB_PRF_XEON 0xB3 /* Intel Xeon */ 498437Smws #define SMB_PRF_AS400 0xB4 /* AS400 */ 499437Smws #define SMB_PRF_XEON_MP 0xB5 /* Intel Xeon MP */ 500437Smws #define SMB_PRF_ATHLON_XP 0xB6 /* AMD Athlon XP */ 501*7107Ssethg #define SMB_PRF_ATHLON_MP 0xB7 /* AMD Athlon MP */ 502437Smws #define SMB_PRF_ITANIC2 0xB8 /* Itanium 2 */ 503437Smws #define SMB_PRF_PENTIUM_M 0xB9 /* Pentium M */ 504*7107Ssethg #define SMB_PRF_CELERON_D 0xBA /* Celeron D */ 505*7107Ssethg #define SMB_PRF_PENTIUM_D 0xBB /* Pentium D */ 506*7107Ssethg #define SMB_PRF_PENTIUM_EE 0xBC /* Pentium Extreme Edition */ 507*7107Ssethg #define SMB_PRF_CORE 0xBD /* Intel Core */ 508*7107Ssethg #define SMB_PRF_CORE2 0xBF /* Intel Core 2 */ 509437Smws #define SMB_PRF_IBM390 0xC8 /* IBM 390 */ 510437Smws #define SMB_PRF_G4 0xC9 /* G4 */ 511437Smws #define SMB_PRF_G5 0xCA /* G5 */ 512*7107Ssethg #define SMB_PRF_ESA390 0xCB /* ESA390 */ 513*7107Ssethg #define SMB_PRF_ZARCH 0xCC /* z/Architecture */ 514*7107Ssethg #define SMB_PRF_C7M 0xD2 /* VIA C7-M */ 515*7107Ssethg #define SMB_PRF_C7D 0xD3 /* VIA C7-D */ 516*7107Ssethg #define SMB_PRF_C7 0xD4 /* VIA C7 */ 517*7107Ssethg #define SMB_PRF_EDEN 0xD5 /* VIA Eden */ 518437Smws #define SMB_PRF_I860 0xFA /* i860 */ 519437Smws #define SMB_PRF_I960 0xFB /* i960 */ 520*7107Ssethg #define SMB_PRF_SH3 0x104 /* SH-3 */ 521*7107Ssethg #define SMB_PRF_SH4 0x105 /* SH-4 */ 522*7107Ssethg #define SMB_PRF_ARM 0x118 /* ARM */ 523*7107Ssethg #define SMB_PRF_SARM 0x119 /* StrongARM */ 524*7107Ssethg #define SMB_PRF_6X86 0x12C /* 6x86 */ 525*7107Ssethg #define SMB_PRF_MEDIAGX 0x12D /* MediaGX */ 526*7107Ssethg #define SMB_PRF_MII 0x12E /* MII */ 527*7107Ssethg #define SMB_PRF_WINCHIP 0x140 /* WinChip */ 528*7107Ssethg #define SMB_PRF_DSP 0x15E /* DSP */ 529*7107Ssethg #define SMB_PRF_VIDEO 0x1F4 /* Video Processor */ 530437Smws 531437Smws /* 532437Smws * SMBIOS Cache Information. See DSP0134 Section 3.3.8 for more information. 533437Smws * If smba_size is zero, this indicates the specified cache is not present. 534437Smws */ 535437Smws typedef struct smbios_cache { 536437Smws uint32_t smba_maxsize; /* maximum installed size in bytes */ 537437Smws uint32_t smba_size; /* installed size in bytes */ 538437Smws uint16_t smba_stype; /* supported SRAM types (SMB_CAT_*) */ 539437Smws uint16_t smba_ctype; /* current SRAM type (SMB_CAT_*) */ 540437Smws uint8_t smba_speed; /* speed in nanoseconds */ 541437Smws uint8_t smba_etype; /* error correction type (SMB_CAE_*) */ 542437Smws uint8_t smba_ltype; /* logical cache type (SMB_CAG_*) */ 543437Smws uint8_t smba_assoc; /* associativity (SMB_CAA_*) */ 544437Smws uint8_t smba_level; /* cache level */ 545437Smws uint8_t smba_mode; /* cache mode (SMB_CAM_*) */ 546437Smws uint8_t smba_location; /* cache location (SMB_CAL_*) */ 547437Smws uint8_t smba_flags; /* cache flags (SMB_CAF_*) */ 548437Smws } smbios_cache_t; 549437Smws 550437Smws #define SMB_CAT_OTHER 0x0001 /* other */ 551437Smws #define SMB_CAT_UNKNOWN 0x0002 /* unknown */ 552437Smws #define SMB_CAT_NONBURST 0x0004 /* non-burst */ 553437Smws #define SMB_CAT_BURST 0x0008 /* burst */ 554437Smws #define SMB_CAT_PBURST 0x0010 /* pipeline burst */ 555437Smws #define SMB_CAT_SYNC 0x0020 /* synchronous */ 556437Smws #define SMB_CAT_ASYNC 0x0040 /* asynchronous */ 557437Smws 558437Smws #define SMB_CAE_OTHER 0x01 /* other */ 559437Smws #define SMB_CAE_UNKNOWN 0x02 /* unknown */ 560437Smws #define SMB_CAE_NONE 0x03 /* none */ 561437Smws #define SMB_CAE_PARITY 0x04 /* parity */ 562437Smws #define SMB_CAE_SBECC 0x05 /* single-bit ECC */ 563437Smws #define SMB_CAE_MBECC 0x06 /* multi-bit ECC */ 564437Smws 565437Smws #define SMB_CAG_OTHER 0x01 /* other */ 566437Smws #define SMB_CAG_UNKNOWN 0x02 /* unknown */ 567437Smws #define SMB_CAG_INSTR 0x03 /* instruction */ 568437Smws #define SMB_CAG_DATA 0x04 /* data */ 569437Smws #define SMB_CAG_UNIFIED 0x05 /* unified */ 570437Smws 571437Smws #define SMB_CAA_OTHER 0x01 /* other */ 572437Smws #define SMB_CAA_UNKNOWN 0x02 /* unknown */ 573437Smws #define SMB_CAA_DIRECT 0x03 /* direct mapped */ 574437Smws #define SMB_CAA_2WAY 0x04 /* 2-way set associative */ 575437Smws #define SMB_CAA_4WAY 0x05 /* 4-way set associative */ 576437Smws #define SMB_CAA_FULL 0x06 /* fully associative */ 577437Smws #define SMB_CAA_8WAY 0x07 /* 8-way set associative */ 578437Smws #define SMB_CAA_16WAY 0x08 /* 16-way set associative */ 579437Smws 580437Smws #define SMB_CAM_WT 0x00 /* write-through */ 581437Smws #define SMB_CAM_WB 0x01 /* write-back */ 582437Smws #define SMB_CAM_VARY 0x02 /* varies by address */ 583437Smws #define SMB_CAM_UNKNOWN 0x03 /* unknown */ 584437Smws 585437Smws #define SMB_CAL_INTERNAL 0x00 /* internal */ 586437Smws #define SMB_CAL_EXTERNAL 0x01 /* external */ 587437Smws #define SMB_CAL_RESERVED 0x02 /* reserved */ 588437Smws #define SMB_CAL_UNKNOWN 0x03 /* unknown */ 589437Smws 590437Smws #define SMB_CAF_ENABLED 0x01 /* enabled at boot time */ 591437Smws #define SMB_CAF_SOCKETED 0x02 /* cache is socketed */ 592437Smws 593437Smws /* 594437Smws * SMBIOS Port Information. See DSP0134 Section 3.3.9 for more information. 595437Smws * The internal reference designator string is also mapped to the location. 596437Smws */ 597437Smws typedef struct smbios_port { 598437Smws const char *smbo_iref; /* internal reference designator */ 599437Smws const char *smbo_eref; /* external reference designator */ 600437Smws uint8_t smbo_itype; /* internal connector type (SMB_POC_*) */ 601437Smws uint8_t smbo_etype; /* external connector type (SMB_POC_*) */ 602437Smws uint8_t smbo_ptype; /* port type (SMB_POT_*) */ 603437Smws uint8_t smbo_pad; /* padding */ 604437Smws } smbios_port_t; 605437Smws 606437Smws #define SMB_POC_NONE 0x00 /* none */ 607437Smws #define SMB_POC_CENT 0x01 /* Centronics */ 608437Smws #define SMB_POC_MINICENT 0x02 /* Mini-Centronics */ 609437Smws #define SMB_POC_PROPRIETARY 0x03 /* proprietary */ 610437Smws #define SMB_POC_DB25M 0x04 /* DB-25 pin male */ 611437Smws #define SMB_POC_DB25F 0x05 /* DB-25 pin female */ 612437Smws #define SMB_POC_DB15M 0x06 /* DB-15 pin male */ 613437Smws #define SMB_POC_DB15F 0x07 /* DB-15 pin female */ 614437Smws #define SMB_POC_DB9M 0x08 /* DB-9 pin male */ 615437Smws #define SMB_POC_DB9F 0x09 /* DB-9 pin female */ 616437Smws #define SMB_POC_RJ11 0x0A /* RJ-11 */ 617437Smws #define SMB_POC_RJ45 0x0B /* RJ-45 */ 618437Smws #define SMB_POC_MINISCSI 0x0C /* 50-pin MiniSCSI */ 619437Smws #define SMB_POC_MINIDIN 0x0D /* Mini-DIN */ 620437Smws #define SMB_POC_MICRODIN 0x0E /* Micro-DIN */ 621437Smws #define SMB_POC_PS2 0x0F /* PS/2 */ 622437Smws #define SMB_POC_IR 0x10 /* Infrared */ 623437Smws #define SMB_POC_HPHIL 0x11 /* HP-HIL */ 624437Smws #define SMB_POC_USB 0x12 /* USB */ 625437Smws #define SMB_POC_SSA 0x13 /* SSA SCSI */ 626437Smws #define SMB_POC_DIN8M 0x14 /* Circular DIN-8 male */ 627437Smws #define SMB_POC_DIN8F 0x15 /* Circular DIN-8 female */ 628437Smws #define SMB_POC_OBIDE 0x16 /* on-board IDE */ 629437Smws #define SMB_POC_OBFLOPPY 0x17 /* on-board floppy */ 630437Smws #define SMB_POC_DI9 0x18 /* 9p dual inline (p10 cut) */ 631437Smws #define SMB_POC_DI25 0x19 /* 25p dual inline (p26 cut) */ 632437Smws #define SMB_POC_DI50 0x1A /* 50p dual inline */ 633437Smws #define SMB_POC_DI68 0x1B /* 68p dual inline */ 634437Smws #define SMB_POC_CDROM 0x1C /* on-board sound from CDROM */ 635437Smws #define SMB_POC_MINI14 0x1D /* Mini-Centronics Type 14 */ 636437Smws #define SMB_POC_MINI26 0x1E /* Mini-Centronics Type 26 */ 637437Smws #define SMB_POC_MINIJACK 0x1F /* Mini-jack (headphones) */ 638437Smws #define SMB_POC_BNC 0x20 /* BNC */ 639437Smws #define SMB_POC_1394 0x21 /* 1394 */ 640437Smws #define SMB_POC_PC98 0xA0 /* PC-98 */ 641437Smws #define SMB_POC_PC98HR 0xA1 /* PC-98Hireso */ 642437Smws #define SMB_POC_PCH98 0xA2 /* PC-H98 */ 643437Smws #define SMB_POC_PC98NOTE 0xA3 /* PC-98Note */ 644437Smws #define SMB_POC_PC98FULL 0xA4 /* PC-98Full */ 645437Smws #define SMB_POC_OTHER 0xFF /* other */ 646437Smws 647437Smws #define SMB_POT_NONE 0x00 /* none */ 648437Smws #define SMB_POT_PP_XTAT 0x01 /* Parallel Port XT/AT compat */ 649437Smws #define SMB_POT_PP_PS2 0x02 /* Parallel Port PS/2 */ 650437Smws #define SMB_POT_PP_ECP 0x03 /* Parallel Port ECP */ 651437Smws #define SMB_POT_PP_EPP 0x04 /* Parallel Port EPP */ 652437Smws #define SMB_POT_PP_ECPEPP 0x05 /* Parallel Port ECP/EPP */ 653437Smws #define SMB_POT_SP_XTAT 0x06 /* Serial Port XT/AT compat */ 654437Smws #define SMB_POT_SP_16450 0x07 /* Serial Port 16450 compat */ 655437Smws #define SMB_POT_SP_16550 0x08 /* Serial Port 16550 compat */ 656437Smws #define SMB_POT_SP_16550A 0x09 /* Serial Port 16550A compat */ 657437Smws #define SMB_POT_SCSI 0x0A /* SCSI port */ 658437Smws #define SMB_POT_MIDI 0x0B /* MIDI port */ 659437Smws #define SMB_POT_JOYSTICK 0x0C /* Joystick port */ 660437Smws #define SMB_POT_KEYBOARD 0x0D /* Keyboard port */ 661437Smws #define SMB_POT_MOUSE 0x0E /* Mouse port */ 662437Smws #define SMB_POT_SSA 0x0F /* SSA SCSI */ 663437Smws #define SMB_POT_USB 0x10 /* USB */ 664437Smws #define SMB_POT_FIREWIRE 0x11 /* FireWrite (IEEE P1394) */ 665437Smws #define SMB_POT_PCMII 0x12 /* PCMCIA Type II */ 666437Smws #define SMB_POT_PCMIIa 0x13 /* PCMCIA Type II (alternate) */ 667437Smws #define SMB_POT_PCMIII 0x14 /* PCMCIA Type III */ 668437Smws #define SMB_POT_CARDBUS 0x15 /* Cardbus */ 669437Smws #define SMB_POT_ACCESS 0x16 /* Access Bus Port */ 670437Smws #define SMB_POT_SCSI2 0x17 /* SCSI II */ 671437Smws #define SMB_POT_SCSIW 0x18 /* SCSI Wide */ 672437Smws #define SMB_POT_PC98 0x19 /* PC-98 */ 673437Smws #define SMB_POT_PC98HR 0x1A /* PC-98Hireso */ 674437Smws #define SMB_POT_PCH98 0x1B /* PC-H98 */ 675437Smws #define SMB_POT_VIDEO 0x1C /* Video port */ 676437Smws #define SMB_POT_AUDIO 0x1D /* Audio port */ 677437Smws #define SMB_POT_MODEM 0x1E /* Modem port */ 678437Smws #define SMB_POT_NETWORK 0x1F /* Network port */ 679*7107Ssethg #define SMB_POT_SATA 0x20 /* SATA */ 680*7107Ssethg #define SMB_POT_SAS 0x21 /* SAS */ 681437Smws #define SMB_POT_8251 0xA0 /* 8251 compatible */ 682437Smws #define SMB_POT_8251F 0xA1 /* 8251 FIFO compatible */ 683437Smws #define SMB_POT_OTHER 0xFF /* other */ 684437Smws 685437Smws /* 686437Smws * SMBIOS Slot Information. See DSP0134 Section 3.3.10 for more information. 687437Smws * See DSP0134 3.3.10.5 for how to interpret the value of smbl_id. 688437Smws */ 689437Smws typedef struct smbios_slot { 690437Smws const char *smbl_name; /* reference designation */ 691437Smws uint8_t smbl_type; /* slot type */ 692437Smws uint8_t smbl_width; /* slot data bus width */ 693437Smws uint8_t smbl_usage; /* current usage */ 694437Smws uint8_t smbl_length; /* slot length */ 695437Smws uint16_t smbl_id; /* slot ID */ 696437Smws uint8_t smbl_ch1; /* slot characteristics 1 */ 697437Smws uint8_t smbl_ch2; /* slot characteristics 2 */ 698437Smws } smbios_slot_t; 699437Smws 700437Smws #define SMB_SLT_OTHER 0x01 /* other */ 701437Smws #define SMB_SLT_UNKNOWN 0x02 /* unknown */ 702437Smws #define SMB_SLT_ISA 0x03 /* ISA */ 703437Smws #define SMB_SLT_MCA 0x04 /* MCA */ 704437Smws #define SMB_SLT_EISA 0x05 /* EISA */ 705437Smws #define SMB_SLT_PCI 0x06 /* PCI */ 706437Smws #define SMB_SLT_PCMCIA 0x07 /* PCMCIA */ 707437Smws #define SMB_SLT_VLVESA 0x08 /* VL-VESA */ 708437Smws #define SMB_SLT_PROPRIETARY 0x09 /* proprietary */ 709437Smws #define SMB_SLT_PROC 0x0A /* processor card slot */ 710437Smws #define SMB_SLT_MEM 0x0B /* proprietary memory card slot */ 711437Smws #define SMB_SLT_IOR 0x0C /* I/O riser card slot */ 712437Smws #define SMB_SLT_NUBUS 0x0D /* NuBus */ 713437Smws #define SMB_SLT_PCI66 0x0E /* PCI (66MHz capable) */ 714437Smws #define SMB_SLT_AGP 0x0F /* AGP */ 715437Smws #define SMB_SLT_AGP2X 0x10 /* AGP 2X */ 716437Smws #define SMB_SLT_AGP4X 0x11 /* AGP 4X */ 717437Smws #define SMB_SLT_PCIX 0x12 /* PCI-X */ 718437Smws #define SMB_SLT_AGP8X 0x13 /* AGP 8X */ 719437Smws #define SMB_SLT_PC98_C20 0xA0 /* PC-98/C20 */ 720437Smws #define SMB_SLT_PC98_C24 0xA1 /* PC-98/C24 */ 721437Smws #define SMB_SLT_PC98_E 0xA2 /* PC-98/E */ 722437Smws #define SMB_SLT_PC98_LB 0xA3 /* PC-98/Local Bus */ 723437Smws #define SMB_SLT_PC98_C 0xA4 /* PC-98/Card */ 724437Smws #define SMB_SLT_PCIE 0xA5 /* PCI Express */ 725*7107Ssethg #define SMB_SLT_PCIE1 0xA6 /* PCI Express x1 */ 726*7107Ssethg #define SMB_SLT_PCIE2 0xA7 /* PCI Express x2 */ 727*7107Ssethg #define SMB_SLT_PCIE4 0xA8 /* PCI Express x4 */ 728*7107Ssethg #define SMB_SLT_PCIE8 0xA9 /* PCI Express x8 */ 729*7107Ssethg #define SMB_SLT_PCIE16 0xAA /* PCI Express x16 */ 730437Smws 731437Smws #define SMB_SLW_OTHER 0x01 /* other */ 732437Smws #define SMB_SLW_UNKNOWN 0x02 /* unknown */ 733437Smws #define SMB_SLW_8 0x03 /* 8 bit */ 734437Smws #define SMB_SLW_16 0x04 /* 16 bit */ 735437Smws #define SMB_SLW_32 0x05 /* 32 bit */ 736437Smws #define SMB_SLW_64 0x06 /* 64 bit */ 737437Smws #define SMB_SLW_128 0x07 /* 128 bit */ 738437Smws #define SMB_SLW_1X 0x08 /* 1x or x1 */ 739437Smws #define SMB_SLW_2X 0x09 /* 2x or x2 */ 740437Smws #define SMB_SLW_4X 0x0A /* 4x or x4 */ 741437Smws #define SMB_SLW_8X 0x0B /* 8x or x8 */ 742437Smws #define SMB_SLW_12X 0x0C /* 12x or x12 */ 743437Smws #define SMB_SLW_16X 0x0D /* 16x or x16 */ 744437Smws #define SMB_SLW_32X 0x0E /* 32x or x32 */ 745437Smws 746437Smws #define SMB_SLU_OTHER 0x01 /* other */ 747437Smws #define SMB_SLU_UNKNOWN 0x02 /* unknown */ 748437Smws #define SMB_SLU_AVAIL 0x03 /* available */ 749437Smws #define SMB_SLU_INUSE 0x04 /* in use */ 750437Smws 751437Smws #define SMB_SLL_OTHER 0x01 /* other */ 752437Smws #define SMB_SLL_UNKNOWN 0x02 /* unknown */ 753437Smws #define SMB_SLL_SHORT 0x03 /* short length */ 754437Smws #define SMB_SLL_LONG 0x04 /* long length */ 755437Smws 756437Smws #define SMB_SLCH1_UNKNOWN 0x01 /* characteristics unknown */ 757437Smws #define SMB_SLCH1_5V 0x02 /* provides 5.0V */ 758437Smws #define SMB_SLCH1_33V 0x04 /* provides 3.3V */ 759437Smws #define SMB_SLCH1_SHARED 0x08 /* opening shared with other slot */ 760437Smws #define SMB_SLCH1_PC16 0x10 /* slot supports PC Card-16 */ 761437Smws #define SMB_SLCH1_PCCB 0x20 /* slot supports CardBus */ 762437Smws #define SMB_SLCH1_PCZV 0x40 /* slot supports Zoom Video */ 763437Smws #define SMB_SLCH1_PCMRR 0x80 /* slot supports Modem Ring Resume */ 764437Smws 765437Smws #define SMB_SLCH2_PME 0x01 /* slot supports PME# signal */ 766437Smws #define SMB_SLCH2_HOTPLUG 0x02 /* slot supports hot-plug devices */ 767437Smws #define SMB_SLCH2_SMBUS 0x04 /* slot supports SMBus signal */ 768437Smws 769437Smws /* 770437Smws * SMBIOS On-Board Device Information. See DSP0134 Section 3.3.11 for more 771437Smws * information. Any number of on-board device sections may be present, each 772437Smws * containing one or more records. The smbios_info_obdevs() function permits 773437Smws * the caller to retrieve one or more of the records from a given section. 774437Smws */ 775437Smws typedef struct smbios_obdev { 776437Smws const char *smbd_name; /* description string for this device */ 777437Smws uint8_t smbd_type; /* type code (SMB_OBT_*) */ 778437Smws uint8_t smbd_enabled; /* boolean (device is enabled) */ 779437Smws } smbios_obdev_t; 780437Smws 781437Smws #define SMB_OBT_OTHER 0x01 /* other */ 782437Smws #define SMB_OBT_UNKNOWN 0x02 /* unknown */ 783437Smws #define SMB_OBT_VIDEO 0x03 /* video */ 784437Smws #define SMB_OBT_SCSI 0x04 /* scsi */ 785437Smws #define SMB_OBT_ETHERNET 0x05 /* ethernet */ 786437Smws #define SMB_OBT_TOKEN 0x06 /* token ring */ 787437Smws #define SMB_OBT_SOUND 0x07 /* sound */ 788*7107Ssethg #define SMB_OBT_PATA 0x08 /* pata */ 789*7107Ssethg #define SMB_OBT_SATA 0x09 /* sata */ 790*7107Ssethg #define SMB_OBT_SAS 0x0A /* sas */ 791437Smws 792437Smws /* 793437Smws * SMBIOS BIOS Language Information. See DSP0134 Section 3.3.14 for more 794437Smws * information. The smbios_info_strtab() function can be applied using a 795437Smws * count of smbla_num to retrieve the other possible language settings. 796437Smws */ 797437Smws typedef struct smbios_lang { 798437Smws const char *smbla_cur; /* current language setting */ 799437Smws uint_t smbla_fmt; /* language name format (see below) */ 800437Smws uint_t smbla_num; /* number of installed languages */ 801437Smws } smbios_lang_t; 802437Smws 803437Smws #define SMB_LFMT_LONG 0 /* <ISO639>|<ISO3166>|Encoding Method */ 804437Smws #define SMB_LFMT_SHORT 1 /* <ISO930><ISO3166> */ 805437Smws 806437Smws /* 807437Smws * SMBIOS System Event Log Information. See DSP0134 Section 3.3.16 for more 808437Smws * information. Accessing the event log itself requires additional interfaces. 809437Smws */ 810437Smws typedef struct smbios_evtype { 811437Smws uint8_t smbevt_ltype; /* log type */ 812437Smws uint8_t smbevt_dtype; /* variable data format type */ 813437Smws } smbios_evtype_t; 814437Smws 815437Smws typedef struct smbios_evlog { 816437Smws size_t smbev_size; /* size in bytes of log area */ 817437Smws size_t smbev_hdr; /* offset or index of header */ 818437Smws size_t smbev_data; /* offset or index of data */ 819437Smws uint8_t smbev_method; /* data access method (see below) */ 820437Smws uint8_t smbev_flags; /* flags (see below) */ 821437Smws uint8_t smbev_format; /* log header format (see below) */ 822437Smws uint8_t smbev_pad; /* padding */ 823437Smws uint32_t smbev_token; /* data update change token */ 824437Smws union { 825437Smws struct { 826437Smws uint16_t evi_iaddr; /* index address */ 827437Smws uint16_t evi_daddr; /* data address */ 828437Smws } eva_io; /* i/o address for SMB_EVM_XxY */ 829437Smws uint32_t eva_addr; /* address for SMB_EVM_MEM32 */ 830437Smws uint16_t eva_gpnv; /* handle for SMB_EVM_GPNV */ 831437Smws } smbev_addr; 832437Smws uint32_t smbev_typec; /* number of type descriptors */ 833437Smws const smbios_evtype_t *smbev_typev; /* type descriptor array */ 834437Smws } smbios_evlog_t; 835437Smws 836437Smws #define SMB_EVM_1x1i_1x1d 0 /* I/O: 1 1b idx port, 1 1b data port */ 837437Smws #define SMB_EVM_2x1i_1x1d 1 /* I/O: 2 1b idx port, 1 1b data port */ 838437Smws #define SMB_EVM_1x2i_1x1d 2 /* I/O: 1 2b idx port, 1 1b data port */ 839437Smws #define SMB_EVM_MEM32 3 /* Memory-Mapped 32-bit Physical Addr */ 840437Smws #define SMB_EVM_GPNV 4 /* GP Non-Volatile API Access */ 841437Smws 842437Smws #define SMB_EVFL_VALID 0x1 /* log area valid */ 843437Smws #define SMB_EVFL_FULL 0x2 /* log area full */ 844437Smws 845437Smws #define SMB_EVHF_NONE 0 /* no log headers used */ 846437Smws #define SMB_EVHF_F1 1 /* DMTF log header type 1 */ 847437Smws 848437Smws /* 849437Smws * SMBIOS Physical Memory Array Information. See DSP0134 Section 3.3.17 for 850437Smws * more information. This describes a collection of physical memory devices. 851437Smws */ 852437Smws typedef struct smbios_memarray { 853437Smws uint8_t smbma_location; /* physical device location */ 854437Smws uint8_t smbma_use; /* physical device functional purpose */ 855437Smws uint8_t smbma_ecc; /* error detect/correct mechanism */ 856437Smws uint8_t smbma_pad0; /* padding */ 857437Smws uint32_t smbma_pad1; /* padding */ 858437Smws uint32_t smbma_ndevs; /* number of slots or sockets */ 859437Smws id_t smbma_err; /* handle of error (if any) */ 860437Smws uint64_t smbma_size; /* maximum capacity in bytes */ 861437Smws } smbios_memarray_t; 862437Smws 863437Smws #define SMB_MAL_OTHER 0x01 /* other */ 864437Smws #define SMB_MAL_UNKNOWN 0x02 /* unknown */ 865437Smws #define SMB_MAL_SYSMB 0x03 /* system board or motherboard */ 866437Smws #define SMB_MAL_ISA 0x04 /* ISA add-on card */ 867437Smws #define SMB_MAL_EISA 0x05 /* EISA add-on card */ 868437Smws #define SMB_MAL_PCI 0x06 /* PCI add-on card */ 869437Smws #define SMB_MAL_MCA 0x07 /* MCA add-on card */ 870437Smws #define SMB_MAL_PCMCIA 0x08 /* PCMCIA add-on card */ 871437Smws #define SMB_MAL_PROP 0x09 /* proprietary add-on card */ 872437Smws #define SMB_MAL_NUBUS 0x0A /* NuBus */ 873437Smws #define SMB_MAL_PC98C20 0xA0 /* PC-98/C20 add-on card */ 874437Smws #define SMB_MAL_PC98C24 0xA1 /* PC-98/C24 add-on card */ 875437Smws #define SMB_MAL_PC98E 0xA2 /* PC-98/E add-on card */ 876437Smws #define SMB_MAL_PC98LB 0xA3 /* PC-98/Local bus add-on card */ 877437Smws 878437Smws #define SMB_MAU_OTHER 0x01 /* other */ 879437Smws #define SMB_MAU_UNKNOWN 0x02 /* unknown */ 880437Smws #define SMB_MAU_SYSTEM 0x03 /* system memory */ 881437Smws #define SMB_MAU_VIDEO 0x04 /* video memory */ 882437Smws #define SMB_MAU_FLASH 0x05 /* flash memory */ 883437Smws #define SMB_MAU_NVRAM 0x06 /* non-volatile RAM */ 884437Smws #define SMB_MAU_CACHE 0x07 /* cache memory */ 885437Smws 886437Smws #define SMB_MAE_OTHER 0x01 /* other */ 887437Smws #define SMB_MAE_UNKNOWN 0x02 /* unknown */ 888437Smws #define SMB_MAE_NONE 0x03 /* none */ 889437Smws #define SMB_MAE_PARITY 0x04 /* parity */ 890437Smws #define SMB_MAE_SECC 0x05 /* single-bit ECC */ 891437Smws #define SMB_MAE_MECC 0x06 /* multi-bit ECC */ 892437Smws #define SMB_MAE_CRC 0x07 /* CRC */ 893437Smws 894437Smws /* 895437Smws * SMBIOS Memory Device Information. See DSP0134 Section 3.3.18 for more 896437Smws * information. One or more of these structures are associated with each 897437Smws * smbios_memarray_t. A structure is present even for unpopulated sockets. 898437Smws * Unknown values are set to -1. A smbmd_size of 0 indicates unpopulated. 899437Smws * WARNING: Some BIOSes appear to export the *maximum* size of the device 900437Smws * that can appear in the corresponding socket as opposed to the current one. 901437Smws */ 902437Smws typedef struct smbios_memdevice { 903437Smws id_t smbmd_array; /* handle of physical memory array */ 904437Smws id_t smbmd_error; /* handle of memory error data */ 905437Smws uint32_t smbmd_twidth; /* total width in bits including ecc */ 906437Smws uint32_t smbmd_dwidth; /* data width in bits */ 907437Smws uint64_t smbmd_size; /* size in bytes (see note above) */ 908437Smws uint8_t smbmd_form; /* form factor */ 909437Smws uint8_t smbmd_set; /* set (0x00=none, 0xFF=unknown) */ 910437Smws uint8_t smbmd_type; /* memory type */ 911437Smws uint8_t smbmd_pad; /* padding */ 912437Smws uint32_t smbmd_flags; /* flags (see below) */ 913437Smws uint32_t smbmd_speed; /* speed in nanoseconds */ 914437Smws const char *smbmd_dloc; /* physical device locator string */ 915437Smws const char *smbmd_bloc; /* physical bank locator string */ 916437Smws } smbios_memdevice_t; 917437Smws 918437Smws #define SMB_MDFF_OTHER 0x01 /* other */ 919437Smws #define SMB_MDFF_UNKNOWN 0x02 /* unknown */ 920437Smws #define SMB_MDFF_SIMM 0x03 /* SIMM */ 921437Smws #define SMB_MDFF_SIP 0x04 /* SIP */ 922437Smws #define SMB_MDFF_CHIP 0x05 /* chip */ 923437Smws #define SMB_MDFF_DIP 0x06 /* DIP */ 924437Smws #define SMB_MDFF_ZIP 0x07 /* ZIP */ 925437Smws #define SMB_MDFF_PROP 0x08 /* proprietary card */ 926437Smws #define SMB_MDFF_DIMM 0x09 /* DIMM */ 927437Smws #define SMB_MDFF_TSOP 0x0A /* TSOP */ 928437Smws #define SMB_MDFF_CHIPROW 0x0B /* row of chips */ 929437Smws #define SMB_MDFF_RIMM 0x0C /* RIMM */ 930437Smws #define SMB_MDFF_SODIMM 0x0D /* SODIMM */ 931437Smws #define SMB_MDFF_SRIMM 0x0E /* SRIMM */ 932*7107Ssethg #define SMB_MDFF_FBDIMM 0x0F /* FBDIMM */ 933437Smws 934437Smws #define SMB_MDT_OTHER 0x01 /* other */ 935437Smws #define SMB_MDT_UNKNOWN 0x02 /* unknown */ 936437Smws #define SMB_MDT_DRAM 0x03 /* DRAM */ 937437Smws #define SMB_MDT_EDRAM 0x04 /* EDRAM */ 938437Smws #define SMB_MDT_VRAM 0x05 /* VRAM */ 939437Smws #define SMB_MDT_SRAM 0x06 /* SRAM */ 940437Smws #define SMB_MDT_RAM 0x07 /* RAM */ 941437Smws #define SMB_MDT_ROM 0x08 /* ROM */ 942437Smws #define SMB_MDT_FLASH 0x09 /* FLASH */ 943437Smws #define SMB_MDT_EEPROM 0x0A /* EEPROM */ 944437Smws #define SMB_MDT_FEPROM 0x0B /* FEPROM */ 945437Smws #define SMB_MDT_EPROM 0x0C /* EPROM */ 946437Smws #define SMB_MDT_CDRAM 0x0D /* CDRAM */ 947437Smws #define SMB_MDT_3DRAM 0x0E /* 3DRAM */ 948437Smws #define SMB_MDT_SDRAM 0x0F /* SDRAM */ 949437Smws #define SMB_MDT_SGRAM 0x10 /* SGRAM */ 950437Smws #define SMB_MDT_RDRAM 0x11 /* RDRAM */ 951437Smws #define SMB_MDT_DDR 0x12 /* DDR */ 952437Smws #define SMB_MDT_DDR2 0x13 /* DDR2 */ 953*7107Ssethg #define SMB_MDT_DDR2FBDIMM 0x14 /* DDR2 FBDIMM */ 954437Smws 955437Smws #define SMB_MDF_OTHER 0x0002 /* other */ 956437Smws #define SMB_MDF_UNKNOWN 0x0004 /* unknown */ 957437Smws #define SMB_MDF_FASTPG 0x0008 /* fast-paged */ 958437Smws #define SMB_MDF_STATIC 0x0010 /* static column */ 959437Smws #define SMB_MDF_PSTATIC 0x0020 /* pseudo-static */ 960437Smws #define SMB_MDF_RAMBUS 0x0040 /* RAMBUS */ 961437Smws #define SMB_MDF_SYNC 0x0080 /* synchronous */ 962437Smws #define SMB_MDF_CMOS 0x0100 /* CMOS */ 963437Smws #define SMB_MDF_EDO 0x0200 /* EDO */ 964437Smws #define SMB_MDF_WDRAM 0x0400 /* Window DRAM */ 965437Smws #define SMB_MDF_CDRAM 0x0800 /* Cache DRAM */ 966437Smws #define SMB_MDF_NV 0x1000 /* non-volatile */ 967437Smws 968437Smws /* 969437Smws * SMBIOS Memory Array Mapped Address. See DSP0134 Section 3.3.20 for more 970437Smws * information. We convert start/end addresses into addr/size for convenience. 971437Smws */ 972437Smws typedef struct smbios_memarrmap { 973437Smws id_t smbmam_array; /* physical memory array handle */ 974437Smws uint32_t smbmam_width; /* number of devices that form a row */ 975437Smws uint64_t smbmam_addr; /* physical address of mapping */ 976437Smws uint64_t smbmam_size; /* size in bytes of address range */ 977437Smws } smbios_memarrmap_t; 978437Smws 979437Smws /* 980437Smws * SMBIOS Memory Device Mapped Address. See DSP0134 Section 3.3.21 for more 981437Smws * information. We convert start/end addresses into addr/size for convenience. 982437Smws */ 983437Smws typedef struct smbios_memdevmap { 984437Smws id_t smbmdm_device; /* memory device handle */ 985437Smws id_t smbmdm_arrmap; /* memory array mapped address handle */ 986437Smws uint64_t smbmdm_addr; /* physical address of mapping */ 987437Smws uint64_t smbmdm_size; /* size in bytes of address range */ 988437Smws uint8_t smbmdm_rpos; /* partition row position */ 989437Smws uint8_t smbmdm_ipos; /* interleave position */ 990437Smws uint8_t smbmdm_idepth; /* interleave data depth */ 991437Smws } smbios_memdevmap_t; 992437Smws 993437Smws /* 994437Smws * SMBIOS Hardware Security Settings. See DSP0134 Section 3.3.25 for more 995437Smws * information. Only one such record will be present in the SMBIOS. 996437Smws */ 997437Smws typedef struct smbios_hwsec { 998437Smws uint8_t smbh_pwr_ps; /* power-on password status */ 999437Smws uint8_t smbh_kbd_ps; /* keyboard password status */ 1000437Smws uint8_t smbh_adm_ps; /* administrator password status */ 1001437Smws uint8_t smbh_pan_ps; /* front panel reset status */ 1002437Smws } smbios_hwsec_t; 1003437Smws 1004437Smws #define SMB_HWSEC_PS_DISABLED 0x00 /* password disabled */ 1005437Smws #define SMB_HWSEC_PS_ENABLED 0x01 /* password enabled */ 1006437Smws #define SMB_HWSEC_PS_NOTIMPL 0x02 /* password not implemented */ 1007437Smws #define SMB_HWSEC_PS_UNKNOWN 0x03 /* password status unknown */ 1008437Smws 1009437Smws /* 1010437Smws * SMBIOS System Boot Information. See DSP0134 Section 3.3.33 for more 1011437Smws * information. The contents of the data varies by type and is undocumented 1012437Smws * from the perspective of DSP0134 -- it seems to be left as vendor-specific. 1013437Smws * The (D) annotation next to SMB_BOOT_* below indicates possible data payload. 1014437Smws */ 1015437Smws typedef struct smbios_boot { 1016437Smws uint8_t smbt_status; /* boot status code (see below) */ 1017437Smws const void *smbt_data; /* data buffer specific to status */ 1018437Smws size_t smbt_size; /* size of smbt_data buffer in bytes */ 1019437Smws } smbios_boot_t; 1020437Smws 1021437Smws #define SMB_BOOT_NORMAL 0 /* no errors detected */ 1022437Smws #define SMB_BOOT_NOMEDIA 1 /* no bootable media */ 1023437Smws #define SMB_BOOT_OSFAIL 2 /* normal o/s failed to load */ 1024437Smws #define SMB_BOOT_FWHWFAIL 3 /* firmware-detected hardware failure */ 1025437Smws #define SMB_BOOT_OSHWFAIL 4 /* o/s-detected hardware failure */ 1026437Smws #define SMB_BOOT_USERREQ 5 /* user-requested boot (keystroke) */ 1027437Smws #define SMB_BOOT_SECURITY 6 /* system security violation */ 1028437Smws #define SMB_BOOT_PREVREQ 7 /* previously requested image (D) */ 1029437Smws #define SMB_BOOT_WATCHDOG 8 /* watchdog initiated reboot */ 1030437Smws #define SMB_BOOT_RESV_LO 9 /* low end of reserved range */ 1031437Smws #define SMB_BOOT_RESV_HI 127 /* high end of reserved range */ 1032437Smws #define SMB_BOOT_OEM_LO 128 /* low end of OEM-specific range */ 1033437Smws #define SMB_BOOT_OEM_HI 191 /* high end of OEM-specific range */ 1034437Smws #define SMB_BOOT_PROD_LO 192 /* low end of product-specific range */ 1035437Smws #define SMB_BOOT_PROD_HI 255 /* high end of product-specific range */ 1036437Smws 1037437Smws /* 1038437Smws * SMBIOS IPMI Device Information. See DSP0134 Section 3.3.39 and also 1039437Smws * Appendix C1 of the IPMI specification for more information on this record. 1040437Smws */ 1041437Smws typedef struct smbios_ipmi { 1042437Smws uint_t smbip_type; /* BMC interface type */ 1043437Smws smbios_version_t smbip_vers; /* BMC's IPMI specification version */ 1044437Smws uint32_t smbip_i2c; /* BMC I2C bus slave address */ 1045437Smws uint32_t smbip_bus; /* bus ID of NV storage device, or -1 */ 1046437Smws uint64_t smbip_addr; /* BMC base address */ 1047437Smws uint32_t smbip_flags; /* flags (see below) */ 1048437Smws uint16_t smbip_intr; /* interrupt number (or zero if none) */ 1049437Smws uint16_t smbip_regspacing; /* i/o space register spacing (bytes) */ 1050437Smws } smbios_ipmi_t; 1051437Smws 1052437Smws #define SMB_IPMI_T_UNKNOWN 0x00 /* unknown */ 1053437Smws #define SMB_IPMI_T_KCS 0x01 /* KCS: Keyboard Controller Style */ 1054437Smws #define SMB_IPMI_T_SMIC 0x02 /* SMIC: Server Mgmt Interface Chip */ 1055437Smws #define SMB_IPMI_T_BT 0x03 /* BT: Block Transfer */ 1056437Smws #define SMB_IPMI_T_SSIF 0x04 /* SSIF: SMBus System Interface */ 1057437Smws 1058437Smws #define SMB_IPMI_F_IOADDR 0x01 /* base address is in i/o space */ 1059437Smws #define SMB_IPMI_F_INTRSPEC 0x02 /* intr information is specified */ 1060437Smws #define SMB_IPMI_F_INTRHIGH 0x04 /* intr active high (else low) */ 1061437Smws #define SMB_IPMI_F_INTREDGE 0x08 /* intr is edge triggered (else lvl) */ 1062437Smws 1063437Smws /* 1064437Smws * SMBIOS Interfaces. An SMBIOS image can be opened by either providing a file 1065437Smws * pathname, device pathname, file descriptor, or raw memory buffer. Once an 1066437Smws * image is opened the functions below can be used to iterate over the various 1067437Smws * structures and convert the underlying data representation into the simpler 1068437Smws * data structures described earlier in this header file. The SMB_VERSION 1069437Smws * constant specified when opening an image indicates the version of the ABI 1070437Smws * the caller expects and the DMTF SMBIOS version the client can understand. 1071437Smws * The library will then map older or newer data structures to that as needed. 1072437Smws */ 1073437Smws 1074437Smws #define SMB_VERSION_23 0x0203 /* SMBIOS encoding for DMTF spec 2.3 */ 1075437Smws #define SMB_VERSION_24 0x0204 /* SMBIOS encoding for DMTF spec 2.4 */ 1076437Smws #define SMB_VERSION SMB_VERSION_24 /* SMBIOS latest version definitions */ 1077437Smws 1078437Smws #define SMB_O_NOCKSUM 0x1 /* do not verify header checksums */ 1079437Smws #define SMB_O_NOVERS 0x2 /* do not verify header versions */ 1080437Smws #define SMB_O_ZIDS 0x4 /* strip out identification numbers */ 1081437Smws #define SMB_O_MASK 0x7 /* mask of valid smbios_*open flags */ 1082437Smws 1083437Smws #define SMB_ID_NOTSUP 0xFFFE /* structure is not supported by BIOS */ 1084437Smws #define SMB_ID_NONE 0xFFFF /* structure is a null reference */ 1085437Smws 1086437Smws #define SMB_ERR (-1) /* id_t value indicating error */ 1087437Smws 1088437Smws typedef struct smbios_hdl smbios_hdl_t; 1089437Smws 1090437Smws typedef struct smbios_struct { 1091437Smws id_t smbstr_id; /* structure ID handle */ 1092437Smws uint_t smbstr_type; /* structure type */ 1093437Smws const void *smbstr_data; /* structure data */ 1094437Smws size_t smbstr_size; /* structure size */ 1095437Smws } smbios_struct_t; 1096437Smws 1097437Smws typedef int smbios_struct_f(smbios_hdl_t *, 1098437Smws const smbios_struct_t *, void *); 1099437Smws 1100437Smws extern smbios_hdl_t *smbios_open(const char *, int, int, int *); 1101437Smws extern smbios_hdl_t *smbios_fdopen(int, int, int, int *); 1102437Smws extern smbios_hdl_t *smbios_bufopen(const smbios_entry_t *, 1103437Smws const void *, size_t, int, int, int *); 1104437Smws 1105437Smws extern const void *smbios_buf(smbios_hdl_t *); 1106437Smws extern size_t smbios_buflen(smbios_hdl_t *); 1107437Smws 1108437Smws extern void smbios_checksum(smbios_hdl_t *, smbios_entry_t *); 1109437Smws extern int smbios_write(smbios_hdl_t *, int); 1110437Smws extern void smbios_close(smbios_hdl_t *); 1111437Smws 1112437Smws extern int smbios_errno(smbios_hdl_t *); 1113437Smws extern const char *smbios_errmsg(int); 1114437Smws 1115437Smws extern int smbios_lookup_id(smbios_hdl_t *, id_t, smbios_struct_t *); 1116437Smws extern int smbios_iter(smbios_hdl_t *, smbios_struct_f *, void *); 1117437Smws 1118437Smws extern void smbios_info_smbios(smbios_hdl_t *, smbios_entry_t *); 1119437Smws extern int smbios_info_common(smbios_hdl_t *, id_t, smbios_info_t *); 1120437Smws extern id_t smbios_info_bios(smbios_hdl_t *, smbios_bios_t *); 1121437Smws extern id_t smbios_info_system(smbios_hdl_t *, smbios_system_t *); 1122437Smws extern int smbios_info_bboard(smbios_hdl_t *, id_t, smbios_bboard_t *); 1123437Smws extern int smbios_info_chassis(smbios_hdl_t *, id_t, smbios_chassis_t *); 1124437Smws extern int smbios_info_processor(smbios_hdl_t *, id_t, smbios_processor_t *); 1125437Smws extern int smbios_info_cache(smbios_hdl_t *, id_t, smbios_cache_t *); 1126437Smws extern int smbios_info_port(smbios_hdl_t *, id_t, smbios_port_t *); 1127437Smws extern int smbios_info_slot(smbios_hdl_t *, id_t, smbios_slot_t *); 1128437Smws extern int smbios_info_obdevs(smbios_hdl_t *, id_t, int, smbios_obdev_t *); 1129437Smws extern int smbios_info_strtab(smbios_hdl_t *, id_t, int, const char *[]); 1130437Smws extern id_t smbios_info_lang(smbios_hdl_t *, smbios_lang_t *); 1131437Smws extern id_t smbios_info_eventlog(smbios_hdl_t *, smbios_evlog_t *); 1132437Smws extern int smbios_info_memarray(smbios_hdl_t *, id_t, smbios_memarray_t *); 1133437Smws extern int smbios_info_memarrmap(smbios_hdl_t *, id_t, smbios_memarrmap_t *); 1134437Smws extern int smbios_info_memdevice(smbios_hdl_t *, id_t, smbios_memdevice_t *); 1135437Smws extern int smbios_info_memdevmap(smbios_hdl_t *, id_t, smbios_memdevmap_t *); 1136437Smws extern id_t smbios_info_hwsec(smbios_hdl_t *, smbios_hwsec_t *); 1137437Smws extern id_t smbios_info_boot(smbios_hdl_t *, smbios_boot_t *); 1138437Smws extern id_t smbios_info_ipmi(smbios_hdl_t *, smbios_ipmi_t *); 1139437Smws 1140437Smws #ifndef _KERNEL 1141437Smws /* 1142437Smws * The smbios_*_desc() and smbios_*_name() interfaces can be used for utilities 1143437Smws * such as smbios(1M) that wish to decode SMBIOS fields for humans. The _desc 1144437Smws * functions return the comment string next to the #defines listed above, and 1145437Smws * the _name functions return the appropriate #define identifier itself. 1146437Smws */ 1147437Smws extern const char *smbios_bboard_flag_desc(uint_t); 1148437Smws extern const char *smbios_bboard_flag_name(uint_t); 1149437Smws extern const char *smbios_bboard_type_desc(uint_t); 1150437Smws 1151437Smws extern const char *smbios_bios_flag_desc(uint64_t); 1152437Smws extern const char *smbios_bios_flag_name(uint64_t); 1153437Smws 1154437Smws extern const char *smbios_bios_xb1_desc(uint_t); 1155437Smws extern const char *smbios_bios_xb1_name(uint_t); 1156437Smws extern const char *smbios_bios_xb2_desc(uint_t); 1157437Smws extern const char *smbios_bios_xb2_name(uint_t); 1158437Smws 1159437Smws extern const char *smbios_boot_desc(uint_t); 1160437Smws 1161437Smws extern const char *smbios_cache_assoc_desc(uint_t); 1162437Smws extern const char *smbios_cache_ctype_desc(uint_t); 1163437Smws extern const char *smbios_cache_ctype_name(uint_t); 1164437Smws extern const char *smbios_cache_ecc_desc(uint_t); 1165437Smws extern const char *smbios_cache_flag_desc(uint_t); 1166437Smws extern const char *smbios_cache_flag_name(uint_t); 1167437Smws extern const char *smbios_cache_loc_desc(uint_t); 1168437Smws extern const char *smbios_cache_logical_desc(uint_t); 1169437Smws extern const char *smbios_cache_mode_desc(uint_t); 1170437Smws 1171437Smws extern const char *smbios_chassis_state_desc(uint_t); 1172437Smws extern const char *smbios_chassis_type_desc(uint_t); 1173437Smws 1174437Smws extern const char *smbios_evlog_flag_desc(uint_t); 1175437Smws extern const char *smbios_evlog_flag_name(uint_t); 1176437Smws extern const char *smbios_evlog_format_desc(uint_t); 1177437Smws extern const char *smbios_evlog_method_desc(uint_t); 1178437Smws 1179437Smws extern const char *smbios_ipmi_flag_name(uint_t); 1180437Smws extern const char *smbios_ipmi_flag_desc(uint_t); 1181437Smws extern const char *smbios_ipmi_type_desc(uint_t); 1182437Smws 1183437Smws extern const char *smbios_hwsec_desc(uint_t); 1184437Smws 1185437Smws extern const char *smbios_memarray_loc_desc(uint_t); 1186437Smws extern const char *smbios_memarray_use_desc(uint_t); 1187437Smws extern const char *smbios_memarray_ecc_desc(uint_t); 1188437Smws 1189437Smws extern const char *smbios_memdevice_form_desc(uint_t); 1190437Smws extern const char *smbios_memdevice_type_desc(uint_t); 1191437Smws extern const char *smbios_memdevice_flag_name(uint_t); 1192437Smws extern const char *smbios_memdevice_flag_desc(uint_t); 1193437Smws 1194437Smws extern const char *smbios_port_conn_desc(uint_t); 1195437Smws extern const char *smbios_port_type_desc(uint_t); 1196437Smws 1197437Smws extern const char *smbios_processor_family_desc(uint_t); 1198437Smws extern const char *smbios_processor_status_desc(uint_t); 1199437Smws extern const char *smbios_processor_type_desc(uint_t); 1200437Smws extern const char *smbios_processor_upgrade_desc(uint_t); 1201437Smws 1202437Smws extern const char *smbios_slot_type_desc(uint_t); 1203437Smws extern const char *smbios_slot_width_desc(uint_t); 1204437Smws extern const char *smbios_slot_usage_desc(uint_t); 1205437Smws extern const char *smbios_slot_length_desc(uint_t); 1206437Smws extern const char *smbios_slot_ch1_desc(uint_t); 1207437Smws extern const char *smbios_slot_ch1_name(uint_t); 1208437Smws extern const char *smbios_slot_ch2_desc(uint_t); 1209437Smws extern const char *smbios_slot_ch2_name(uint_t); 1210437Smws 1211437Smws extern const char *smbios_type_desc(uint_t); 1212437Smws extern const char *smbios_type_name(uint_t); 1213437Smws 1214437Smws extern const char *smbios_system_wakeup_desc(uint_t); 1215437Smws #endif /* !_KERNEL */ 1216437Smws 1217437Smws #ifdef _KERNEL 1218437Smws /* 1219437Smws * For SMBIOS clients within the kernel itself, ksmbios is used to refer to 1220437Smws * the kernel's current snapshot of the SMBIOS, if one exists, and the 1221437Smws * ksmbios_flags tunable is the set of flags for use with smbios_open(). 1222437Smws */ 1223437Smws extern smbios_hdl_t *ksmbios; 1224437Smws extern int ksmbios_flags; 1225437Smws #endif /* _KERNEL */ 1226437Smws 1227437Smws #ifdef __cplusplus 1228437Smws } 1229437Smws #endif 1230437Smws 1231437Smws #endif /* _SYS_SMBIOS_H */ 1232