7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER START
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * The contents of this file are subject to the terms of the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Common Development and Distribution License (the "License").
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You may not use this file except in compliance with the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * See the License for the specific language governing permissions
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * and limitations under the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * When distributing Covered Code, include this CDDL HEADER in each
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If applicable, add the following below this CDDL HEADER, with the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * fields enclosed by brackets "[]" replaced with your own identifying
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * information: Portions Copyright [yyyy] [name of copyright owner]
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER END
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Use is subject to license terms.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#pragma ident "%Z%%M% %I% %E% SMI"
0eb822a1c0c2bea495647510b75f77f0e57633ebcindicount_busorrc(topo_mod_t *mod, busorrc_t *list, int *hbc, int *bph)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi while (p != NULL) {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * sanity check that we have the correct number of buses/root
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * complexes in the list to have the same number of buses on
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * each hostbridge
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi "Imbalance between bus/root complex count and "
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi "the number of hostbridges.\n");
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (0);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindibusorrc_process(topo_mod_t *mod, busorrc_t *list, int isrc, tnode_t *ptn)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (0);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * At this point we've looked through all the top-level device
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * tree nodes for instances of drivers that represent logical
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * PCI buses or root complexes. We've sorted them into a
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * list, ordered by "bus address". We retrieved "bus address"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * using di_bus_addr(). That gave us a string that contains
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * either a single hex number or a pair of them separated by a
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * comma. If there was a single number, we've assumed the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * second number to be zero.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * So, we always have a pair of numbers describing a bus/root
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * complex, X1 and X2, with X1 being the number before the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * comma, and X2 being the number after (or the assumed zero).
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * As each node was examined, we then sorted these buses/root
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * complexes, first by the value of X2, and using X1 to order
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * amongst buses/root complexes with the same value for X2.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * We infer the existence of hostbridges by observing a
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * pattern that X2 is recycled for different hostbridges, and
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * that sorting by X1 within buses/root complexes with equal
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * values of X2 maintains the correct associations of
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * buses/root complexes and bridges.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (-1);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi return (declare_exbuses(mod, list, ptn, hbc, busper));
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi /* Scan for buses, top-level devinfo nodes with the right driver */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (0);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*ARGSUSED*/
0eb822a1c0c2bea495647510b75f77f0e57633ebcindiplatform_hb_enum(topo_mod_t *mod, tnode_t *parent, const char *name,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*ARGSUSED*/