/*
* 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 (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <kvm.h>
#include <varargs.h>
#include <errno.h>
#include <time.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/openpromio.h>
#include <kstat.h>
#include <libintl.h>
#include <syslog.h>
#include "pdevinfo.h"
#include "display.h"
#include "pdevinfo_sun4u.h"
#include "display_sun4u.h"
#include "libprtdiag.h"
/*
* This module does the reading and interpreting of sun4u system
* kstats. These kstats are created by the following drivers:
* fhc, environ, sysctrl. Each board in the tree should have
* kstats created for it. There are also system wide kstats that
* are created.
*/
void
{
int i;
#ifdef lint
#endif
return;
}
/* For each board in the system, read the kstats for it. */
int board;
/*
* Kstat instances numbers are set by fhc, ac, simmstat,
* and environ drivers based on their board# property.
*/
/* Try to find an FHC instance for this board number */
/* Atempt to read the FHC kstat */
}
/* Now read out the data if the kstat read OK */
/*
* We set the kstats_ok flag to good here. If we
* fail one of the data reads, we set it to bad.
*/
/*
* For each data value, If the Kstat named struct
* is found, then get the data out.
*/
} else {
bdp->fhc_kstats_ok = 0;
}
} else {
bdp->fhc_kstats_ok = 0;
}
}
/* Try to find an AC instance for this board number */
/* Attempt to read the AC kstat. */
}
/* If the AC kstat exists, try to read the data from it. */
/*
* We set the kstats_ok flag to good here. If we
* fail one of the data reads, we set it to bad.
*/
/*
* For each data value, If the Kstat named struct
* is found, then get the data out.
*/
} else {
bdp->ac_kstats_ok = 0;
}
} else {
bdp->ac_kstats_ok = 0;
}
} else {
bdp->ac_kstats_ok = 0;
}
} else {
bdp->ac_memstat_ok = 0;
}
} else {
bdp->ac_memstat_ok = 0;
}
}
/* Try to find an simmstat instance for this board number */
bdp->simmstat_kstats_ok = 0;
} else {
sizeof (bdp->simm_status));
}
}
/* Try to find an overtemp kstat instance for this board */
bdp->temp_kstat_ok = 0;
} else {
/* XXX - this is for 2.5.1 testing. remove */
}
}
}
/* Read the kstats for the system control board */
sys_kstat->sys_kstats_ok = 0;
}
} else {
sys_kstat->sys_kstats_ok = 0;
}
} else {
sys_kstat->sys_kstats_ok = 0;
}
} else {
sys_kstat->sys_kstats_ok = 0;
}
} else {
sys_kstat->sys_kstats_ok = 0;
}
} else {
sys_kstat->sys_kstats_ok = 0;
}
} else {
sys_kstat->sys_kstats_ok = 0;
}
} else {
sys_kstat->sys_kstats_ok = 0;
}
} else {
/*
* the clock version register only appears
* on new clock boards
*/
}
}
/* Read the kstats for the power supply stats */
} else {
sys_kstat->psstat_kstat_ok = 0;
}
/* read the overtemp kstat for the system control board */
/* Try to find an overtemp kstat instance for this board */
sys_kstat->temp_kstat_ok = 0;
} else {
/* XXX - this is for 2.5.1 testing. remove */
}
}
/* Read the reset-info kstat from one of the boards. */
sys_kstat->reset_kstats_ok = 0;
sys_kstat->reset_kstats_ok = 0;
} else {
sizeof (sys_kstat->reset_info));
}
/* read kstats for hotplugged boards */
continue;
}
} else {
}
}
/* read in the kstat for the fault list. */
sys_kstat->ft_kstat_ok = 0;
} else {
perror("kstat read");
sys_kstat->ft_kstat_ok = 0;
return;
}
sizeof (struct ft_list);
perror("Malloc");
exit(2);
}
ksp->ks_data_size);
}
}
/*
* This function does the reading and interpreting of sun4u system
* kstats. These kstats are created by the following drivers:
* fhc, environ, sysctrl. Each board in the tree should have
* kstats created for it. There are also system wide kstats that
* are created.
*/
void
{
#if 0
struct envctrltwo_kstat_data *ecp;
#endif
int i;
return;
}
#ifdef lint
#endif
/* Initialize the kstats structure */
sys_kstat->sys_kstats_ok = 0;
sys_kstat->temp_kstat_ok = 0;
sys_kstat->reset_kstats_ok = 0;
sys_kstat->ft_kstat_ok = 0;
sys_kstat->envctrl_kstat_ok = 0;
for (i = 0; i < MAX_BOARDS; i++) {
bdp->ac_kstats_ok = 0;
bdp->fhc_kstats_ok = 0;
bdp->simmstat_kstats_ok = 0;
bdp->temp_kstat_ok = 0;
}
for (i = 0; i < MAX_DEVS; i++) {
}
}