10eb822a1Scindi /*
20eb822a1Scindi  * CDDL HEADER START
30eb822a1Scindi  *
40eb822a1Scindi  * The contents of this file are subject to the terms of the
50eb822a1Scindi  * Common Development and Distribution License (the "License").
60eb822a1Scindi  * You may not use this file except in compliance with the License.
70eb822a1Scindi  *
80eb822a1Scindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90eb822a1Scindi  * or http://www.opensolaris.org/os/licensing.
100eb822a1Scindi  * See the License for the specific language governing permissions
110eb822a1Scindi  * and limitations under the License.
120eb822a1Scindi  *
130eb822a1Scindi  * When distributing Covered Code, include this CDDL HEADER in each
140eb822a1Scindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150eb822a1Scindi  * If applicable, add the following below this CDDL HEADER, with the
160eb822a1Scindi  * fields enclosed by brackets "[]" replaced with your own identifying
170eb822a1Scindi  * information: Portions Copyright [yyyy] [name of copyright owner]
180eb822a1Scindi  *
190eb822a1Scindi  * CDDL HEADER END
200eb822a1Scindi  */
210eb822a1Scindi 
220eb822a1Scindi /*
2344ed9dbbSStephen Hanson  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
24*3c6ffbabSRob Johnston  * Copyright 2020 Joyent, Inc.
250eb822a1Scindi  */
260eb822a1Scindi 
270eb822a1Scindi #ifndef _TOPO_HC_H
280eb822a1Scindi #define	_TOPO_HC_H
290eb822a1Scindi 
300eb822a1Scindi #ifdef	__cplusplus
310eb822a1Scindi extern "C" {
320eb822a1Scindi #endif
330eb822a1Scindi 
340eb822a1Scindi /*
350eb822a1Scindi  * Allowable hardware component names for hc FMRIs
360eb822a1Scindi  */
37908f1e13Ssd #define	BANK		"bank"
38184cd04cScth #define	BAY		"bay"
39908f1e13Ssd #define	BLADE		"blade"
4014ea4bb7Ssd #define	BRANCH		"branch"
410eb822a1Scindi #define	CMP		"CMP"
420eb822a1Scindi #define	CENTERPLANE	"centerplane"
430eb822a1Scindi #define	CHASSIS		"chassis"
440eb822a1Scindi #define	CHIP		"chip"
45dc90e123SRobert Mustacchi #define	CHIPSET		"chipset"
46908f1e13Ssd #define	CORE		"core"
47e3d60c9bSAdrian Frost #define	STRAND		"strand"
48e3d60c9bSAdrian Frost #define	CHIP_SELECT	"chip-select"
49940d71d2Seschrock #define	CONTROLLER	"controller"
500eb822a1Scindi #define	CPU		"cpu"
5113faa912Ssd #define	CPUBOARD	"cpuboard"
520eb822a1Scindi #define	DIMM		"dimm"
530eb822a1Scindi #define	DISK		"disk"
54908f1e13Ssd #define	DRAM		"dram"
550eb822a1Scindi #define	DRAMCHANNEL	"dram-channel"
562eeaed14Srobj #define	FAN		"fan"
57ded93414SHyon Kim #define	FANBOARD	"fanboard"
582eeaed14Srobj #define	FANMODULE	"fanmodule"
59fc333478STom Pothier #define	HBA		"hba"
600eb822a1Scindi #define	HOSTBRIDGE	"hostbridge"
610eb822a1Scindi #define	INTERCONNECT	"interconnect"
620eb822a1Scindi #define	IOBOARD		"ioboard"
63ac88567aSHyon Kim #define	IPORT		"iport"
6413faa912Ssd #define	MEMBOARD	"memboard"
65908f1e13Ssd #define	MEMORYBUFFER	"memory-buffer"
660eb822a1Scindi #define	MEMORYCONTROL	"memory-controller"
67908f1e13Ssd #define	MICROCORE	"micro-core"
680eb822a1Scindi #define	MOTHERBOARD	"motherboard"
6914ea4bb7Ssd #define	NIU		"niu"
7014ea4bb7Ssd #define	NIUFN		"niufn"
71*3c6ffbabSRob Johnston #define	NVME		"nvme"
720eb822a1Scindi #define	PCI_BUS		"pcibus"
730eb822a1Scindi #define	PCI_DEVICE	"pcidev"
740eb822a1Scindi #define	PCI_FUNCTION    "pcifn"
750eb822a1Scindi #define	PCIEX_BUS	"pciexbus"
760eb822a1Scindi #define	PCIEX_DEVICE	"pciexdev"
770eb822a1Scindi #define	PCIEX_FUNCTION  "pciexfn"
780eb822a1Scindi #define	PCIEX_ROOT	"pciexrc"
790eb822a1Scindi #define	PCIEX_SWUP	"pciexswu"
800eb822a1Scindi #define	PCIEX_SWDWN	"pciexswd"
8145d3dd98SRobert Mustacchi #define	PORT		"port"
82ded93414SHyon Kim #define	POWERBOARD	"powerboard"
832eeaed14Srobj #define	POWERMODULE	"powermodule"
842eeaed14Srobj #define	PSU		"psu"
850eb822a1Scindi #define	RANK		"rank"
86ac88567aSHyon Kim #define	RECEPTACLE	"receptacle"
87908f1e13Ssd #define	RISER		"riser"
88ac88567aSHyon Kim #define	SASEXPANDER	"sas-expander"
89908f1e13Ssd #define	SHELF		"shelf"
90ac88567aSHyon Kim #define	SCSI_DEVICE	"scsi-device"
91940d71d2Seschrock #define	SES_ENCLOSURE	"ses-enclosure"
926d65bee7SRob Johnston #define	SLOT		"slot"
93ac88567aSHyon Kim #define	SMP_DEVICE	"smp-device"
944df55fdeSJanie Lu #define	SP		"sp"
9553dbcc59SSundeep Panicker #define	SUBCHASSIS	"subchassis"
960eb822a1Scindi #define	SYSTEMBOARD	"systemboard"
9745d3dd98SRobert Mustacchi #define	TRANSCEIVER	"transceiver"
98508a0e8cSRob Johnston #define	UFM		"ufm"
99672fc84aSRobert Mustacchi #define	USB_DEVICE	"usb-device"
10014ea4bb7Ssd #define	XAUI		"xaui"
10114ea4bb7Ssd #define	XFP		"xfp"
1020eb822a1Scindi 
1030eb822a1Scindi /*
1040eb822a1Scindi  * Allowable hc node property group and property names
1050eb822a1Scindi  */
1060eb822a1Scindi #define	TOPO_PGROUP_IO		"io"
1070eb822a1Scindi #define	TOPO_IO_DEVTYPE		"devtype"
1080eb822a1Scindi #define	TOPO_IO_DRIVER		"driver"
10973797b86SRob Johnston #define	TOPO_IO_INSTANCE	"instance"
1109dd0f810Scindi #define	TOPO_IO_MODULE		"module"
1110eb822a1Scindi #define	TOPO_IO_DEV		"dev"
112602ca9eaScth #define	TOPO_IO_DEVID		"devid"
1130eb822a1Scindi #define	TOPO_IO_DEV_PATH	"devfs-path"
1140eb822a1Scindi #define	TOPO_IO_AP_PATH		"ap-path"
115602ca9eaScth #define	TOPO_IO_PHYS_PATH	"phys-path"
1160eb822a1Scindi 
1170eb822a1Scindi #define	TOPO_PGROUP_PCI		"pci"
1180eb822a1Scindi #define	TOPO_PCI_VENDID		"vendor-id"
11966d05358SRob Johnston #define	TOPO_PCI_VENDNM		"vendor-name"
12066d05358SRob Johnston #define	TOPO_PCI_SUBSYSNM	"subsystem-name"
1210eb822a1Scindi #define	TOPO_PCI_DEVID		"device-id"
12266d05358SRob Johnston #define	TOPO_PCI_DEVNM		"device-name"
1230eb822a1Scindi #define	TOPO_PCI_EXCAP		"extended-capabilities"
1240eb822a1Scindi #define	TOPO_PCI_BDF		"BDF"
1250eb822a1Scindi #define	TOPO_PCI_CLASS		"class-code"
126eae2e508Skrishnae #define	TOPO_PCI_AADDR		"assigned-addresses"
1270eb822a1Scindi 
128b3d69c05SRobert Mustacchi #define	TOPO_PCI_MAX_WIDTH	"link-maximum-width"
129b3d69c05SRobert Mustacchi #define	TOPO_PCI_CUR_WIDTH	"link-current-width"
130b3d69c05SRobert Mustacchi #define	TOPO_PCI_MAX_SPEED	"link-maximum-speed"
131b3d69c05SRobert Mustacchi #define	TOPO_PCI_CUR_SPEED	"link-current-speed"
132b3d69c05SRobert Mustacchi #define	TOPO_PCI_SUP_SPEED	"link-supported-speeds"
133b3d69c05SRobert Mustacchi #define	TOPO_PCI_ADMIN_SPEED	"link-admin-target-speed"
134b3d69c05SRobert Mustacchi 
135ac88567aSHyon Kim #define	TOPO_PGROUP_BINDING	"binding"
136ac88567aSHyon Kim #define	TOPO_BINDING_OCCUPANT	"occupant-path"
137aed5247fSJoshua M. Clulow #define	TOPO_BINDING_DRIVER	"driver"
138aed5247fSJoshua M. Clulow #define	TOPO_BINDING_DEVCTL	"devctl"
139aed5247fSJoshua M. Clulow #define	TOPO_BINDING_ENCLOSURE	"enclosure"
140aed5247fSJoshua M. Clulow #define	TOPO_BINDING_SLOT	"slot"
141e2f631f9SJordan Paige Hendricks #define	TOPO_BINDING_PORT	"port"
142*3c6ffbabSRob Johnston #define	TOPO_BINDING_PARENT_DEV	"parent-device"
143ac88567aSHyon Kim 
14444ed9dbbSStephen Hanson #define	TOPO_PGROUP_STORAGE	"storage"
145ac88567aSHyon Kim #define	TOPO_STORAGE_INITIATOR_PORT	"initiator-port"
146ac88567aSHyon Kim #define	TOPO_STORAGE_INITIATOR_PORT_PM	"initiator-port-pm"
147ac88567aSHyon Kim #define	TOPO_STORAGE_TARGET_PORT	"target-port"
14844ed9dbbSStephen Hanson #define	TOPO_STORAGE_TARGET_PORT_L0ID	"target-port-l0id"
14944ed9dbbSStephen Hanson #define	TOPO_STORAGE_TARGET_PORT_L0IDS	"target-port-l0ids"
150ac88567aSHyon Kim #define	TOPO_STORAGE_ATTACHED_PORT	"attached-port"
151ac88567aSHyon Kim #define	TOPO_STORAGE_TARGET_PORT_PM	"target-port-pm"
152ac88567aSHyon Kim #define	TOPO_STORAGE_ATTACHED_PORT_PM	"attached-port-pm"
153ac88567aSHyon Kim #define	TOPO_STORAGE_DEVID		"devid"
154ac88567aSHyon Kim #define	TOPO_STORAGE_LUN64		"lun64"
155ac88567aSHyon Kim #define	TOPO_STORAGE_DEVICE_TYPE	"inquiry-device-type"
156ac88567aSHyon Kim #define	TOPO_STORAGE_MANUFACTURER	"manufacturer"
157ac88567aSHyon Kim #define	TOPO_STORAGE_MODEL		"model"
158ac88567aSHyon Kim #define	TOPO_STORAGE_FIRMWARE_REV	"firmware-revision"
159ac88567aSHyon Kim #define	TOPO_STORAGE_SAS_PHY_MASK	"receptacle-pm"
160ac88567aSHyon Kim #define	TOPO_STORAGE_SAS_CONNECTOR_TYPE	"sas-connector-type"
16103f9f63dSTom Pothier 
162e58a33b6SStephen Hanson #define	TOPO_PGROUP_SES		"ses"
163e58a33b6SStephen Hanson /* Applied  any SES standard related topo node. */
164e58a33b6SStephen Hanson #define	TOPO_PROP_NODE_ID	"node-id"
165e58a33b6SStephen Hanson #define	TOPO_PROP_TARGET_PATH	"target-path"
166e58a33b6SStephen Hanson #define	TOPO_PROP_SES_DEVID	"ses-devid"
167e58a33b6SStephen Hanson #define	TOPO_PROP_SES_DEV_PATH	"ses-devfs-path"
168e58a33b6SStephen Hanson #define	TOPO_PROP_SES_PHYS_PATH	"ses-phys-path"
169e58a33b6SStephen Hanson #define	TOPO_PROP_SES_TARGET_PORT "ses-target-port"
170e58a33b6SStephen Hanson 
171e58a33b6SStephen Hanson #define	TOPO_PGROUP_SMP		"smp"
172e58a33b6SStephen Hanson /* host SMP target related info for an expander node. */
173e58a33b6SStephen Hanson #define	TOPO_PROP_SMP_DEVID	"smp-devid"
174e58a33b6SStephen Hanson #define	TOPO_PROP_SMP_DEV_PATH	"smp-devfs-path"
175e58a33b6SStephen Hanson #define	TOPO_PROP_SMP_PHYS_PATH	"smp-phys-path"
176e58a33b6SStephen Hanson #define	TOPO_PROP_SMP_TARGET_PORT	"smp-target-port"
177e58a33b6SStephen Hanson #define	TOPO_PROP_SAS_ADDR	"sas-address"
178e58a33b6SStephen Hanson #define	TOPO_PROP_PHY_COUNT	"phy-count"
179e58a33b6SStephen Hanson #define	TOPO_PROP_PATHS		"paths"
180e58a33b6SStephen Hanson #define	TOPO_PROP_CHASSIS_TYPE	"chassis-type"
181e58a33b6SStephen Hanson #define	TOPO_PROP_SAS_PHY_MASK	"phy-mask"
182e58a33b6SStephen Hanson #define	TOPO_PROP_SAS_CONNECTOR_TYPE	"sas-connector-type"
183e58a33b6SStephen Hanson 
18445d3dd98SRobert Mustacchi #define	TOPO_PGROUP_PORT	"port"
18545d3dd98SRobert Mustacchi #define	TOPO_PROP_PORT_TYPE	"type"
18645d3dd98SRobert Mustacchi #define	TOPO_PROP_PORT_TYPE_SFF	"sff"
187672fc84aSRobert Mustacchi #define	TOPO_PROP_PORT_TYPE_USB	"usb"
1888a2b682eSRobert Mustacchi #define	TOPO_PROP_PORT_TYPE_UNKNOWN	"unknown"
18945d3dd98SRobert Mustacchi 
19045d3dd98SRobert Mustacchi #define	TOPO_PGROUP_TRANSCEIVER	"transceiver"
19145d3dd98SRobert Mustacchi #define	TOPO_PROP_TRANSCEIVER_TYPE	"type"
19245d3dd98SRobert Mustacchi #define