03831d35f7499c87d51205817c93e9a8d42c4baestevel * CDDL HEADER START
03831d35f7499c87d51205817c93e9a8d42c4baestevel * The contents of this file are subject to the terms of the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Common Development and Distribution License, Version 1.0 only
03831d35f7499c87d51205817c93e9a8d42c4baestevel * (the "License"). You may not use this file except in compliance
03831d35f7499c87d51205817c93e9a8d42c4baestevel * with the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
03831d35f7499c87d51205817c93e9a8d42c4baestevel * See the License for the specific language governing permissions
03831d35f7499c87d51205817c93e9a8d42c4baestevel * and limitations under the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * When distributing Covered Code, include this CDDL HEADER in each
03831d35f7499c87d51205817c93e9a8d42c4baestevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If applicable, add the following below this CDDL HEADER, with the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * fields enclosed by brackets "[]" replaced with your own identifying
03831d35f7499c87d51205817c93e9a8d42c4baestevel * information: Portions Copyright [yyyy] [name of copyright owner]
03831d35f7499c87d51205817c93e9a8d42c4baestevel * CDDL HEADER END
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Copyright 2000, 2003 Sun Microsystems, Inc. All rights reserved.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Use is subject to license terms.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Littleneck Platform specific functions.
03831d35f7499c87d51205817c93e9a8d42c4baestevel#pragma ident "%Z%%M% %I% %E% SMI"
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic Prom_node *dev_next_node_by_compat(Prom_node *root, char *model);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic Prom_node *dev_find_node_by_compat(Prom_node *root, char *model);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic Board_node *littleneck_insert_board(Sys_tree *root, int board);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic Board_node *littleneck_find_board(Sys_tree *root, int board);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic Prom_node *next_pci_card(Prom_node *curr_card, int *is_bridge,
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define LNECK_CLK_FREQ_TO_MHZ(x) (((x) + 500000) / 1000000)
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* This is stuff to get the HW Revisions stuff to work */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * LNECK_PORTID_TO_SAFARI_ID
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Calculates the Safari Agent ID from the portid.
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define LNECK_PORTID_TO_SAFARI_ID(portid) ((portid) & LNECK_SAFARI_ID_MASK)
03831d35f7499c87d51205817c93e9a8d42c4baestevel * LNECK_PORTID_IS_CPU_TYPE
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If the portid associated with a CPU board is passed in, TRUE is returned,
03831d35f7499c87d51205817c93e9a8d42c4baestevel * otherwise FALSE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel (((((portid) & LNECK_SAFARI_ID_MASK) >= LNECK_MIN_CPU_SAFARI_ID) && \
03831d35f7499c87d51205817c93e9a8d42c4baestevel (((portid) & LNECK_SAFARI_ID_MASK) <= LNECK_MAX_CPU_SAFARI_ID)) ? \
03831d35f7499c87d51205817c93e9a8d42c4baestevel * LNECK_PORTID_TO_NODEID
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Calculates the SSM NodeID from the portid
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define LNECK_PORTID_TO_NODEID(portid) (((portid) >> LNECK_PORTID_NODE_SHIFT) \
03831d35f7499c87d51205817c93e9a8d42c4baestevel * LNECK_CPU_BD_PORTID_TO_BD_NUM
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If the portid associated with a CPU board is passed in, the board number
03831d35f7499c87d51205817c93e9a8d42c4baestevel * associated with this portid is returned, otherwise -1.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * LNECK_PORTID_IS_IO_TYPE
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If the portid associated with an IO board is passed in, TRUE is returned,
03831d35f7499c87d51205817c93e9a8d42c4baestevel * otherwise FALSE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel (((((portid) & LNECK_SAFARI_ID_MASK) >= LNECK_MIN_IO_SAFARI_ID) && \
03831d35f7499c87d51205817c93e9a8d42c4baestevel (((portid) & LNECK_SAFARI_ID_MASK) <= LNECK_MAX_IO_SAFARI_ID)) ? \
03831d35f7499c87d51205817c93e9a8d42c4baestevel * LNECK_IO_BD_PORTID_TO_BD_NUM
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If the portid associated with an IO board is passed in, the board number
03831d35f7499c87d51205817c93e9a8d42c4baestevel * associated with this portid is returned, otherwise -1.
03831d35f7499c87d51205817c93e9a8d42c4baestevel (((((portid) & LNECK_SAFARI_ID_MASK) - 24) / 2) + 6) : (-1))
03831d35f7499c87d51205817c93e9a8d42c4baestevel * LNECK_PORTID_TO_BOARD_NUM
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If a valid portid is passed in, this macro returns the board number
03831d35f7499c87d51205817c93e9a8d42c4baestevel * associated with it, otherwise it returns -1.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Start from the current node and return the next node besides
03831d35f7499c87d51205817c93e9a8d42c4baestevel * the current one which has the requested model property.
03831d35f7499c87d51205817c93e9a8d42c4baesteveldev_next_node_by_compat(Prom_node *root, char *compat)
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* look at your children first */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((node = dev_find_node_by_compat(root->child, compat)) != NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* now look at your siblings */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((node = dev_find_node_by_compat(root->sibling, compat)) != NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Do a depth-first walk of a device tree and
03831d35f7499c87d51205817c93e9a8d42c4baestevel * return the first node with the matching model.
03831d35f7499c87d51205817c93e9a8d42c4baesteveldev_find_node_by_compat(Prom_node *root, char *compat)
03831d35f7499c87d51205817c93e9a8d42c4baestevel compatible = (char *)get_prop_val(find_prop(root, "compatible"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((strcmp(name, "pci") == 0) && (compatible != NULL) &&
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* look at your children first */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((node = dev_find_node_by_compat(root->child, compat)) != NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* now look at your siblings */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((node = dev_find_node_by_compat(root->sibling, compat)) != NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevelfind_child_device(picl_nodehdl_t parent, char *child_name,
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(parent, PICL_PROP_CHILD, &(*child),
03831d35f7499c87d51205817c93e9a8d42c4baestevel "Failed picl_get_propval_by_name with %s\n"),
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(*child, PICL_PROP_NAME, name,
03831d35f7499c87d51205817c93e9a8d42c4baestevel "failed the get name for root\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "child name is %s\n"), name);
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(*child, PICL_PROP_PEER,
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(*child, PICL_PROP_NAME,
03831d35f7499c87d51205817c93e9a8d42c4baestevel "Failed picl_get_propval_by_name with %s\n"),
03831d35f7499c87d51205817c93e9a8d42c4baestevelfill_device_from_id(picl_nodehdl_t device_id, char *assoc_id,
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(device_id, assoc_id, &tbl_hdl,
03831d35f7499c87d51205817c93e9a8d42c4baestevel "fill_device_from_id failure in "
03831d35f7499c87d51205817c93e9a8d42c4baestevel "picl_get_propval_by_name err is %s\n"),
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_next_by_row(tbl_hdl, &reference_property);
03831d35f7499c87d51205817c93e9a8d42c4baestevel "fill_device_from_id failure in picl_get_next_by_row"
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* get node associated with reference property */
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval(reference_property, &(*device),
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != 0) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel "fill_device_from_id failure in picl_get_propval"
03831d35f7499c87d51205817c93e9a8d42c4baestevelfill_device_array_from_id(picl_nodehdl_t device_id, char *assoc_id,
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t *number_of_devices, picl_nodehdl_t *device_array[])
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(device_id, assoc_id, &tbl_hdl,
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((err != PICL_SUCCESS) && (err != PICL_INVALIDHANDLE)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel "fill_device_array_from_id failure in "
03831d35f7499c87d51205817c93e9a8d42c4baestevel "picl_get_propval_by_name err is %s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel *device_array = calloc((devs), sizeof (picl_nodehdl_t));
03831d35f7499c87d51205817c93e9a8d42c4baestevel "fill_device_array_from_id failure getting memory"
03831d35f7499c87d51205817c93e9a8d42c4baestevel " for array\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 0; i < devs; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != 0) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel "fill_device_array_from_id failure in "
03831d35f7499c87d51205817c93e9a8d42c4baestevel "picl_get_next_by_row err is %s\n"),
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* get node associated with reference property */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != 0) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel "fill_device_array_from_id failure in "
03831d35f7499c87d51205817c93e9a8d42c4baestevel "picl_get_propval err is %s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Add a board to the system list in order (sorted by board#).
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Initialize all pointer fields to NULL.
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((bnode = (Board_node *) malloc(sizeof (Board_node))) == NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel while ((temp->next != NULL) && (board > temp->next->board_num))
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Find the requested board struct in the system device tree.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This function overrides the functionality of the generic find_board()
03831d35f7499c87d51205817c93e9a8d42c4baestevel * function in libprtdiag, but since we need to pass another parameter,
03831d35f7499c87d51205817c93e9a8d42c4baestevel * we cannot simply overlay the symbol table.
03831d35f7499c87d51205817c93e9a8d42c4baestevel while ((bnode != NULL) && (board != bnode->board_num)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This function adds a board node to the board structure where that
03831d35f7499c87d51205817c93e9a8d42c4baestevel * that node's physical component lives.
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Get the board number of this board from the portid prop */
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* find the board node with the same board number */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((bnode = littleneck_find_board(root, board)) == NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* now attach this prom node to the board list */
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Insert this node at the end of the list */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This function provides formatting of the memory config
03831d35f7499c87d51205817c93e9a8d42c4baestevel * information that get_us3_mem_regs() and display_us3_banks() code has
03831d35f7499c87d51205817c93e9a8d42c4baestevel * gathered. It overrides the generic print_us3_memory_line() code
03831d35f7499c87d51205817c93e9a8d42c4baestevel * which prints an error message.
03831d35f7499c87d51205817c93e9a8d42c4baestevelprint_us3_memory_line(int portid, int bank_id, uint64_t bank_size,
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *bank_status, uint64_t dimm_size, uint32_t intlv, int seg_id)
03831d35f7499c87d51205817c93e9a8d42c4baestevel board_id[0] = 'A'; /* it will usually be, A, there's only one mc! */
03831d35f7499c87d51205817c93e9a8d42c4baestevel "\n C%-1c %2d %2d %4lldMB %11-s %4lldMB "
03831d35f7499c87d51205817c93e9a8d42c4baestevel " %2d-way %d"),
03831d35f7499c87d51205817c93e9a8d42c4baestevel * We call do_devinfo() in order to use the libdevinfo device tree
03831d35f7499c87d51205817c93e9a8d42c4baestevel * instead of OBP's device tree.
03831d35f7499c87d51205817c93e9a8d42c4baesteveldo_prominfo(int syserrlog, char *pgname, int log_flag, int prt_flag)
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (do_devinfo(syserrlog, pgname, log_flag, prt_flag));
03831d35f7499c87d51205817c93e9a8d42c4baestevel * return the property value for the Prop
03831d35f7499c87d51205817c93e9a8d42c4baestevel * passed in. (When using libdevinfo)
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Search a Prom node and retrieve the property with the correct
03831d35f7499c87d51205817c93e9a8d42c4baestevel * name. (When using libdevinfo)
03831d35f7499c87d51205817c93e9a8d42c4baestevel while ((prop != NULL) && (strcmp((char *)(prop->name.val_ptr), name))) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This function searches through the properties of the node passed in
03831d35f7499c87d51205817c93e9a8d42c4baestevel * and returns a pointer to the value of the name property.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * (When using libdevinfo)
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This function searches through the properties of the node passed in
03831d35f7499c87d51205817c93e9a8d42c4baestevel * and returns a pointer to the value of the device_type property.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * (When using libdevinfo)
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (strcmp("device_type", (char *)prop->name.val_ptr) == 0)
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Fills in the i/o card list to be displayed later in display_pci();
03831d35f7499c87d51205817c93e9a8d42c4baestevelfill_pci_card_list(Prom_node * pci_instance, Prom_node * pci_card_node,
03831d35f7499c87d51205817c93e9a8d42c4baestevel struct io_card **pci_card_list, char **slot_name_arr)
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *slot_name = NULL; /* info in "slot-names" prop */
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* If it doesn't have a name, skip it */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Get the portid of the schizo that this card
03831d35f7499c87d51205817c93e9a8d42c4baestevel * lives under.
03831d35f7499c87d51205817c93e9a8d42c4baestevel value = get_prop_val(find_prop(pci_instance, "portid"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Find out whether this is PCI bus A or B
03831d35f7499c87d51205817c93e9a8d42c4baestevel * using the 'reg' property.
03831d35f7499c87d51205817c93e9a8d42c4baestevel int_val = (int *)get_prop_val(find_prop(pci_instance, "reg"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel * get dev# and func# for this card from the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * 'reg' property.
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* We only have one slot on bus A */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((pci_card->pci_bus == 'A') && (pci_card->dev_no != 1) &&
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((pci_card->pci_bus == 'B') && (pci_card->dev_no > 4)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If this is a pci-bridge, then store its dev#
03831d35f7499c87d51205817c93e9a8d42c4baestevel * as its children nodes need this to get their slot#.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * We set the pci_bridge flag so that we know we are
03831d35f7499c87d51205817c93e9a8d42c4baestevel * looking at a pci-bridge node. This flag gets reset
03831d35f7499c87d51205817c93e9a8d42c4baestevel * every time we enter this while loop.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Check for a PCI-PCI Bridge for PCI and cPCI
03831d35f7499c87d51205817c93e9a8d42c4baestevel * IO Boards using the name and type properties.
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((type != NULL) && (strncmp(name, "pci", 3) == 0) &&
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Get slot-names property from slot_names_arr.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If we are the child of a pci_bridge we use the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * dev# of the pci_bridge as an index to get
03831d35f7499c87d51205817c93e9a8d42c4baestevel * the slot number. We know that we are a child of
03831d35f7499c87d51205817c93e9a8d42c4baestevel * a pci-bridge if our parent is the same as the last
03831d35f7499c87d51205817c93e9a8d42c4baestevel * pci_bridge node found above.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * We compare this cards parent node with the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * pci_bridge_node to see if it's a child.
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* use dev_no of pci_bridge */
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Slot num is last char in string */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Check for failed status.
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Get the model of this pci_card */
03831d35f7499c87d51205817c93e9a8d42c4baestevel value = get_prop_val(find_prop(pci_card_node, "model"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Skip sgsbbc nodes, they are not cards */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * The card may have a "clock-frequency" but we
03831d35f7499c87d51205817c93e9a8d42c4baestevel * are not interested in that. Instead we get the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * "clock-frequency" of the PCI Bus that the card
03831d35f7499c87d51205817c93e9a8d42c4baestevel * resides on. PCI-A can operate at 33Mhz or 66Mhz
03831d35f7499c87d51205817c93e9a8d42c4baestevel * depending on what card is plugged into the Bus.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * PCI-B always operates at 33Mhz.
03831d35f7499c87d51205817c93e9a8d42c4baestevel "clock-frequency"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Figure out how we want to display the name
03831d35f7499c87d51205817c93e9a8d42c4baestevel "compatible"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* use 'name'-'compatible' */
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* just use 'name' */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If this node has children, add the device_type
03831d35f7499c87d51205817c93e9a8d42c4baestevel * of the child to the name value of this pci_card->
03831d35f7499c87d51205817c93e9a8d42c4baestevel child_name = (char *)get_node_name(pci_card_node->child);
03831d35f7499c87d51205817c93e9a8d42c4baestevel "device_type"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* add device_type of child to name */
03831d35f7499c87d51205817c93e9a8d42c4baestevel "%s/%s (%s)",
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* just add childs name */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If this is a pci-bridge, then add the word
03831d35f7499c87d51205817c93e9a8d42c4baestevel * 'pci-bridge' to its model. If we can't find
03831d35f7499c87d51205817c93e9a8d42c4baestevel * a model, then we just describe what the device
03831d35f7499c87d51205817c93e9a8d42c4baestevel * is based on some properties.
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* insert this pci_card in the list to be displayed later */
03831d35f7499c87d51205817c93e9a8d42c4baestevel *pci_card_list = insert_io_card(*pci_card_list, pci_card);
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If we are dealing with a pci-bridge, we need to move
03831d35f7499c87d51205817c93e9a8d42c4baestevel * down to the children of this bridge if there are any.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If we are not, we are either dealing with a regular
03831d35f7499c87d51205817c93e9a8d42c4baestevel * card (in which case we move onto the sibling of this
03831d35f7499c87d51205817c93e9a8d42c4baestevel * card) or we are dealing with a child of a pci-bridge
03831d35f7499c87d51205817c93e9a8d42c4baestevel * (in which case we move onto the child's siblings or
03831d35f7499c87d51205817c93e9a8d42c4baestevel * if there are no more siblings for this child, we
03831d35f7499c87d51205817c93e9a8d42c4baestevel * move onto the parents siblings).
03831d35f7499c87d51205817c93e9a8d42c4baestevel pci_card_node = next_pci_card(pci_card_node, &pci_bridge,
03831d35f7499c87d51205817c93e9a8d42c4baestevel } /* end-while */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Helper function for fill_pci_card_list(). Indicates which
03831d35f7499c87d51205817c93e9a8d42c4baestevel * card node to go to next.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Parameters:
03831d35f7499c87d51205817c93e9a8d42c4baestevel * -----------
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Prom_node * curr_card: pointer to the current card node
03831d35f7499c87d51205817c93e9a8d42c4baestevel * int * is_bridge: indicates whether or not the card (is | is on)
03831d35f7499c87d51205817c93e9a8d42c4baestevel * a pci bridge
03831d35f7499c87d51205817c93e9a8d42c4baestevel * int is_pcidev: indicates whether or not the current card
03831d35f7499c87d51205817c93e9a8d42c4baestevel * is a pci bridge
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Prom_node * curr_bridge: pointer to the current pci bridge. Eg:
03831d35f7499c87d51205817c93e9a8d42c4baestevel * curr_card->parent.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Prom_node * parent_bridge: pointer to the first pci bridge encountered.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * we could have nested pci bridges, this would
03831d35f7499c87d51205817c93e9a8d42c4baestevel * be the first one.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Prom_node * pci: pointer to the pci instance that we are attached to.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This would be parent_bridge->parent, or
03831d35f7499c87d51205817c93e9a8d42c4baestevel * curr_node->parent, if curr_node is not on a pci bridge.
03831d35f7499c87d51205817c93e9a8d42c4baestevelnext_pci_card(Prom_node *curr_card, int *is_bridge, int is_pcidev,
03831d35f7499c87d51205817c93e9a8d42c4baestevel * is_pcidev is used to prevent us from following the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * children of something like a scsi device.