pci_sun4v.c revision 908f1e1388f616898b4e515d343c0414f2a6472e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <fm/topo_mod.h>
#include <string.h>
#include <alloca.h>
#include <libdevinfo.h>
#include <did_props.h>
/*
* Including the following file gives us definitions of the three
* global arrays used to adjust labels, Slot_Rewrites, Physlot_Names,
* and Missing_Names. With those defined we can use the common labeling
* routines for pci.
*/
#include "pci_sun4v.h"
#include "pci_sun4.h"
#define PI_PROP_CHASSIS_LOCATION_NAME "chassis-location-name"
typedef struct _pci_fru {
char *location;
int locsiz;
} _pci_fru_t;
int
{
int result;
int err;
int locsiz = 0;
/* Invoke the generic label generator for this node */
}
/*
* We have crossed a FRU boundary. Use the value in the
* chassis-location-name property as the node label.
*/
if (result < 0) {
if (err != ETOPO_PROP_NOENT) {
}
}
return (0);
}
int
{
int err = 0;
const char *label;
int found_t1plat = 0;
int locsiz;
return (-1);
}
/* Delete the "SUNW," */
else
++pp;
/* Is this an UltraSPARC-T1 platform? */
cp = usT1_plats;
found_t1plat = 1;
cp++;
}
/*
* On UltraSPARC-T1 systems, use the legacy hc scheme on
* the adapter slots to ensure ALOM on the SP can interpret
* the FRU correctly. For everything else, follow the normal
* code flow
*/
if (found_t1plat) {
return (0);
"not found.\n");
return (-1);
}
/*
* Is there a slotname associated with the device?
*/
!= NULL) {
label);
return (-1);
}
return (0);
/*
* We have crossed a FRU boundary and need to find the parent
* node with this location and set our FMRI to that value.
*/
} else {
}
}
static int
int locsiz)
{
int err;
/* Find the root node */
}
/* Create a walker starting at the root node */
}
/*
* Walk the tree breadth first to hopefully avoid visiting too many
* nodes while searching for the node with the appropriate FMRI.
*/
return (0);
}
static int
{
int err;
char *location;
/* This is the starting node. Do not check the location */
return (TOPO_WALK_NEXT);
}
/* This node has no location property. Continue the walk */
return (TOPO_WALK_NEXT);
}
/*
* We have a match. Set the node's FRU FMRI to this nodes
* FRU FMRI
*/
if (rc == 0) {
}
if (rc != 0) {
}
}
return (result);
}