1*5911Svn83148 /* 2*5911Svn83148 * CDDL HEADER START 3*5911Svn83148 * 4*5911Svn83148 * The contents of this file are subject to the terms of the 5*5911Svn83148 * Common Development and Distribution License (the "License"). 6*5911Svn83148 * You may not use this file except in compliance with the License. 7*5911Svn83148 * 8*5911Svn83148 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*5911Svn83148 * or http://www.opensolaris.org/os/licensing. 10*5911Svn83148 * See the License for the specific language governing permissions 11*5911Svn83148 * and limitations under the License. 12*5911Svn83148 * 13*5911Svn83148 * When distributing Covered Code, include this CDDL HEADER in each 14*5911Svn83148 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*5911Svn83148 * If applicable, add the following below this CDDL HEADER, with the 16*5911Svn83148 * fields enclosed by brackets "[]" replaced with your own identifying 17*5911Svn83148 * information: Portions Copyright [yyyy] [name of copyright owner] 18*5911Svn83148 * 19*5911Svn83148 * CDDL HEADER END 20*5911Svn83148 */ 21*5911Svn83148 22*5911Svn83148 /* 23*5911Svn83148 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24*5911Svn83148 * Use is subject to license terms. 25*5911Svn83148 */ 26*5911Svn83148 27*5911Svn83148 #ifndef _HB_MDESC_H 28*5911Svn83148 #define _HB_MDESC_H 29*5911Svn83148 30*5911Svn83148 #pragma ident "%Z%%M% %I% %E% SMI" 31*5911Svn83148 32*5911Svn83148 #include <fm/topo_mod.h> 33*5911Svn83148 34*5911Svn83148 #ifdef __cplusplus 35*5911Svn83148 extern "C" { 36*5911Svn83148 #endif 37*5911Svn83148 38*5911Svn83148 /* 39*5911Svn83148 * Node/Field names in the PRI/MD 40*5911Svn83148 */ 41*5911Svn83148 #define MD_STR_ID "id" 42*5911Svn83148 #define MD_STR_IODEVICE "iodevice" 43*5911Svn83148 #define MD_STR_DEVICE_TYPE "device-type" 44*5911Svn83148 #define MD_STR_PCIEX "pciex" 45*5911Svn83148 #define MD_STR_CFGHDL "cfg-handle" 46*5911Svn83148 47*5911Svn83148 /* A root complex */ 48*5911Svn83148 typedef struct md_rc { 49*5911Svn83148 int16_t id; /* physical id of the rc */ 50*5911Svn83148 uint64_t cfg_handle; /* bus address */ 51*5911Svn83148 } md_rc_t; 52*5911Svn83148 53*5911Svn83148 /* A hostbridge */ 54*5911Svn83148 typedef struct md_hb { 55*5911Svn83148 int16_t id; /* physiscal id of the hostbridge */ 56*5911Svn83148 md_rc_t *rcs; /* a list of pciex root complexes */ 57*5911Svn83148 int16_t srcs; /* size of the rcs */ 58*5911Svn83148 int16_t nrcs; /* count of rc entries in rcs */ 59*5911Svn83148 } md_hb_t; 60*5911Svn83148 61*5911Svn83148 typedef struct md_info { 62*5911Svn83148 md_hb_t *hbs; /* a list of hostbridges */ 63*5911Svn83148 int16_t shbs; /* size of the hbs */ 64*5911Svn83148 int16_t nhbs; /* count of hb entries in hbs */ 65*5911Svn83148 } md_info_t; 66*5911Svn83148 67*5911Svn83148 68*5911Svn83148 extern int hb_mdesc_init(topo_mod_t *mod, md_info_t *hbmdp); 69*5911Svn83148 extern void hb_mdesc_fini(topo_mod_t *mod, md_info_t *hbmdp); 70*5911Svn83148 71*5911Svn83148 extern md_hb_t *hb_find_hb(md_info_t *hbmd, int hbid); 72*5911Svn83148 73*5911Svn83148 #ifdef __cplusplus 74*5911Svn83148 } 75*5911Svn83148 #endif 76*5911Svn83148 77*5911Svn83148 #endif /* _HB_MDESC_H */ 78