/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Kernel statistics.
*/
static int n2rng_ksupdate(kstat_t *, int);
/*
* Initialize Kstats.
*/
void
{
int instance;
int i;
int j;
/*
* sysadmin has explicity disabled stats to prevent
* covert channel.
*/
return;
}
/*
* Named kstats.
*/
sizeof (n2rng_stat_t) / sizeof (kstat_named_t),
} else {
if (n2rng_iscontrol(n2rng)) {
for (j = 0; j < N2RNG_NOSC; j++) {
"rng%d-cell%d-bias", i, j);
(&dkp->ns_rngbias[i][j],
"rng%d-cell%d-entropy", i, j);
(&dkp->ns_rngentropy[i][j],
}
}
}
}
}
/*
* Deinitialize Kstats.
*/
void
{
}
}
/*
* Update Kstats.
*/
int
{
int i;
int j;
if (rw == KSTAT_WRITE) {
for (i = 0; i < DS_MAX; i++) {
}
} else {
/* handy status value */
if (n2rng_isfailed(n2rng)) {
/* device has failed */
} else if (!n2rng_isconfigured(n2rng)) {
/* device is not configured */
} else {
/* everything looks good */
}
for (i = 0; i < DS_MAX; i++) {
}
if (n2rng_iscontrol(n2rng)) {
switch (rng->n_rng_state) {
case CTL_STATE_ERROR:
(void) strcpy(
"error");
break;
case CTL_STATE_HEALTHCHECK:
(void) strcpy(
"healthcheck");
break;
case CTL_STATE_CONFIGURED:
(void) strcpy(
"online");
break;
case CTL_STATE_UNCONFIGURED:
(void) strcpy(
"offline");
break;
default:
(void) strcpy(
"unknown");
break;
}
for (j = 0; j < N2RNG_NOSC; j++) {
}
}
}
}
return (0);
}