/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "nge.h"
/*
* Table of Hardware-defined Statistics Block Offsets and Names
*/
{ KS_STATS_SIZE, NULL }
};
/*
* Local datatype for defining tables of (Offset, Name) pairs
*/
static int
{
if (flag != KSTAT_READ)
return (EACCES);
/*
* Transfer the statistics values from the hardware statistics regs
*/
}
return (0);
}
{ 0, "businfo" },
{ 1, "command" },
{ 2, "vendor_id" },
{ 3, "device_id" },
{ 4, "subsystem_vendor_id" },
{ 5, "subsystem_device_id" },
{ 6, "revision_id" },
{ 7, "cache_line_size" },
{ 8, "latency_timer" },
{ 9, "phy_mode" },
{ 10, "phy_id" },
{ 11, "hw_mac_addr" },
{ 12, "&bus_type" },
{ 13, "&bus_speed" },
{ 14, "&bus_size" },
{ -1, NULL }
};
{ 0, "rx_realloc" },
{ 1, "rx_realloc_fails" },
{ 2, "rx_realloc_DMA_fails" },
{ 3, "rx_realloc_MP_fails" },
{ 4, "rx_rcfree" },
{ 5, "context_switch" },
{ 6, "ip_hsum_err" },
{ 7, "tcp_hsum_err" },
{ 8, "tc_next" },
{ 9, "tx_next" },
{ 10, "tx_free" },
{ 11, "tx_flow" },
{ 12, "rx_prod" },
{ 13, "rx_hold" },
{ 14, "rx_nobuf" },
{ 15, "rx_err" },
{16, "tx_err" },
{17, "tx_stall" },
{ -1, NULL }
};
static int
{
if (flag != KSTAT_READ)
return (EACCES);
return (0);
}
static int
{
if (flag != KSTAT_READ)
return (EACCES);
return (0);
}
static kstat_t *
{
char *np;
int type;
size /= sizeof (nge_ksindex_t);
return (NULL);
switch (*np) {
default:
break;
case '%':
np += 1;
break;
case '$':
np ++;
break;
case '&':
np ++;
break;
}
}
return (ksp);
}
void
{
sizeof (nge_statistics), nge_statistics_update);
sizeof (nge_chipinfo), nge_chipinfo_update);
sizeof (nge_debuginfo), nge_debuginfo_update);
}
void
{
int i;
for (i = NGE_KSTAT_COUNT; --i >= 0; )
}
int
{
switch (stat) {
case MAC_STAT_IFSPEED:
break;
case MAC_STAT_MULTIRCV:
break;
case MAC_STAT_BRDCSTRCV:
break;
case MAC_STAT_NORCVBUF:
break;
case MAC_STAT_IERRORS:
hw_stp->s.InExtraOctErrCount +
hw_stp->s.InLColErrCount +
hw_stp->s.InOversizeErrCount +
hw_stp->s.InFovErrCount +
hw_stp->s.InFCSErrCount +
hw_stp->s.InAlignErrCount +
hw_stp->s.InLenErrCount;
break;
case MAC_STAT_OERRORS:
hw_stp->s.OutLOCCount +
hw_stp->s.OutExDecCount +
hw_stp->s.OutRetryCount;
break;
case MAC_STAT_COLLISIONS:
break;
case MAC_STAT_RBYTES:
break;
case MAC_STAT_IPACKETS:
break;
case MAC_STAT_OBYTES:
break;
case MAC_STAT_OPACKETS:
break;
case ETHER_STAT_ALIGN_ERRORS:
break;
case ETHER_STAT_FCS_ERRORS:
break;
break;
break;
case ETHER_STAT_DEFER_XMTS:
break;
break;
case ETHER_STAT_EX_COLLISIONS:
break;
break;
break;
case ETHER_STAT_XCVR_ADDR:
break;
case ETHER_STAT_XCVR_ID:
break;
case ETHER_STAT_XCVR_INUSE:
*val = XCVR_1000T;
break;
case ETHER_STAT_CAP_1000FDX:
*val = 1;
break;
case ETHER_STAT_CAP_1000HDX:
*val = 0;
break;
case ETHER_STAT_CAP_100FDX:
*val = 1;
break;
case ETHER_STAT_CAP_100HDX:
*val = 1;
break;
case ETHER_STAT_CAP_10FDX:
*val = 1;
break;
case ETHER_STAT_CAP_10HDX:
*val = 1;
break;
case ETHER_STAT_CAP_ASMPAUSE:
*val = 1;
break;
case ETHER_STAT_CAP_PAUSE:
*val = 1;
break;
case ETHER_STAT_CAP_AUTONEG:
*val = 1;
break;
break;
break;
break;
break;
case ETHER_STAT_ADV_CAP_10FDX:
break;
case ETHER_STAT_ADV_CAP_10HDX:
break;
break;
case ETHER_STAT_ADV_CAP_PAUSE:
break;
break;
break;
break;
case ETHER_STAT_LP_CAP_100FDX:
break;
case ETHER_STAT_LP_CAP_100HDX:
break;
case ETHER_STAT_LP_CAP_10FDX:
break;
case ETHER_STAT_LP_CAP_10HDX:
break;
break;
case ETHER_STAT_LP_CAP_PAUSE:
break;
break;
case ETHER_STAT_LINK_ASMPAUSE:
break;
case ETHER_STAT_LINK_PAUSE:
break;
case ETHER_STAT_LINK_AUTONEG:
break;
case ETHER_STAT_LINK_DUPLEX:
break;
case ETHER_STAT_CAP_100T4:
case ETHER_STAT_LP_CAP_100T4:
*val = 0;
break;
default:
return (ENOTSUP);
}
return (0);
}