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