did_props.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 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) 2006, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A const char *,
const char *,
const char *);
2N/A * Arrays of "property translation routines" to set the properties a 2N/A * given type of topology node should have. 2N/A * Note that the label_set translation *MUST COME BEFORE* the FRU 2N/A * translation. For the near term we're setting the FRU fmri to 2N/A * be a legacy-hc style FMRI based on the label, so the label needs 2N/A * to have been set before we do the FRU translation. 2N/A};
/* Request to create protocol will be ignored by libtopo */ 2N/A {
"serd_io_device_nonfatal_n", &
io_pgroup,
"serd_io_device_nonfatal_n",
2N/A {
"serd_io_device_nonfatal_t", &
io_pgroup,
"serd_io_device_nonfatal_t",
2N/A * These props need to be put at the end of table. x86pi has its 2N/A * own way to set them. 2N/A * These props need to be put at the end of table. x86pi has its 2N/A * own way to set them. 2N/A * These props need to be put at the end of table. x86pi has its 2N/A * own way to set them. 2N/A * If this devinfo node came originally from OBP data, we'll have prom 2N/A * properties associated with the node where we can find properties of 2N/A * interest. We ignore anything after the the first four bytes of the 2N/A * property, and interpet those first four bytes as our unsigned 2N/A * integer. If we don't find the property or it's not large enough, 2N/A * 'val' will remained unchanged and we'll return -1. Otherwise 'val' 2N/A * gets updated with the property value and we return 0. 2N/A * If this devinfo node was added by the PCI hotplug framework it 2N/A * doesn't have the PROM properties, but hopefully has the properties 2N/A * we're looking for attached directly to the devinfo node. We only 2N/A * care about the first four bytes of the property, which we read as 2N/A * our unsigned integer. The remaining bytes are ignored. If we 2N/A * don't find the property we're looking for, or can't get its value, 2N/A * 'val' remains unchanged and we return -1. Otherwise 'val' gets the 2N/A * property value and we return 0. 2N/A * fix_dev_prop -- sometimes di_devfs_path() doesn't tell the whole 2N/A * story, leaving off the device and function number. Chances are if 2N/A * devfs doesn't put these on then we'll never see this device as an 2N/A * error detector called out in an ereport. Unfortunately, there are 2N/A * races and we sometimes do get ereports from devices that devfs 2N/A * decides aren't there. For example, the error injector card seems 2N/A * to bounce in and out of existence according to devfs. We tack on 2N/A * the missing dev and fn here so that the DEV property used to look 2N/A * up the topology node is correct. 2N/A * We only care about the last component of the dev path. If 2N/A * we don't find a slash, something is weird. 2N/A * If an @ sign is present in the last component, the 2N/A * di_devfs_path() result had the device,fn unit-address. 2N/A * In that case there's nothing we need do. 2N/A * dev_for_hostbridge() -- For hostbridges we truncate the devfs path 2N/A * after the first element in the bus address. 2N/A * We only care about the last component of the dev path. If 2N/A * we don't find a slash, something is weird. 2N/A * Find the comma in the last component component@x,y, and 2N/A * truncate the comma and any following number. 2N/A * If this topology node represents a function of device, 2N/A * set the ASRU to a dev scheme FMRI based on the value of 2N/A * di_devfs_path(). If that path is NULL, set the ASRU to 2N/A * be the resource describing this topology node. If this 2N/A * isn't a function, inherit any ASRU from the parent. 2N/A * Dup the path, dev_path_fix() may replace it and 2N/A * dev_path_fix() wouldn't know to use 2N/A * di_devfs_path_free() 2N/A "dev:///%s fmri creation failed.\n",
fpath);
2N/A * Set the FRU property to the hc fmri of this tnode 2N/A * If this is a PCIEX_BUS and its parent is a PCIEX_ROOT, 2N/A * check for a CPUBOARD predecessor. If found, inherit its 2N/A * parent's FRU. Otherwise, continue with FRU set. 2N/A * If this topology node represents something other than an 2N/A * ioboard or a device that implements a slot, inherit the 2N/A * parent's FRU value. If there is no label, inherit our 2N/A * parent's FRU value. Otherwise, munge up an fmri based on 2N/A * If ioboard, set fru fmri to hc fmri 2N/A * If this is a PCIEX_BUS and its parent is a PCIEX_ROOT, 2N/A * check for a CPUBOARD predecessor. If found, inherit its 2N/A * parent's Label. Otherwise, continue with label set. 2N/A /* The DEV path is modified for hostbridges */ 2N/A return (0);
/* driver maybe detached, return success */ 2N/A char str[
21];
/* sizeof (UINT64_MAX) + '\0' */ 2N/A char str[
21];
/* sizeof (UINT64_MAX) + '\0' */ 2N/A char str[
23];
/* '0x' + sizeof (UINT64_MAX) + '\0' */ 2N/A * Ensure the property group has been created. 2N/A "Setting property %s in group %s.\n",