/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/mdb_modapi.h>
/*
* This dcmd returns the values of the tunable variables in the Serengeti
* environmental driver (SGENV).
*/
/*ARGSUSED*/
static int
{
int mbox_wait_time;
int debug_flag;
int err;
return (DCMD_USAGE);
mdb_printf("SGENV tunable parameters:\n");
mdb_printf("=========================\n");
if (err != -1) {
mdb_printf("sgenv_max_mbox_wait_time = %d seconds\n",
}
if (err != -1) {
}
return (DCMD_OK);
}
/*
* This dcmd prints the values of some of the module specific
* variables in the Serengeti environmental driver (SGENV).
*/
/*ARGSUSED*/
static int
{
int env_cache_updated;
int env_writer_count;
int board_cache_updated;
int board_count_snapshot;
int board_count;
int board_writer_count;
int mbox_error_count;
int rv;
return (DCMD_USAGE);
mdb_printf("\nSGENV module variables:\n");
mdb_printf("=======================\n");
mdb_printf("\nEnvironmental variables:\n");
mdb_printf("------------------------\n");
if (rv == sizeof (env_cache_updated)) {
mdb_printf("env_cache_updated\t\t= %s\n",
}
if (rv == sizeof (env_writer_count)) {
}
if (rv == sizeof (env_cache_snapshot_size)) {
mdb_printf("env_cache_snapshot_size\t\t= %d\n",
}
mdb_printf("\nBoard info variables:\n");
mdb_printf("---------------------\n");
if (rv == sizeof (board_cache_updated)) {
mdb_printf("board_cache_updated\t\t= %s\n",
}
if (rv == sizeof (board_writer_count)) {
}
if (rv == sizeof (board_count)) {
}
if (rv == sizeof (board_count_snapshot)) {
mdb_printf("board_count_snapshot\t\t= %d\n",
}
mdb_printf("\nError variables:\n");
mdb_printf("----------------\n");
if (rv == sizeof (mbox_error_count)) {
}
mdb_printf("\n");
return (DCMD_OK);
}
/*ARGSUSED2*/
int
{
int rv;
if ((flags & DCMD_ADDRSPEC) == 0) {
mdb_warn("sgenv_env_sensor: requires an address");
return (DCMD_ERR);
}
if (rv != sizeof (env_sensor_t)) {
mdb_warn("sgenv_env_sensor: Failed read on "
"address %ll#r", addr);
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*
* MDB module linkage information:
*/
"sgenv_parameters",
NULL,
"print environmental driver tunable parameters",
}, {
"sgenv_variables",
NULL,
"print environmental driver variables",
}, {
"sgenv_env_sensor",
NULL,
"print contents of environmental sesnor",
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}