17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
5ea8dc4beschrock * Common Development and Distribution License (the "License").
6ea8dc4beschrock * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
21d9638e5mws
227c478bdstevel@tonic-gate/*
23392e836Gavin Maltby * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
247c478bdstevel@tonic-gate */
257c478bdstevel@tonic-gate
267c478bdstevel@tonic-gate#ifndef	_SYS_FM_PROTOCOL_H
277c478bdstevel@tonic-gate#define	_SYS_FM_PROTOCOL_H
287c478bdstevel@tonic-gate
297c478bdstevel@tonic-gate#ifdef	__cplusplus
307c478bdstevel@tonic-gateextern "C" {
317c478bdstevel@tonic-gate#endif
327c478bdstevel@tonic-gate
337c478bdstevel@tonic-gate#ifdef _KERNEL
347c478bdstevel@tonic-gate#include <sys/varargs.h>
357c478bdstevel@tonic-gate#include <sys/nvpair.h>
367c478bdstevel@tonic-gate#else
377c478bdstevel@tonic-gate#include <libnvpair.h>
387c478bdstevel@tonic-gate#include <stdarg.h>
397c478bdstevel@tonic-gate#endif
407c478bdstevel@tonic-gate#include <sys/processor.h>
417c478bdstevel@tonic-gate
427c478bdstevel@tonic-gate/* FM common member names */
437c478bdstevel@tonic-gate#define	FM_CLASS			"class"
447c478bdstevel@tonic-gate#define	FM_VERSION			"version"
457c478bdstevel@tonic-gate
46f6e214cGavin Maltby/* FM protocol category 1 class names */
477c478bdstevel@tonic-gate#define	FM_EREPORT_CLASS		"ereport"
487c478bdstevel@tonic-gate#define	FM_FAULT_CLASS			"fault"
49705e9f4Stephen Hanson#define	FM_DEFECT_CLASS			"defect"
507c478bdstevel@tonic-gate#define	FM_RSRC_CLASS			"resource"
517c478bdstevel@tonic-gate#define	FM_LIST_EVENT			"list"
52f6e214cGavin Maltby#define	FM_IREPORT_CLASS		"ireport"
53d9638e5mws
54d9638e5mws/* FM list.* event class values */
557c478bdstevel@tonic-gate#define	FM_LIST_SUSPECT_CLASS		FM_LIST_EVENT ".suspect"
56d9638e5mws#define	FM_LIST_ISOLATED_CLASS		FM_LIST_EVENT ".isolated"
57d9638e5mws#define	FM_LIST_REPAIRED_CLASS		FM_LIST_EVENT ".repaired"
5825c6ff4stephh#define	FM_LIST_UPDATED_CLASS		FM_LIST_EVENT ".updated"
5925c6ff4stephh#define	FM_LIST_RESOLVED_CLASS		FM_LIST_EVENT ".resolved"
607c478bdstevel@tonic-gate
617c478bdstevel@tonic-gate/* ereport class subcategory values */
627c478bdstevel@tonic-gate#define	FM_ERROR_CPU			"cpu"
637c478bdstevel@tonic-gate#define	FM_ERROR_IO			"io"
647c478bdstevel@tonic-gate
657c478bdstevel@tonic-gate/* ereport version and payload member names */
667c478bdstevel@tonic-gate#define	FM_EREPORT_VERS0		0
677c478bdstevel@tonic-gate#define	FM_EREPORT_VERSION		FM_EREPORT_VERS0
687c478bdstevel@tonic-gate
697c478bdstevel@tonic-gate/* ereport payload member names */
707c478bdstevel@tonic-gate#define	FM_EREPORT_DETECTOR		"detector"
717c478bdstevel@tonic-gate#define	FM_EREPORT_ENA			"ena"
727c478bdstevel@tonic-gate
73d9638e5mws/* list.* event payload member names */
747c478bdstevel@tonic-gate#define	FM_LIST_EVENT_SIZE		"list-sz"
757c478bdstevel@tonic-gate
76f6e214cGavin Maltby/* ireport.* event payload member names */
77f6e214cGavin Maltby#define	FM_IREPORT_DETECTOR		"detector"
78f6e214cGavin Maltby#define	FM_IREPORT_UUID			"uuid"
79f6e214cGavin Maltby#define	FM_IREPORT_PRIORITY		"pri"
80f6e214cGavin Maltby#define	FM_IREPORT_ATTRIBUTES		"attr"
81f6e214cGavin Maltby
8225c6ff4stephh/*
8325c6ff4stephh * list.suspect, isolated, updated, repaired and resolved
8425c6ff4stephh * versions/payload member names.
8525c6ff4stephh */
867c478bdstevel@tonic-gate#define	FM_SUSPECT_UUID			"uuid"
877c478bdstevel@tonic-gate#define	FM_SUSPECT_DIAG_CODE		"code"
887c478bdstevel@tonic-gate#define	FM_SUSPECT_DIAG_TIME		"diag-time"
897c478bdstevel@tonic-gate#define	FM_SUSPECT_DE			"de"
907c478bdstevel@tonic-gate#define	FM_SUSPECT_FAULT_LIST		"fault-list"
917c478bdstevel@tonic-gate#define	FM_SUSPECT_FAULT_SZ		"fault-list-sz"
92d9638e5mws#define	FM_SUSPECT_FAULT_STATUS		"fault-status"
93540db9aStephen Hanson#define	FM_SUSPECT_INJECTED		"__injected"
947c478bdstevel@tonic-gate#define	FM_SUSPECT_MESSAGE		"message"
95b7d3956stephh#define	FM_SUSPECT_RETIRE		"retire"
96b7d3956stephh#define	FM_SUSPECT_RESPONSE		"response"
9788045cfRobert Johnston#define	FM_SUSPECT_SEVERITY		"severity"
987c478bdstevel@tonic-gate
997c478bdstevel@tonic-gate#define	FM_SUSPECT_VERS0		0
1007c478bdstevel@tonic-gate#define	FM_SUSPECT_VERSION		FM_SUSPECT_VERS0
1017c478bdstevel@tonic-gate
1024474369stephh#define	FM_SUSPECT_FAULTY		0x1
1034474369stephh#define	FM_SUSPECT_UNUSABLE		0x2
1044474369stephh#define	FM_SUSPECT_NOT_PRESENT		0x4
10525c6ff4stephh#define	FM_SUSPECT_DEGRADED		0x8
10625c6ff4stephh#define	FM_SUSPECT_REPAIRED		0x10
10725c6ff4stephh#define	FM_SUSPECT_REPLACED		0x20
10825c6ff4stephh#define	FM_SUSPECT_ACQUITTED		0x40
1094474369stephh
1107c478bdstevel@tonic-gate/* fault event versions and payload member names */
1117c478bdstevel@tonic-gate#define	FM_FAULT_VERS0			0
1127c478bdstevel@tonic-gate#define	FM_FAULT_VERSION		FM_FAULT_VERS0
1137c478bdstevel@tonic-gate
1147c478bdstevel@tonic-gate#define	FM_FAULT_ASRU			"asru"
1157c478bdstevel@tonic-gate#define	FM_FAULT_FRU			"fru"
1167c478bdstevel@tonic-gate#define	FM_FAULT_FRU_LABEL		"fru-label"
1177c478bdstevel@tonic-gate#define	FM_FAULT_CERTAINTY		"certainty"
1187c478bdstevel@tonic-gate#define	FM_FAULT_RESOURCE		"resource"
1199dd0f81cindi#define	FM_FAULT_LOCATION		"location"
1207c478bdstevel@tonic-gate
1217c478bdstevel@tonic-gate/* resource event versions and payload member names */
1227c478bdstevel@tonic-gate#define	FM_RSRC_VERS0			0
1237c478bdstevel@tonic-gate#define	FM_RSRC_VERSION			FM_RSRC_VERS0
1247c478bdstevel@tonic-gate#define	FM_RSRC_RESOURCE		"resource"
1257c478bdstevel@tonic-gate
126d9638e5mws/* resource.fm.asru.* payload member names */
1277c478bdstevel@tonic-gate#define	FM_RSRC_ASRU_UUID		"uuid"
128d9638e5mws#define	FM_RSRC_ASRU_CODE		"code"
1297c478bdstevel@tonic-gate#define	FM_RSRC_ASRU_FAULTY		"faulty"
13025c6ff4stephh#define	FM_RSRC_ASRU_REPAIRED		"repaired"
13125c6ff4stephh#define	FM_RSRC_ASRU_REPLACED		"replaced"
13225c6ff4stephh#define	FM_RSRC_ASRU_ACQUITTED		"acquitted"
1335750ef5Stephen Hanson#define	FM_RSRC_ASRU_RESOLVED		"resolved"
1347c478bdstevel@tonic-gate#define	FM_RSRC_ASRU_UNUSABLE		"unusable"
1357c478bdstevel@tonic-gate#define	FM_RSRC_ASRU_EVENT		"event"
1367c478bdstevel@tonic-gate
137d9638e5mws/* resource.fm.xprt.* versions and payload member names */
138d9638e5mws#define	FM_RSRC_XPRT_VERS0		0
139d9638e5mws#define	FM_RSRC_XPRT_VERSION		FM_RSRC_XPRT_VERS0
140d9638e5mws#define	FM_RSRC_XPRT_UUID		"uuid"
141d9638e5mws#define	FM_RSRC_XPRT_SUBCLASS		"subclass"
142cbf75e6Stephen Hanson#define	FM_RSRC_XPRT_FAULT_STATUS	"fault-status"
143cbf75e6Stephen Hanson#define	FM_RSRC_XPRT_FAULT_HAS_ASRU	"fault-has-asru"
144d9638e5mws
1457c478bdstevel@tonic-gate/*
1467c478bdstevel@tonic-gate * FM ENA Format Macros
1477c478bdstevel@tonic-gate */
1487c478bdstevel@tonic-gate#define	ENA_FORMAT_MASK			0x3
1497c478bdstevel@tonic-gate#define	ENA_FORMAT(ena)			((ena) & ENA_FORMAT_MASK)
1507c478bdstevel@tonic-gate
1517c478bdstevel@tonic-gate/* ENA format types */
1527c478bdstevel@tonic-gate#define	FM_ENA_FMT0			0
1537c478bdstevel@tonic-gate#define	FM_ENA_FMT1			1
1547c478bdstevel@tonic-gate#define	FM_ENA_FMT2			2
1557c478bdstevel@tonic-gate
1567c478bdstevel@tonic-gate/* Format 1 */
1577c478bdstevel@tonic-gate#define	ENA_FMT1_GEN_MASK		0x00000000000003FCull
1587c478bdstevel@tonic-gate#define	ENA_FMT1_ID_MASK		0xFFFFFFFFFFFFFC00ull
1597c478bdstevel@tonic-gate#define	ENA_FMT1_CPUID_MASK		0x00000000000FFC00ull
1607c478bdstevel@tonic-gate#define	ENA_FMT1_TIME_MASK		0xFFFFFFFFFFF00000ull
1617c478bdstevel@tonic-gate#define	ENA_FMT1_GEN_SHFT		2
1627c478bdstevel@tonic-gate#define	ENA_FMT1_ID_SHFT		10
1637c478bdstevel@tonic-gate#define	ENA_FMT1_CPUID_SHFT		ENA_FMT1_ID_SHFT
1647c478bdstevel@tonic-gate#define	ENA_FMT1_TIME_SHFT		20
1657c478bdstevel@tonic-gate
1667c478bdstevel@tonic-gate/* Format 2 */
1677c478bdstevel@tonic-gate#define	ENA_FMT2_GEN_MASK		0x00000000000003FCull
1687c478bdstevel@tonic-gate#define	ENA_FMT2_ID_MASK		0xFFFFFFFFFFFFFC00ull
1697c478bdstevel@tonic-gate#define	ENA_FMT2_TIME_MASK		ENA_FMT2_ID_MASK
1707c478bdstevel@tonic-gate#define	ENA_FMT2_GEN_SHFT		2
1717c478bdstevel@tonic-gate#define	ENA_FMT2_ID_SHFT		10
1727c478bdstevel@tonic-gate#define	ENA_FMT2_TIME_SHFT		ENA_FMT2_ID_SHFT
1737c478bdstevel@tonic-gate
1747c478bdstevel@tonic-gate/* Common FMRI type names */
1757c478bdstevel@tonic-gate#define	FM_FMRI_AUTHORITY		"authority"
1767c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME			"scheme"
1777c478bdstevel@tonic-gate#define	FM_FMRI_SVC_AUTHORITY		"svc-authority"
178825ba0frobj#define	FM_FMRI_FACILITY		"facility"
1797c478bdstevel@tonic-gate
1807c478bdstevel@tonic-gate/* FMRI authority-type member names */
1817c478bdstevel@tonic-gate#define	FM_FMRI_AUTH_CHASSIS		"chassis-id"
1829c94f15Cheng Sean Ye#define	FM_FMRI_AUTH_PRODUCT_SN		"product-sn"
1837c478bdstevel@tonic-gate#define	FM_FMRI_AUTH_PRODUCT		"product-id"
1847c478bdstevel@tonic-gate#define	FM_FMRI_AUTH_DOMAIN		"domain-id"
1857c478bdstevel@tonic-gate#define	FM_FMRI_AUTH_SERVER		"server-id"
1867c478bdstevel@tonic-gate#define	FM_FMRI_AUTH_HOST		"host-id"
1877c478bdstevel@tonic-gate
1887c478bdstevel@tonic-gate#define	FM_AUTH_VERS0			0
1897c478bdstevel@tonic-gate#define	FM_FMRI_AUTH_VERSION		FM_AUTH_VERS0
1907c478bdstevel@tonic-gate
1917c478bdstevel@tonic-gate/* scheme name values */
1927c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_FMD		"fmd"
1937c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_DEV		"dev"
1947c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_HC		"hc"
1957c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_SVC		"svc"
1967c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_CPU		"cpu"
1977c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_MEM		"mem"
1987c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_MOD		"mod"
1997c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_PKG		"pkg"
2007c478bdstevel@tonic-gate#define	FM_FMRI_SCHEME_LEGACY		"legacy-hc"
201ea8dc4beschrock#define	FM_FMRI_SCHEME_ZFS		"zfs"
202f6e214cGavin Maltby#define	FM_FMRI_SCHEME_SW		"sw"
2037c478bdstevel@tonic-gate
2047c478bdstevel@tonic-gate/* Scheme versions */
2057c478bdstevel@tonic-gate#define	FMD_SCHEME_VERSION0		0
2067c478bdstevel@tonic-gate#define	FM_FMD_SCHEME_VERSION		FMD_SCHEME_VERSION0
2077c478bdstevel@tonic-gate#define	DEV_SCHEME_VERSION0		0
2087c478bdstevel@tonic-gate#define	FM_DEV_SCHEME_VERSION		DEV_SCHEME_VERSION0
2097c478bdstevel@tonic-gate#define	FM_HC_VERS0			0
2107c478bdstevel@tonic-gate#define	FM_HC_SCHEME_VERSION		FM_HC_VERS0
2117c478bdstevel@tonic-gate#define	CPU_SCHEME_VERSION0		0
2127aec1d6cindi#define	CPU_SCHEME_VERSION1		1
2137aec1d6cindi#define	FM_CPU_SCHEME_VERSION		CPU_SCHEME_VERSION1
2147c478bdstevel@tonic-gate#define	MEM_SCHEME_VERSION0		0
2157c478bdstevel@tonic-gate#define	FM_MEM_SCHEME_VERSION		MEM_SCHEME_VERSION0
2167c478bdstevel@tonic-gate#define	MOD_SCHEME_VERSION0		0
2177c478bdstevel@tonic-gate#define	FM_MOD_SCHEME_VERSION		MOD_SCHEME_VERSION0
2187c478bdstevel@tonic-gate#define	PKG_SCHEME_VERSION0		0
2197c478bdstevel@tonic-gate#define	FM_PKG_SCHEME_VERSION		PKG_SCHEME_VERSION0
2207c478bdstevel@tonic-gate#define	LEGACY_SCHEME_VERSION0		0
2217c478bdstevel@tonic-gate#define	FM_LEGACY_SCHEME_VERSION	LEGACY_SCHEME_VERSION0
22295efa35Eric Schrock#define	SVC_SCHEME_VERSION0		0
22395efa35Eric Schrock#define	FM_SVC_SCHEME_VERSION		SVC_SCHEME_VERSION0
224ea8dc4beschrock#define	ZFS_SCHEME_VERSION0		0
225ea8dc4beschrock#define	FM_ZFS_SCHEME_VERSION		ZFS_SCHEME_VERSION0
226f6e214cGavin Maltby#define	SW_SCHEME_VERSION0		0
227f6e214cGavin Maltby#define	FM_SW_SCHEME_VERSION		SW_SCHEME_VERSION0
2287c478bdstevel@tonic-gate
2297c478bdstevel@tonic-gate/* hc scheme member names */
2307c478bdstevel@tonic-gate#define	FM_FMRI_HC_SERIAL_ID		"serial"
2317c478bdstevel@tonic-gate#define	FM_FMRI_HC_PART			"part"
2327c478bdstevel@tonic-gate#define	FM_FMRI_HC_REVISION		"revision"
2337c478bdstevel@tonic-gate#define	FM_FMRI_HC_ROOT			"hc-root"
2347c478bdstevel@tonic-gate#define	FM_FMRI_HC_LIST_SZ		"hc-list-sz"
2357c478bdstevel@tonic-gate#define	FM_FMRI_HC_LIST			"hc-list"
2367aec1d6cindi#define	FM_FMRI_HC_SPECIFIC		"hc-specific"
2377c478bdstevel@tonic-gate
238825ba0frobj/* facility member names */
239825ba0frobj#define	FM_FMRI_FACILITY_NAME		"facility-name"
240825ba0frobj#define	FM_FMRI_FACILITY_TYPE		"facility-type"
241825ba0frobj
2427c478bdstevel@tonic-gate/* hc-list version and member names */
2437c478bdstevel@tonic-gate#define	FM_FMRI_HC_NAME			"hc-name"
2447c478bdstevel@tonic-gate#define	FM_FMRI_HC_ID			"hc-id"
2457c478bdstevel@tonic-gate
2467c478bdstevel@tonic-gate#define	HC_LIST_VERSION0		0
2477c478bdstevel@tonic-gate#define	FM_HC_LIST_VERSION		HC_LIST_VERSION0
2487c478bdstevel@tonic-gate
2497aec1d6cindi/* hc-specific member names */
2507aec1d6cindi#define	FM_FMRI_HC_SPECIFIC_OFFSET	"offset"
251e4b8688Cheng Sean Ye#define	FM_FMRI_HC_SPECIFIC_PHYSADDR	"physaddr"
2527aec1d6cindi
2537c478bdstevel@tonic-gate/* fmd module scheme member names */
2547c478bdstevel@tonic-gate#define	FM_FMRI_FMD_NAME		"mod-name"
2557c478bdstevel@tonic-gate#define	FM_FMRI_FMD_VERSION		"mod-version"
2567c478bdstevel@tonic-gate
2577c478bdstevel@tonic-gate/* dev scheme member names */
2587c478bdstevel@tonic-gate#define	FM_FMRI_DEV_ID			"devid"
259392e836Gavin Maltby#define	FM_FMRI_DEV_TGTPTLUN0		"target-port-l0id"
2607c478bdstevel@tonic-gate#define	FM_FMRI_DEV_PATH		"device-path"
2617c478bdstevel@tonic-gate
2627c478bdstevel@tonic-gate/* pkg scheme member names */
2637c478bdstevel@tonic-gate#define	FM_FMRI_PKG_BASEDIR		"pkg-basedir"
2647c478bdstevel@tonic-gate#define	FM_FMRI_PKG_INST		"pkg-inst"
2657c478bdstevel@tonic-gate#define	FM_FMRI_PKG_VERSION		"pkg-version"
2667c478bdstevel@tonic-gate
2677c478bdstevel@tonic-gate/* svc scheme member names */
26895efa35Eric Schrock#define	FM_FMRI_SVC_NAME		"svc-name"
26995efa35Eric Schrock#define	FM_FMRI_SVC_INSTANCE		"svc-instance"
27095efa35Eric Schrock#define	FM_FMRI_SVC_CONTRACT_ID		"svc-contract-id"
2717c478bdstevel@tonic-gate
2727c478bdstevel@tonic-gate/* svc-authority member names */
2737c478bdstevel@tonic-gate#define	FM_FMRI_SVC_AUTH_SCOPE		"scope"
27495efa35Eric Schrock#define	FM_FMRI_SVC_AUTH_SYSTEM_FQN	"system-fqn"
2757c478bdstevel@tonic-gate
2767c478bdstevel@tonic-gate/* cpu scheme member names */
2777c478bdstevel@tonic-gate#define	FM_FMRI_CPU_ID			"cpuid"
2787c478bdstevel@tonic-gate#define	FM_FMRI_CPU_SERIAL_ID		"serial"
2797c478bdstevel@tonic-gate#define	FM_FMRI_CPU_MASK		"cpumask"
2806dfee48tsien#define	FM_FMRI_CPU_VID			"cpuvid"
2816dfee48tsien#define	FM_FMRI_CPU_CPUFRU		"cpufru"
2827bebe46jc#define	FM_FMRI_CPU_CACHE_INDEX		"cacheindex"
2837bebe46jc#define	FM_FMRI_CPU_CACHE_WAY		"cacheway"
2847bebe46jc#define	FM_FMRI_CPU_CACHE_BIT		"cachebit"
2857bebe46jc#define	FM_FMRI_CPU_CACHE_TYPE		"cachetype"
2867bebe46jc
2877bebe46jc#define	FM_FMRI_CPU_CACHE_TYPE_L2	0
2887bebe46jc#define	FM_FMRI_CPU_CACHE_TYPE_L3	1
2897c478bdstevel@tonic-gate
2907c478bdstevel@tonic-gate/* legacy-hc scheme member names */
2917c478bdstevel@tonic-gate#define	FM_FMRI_LEGACY_HC		"component"
2929dd0f81cindi#define	FM_FMRI_LEGACY_HC_PREFIX	FM_FMRI_SCHEME_HC":///" \
2939dd0f81cindi    FM_FMRI_LEGACY_HC"="
2947c478bdstevel@tonic-gate
2957c478bdstevel@tonic-gate/* mem scheme member names */
2967c478bdstevel@tonic-gate#define	FM_FMRI_MEM_UNUM		"unum"
2977c478bdstevel@tonic-gate#define	FM_FMRI_MEM_SERIAL_ID		"serial"
2987c478bdstevel@tonic-gate#define	FM_FMRI_MEM_PHYSADDR		"physaddr"
299822fb41tsien#define	FM_FMRI_MEM_MEMCONFIG		"memconfig"
300d00f015ayznaga#define	FM_FMRI_MEM_OFFSET		"offset"
3017c478bdstevel@tonic-gate
3027c478bdstevel@tonic-gate/* mod scheme member names */
3037c478bdstevel@tonic-gate#define	FM_FMRI_MOD_PKG			"mod-pkg"
3047c478bdstevel@tonic-gate#define	FM_FMRI_MOD_NAME		"mod-name"
3057c478bdstevel@tonic-gate#define	FM_FMRI_MOD_ID			"mod-id"
3067c478bdstevel@tonic-gate#define	FM_FMRI_MOD_DESC		"mod-desc"
3077c478bdstevel@tonic-gate
308ea8dc4beschrock/* zfs scheme member names */
309ea8dc4beschrock#define	FM_FMRI_ZFS_POOL		"pool"
310ea8dc4beschrock#define	FM_FMRI_ZFS_VDEV		"vdev"
311ea8dc4beschrock
312f6e214cGavin Maltby/* sw scheme member names - extra indentation for members of an nvlist */
313f6e214cGavin Maltby#define	FM_FMRI_SW_OBJ			"object"
314f6e214cGavin Maltby#define	FM_FMRI_SW_OBJ_PATH			"path"
315f6e214cGavin Maltby#define	FM_FMRI_SW_OBJ_ROOT			"root"
316f6e214cGavin Maltby#define	FM_FMRI_SW_OBJ_PKG			"pkg"
317f6e214cGavin Maltby#define	FM_FMRI_SW_SITE			"site"
318f6e214cGavin Maltby#define	FM_FMRI_SW_SITE_TOKEN			"token"
319f6e214cGavin Maltby#define	FM_FMRI_SW_SITE_MODULE			"module"
320f6e214cGavin Maltby#define	FM_FMRI_SW_SITE_FILE			"file"
321f6e214cGavin Maltby#define	FM_FMRI_SW_SITE_LINE			"line"
322f6e214cGavin Maltby#define	FM_FMRI_SW_SITE_FUNC			"func"
323f6e214cGavin Maltby#define	FM_FMRI_SW_CTXT			"context"
324f6e214cGavin Maltby#define	FM_FMRI_SW_CTXT_ORIGIN			"origin"
325f6e214cGavin Maltby#define	FM_FMRI_SW_CTXT_EXECNAME		"execname"
326f6e214cGavin Maltby#define	FM_FMRI_SW_CTXT_PID			"pid"
327f6e214cGavin Maltby#define	FM_FMRI_SW_CTXT_ZONE			"zone"
328f6e214cGavin Maltby#define	FM_FMRI_SW_CTXT_CTID			"ctid"
329f6e214cGavin Maltby#define	FM_FMRI_SW_CTXT_STACK			"stack"
330f6e214cGavin Maltby
3317c478bdstevel@tonic-gateextern nv_alloc_t *fm_nva_xcreate(char *, size_t);
3327c478bdstevel@tonic-gateextern void fm_nva_xdestroy(nv_alloc_t *);
3337c478bdstevel@tonic-gate
3347c478bdstevel@tonic-gateextern nvlist_t *fm_nvlist_create(nv_alloc_t *);
3357c478bdstevel@tonic-gateextern void fm_nvlist_destroy(nvlist_t *, int);
3367c478bdstevel@tonic-gate
3377c478bdstevel@tonic-gate#define	FM_NVA_FREE	0		/* free allocator on nvlist_destroy */
3387c478bdstevel@tonic-gate#define	FM_NVA_RETAIN	1		/* keep allocator on nvlist_destroy */
3397c478bdstevel@tonic-gate
3407c478bdstevel@tonic-gateextern void fm_ereport_set(nvlist_t *, int, const char *, uint64_t,
3417c478bdstevel@tonic-gate    const nvlist_t *, ...);
3427c478bdstevel@tonic-gateextern void fm_payload_set(nvlist_t *, ...);
3437c478bdstevel@tonic-gateextern int i_fm_payload_set(nvlist_t *, const char *, va_list);
3447aec1d6cindiextern void fm_fmri_hc_set(nvlist_t *, int, const nvlist_t *, nvlist_t *,
3457aec1d6cindi    int, ...);
3467c478bdstevel@tonic-gateextern void fm_fmri_dev_set(nvlist_t *, int, const nvlist_t *, const char *,
347392e836Gavin Maltby    const char *, const char *);
3487c478bdstevel@tonic-gateextern void fm_fmri_de_set(nvlist_t *, int, const nvlist_t *, const char *);
3497c478bdstevel@tonic-gateextern void fm_fmri_cpu_set(nvlist_t *, int, const nvlist_t *, uint32_t,
3507aec1d6cindi    uint8_t *, const char *);
3517c478bdstevel@tonic-gateextern void fm_fmri_mem_set(nvlist_t *, int, const nvlist_t *, const char *,
352d00f015ayznaga    const char *, uint64_t);
3537c478bdstevel@tonic-gateextern void fm_authority_set(nvlist_t *, int, const char *, const char *,
3547c478bdstevel@tonic-gate    const char *, const char *);
355ea8dc4beschrockextern void fm_fmri_zfs_set(nvlist_t *, int, uint64_t, uint64_t);
356074bb90Tom Pothierextern void fm_fmri_hc_create(nvlist_t *, int, const nvlist_t *, nvlist_t *,
357074bb90Tom Pothier    nvlist_t *, int, ...);
3587c478bdstevel@tonic-gate
3597c478bdstevel@tonic-gateextern uint64_t fm_ena_increment(uint64_t);
3607c478bdstevel@tonic-gateextern uint64_t fm_ena_generate(uint64_t, uchar_t);
3617c478bdstevel@tonic-gateextern uint64_t fm_ena_generate_cpu(uint64_t, processorid_t, uchar_t);
3627c478bdstevel@tonic-gateextern uint64_t fm_ena_generation_get(uint64_t);
3637c478bdstevel@tonic-gateextern uchar_t fm_ena_format_get(uint64_t);
3647c478bdstevel@tonic-gateextern uint64_t fm_ena_id_get(uint64_t);
3657c478bdstevel@tonic-gateextern uint64_t fm_ena_time_get(uint64_t);
3667c478bdstevel@tonic-gate
3677c478bdstevel@tonic-gate#ifdef	__cplusplus
3687c478bdstevel@tonic-gate}
3697c478bdstevel@tonic-gate#endif
3707c478bdstevel@tonic-gate
3717c478bdstevel@tonic-gate#endif /* _SYS_FM_PROTOCOL_H */
372