softmac_stat.c revision d62bc4badc1c1f1549c961cfb8b420e650e1272b
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/softmac_impl.h>
typedef struct i_softmac_stat_info_s {
char *ssi_name;
char *ssi_alias;
/*
* Must be the same order as mac_driver_stat.
*/
static i_softmac_stat_info_t i_softmac_driver_si[] = {
};
/*
* Must be the same order as ether_stat.
*/
static i_softmac_stat_info_t i_softmac_ether_si[] = {
{ ETHER_STAT_ALIGN_ERRORS, "align_errors",
"alignment_err" },
{ ETHER_STAT_TX_LATE_COLLISIONS, "tx_late_collisions",
"late_collisions" },
{ ETHER_STAT_EX_COLLISIONS, "ex_collisions",
"excessive_collisions" },
{ ETHER_STAT_MACRCV_ERRORS, "macrcv_errors",
"Rx Error Count" },
};
static void softmac_rele_dev_kstat(kstat_t *);
static kstat_t *
{
char drv[MAXLINKNAMELEN];
return (NULL);
/*
* Find the kstat by the module name and the instance number.
*/
/*
* Update the kstat to get the latest statistics.
*/
return (ksp);
}
}
return (NULL);
}
static void
{
}
/*
* The kstat needs to be held when calling this function.
*/
static int
{
int i;
return (ret);
/*
* Search the kstat with the given name.
*/
case KSTAT_DATA_INT32:
case KSTAT_DATA_UINT32:
ret = 0;
break;
case KSTAT_DATA_INT64:
case KSTAT_DATA_UINT64:
ret = 0;
break;
#ifdef _LP64
case KSTAT_DATA_LONG:
case KSTAT_DATA_ULONG:
ret = 0;
break;
#endif
case KSTAT_DATA_CHAR:
break;
*valp = LINK_DUPLEX_FULL;
*valp = LINK_DUPLEX_HALF;
else
ret = 0;
break;
}
break;
}
}
return (ret);
}
int
{
int ret;
return (ENOTSUP);
if (IS_MAC_STAT(stat)) {
}
} else {
switch (softmac->smac_media) {
case DL_ETHER:
}
break;
default:
break;
}
}
return (ret);
}