2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 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 * Copyright (c) 1999-2001 by Sun Microsystems, Inc. 2N/A * All rights reserved. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A /* find the first pci node */ 2N/A * Determines the PCI bus, either A (0) or B (1). If the function cannot 2N/A * find the bus-ranges property, it returns -1. 2N/A /* look up the bus-range property */ 2N/A return (
1);
/* B bus has a bus-range value = 0 */ 2N/A * Find the PCI device number of this PCI device. If no device number can 2N/A * be determined, then return -1. 2N/A * Find the PCI device number of this PCI device. If no device number can 2N/A * be determined, then return -1. 2N/A * Frees the memory allocated for an io card list. 2N/A * Inserts an io_card structure into the list. The list is maintained 2N/A * in order based on board number and slot number. Also, the storage 2N/A * for the "card" argument is assumed to be handled by the caller, 2N/A * so we won't touch it. 2N/A /* Copy the card to be added into new storage */ 2N/A /* Find the proper place in the list for the new card */ 2N/A /* Insert the new card into the list */ 2N/A * Format the manufacturer's info. Note a small inconsistency we 2N/A * have to work around - Brooktree has it's part number in decimal, 2N/A * while Mitsubishi has it's part number in hex. 2N/A * Find the sbus slot number of this Sbus device. If no slot number can 2N/A * be determined, then return -1. 2N/A * This routine is the generic link into displaying system IO 2N/A * configuration. It displays the table header, then displays 2N/A * all the SBus cards, then displays all fo the PCI IO cards. 2N/A * Following string is used as a table header. 2N/A * Please maintain the current alignment in 2N/A * This function is intentionally empty 2N/A * Print out all the io cards in the list. Also print the column 2N/A * headers if told to do so. 2N/A static int banner = 0;
/* Have we printed the column headings? */ 2N/A "---------------------------- " 2N/A "--------------------", 0);
2N/A * We check to see if it's an int or 2N/A * a char string to display for slot. 2N/A * Display all FFBs on this board. It can either be in tabular format, 2N/A * or a more verbose format. 2N/A /* Fill in common information */ 2N/A /* Print out in table format */ 2N/A /* XXX - Get the slot number (hack) */ 2N/A /* Find out if it's single or double buffered */ 2N/A * Print model number only if board_type bit 2 2N/A * is not set and it is not SUNW,XXX-XXXX. 2N/A "SUNW,XXX-XXXX") != 0)) {
2N/A /* print in long format */ 2N/A * Display all the SBus IO cards on this board. 2N/A /* Skip failed nodes for now */ 2N/A /* Calculate SBus frequency in MHz */ 2N/A /* Fill in card information */ 2N/A /* Try and get card status */ 2N/A /* XXX - For now, don't display failed cards */ 2N/A /* Now gather all of the node names for that card */ 2N/A /* Figure out how we want to display the name */ 2N/A /* We're all done gathering card info, now print it out */ 2N/A * Get slot-names properties from parent node and 2N/A * store them in an array. 2N/A /* array starts after first int */ 2N/A * break the array out into num_slots number of strings 2N/A * process array of slot_names to remove blanks 2N/A D_PRINTF(
"\n populate_slot_name_arr: - psycho with no " 2N/A return (
int)(((*(
int *)
value) +
500000) /
1000000);
2N/A "%s",
"pci-bridge");
2N/A * Desktop display_psycho_pci 2N/A * Display all the psycho based PCI IO cards on this board. 2N/A /* Initialize all the common information */ 2N/A * If we have reached a pci-to-pci bridge node, 2N/A * we are one level below the 'pci' nodes level 2N/A * in the device tree. To get back to that level, 2N/A * the search should continue with the sibling of 2N/A * the parent or else the remaining 'pci' cards 2N/A * will not show up in the output. 2N/A D_PRINTF(
"\n\n------->Looking at device [%s][%d] - [%s]\n",
2N/A /* Skip all failed nodes for now */ 2N/A /* Fill in frequency */ 2N/A * Each PSYCHO device has a slot-names property that can be 2N/A * used to determine the slot-name string for each IO 2N/A * device under this node. We get this array now and use 2N/A * it later when looking at the children of this PSYCHO. 2N/A /* Walk through the PSYCHO children */ 2N/A /* If it doesn't have a name, skip it */ 2N/A /* get dev# and func# for this card. */ 2N/A * Weed out PCI Bridge, subclass 'other' and 2N/A * If this is a PCI bridge, then we store it's dev_no 2N/A * so that it's children can use it for getting at 2N/A * If we are the child of a pci_bridge we use the 2N/A * dev# of the pci_bridge as an index to get 2N/A * the slot number. We know that we are a child of 2N/A * a pci-bridge if our parent is the same as the last 2N/A * pci_bridge node found above. 2N/A /* Get slot-names property from slot_names_arr. */ 2N/A /* XXX - Don't know how to get status for PCI cards */ 2N/A /* Get the model of this card */ 2N/A * If we haven't figured out the frequency yet, 2N/A * try and get it from the card. 2N/A /* Figure out how we want to display the name */ 2N/A * If we are done with the children of the pci bridge, 2N/A * we must continue with the remaining siblings of 2N/A * the pci-to-pci bridge - otherwise we move onto our 2N/A * slot_name_bits is a mask of the plug-in slots so if our 2N/A * dev_no does not appear in this mask we must be an 2N/A * on_board device so set the slot to 'On-Board' 2N/A /* we are a plug-in card */ 2N/A /* this is an on-board dev. */ 2N/A /* Informs display_io_cards to print slot_str instead of slot */ 2N/A * The output of a number of I/O cards are identical so we need to 2N/A * differentiate between them. 2N/A * This function is called by the platform specific code and it decides 2N/A * if the card needs further processing. 2N/A * It can be extended in the future if card types other than QLC have 2N/A * the same problems. 2N/A * The name/model properties for a number of the QLC FCAL PCI cards are 2N/A * identical (*), so we need to distinguish them using the subsystem-id 2N/A * and modify the model string to be more informative. 2N/A * (*) Currently the problem cards are: 2N/A * If information has been saved into the model field 2N/A * before this function was called we will keep it as 2N/A * it probably will be more meaningful that the 2N/A * subsystem-id, otherwise we save the subsystem-id in 2N/A * the hope that it will distinguish the cards.