pcibus_labels.c revision 80ab886d233f514d54c2a6bdeb9fdfd951bd6881
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libnvpair.h>
#include <fm/topo_mod.h>
#include <assert.h>
#include <string.h>
#include "topo_error.h"
#include "did.h"
#include "pcibus.h"
#include "pcibus_labels.h"
extern slotnm_rewrite_t *Slot_Rewrites;
extern physlot_names_t *Physlot_Names;
extern missing_names_t *Missing_Names;
static const char *
{
int n, p, i;
return (NULL);
for (p = 0; p < Physlot_Names->psn_nplats; p++) {
platform) != 0)
continue;
break;
}
}
break;
}
return (rlabel);
}
static const char *
{
int s, i;
if (Slot_Rewrites == NULL)
return (rlabel);
for (s = 0; s < Slot_Rewrites->srw_nplats; s++) {
platform) != 0)
continue;
for (i = 0;
i++) {
break;
}
}
break;
}
return (rlabel);
}
static const char *
{
int p, i;
if (Missing_Names == NULL)
return (NULL);
for (p = 0; p < Missing_Names->mn_nplats; p++) {
platform) != 0)
continue;
devlab_t m;
break;
}
}
break;
}
return (rlabel);
}
static const char *
{
const char *l;
char *plat;
int err;
int d;
if (topo_prop_get_string(node,
return (NULL);
}
l = pci_slotname_rewrite(plat, l);
} else {
}
return (l);
}
int
{
const char *l;
char *nm;
int err;
/*
* If it's not a device, just inherit any label from our parent
*/
if (err != ETOPO_PROP_NOENT)
return (0);
}
"label method argument not found.\n");
return (-1);
}
/*
* Is there a slotname associated with the device?
*/
return (0);
} else {
if (err != ETOPO_PROP_NOENT)
return (0);
}
}