/*
* 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
*/
/*
*/
/*
* The routines in this file are what's needed to create a bay topo node.
*/
#include <strings.h>
#include <devid.h>
#include <inttypes.h>
#include <fm/topo_mod.h>
#include <fm/topo_list.h>
#include <sys/systeminfo.h>
#include <bay_impl.h>
1
};
1
};
/*
* Set the label.
*/
int
{
int rv;
int err;
return (-1);
}
if (rv != 0) {
"failed to set label (%s) for %s:%d: (%s)\n",
}
return (rv);
}
/*
* Create the authority pgroup and inherit info from the parent.
*/
int
{
int rv;
int err;
char *f = "bay_set_auth";
return (-1);
}
(err != ETOPO_PROP_DEFD)) {
/* not existing and failed to create */
return (-1);
}
/* get auth list from parent */
/*
* Set the authority data.
*
* Continue even if some authority information is not available
* to enumerate as much as possible.
*/
if (rv != 0) {
"for bay node\n", f);
}
return (0);
}
/*
* Create the system pgoup and inherit the info from the parent.
*/
int
{
int rv;
int err;
return (-1);
}
/* not existing and failed to create */
"bay_set_system: failed to create system pgroup: %s.\n",
topo_strerror(err));
return (-1);
}
isa[0] = '\0';
if (rv == -1) {
"bay_set_system: failed to get ISA: %d\n", errno);
}
if (rv != 0) {
/* failed to inherit or create prop */
"bay_set_system: failed to set isa "
"system property: %s\n",
topo_strerror(err));
}
}
}
&err);
if (rv == -1) {
"bay_set_system: failed to get uname: %d\n",
errno);
}
if (rv != 0) {
/* failed to inherit or create prop */
"bay_set_system: failed to set "
"system machine property: %s\n",
topo_strerror(err));
}
}
}
return (0);
}
/*
* Create bay topo node.
*/
int
{
int rv = 0;
char *f = "bay_create_tnode";
/* create FMRI */
rv = -1;
goto out;
}
/* bind the node to the parent */
rv = -1;
goto out;
}
/* set the label (bay_set_label) */
if (rv != 0) {
/* report the error and drive on */
"%s: failed to set label for %s:%d: (%s)\n",
}
/* set authority info (bay_set_auth) */
if (rv != 0) {
/* report the error and drive on */
"%s: failed to set auth for %s:%d: (%s)\n",
}
/* don't set system info if under an external chassis */
goto out;
/* set the system info (bay_set_system) */
if (rv != 0) {
/* report the error and drive on */
"%s: failed to set system for %s:%d: (%s)\n",
}
out:
}
}
return (rv);
}