2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _HB_MDESC_H
2N/A#define _HB_MDESC_H
2N/A
2N/A#include <fm/topo_mod.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * Node/Field names in the PRI/MD
2N/A */
2N/A#define MD_STR_ID "id"
2N/A#define MD_STR_IODEVICE "iodevice"
2N/A#define MD_STR_DEVICE_TYPE "device-type"
2N/A#define MD_STR_PCIEX "pciex"
2N/A#define MD_STR_CFGHDL "cfg-handle"
2N/A
2N/A/* A root complex */
2N/Atypedef struct md_rc {
2N/A int16_t id; /* physical id of the rc */
2N/A uint64_t cfg_handle; /* bus address */
2N/A} md_rc_t;
2N/A
2N/A/* A hostbridge */
2N/Atypedef struct md_hb {
2N/A int16_t id; /* physiscal id of the hostbridge */
2N/A md_rc_t *rcs; /* a list of pciex root complexes */
2N/A int16_t srcs; /* size of the rcs */
2N/A int16_t nrcs; /* count of rc entries in rcs */
2N/A} md_hb_t;
2N/A
2N/Atypedef struct md_info {
2N/A md_hb_t *hbs; /* a list of hostbridges */
2N/A int16_t shbs; /* size of the hbs */
2N/A int16_t nhbs; /* count of hb entries in hbs */
2N/A} md_info_t;
2N/A
2N/A
2N/Aextern int hb_mdesc_init(topo_mod_t *mod, md_info_t *hbmdp);
2N/Aextern void hb_mdesc_fini(topo_mod_t *mod, md_info_t *hbmdp);
2N/A
2N/Aextern md_hb_t *hb_find_hb(md_info_t *hbmd, int hbid);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _HB_MDESC_H */