17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5ea8dc4b6Seschrock * Common Development and Distribution License (the "License"). 6ea8dc4b6Seschrock * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21d9638e54Smws 227c478bd9Sstevel@tonic-gate /* 23392e836bSGavin Maltby * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 24*c5591576SRob Johnston * Copyright 2020 Joyent, Inc. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_FM_PROTOCOL_H 287c478bd9Sstevel@tonic-gate #define _SYS_FM_PROTOCOL_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifdef __cplusplus 317c478bd9Sstevel@tonic-gate extern "C" { 327c478bd9Sstevel@tonic-gate #endif 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate #ifdef _KERNEL 357c478bd9Sstevel@tonic-gate #include <sys/varargs.h> 367c478bd9Sstevel@tonic-gate #include <sys/nvpair.h> 377c478bd9Sstevel@tonic-gate #else 387c478bd9Sstevel@tonic-gate #include <libnvpair.h> 397c478bd9Sstevel@tonic-gate #include <stdarg.h> 407c478bd9Sstevel@tonic-gate #endif 417c478bd9Sstevel@tonic-gate #include <sys/processor.h> 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate /* FM common member names */ 447c478bd9Sstevel@tonic-gate #define FM_CLASS "class" 457c478bd9Sstevel@tonic-gate #define FM_VERSION "version" 467c478bd9Sstevel@tonic-gate 47f6e214c7SGavin Maltby /* FM protocol category 1 class names */ 487c478bd9Sstevel@tonic-gate #define FM_EREPORT_CLASS "ereport" 497c478bd9Sstevel@tonic-gate #define FM_FAULT_CLASS "fault" 50705e9f42SStephen Hanson #define FM_DEFECT_CLASS "defect" 517c478bd9Sstevel@tonic-gate #define FM_RSRC_CLASS "resource" 527c478bd9Sstevel@tonic-gate #define FM_LIST_EVENT "list" 53f6e214c7SGavin Maltby #define FM_IREPORT_CLASS "ireport" 54d9638e54Smws 55d9638e54Smws /* FM list.* event class values */ 567c478bd9Sstevel@tonic-gate #define FM_LIST_SUSPECT_CLASS FM_LIST_EVENT ".suspect" 57d9638e54Smws #define FM_LIST_ISOLATED_CLASS FM_LIST_EVENT ".isolated" 58d9638e54Smws #define FM_LIST_REPAIRED_CLASS FM_LIST_EVENT ".repaired" 5925c6ff4bSstephh #define FM_LIST_UPDATED_CLASS FM_LIST_EVENT ".updated" 6025c6ff4bSstephh #define FM_LIST_RESOLVED_CLASS FM_LIST_EVENT ".resolved" 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate /* ereport class subcategory values */ 637c478bd9Sstevel@tonic-gate #define FM_ERROR_CPU "cpu" 647c478bd9Sstevel@tonic-gate #define FM_ERROR_IO "io" 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate /* ereport version and payload member names */ 677c478bd9Sstevel@tonic-gate #define FM_EREPORT_VERS0 0 687c478bd9Sstevel@tonic-gate #define FM_EREPORT_VERSION FM_EREPORT_VERS0 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate /* ereport payload member names */ 717c478bd9Sstevel@tonic-gate #define FM_EREPORT_DETECTOR "detector" 727c478bd9Sstevel@tonic-gate #define FM_EREPORT_ENA "ena" 737c478bd9Sstevel@tonic-gate 74d9638e54Smws /* list.* event payload member names */ 757c478bd9Sstevel@tonic-gate #define FM_LIST_EVENT_SIZE "list-sz" 767c478bd9Sstevel@tonic-gate 77f6e214c7SGavin Maltby /* ireport.* event payload member names */ 78f6e214c7SGavin Maltby #define FM_IREPORT_DETECTOR "detector" 79f6e214c7SGavin Maltby #define FM_IREPORT_UUID "uuid" 80f6e214c7SGavin Maltby #define FM_IREPORT_PRIORITY "pri" 81f6e214c7SGavin Maltby #define FM_IREPORT_ATTRIBUTES "attr" 82f6e214c7SGavin Maltby 8325c6ff4bSstephh /* 8425c6ff4bSstephh * list.suspect, isolated, updated, repaired and resolved 8525c6ff4bSstephh * versions/payload member names. 8625c6ff4bSstephh */ 877c478bd9Sstevel@tonic-gate #define FM_SUSPECT_UUID "uuid" 887c478bd9Sstevel@tonic-gate #define FM_SUSPECT_DIAG_CODE "code" 897c478bd9Sstevel@tonic-gate #define FM_SUSPECT_DIAG_TIME "diag-time" 907c478bd9Sstevel@tonic-gate #define FM_SUSPECT_DE "de" 917c478bd9Sstevel@tonic-gate #define FM_SUSPECT_FAULT_LIST "fault-list" 927c478bd9Sstevel@tonic-gate #define FM_SUSPECT_FAULT_SZ "fault-list-sz" 93d9638e54Smws #define FM_SUSPECT_FAULT_STATUS "fault-status" 94540db9a9SStephen Hanson #define FM_SUSPECT_INJECTED "__injected" 957c478bd9Sstevel@tonic-gate #define FM_SUSPECT_MESSAGE "message" 96b7d3956bSstephh #define FM_SUSPECT_RETIRE "retire" 97b7d3956bSstephh #define FM_SUSPECT_RESPONSE "response" 9888045cffSRobert Johnston #define FM_SUSPECT_SEVERITY "severity" 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate #define FM_SUSPECT_VERS0 0 1017c478bd9Sstevel@tonic-gate #define FM_SUSPECT_VERSION FM_SUSPECT_VERS0 1027c478bd9Sstevel@tonic-gate 10344743693Sstephh #define FM_SUSPECT_FAULTY 0x1 10444743693Sstephh #define FM_SUSPECT_UNUSABLE 0x2 10544743693Sstephh #define FM_SUSPECT_NOT_PRESENT 0x4 10625c6ff4bSstephh #define FM_SUSPECT_DEGRADED 0x8 10725c6ff4bSstephh #define FM_SUSPECT_REPAIRED 0x10 10825c6ff4bSstephh #define FM_SUSPECT_REPLACED 0x20 10925c6ff4bSstephh #define FM_SUSPECT_ACQUITTED 0x40 11044743693Sstephh 1117c478bd9Sstevel@tonic-gate /* fault event versions and payload member names */ 1127c478bd9Sstevel@tonic-gate #define FM_FAULT_VERS0 0 1137c478bd9Sstevel@tonic-gate #define FM_FAULT_VERSION FM_FAULT_VERS0 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate #define FM_FAULT_ASRU "asru" 1167c478bd9Sstevel@tonic-gate #define FM_FAULT_FRU "fru" 1177c478bd9Sstevel@tonic-gate #define FM_FAULT_FRU_LABEL "fru-label" 1187c478bd9Sstevel@tonic-gate #define FM_FAULT_CERTAINTY "certainty" 1197c478bd9Sstevel@tonic-gate #define FM_FAULT_RESOURCE "resource" 1209dd0f810Scindi #define FM_FAULT_LOCATION "location" 1217c478bd9Sstevel@tonic-gate 1227c478bd9Sstevel@tonic-gate /* resource event versions and payload member names */ 1237c478bd9Sstevel@tonic-gate #define FM_RSRC_VERS0 0 1247c478bd9Sstevel@tonic-gate #define FM_RSRC_VERSION FM_RSRC_VERS0 1257c478bd9Sstevel@tonic-gate #define FM_RSRC_RESOURCE "resource" 1267c478bd9Sstevel@tonic-gate 127d9638e54Smws /* resource.fm.asru.* payload member names */ 1287c478bd9Sstevel@tonic-gate #define FM_RSRC_ASRU_UUID "uuid" 129d9638e54Smws #define FM_RSRC_ASRU_CODE "code" 1307c478bd9Sstevel@tonic-gate #define FM_RSRC_ASRU_FAULTY "faulty" 13125c6ff4bSstephh #define FM_RSRC_ASRU_REPAIRED "repaired" 13225c6ff4bSstephh #define FM_RSRC_ASRU_REPLACED "replaced" 13325c6ff4bSstephh #define FM_RSRC_ASRU_ACQUITTED "acquitted" 1345750ef5cSStephen Hanson #define FM_RSRC_ASRU_RESOLVED "resolved" 1357c478bd9Sstevel@tonic-gate #define FM_RSRC_ASRU_UNUSABLE "unusable" 1367c478bd9Sstevel@tonic-gate #define FM_RSRC_ASRU_EVENT "event" 1377c478bd9Sstevel@tonic-gate 138d9638e54Smws /* resource.fm.xprt.* versions and payload member names */ 139d9638e54Smws #define FM_RSRC_XPRT_VERS0 0 140d9638e54Smws #define FM_RSRC_XPRT_VERSION FM_RSRC_XPRT_VERS0 141d9638e54Smws #define FM_RSRC_XPRT_UUID "uuid" 142d9638e54Smws #define FM_RSRC_XPRT_SUBCLASS "subclass" 143cbf75e67SStephen Hanson #define FM_RSRC_XPRT_FAULT_STATUS "fault-status" 144cbf75e67SStephen Hanson #define FM_RSRC_XPRT_FAULT_HAS_ASRU "fault-has-asru" 145d9638e54Smws 1467c478bd9Sstevel@tonic-gate /* 1477c478bd9Sstevel@tonic-gate * FM ENA Format Macros 1487c478bd9Sstevel@tonic-gate */ 1497c478bd9Sstevel@tonic-gate #define ENA_FORMAT_MASK 0x3 1507c478bd9Sstevel@tonic-gate #define ENA_FORMAT(ena) ((ena) & ENA_FORMAT_MASK) 1517c478bd9Sstevel@tonic-gate 1527c478bd9Sstevel@tonic-gate /* ENA format types */ 1537c478bd9Sstevel@tonic-gate #define FM_ENA_FMT0 0 1547c478bd9Sstevel@tonic-gate #define FM_ENA_FMT1 1 1557c478bd9Sstevel@tonic-gate #define FM_ENA_FMT2 2 1567c478bd9Sstevel@tonic-gate 1577c478bd9Sstevel@tonic-gate /* Format 1 */ 1587c478bd9Sstevel@tonic-gate #define ENA_FMT1_GEN_MASK 0x00000000000003FCull 1597c478bd9Sstevel@tonic-gate #define ENA_FMT1_ID_MASK 0xFFFFFFFFFFFFFC00ull 1607c478bd9Sstevel@tonic-gate #define ENA_FMT1_CPUID_MASK 0x00000000000FFC00ull 1617c478bd9Sstevel@tonic-gate #define ENA_FMT1_TIME_MASK 0xFFFFFFFFFFF00000ull 1627c478bd9Sstevel@tonic-gate #define ENA_FMT1_GEN_SHFT 2 1637c478bd9Sstevel@tonic-gate #define ENA_FMT1_ID_SHFT 10 1647c478bd9Sstevel@tonic-gate #define ENA_FMT1_CPUID_SHFT ENA_FMT1_ID_SHFT 1657c478bd9Sstevel@tonic-gate #define ENA_FMT1_TIME_SHFT 20 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate /* Format 2 */ 1687c478bd9Sstevel@tonic-gate #define ENA_FMT2_GEN_MASK 0x00000000000003FCull 1697c478bd9Sstevel@tonic-gate #define ENA_FMT2_ID_MASK 0xFFFFFFFFFFFFFC00ull 1707c478bd9Sstevel@tonic-gate #define ENA_FMT2_TIME_MASK ENA_FMT2_ID_MASK 1717c478bd9Sstevel@tonic-gate #define ENA_FMT2_GEN_SHFT 2 1727c478bd9Sstevel@tonic-gate #define ENA_FMT2_ID_SHFT 10 1737c478bd9Sstevel@tonic-gate #define ENA_FMT2_TIME_SHFT ENA_FMT2_ID_SHFT 1747c478bd9Sstevel@tonic-gate 1757c478bd9Sstevel@tonic-gate /* Common FMRI type names */ 1767c478bd9Sstevel@tonic-gate #define FM_FMRI_AUTHORITY "authority" 1777c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME "scheme" 1787c478bd9Sstevel@tonic-gate #define FM_FMRI_SVC_AUTHORITY "svc-authority" 179825ba0f2Srobj #define FM_FMRI_FACILITY "facility" 1807c478bd9Sstevel@tonic-gate 1817c478bd9Sstevel@tonic-gate /* FMRI authority-type member names */ 1827c478bd9Sstevel@tonic-gate #define FM_FMRI_AUTH_CHASSIS "chassis-id" 1839c94f155SCheng Sean Ye #define FM_FMRI_AUTH_PRODUCT_SN "product-sn" 1847c478bd9Sstevel@tonic-gate #define FM_FMRI_AUTH_PRODUCT "product-id" 1857c478bd9Sstevel@tonic-gate #define FM_FMRI_AUTH_DOMAIN "domain-id" 1867c478bd9Sstevel@tonic-gate #define FM_FMRI_AUTH_SERVER "server-id" 1877c478bd9Sstevel@tonic-gate #define FM_FMRI_AUTH_HOST "host-id" 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate #define FM_AUTH_VERS0 0 1907c478bd9Sstevel@tonic-gate #define FM_FMRI_AUTH_VERSION FM_AUTH_VERS0 1917c478bd9Sstevel@tonic-gate 1927c478bd9Sstevel@tonic-gate /* scheme name values */ 1937c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_FMD "fmd" 1947c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_DEV "dev" 1957c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_HC "hc" 1967c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_SVC "svc" 1977c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_CPU "cpu" 1987c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_MEM "mem" 1997c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_MOD "mod" 2007c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_PKG "pkg" 2017c478bd9Sstevel@tonic-gate #define FM_FMRI_SCHEME_LEGACY "legacy-hc" 202ea8dc4b6Seschrock #define FM_FMRI_SCHEME_ZFS "zfs" 203f6e214c7SGavin Maltby #define FM_FMRI_SCHEME_SW "sw" 204*c5591576SRob Johnston #define FM_FMRI_SCHEME_PATH "path" 2057c478bd9Sstevel@tonic-gate 2067c478bd9Sstevel@tonic-gate /* Scheme versions */ 2077c478bd9Sstevel@tonic-gate #define FMD_SCHEME_VERSION0 0 2087c478bd9Sstevel@tonic-gate #define FM_FMD_SCHEME_VERSION FMD_SCHEME_VERSION0 2097c478bd9Sstevel@tonic-gate #define DEV_SCHEME_VERSION0 0 2107c478bd9Sstevel@tonic-gate #define FM_DEV_SCHEME_VERSION DEV_SCHEME_VERSION0 2117c478bd9Sstevel@tonic-gate #define FM_HC_VERS0 0 2127c478bd9Sstevel@tonic-gate #define FM_HC_SCHEME_VERSION FM_HC_VERS0 2137c478bd9Sstevel@tonic-gate #define CPU_SCHEME_VERSION0 0 2147aec1d6eScindi #define CPU_SCHEME_VERSION1 1 2157aec1d6eScindi #define FM_CPU_SCHEME_VERSION CPU_SCHEME_VERSION1 2167c478bd9Sstevel@tonic-gate #define MEM_SCHEME_VERSION0 0 2177c478bd9Sstevel@tonic-gate #define FM_MEM_SCHEME_VERSION MEM_SCHEME_VERSION0 2187c478bd9Sstevel@tonic-gate #define MOD_SCHEME_VERSION0 0 2197c478bd9Sstevel@tonic-gate #define FM_MOD_SCHEME_VERSION MOD_SCHEME_VERSION0 2207c478bd9Sstevel@tonic-gate #define PKG_SCHEME_VERSION0 0 2217c478bd9Sstevel@tonic-gate #define FM_PKG_SCHEME_VERSION PKG_SCHEME_VERSION0 2227c478bd9Sstevel@tonic-gate #define LEGACY_SCHEME_VERSION0 0 2237c478bd9Sstevel@tonic-gate #define FM_LEGACY_SCHEME_VERSION LEGACY_SCHEME_VERSION0 22495efa359SEric Schrock #define SVC_SCHEME_VERSION0 0 22595efa359SEric Schrock #define FM_SVC_SCHEME_VERSION SVC_SCHEME_VERSION0 226ea8dc4b6Seschrock #define ZFS_SCHEME_VERSION0 0 227ea8dc4b6Seschrock #define FM_ZFS_SCHEME_VERSION ZFS_SCHEME_VERSION0 228f6e214c7SGavin Maltby #define SW_SCHEME_VERSION0 0 229f6e214c7SGavin Maltby #define FM_SW_SCHEME_VERSION SW_SCHEME_VERSION0 230*c5591576SRob Johnston #define PATH_SCHEME_VERSION0 0 231*c5591576SRob Johnston #define FM_PATH_SCHEME_VERSION PATH_SCHEME_VERSION0 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate /* hc scheme member names */ 2347c478bd9Sstevel@tonic-gate #define FM_FMRI_HC_SERIAL_ID "serial" 2357c478bd9Sstevel@tonic-gate #define FM_FMRI_HC_PART "part" 2367c478bd9Sstevel@tonic-gate #define FM_FMRI_HC_REVISION "revision" 2377c478bd9Sstevel@tonic-gate #define FM_FMRI_HC_ROOT "hc-root" 2387c478bd9Sstevel@tonic-gate #define FM_FMRI_HC_LIST_SZ "hc-list-sz" 2397c478bd9Sstevel@tonic-gate #define FM_FMRI_HC_LIST "hc-list" 2407aec1d6eScindi #define FM_FMRI_HC_SPECIFIC "hc-specific" 2417c478bd9Sstevel@tonic-gate 242825ba0f2Srobj /* facility member names */ 243825ba0f2Srobj #define FM_FMRI_FACILITY_NAME "facility-name" 244825ba0f2Srobj #define FM_FMRI_FACILITY_TYPE "facility-type" 245825ba0f2Srobj 2467c478bd9Sstevel@tonic-gate /* hc-list version and member names */ 2477c478bd9Sstevel@tonic-gate #define FM_FMRI_HC_NAME "hc-name" 2487c478bd9Sstevel@tonic-gate #define FM_FMRI_HC_ID "hc-id" 2497c478bd9Sstevel@tonic-gate 2507c478bd9Sstevel@tonic-gate #define HC_LIST_VERSION0 0 2517c478bd9Sstevel@tonic-gate #define FM_HC_LIST_VERSION HC_LIST_VERSION0 2527c478bd9Sstevel@tonic-gate 2537aec1d6eScindi /* hc-specific member names */ 2547aec1d6eScindi #define FM_FMRI_HC_SPECIFIC_OFFSET "offset" 255e4b86885SCheng Sean Ye #define FM_FMRI_HC_SPECIFIC_PHYSADDR "physaddr" 2567aec1d6eScindi 2577c478bd9Sstevel@tonic-gate /* fmd module scheme member names */ 2587c478bd9Sstevel@tonic-gate #define FM_FMRI_FMD_NAME "mod-name" 2597c478bd9Sstevel@tonic-gate #define FM_FMRI_FMD_VERSION "mod-version" 2607c478bd9Sstevel@tonic-gate 2617c478bd9Sstevel@tonic-gate /* dev scheme member names */ 2627c478bd9Sstevel@tonic-gate #define FM_FMRI_DEV_ID "devid" 263392e836bSGavin Maltby #define FM_FMRI_DEV_TGTPTLUN0 "target-port-l0id" 2647c478bd9Sstevel@tonic-gate #define FM_FMRI_DEV_PATH "device-path" 2657c478bd9Sstevel@tonic-gate 2667c478bd9Sstevel@tonic-gate /* pkg scheme member names */ 2677c478bd9Sstevel@tonic-gate #define FM_FMRI_PKG_BASEDIR "pkg-basedir" 2687c478bd9Sstevel@tonic-gate #define FM_FMRI_PKG_INST "pkg-inst" 2697c478bd9Sstevel@tonic-gate #define FM_FMRI_PKG_VERSION "pkg-version" 2707c478bd9Sstevel@tonic-gate 2717c478bd9Sstevel@tonic-gate /* svc scheme member names */ 27295efa359SEric Schrock #define FM_FMRI_SVC_NAME "svc-name" 27395efa359SEric Schrock #define FM_FMRI_SVC_INSTANCE "svc-instance" 27495efa359SEric Schrock #define FM_FMRI_SVC_CONTRACT_ID "svc-contract-id" 2757c478bd9Sstevel@tonic-gate 2767c478bd9Sstevel@tonic-gate /* svc-authority member names */ 2777c478bd9Sstevel@tonic-gate #define FM_FMRI_SVC_AUTH_SCOPE "scope" 27895efa359SEric Schrock #define FM_FMRI_SVC_AUTH_SYSTEM_FQN "system-fqn" 2797c478bd9Sstevel@tonic-gate 2807c478bd9Sstevel@tonic-gate /* cpu scheme member names */ 2817c478bd9Sstevel@tonic-gate #define FM_FMRI_CPU_ID "cpuid" 2827c478bd9Sstevel@tonic-gate #define FM_FMRI_CPU_SERIAL_ID "serial" 2837c478bd9Sstevel@tonic-gate #define FM_FMRI_CPU_MASK "cpumask" 2846dfee483Stsien #define FM_FMRI_CPU_VID "cpuvid" 2856dfee483Stsien #define FM_FMRI_CPU_CPUFRU "cpufru" 2867bebe46cSjc #define FM_FMRI_CPU_CACHE_INDEX "cacheindex" 2877bebe46cSjc #define FM_FMRI_CPU_CACHE_WAY "cacheway" 2887bebe46cSjc #define FM_FMRI_CPU_CACHE_BIT "cachebit" 2897bebe46cSjc #define FM_FMRI_CPU_CACHE_TYPE "cachetype" 2907bebe46cSjc 2917bebe46cSjc #define FM_FMRI_CPU_CACHE_TYPE_L2 0 2927bebe46cSjc #define FM_FMRI_CPU_CACHE_TYPE_L3 1 2937c478bd9Sstevel@tonic-gate 2947c478bd9Sstevel@tonic-gate /* legacy-hc scheme member names */ 2957c478bd9Sstevel@tonic-gate #define FM_FMRI_LEGACY_HC "component" 2969dd0f810Scindi #define FM_FMRI_LEGACY_HC_PREFIX FM_FMRI_SCHEME_HC":///" \ 2979dd0f810Scindi FM_FMRI_LEGACY_HC"=" 2987c478bd9Sstevel@tonic-gate 2997c478bd9Sstevel@tonic-gate /* mem scheme member names */ 3007c478bd9Sstevel@tonic-gate #define FM_FMRI_MEM_UNUM "unum" 3017c478bd9Sstevel@tonic-gate #define FM_FMRI_MEM_SERIAL_ID "serial" 3027c478bd9Sstevel@tonic-gate #define FM_FMRI_MEM_PHYSADDR "physaddr" 303822fb41dStsien #define FM_FMRI_MEM_MEMCONFIG "memconfig" 304d00f0155Sayznaga #define FM_FMRI_MEM_OFFSET "offset" 3057c478bd9Sstevel@tonic-gate 3067c478bd9Sstevel@tonic-gate /* mod scheme member names */ 3077c478bd9Sstevel@tonic-gate #define FM_FMRI_MOD_PKG "mod-pkg" 3087c478bd9Sstevel@tonic-gate #define FM_FMRI_MOD_NAME "mod-name" 3097c478bd9Sstevel@tonic-gate #define FM_FMRI_MOD_ID "mod-id" 3107c478bd9Sstevel@tonic-gate #define FM_FMRI_MOD_DESC "mod-desc" 3117c478bd9Sstevel@tonic-gate 312ea8dc4b6Seschrock /* zfs scheme member names */ 313ea8dc4b6Seschrock #define FM_FMRI_ZFS_POOL "pool" 314ea8dc4b6Seschrock #define FM_FMRI_ZFS_VDEV "vdev" 315ea8dc4b6Seschrock 316f6e214c7SGavin Maltby /* sw scheme member names - extra indentation for members of an nvlist */ 317f6e214c7SGavin Maltby #define FM_FMRI_SW_OBJ "object" 318f6e214c7SGavin Maltby #define FM_FMRI_SW_OBJ_PATH "path" 319f6e214c7SGavin Maltby #define FM_FMRI_SW_OBJ_ROOT "root" 320f6e214c7SGavin Maltby #define FM_FMRI_SW_OBJ_PKG "pkg" 321f6e214c7SGavin Maltby #define FM_FMRI_SW_SITE "site" 322f6e214c7SGavin Maltby #define FM_FMRI_SW_SITE_TOKEN "token" 323f6e214c7SGavin Maltby #define FM_FMRI_SW_SITE_MODULE "module" 324f6e214c7SGavin Maltby #define FM_FMRI_SW_SITE_FILE "file" 325f6e214c7SGavin Maltby #define FM_FMRI_SW_SITE_LINE "line" 326f6e214c7SGavin Maltby #define FM_FMRI_SW_SITE_FUNC "func" 327f6e214c7SGavin Maltby #define FM_FMRI_SW_CTXT "context" 328f6e214c7SGavin Maltby #define FM_FMRI_SW_CTXT_ORIGIN "origin" 329f6e214c7SGavin Maltby #define FM_FMRI_SW_CTXT_EXECNAME "execname" 330f6e214c7SGavin Maltby #define FM_FMRI_SW_CTXT_PID "pid" 331f6e214c7SGavin Maltby #define FM_FMRI_SW_CTXT_ZONE "zone" 332f6e214c7SGavin Maltby #define FM_FMRI_SW_CTXT_CTID "ctid" 333f6e214c7SGavin Maltby #define FM_FMRI_SW_CTXT_STACK "stack" 334f6e214c7SGavin Maltby 335*c5591576SRob Johnston /* path scheme member names */ 336*c5591576SRob Johnston #define FM_FMRI_PATH_VERSION "path-scheme-version" 337*c5591576SRob Johnston #define FM_FMRI_PATH "path" 338*c5591576SRob Johnston #define FM_FMRI_PATH_NAME "path-name" 339*c5591576SRob Johnston #define FM_FMRI_PATH_INST "path-instance" 340*c5591576SRob Johnston #define FM_FMRI_PATH_DIGRAPH_SCHEME "path-digraph-scheme" 341*c5591576SRob Johnston 3427c478bd9Sstevel@tonic-gate extern nv_alloc_t *fm_nva_xcreate(char *, size_t); 3437c478bd9Sstevel@tonic-gate extern void fm_nva_xdestroy(nv_alloc_t *); 3447c478bd9Sstevel@tonic-gate 3457c478bd9Sstevel@tonic-gate extern nvlist_t *fm_nvlist_create(nv_alloc_t *); 3467c478bd9Sstevel@tonic-gate extern void fm_nvlist_destroy(nvlist_t *, int); 3477c478bd9Sstevel@tonic-gate 3487c478bd9Sstevel@tonic-gate #define FM_NVA_FREE 0 /* free allocator on nvlist_destroy */ 3497c478bd9Sstevel@tonic-gate #define FM_NVA_RETAIN 1 /* keep allocator on nvlist_destroy */ 3507c478bd9Sstevel@tonic-gate 3517c478bd9Sstevel@tonic-gate extern void fm_ereport_set(nvlist_t *, int, const char *, uint64_t, 3527c478bd9Sstevel@tonic-gate const nvlist_t *, ...); 3537c478bd9Sstevel@tonic-gate extern void fm_payload_set(nvlist_t *, ...); 3547c478bd9Sstevel@tonic-gate extern int i_fm_payload_set(nvlist_t *, const char *, va_list); 3557aec1d6eScindi extern void fm_fmri_hc_set(nvlist_t *, int, const nvlist_t *, nvlist_t *, 3567aec1d6eScindi int, ...); 3577c478bd9Sstevel@tonic-gate extern void fm_fmri_dev_set(nvlist_t *, int, const nvlist_t *, const char *, 358392e836bSGavin Maltby const char *, const char *); 3597c478bd9Sstevel@tonic-gate extern void fm_fmri_de_set(nvlist_t *, int, const nvlist_t *, const char *); 3607c478bd9Sstevel@tonic-gate extern void fm_fmri_cpu_set(nvlist_t *, int, const nvlist_t *, uint32_t, 3617aec1d6eScindi uint8_t *, const char *); 3627c478bd9Sstevel@tonic-gate extern void fm_fmri_mem_set(nvlist_t *, int, const nvlist_t *, const char *, 363d00f0155Sayznaga const char *, uint64_t); 3647c478bd9Sstevel@tonic-gate extern void fm_authority_set(nvlist_t *, int, const char *, const char *, 3657c478bd9Sstevel@tonic-gate const char *, const char *); 366ea8dc4b6Seschrock extern void fm_fmri_zfs_set(nvlist_t *, int, uint64_t, uint64_t); 367074bb90dSTom Pothier extern void fm_fmri_hc_create(nvlist_t *, int, const nvlist_t *, nvlist_t *, 368074bb90dSTom Pothier nvlist_t *, int, ...); 3697c478bd9Sstevel@tonic-gate 3707c478bd9Sstevel@tonic-gate extern uint64_t fm_ena_increment(uint64_t); 3717c478bd9Sstevel@tonic-gate extern uint64_t fm_ena_generate(uint64_t, uchar_t); 3727c478bd9Sstevel@tonic-gate extern uint64_t fm_ena_generate_cpu(uint64_t, processorid_t, uchar_t); 3737c478bd9Sstevel@tonic-gate extern uint64_t fm_ena_generation_get(uint64_t); 3747c478bd9Sstevel@tonic-gate extern uchar_t fm_ena_format_get(uint64_t); 3757c478bd9Sstevel@tonic-gate extern uint64_t fm_ena_id_get(uint64_t); 3767c478bd9Sstevel@tonic-gate extern uint64_t fm_ena_time_get(uint64_t); 3777c478bd9Sstevel@tonic-gate 3787c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3797c478bd9Sstevel@tonic-gate } 3807c478bd9Sstevel@tonic-gate #endif 3817c478bd9Sstevel@tonic-gate 3827c478bd9Sstevel@tonic-gate #endif /* _SYS_FM_PROTOCOL_H */ 383