/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* PICL Cherrystone platform plug-in to remove environment tree nodes
* if corresponding physical device is not present. For creating
* the picltree nodes, see:
*/
#include <picl.h>
#include <picltree.h>
#include <stdio.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <libintl.h>
#include <limits.h>
#include <ctype.h>
#include <errno.h>
#include <semaphore.h>
#include <syslog.h>
#include <string.h>
#include <sys/systeminfo.h>
#include <psvc_objects.h>
typedef struct {
} picl_psvc_t;
extern struct handle {
} psvc_hdl;
void psvc_psr_plugin_init(void);
void psvc_psr_plugin_fini(void);
"PSVC_PSR",
};
#define PTREE_GET_NODE_ERR \
gettext("%s: ptree_get_node_by_path() failed: %s\n")
extern int ptree_get_node_by_path(const char *, picl_nodehdl_t *);
/* ======================================== */
struct node_file {
} dev_pr_info[] = {
/* Search for memory */
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CPU_0_2_MOD_CARD/24C02_A0_0",
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CPU_0_2_MOD_CARD/24C02_A2_0",
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CPU_0_2_MOD_CARD/24C02_A4_0",
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CP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02_A6_2",
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CPU_0_2_MOD_CARD/24C02_A8_2",
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CPU_0_2_MOD_CARD/24C02_AA_2",
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CPU_0_2_MOD_CARD/24C02_AC_2",
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CPU_0_2_MOD_CARD/24C02_AE_2",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C02_A0_3",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C02_A2_3",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C02_A4_3",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C02_A6_3",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C02_A8_3",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C02_AA_3",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C02_AC_3",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C02_AE_3",
/* Search for 64Kbit SPD */
{"/SYSTEM/MOTHERBOARD/CPU_0_2_MOD_SLOT/CPU_0_2_MOD_CARD/24C64_A0_4",
{"/SYSTEM/MOTHERBOARD/CPU_1_3_MOD_SLOT/CPU_1_3_MOD_CARD/24C64_A2_4",
/*
* Search for CPU Module cards. We check one cpu's die temperature
* sensor If not present, then we remove the entire node since module
* cards come with two cpus in them, each cpu having a die temperature
* sensor
*/
/*
* Check to see if RSC Card FRU is present. If it is not present,
* then RSC Card is not present, and so we remove those nodes from
* picl tree as well.
*/
};
{
}
void
psvc_psr_plugin_init(void)
{
int32_t i;
int err;
/*
* psvc or picl
*/
if (err != 0) {
}
/*
* Remove nodes whose devices aren't present from the picl tree.
*/
&present);
if (err != PSVC_SUCCESS)
continue;
&features);
if (err != PSVC_SUCCESS)
continue;
(present == PSVC_ABSENT)) {
if (err != 0) {
picl_strerror(err));
return;
}
}
}
/*
* Remove PICL device nodes if their /devices file isn't present or
* if the device file is present but the open returns ENXIO
* which indicates that the node file doesn't represent a device
* tree node and is probably a relic from some previous boot config
*/
for (i = 0; i < DEV_PR_COUNT; ++i) {
int fd;
if (fd != -1) {
continue;
}
continue;
if (err != 0) {
picl_strerror(err));
return;
}
if (err != 0) {
picl_strerror(err));
return;
}
}
}
void
psvc_psr_plugin_fini(void)
{
}
void
psvc_psr_plugin_register(void)
{
}