/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
void nxge_xmac_init_kstats(struct kstat *);
void nxge_bmac_init_kstats(struct kstat *);
/* ARGSUSED */
void
{
stats_size = sizeof (nxge_stats_t);
}
typedef struct {
char *name;
typedef enum {
RDC_STAT_PACKETS = 0,
"rdc_compl_zcp_soft_err"},
"rdc_compl_fflp_soft_err"},
};
typedef enum {
};
typedef enum {
TDC_STAT_PACKETS = 0,
KSTAT_DATA_ULONG, "tdc_tx_ring_oflow"},
KSTAT_DATA_ULONG, "tdc_pref_buf_err_err"},
KSTAT_DATA_ULONG, "tdc_conf_part_err"},
};
/* IPP Statistics definitions */
typedef enum {
IPP_STAT_EOP_MISS = 0,
};
/* TXC Statistics definitions */
typedef enum {
TXC_STAT_PKT_STUFFED = 0,
};
typedef enum {
#ifdef NXGE_DEBUG_SYMBOL_ERR
#endif
KSTAT_DATA_ULONG, "rxmac_alignment_err"},
KSTAT_DATA_ULONG, "rxmac_linkfault_errs"},
KSTAT_DATA_ULONG, "rxmac_remote_faults"},
KSTAT_DATA_ULONG, "rxmac_local_faults"},
KSTAT_DATA_ULONG, "xpcs_deskew_err_cnt"},
#ifdef NXGE_DEBUG_SYMBOL_ERR
KSTAT_DATA_ULONG, "xpcs_ln0_symbol_err_cnt"},
KSTAT_DATA_ULONG, "xpcs_ln1_symbol_err_cnt"},
KSTAT_DATA_ULONG, "xpcs_ln2_symbol_err_cnt"},
KSTAT_DATA_ULONG, "xpcs_ln3_symbol_err_cnt"},
#endif
};
typedef enum {
};
typedef enum {
"zcp_rspfifo_uncorr_err"},
};
typedef enum {
};
typedef enum {
};
/* ARGSUSED */
int
{
int channel;
return (-1);
"nxge_tdc_stat_update data $%p statsp $%p channel %d",
if (rw == KSTAT_WRITE) {
} else {
}
return (0);
}
/* ARGSUSED */
int
{
int channel;
return (-1);
"nxge_rdc_stat_update $%p statsp $%p channel %d",
if (rw == KSTAT_WRITE) {
} else {
}
return (0);
}
/* ARGSUSED */
int
{
return (-1);
if (rw == KSTAT_WRITE) {
} else {
}
return (0);
}
/* ARGSUSED */
static int
{
return (-1);
if (rw == KSTAT_WRITE) {
} else {
}
return (0);
}
/* ARGSUSED */
int
{
return (-1);
if (rw == KSTAT_WRITE) {
} else {
}
return (0);
}
/* ARGSUSED */
int
{
return (-1);
if (rw == KSTAT_WRITE) {
#ifdef NXGE_DEBUG_SYMBOL_ERR
#endif
} else {
#ifdef NXGE_DEBUG_SYMBOL_ERR
#endif
}
return (0);
}
/* ARGSUSED */
int
{
return (-1);
if (rw == KSTAT_WRITE) {
} else {
}
return (0);
}
/* ARGSUSED */
int
{
return (-1);
if (rw == KSTAT_WRITE) {
} else {
}
return (0);
}
/* ARGSUSED */
int
{
int ldc_grp;
return (-1);
if (rw == KSTAT_WRITE) {
}
} else {
}
}
return (0);
}
/* ARGSUSED */
static uint64_t
{
int i;
for (i = ETHERADDRL - 1; i >= 0; i--) {
addr64 <<= 8;
}
return (addr64);
}
/* ARGSUSED */
int
{
return (-1);
if (rw == KSTAT_WRITE) {
} else {
}
return (0);
}
/* ARGSUSED */
static kstat_t *
{
int i;
KSTAT_TYPE_NAMED, count, 0);
return (NULL);
}
return (ksp);
}
/* ARGSUSED */
void
{
/* Setup RDC statistics */
#ifdef NXGE_DEBUG_ERROR
"kstat_create failed for rdc channel %d", channel));
#endif
}
void
{
/* Setup TDC statistics */
#ifdef NXGE_DEBUG_ERROR
"kstat_create failed for tdc channel %d", channel));
}
#endif
}
void
{
/* Setup RDC System statistics */
"RDC System Stats",
&nxge_rdc_sys_stats[0],
/* Setup IPP statistics */
"IPP Stats",
&nxge_ipp_stats[0],
#ifdef NXGE_DEBUG_ERROR
#endif
/* Setup TXC statistics */
#ifdef NXGE_DEBUG_ERROR
#endif
/* Setup ZCP statistics */
#ifdef NXGE_DEBUG_ERROR
#endif
/* Setup FFLP statistics */
#ifdef NXGE_DEBUG_ERROR
"kstat_create failed for fflp"));
#endif
nxge_kstat_sz = sizeof (nxge_port_kstat_t) +
sizeof (nxge_mac_kstat_t) - sizeof (kstat_named_t);
return;
}
/*
* kstats
*/
/*
* transceiver state informations.
*/
/*
* Link partner capabilities.
*/
/*
* Shared link setup.
*/
/*
* Let the user know the MTU currently in use by the physical MAC
* port.
*/
/*
* Loopback statistics.
*/
/*
* This tells the user whether the driver is in QOS mode or not.
*/
/*
* This tells whether the instance is trunked or not
*/
#if defined MULTI_DATA_TX || defined MULTI_DATA_TXV2
#endif
#ifdef ACCEPT_JUMBO
#endif
/*
* Rx Statistics.
*/
#ifdef ACCEPT_JUMBO
#endif
/* General MAC statistics */
else
}
/* ARGSUSED */
void
{
/*
* Transmit MAC statistics.
*/
/* Receive MAC statistics */
"rxmac_alignment_err",
"rxmac_remote_faults",
/* XPCS statistics */
#ifdef NXGE_DEBUG_SYMBOL_ERR
"xpcs_ln0_symbol_err_cnt",
"xpcs_ln1_symbol_err_cnt",
"xpcs_ln2_symbol_err_cnt",
"xpcs_ln3_symbol_err_cnt",
#endif
}
/* ARGSUSED */
void
{
/*
* Transmit MAC statistics.
*/
/* Receive MAC statistics */
}
/* ARGSUSED */
void
{
/*
* Transmit MAC statistics.
*/
/*
* Receive MAC statistics
*/
"rxmac_alignment_err",
"rxmac_broadcast_cnt",
"rxmac_linkfault_errs",
"rxmac_remote_faults",
"rxmac_local_faults",
}
}
/* ARGSUSED */
void
{
return;
}
/* ARGSUSED */
int
{
return (-1);
if (rw == KSTAT_WRITE) {
/*
* transceiver state informations.
*/
/*
* Tx Statistics.
*/
#if defined MULTI_DATA_TX || defined MULTI_DATA_TXV2
#endif
#ifdef ACCEPT_JUMBO
#endif
/*
* Rx Statistics.
*/
#ifdef ACCEPT_JUMBO
#endif
} else {
}
return (0);
} else {
else
/*
* transceiver state informations.
*/
/*
* Link partner capabilities.
*/
/*
* Physical link statistics.
*/
else
/*
* Lets the user know the MTU currently in use by the physical
* MAC port.
*/
/*
* Loopback statistics.
*/
/*
* This tells the user whether the driver is in QOS mode or
* not.
*/
/*
* This tells whether the instance is trunked or not
*/
#if defined MULTI_DATA_TX || defined MULTI_DATA_TXV2
#endif
#ifdef ACCEPT_JUMBO
#endif
#ifdef TX_MBLK_DEST
#endif
/*
* Rx Statistics.
*/
#ifdef ACCEPT_JUMBO
#endif
} else {
}
}
return (0);
}
/*
* if this is the first init do not bother to save the
* counters.
*/
/* ARGSUSED */
void
{
/*
* Transmit MAC statistics.
*/
/*
* Receive XMAC statistics.
*/
(val & XRXMAC_HIST_CNT1_MASK);
(val & XRXMAC_HIST_CNT1_MASK);
(val & XRXMAC_HIST_CNT2_MASK);
(val & XRXMAC_HIST_CNT2_MASK);
(val & XRXMAC_HIST_CNT3_MASK);
(val & XRXMAC_HIST_CNT3_MASK);
(val & XRXMAC_HIST_CNT4_MASK);
(val & XRXMAC_HIST_CNT4_MASK);
(val & XRXMAC_HIST_CNT5_MASK);
(val & XRXMAC_HIST_CNT5_MASK);
(val & XRXMAC_HIST_CNT6_MASK);
(val & XRXMAC_HIST_CNT6_MASK);
(val & XRXMAC_HIST_CNT7_MASK);
(val & XRXMAC_HIST_CNT7_MASK);
(val & XRXMAC_AL_ER_CNT_MASK);
#ifdef NXGE_DEBUG_SYMBOL_ERR
((cnt32 & XMAC_XPCS_SYM_ERR_CNT_L1_MASK) >>
((cnt32 & XMAC_XPCS_SYM_ERR_CNT_L3_MASK) >>
#endif
/*
* Transmit MAC statistics.
*/
/* Clear register as it is not auto clear on read */
/* Clear register as it is not auto clear on read */
/*
* Receive MAC statistics.
*/
/* Clear register as it is not auto clear on read */
/* Clear register as it is not auto clear on read */
(val & BMAC_AL_ER_CNT_MASK);
/* Clear register as it is not auto clear on read */
(val & MAC_LEN_ER_CNT_MASK);
/* Clear register as it is not auto clear on read */
(val & BMAC_CRC_ER_CNT_MASK);
/* Clear register as it is not auto clear on read */
(val & BMAC_CD_VIO_CNT_MASK);
/* Clear register as it is not auto clear on read */
}
if (isLDOMguest(nxgep)) {
goto nxge_save_cntrs_exit;
}
/* Update IPP counters */
}
{
int i, cursor;
for (i = 0, cursor = 0; i < NXGE_MAX_RDCS; i++) {
}
}
for (i = 0; i < cursor; i++) {
switch (stat) {
case MAC_STAT_IERRORS:
case ETHER_STAT_MACRCV_ERRORS:
break;
case MAC_STAT_RBYTES:
break;
case MAC_STAT_IPACKETS:
break;
default:
break;
}
}
return (val);
}
{
int i, cursor;
for (i = 0, cursor = 0; i < NXGE_MAX_TDCS; i++) {
}
}
for (i = 0; i < cursor; i++) {
switch (stat) {
case MAC_STAT_OERRORS:
break;
case MAC_STAT_OBYTES:
break;
case MAC_STAT_OPACKETS:
break;
default:
break;
}
}
return (val);
}
/*
* Retrieve a value for one of the statistics for a particular rx ring
*/
int
{
int r_index;
return (0);
switch (stat) {
case MAC_STAT_IERRORS:
break;
case MAC_STAT_RBYTES:
break;
case MAC_STAT_IPACKETS:
break;
default:
*val = 0;
return (ENOTSUP);
}
return (0);
}
/*
* Retrieve a value for one of the statistics for a particular tx ring
*/
int
{
int r_index;
return (0);
switch (stat) {
case MAC_STAT_OERRORS:
break;
case MAC_STAT_OBYTES:
break;
case MAC_STAT_OPACKETS:
break;
default:
*val = 0;
return (ENOTSUP);
}
return (0);
}
/* ARGSUSED */
int
{
switch (stat) {
case MAC_STAT_IFSPEED:
break;
case MAC_STAT_MULTIRCV:
break;
case MAC_STAT_BRDCSTRCV:
break;
case MAC_STAT_MULTIXMT:
break;
case MAC_STAT_BRDCSTXMT:
break;
case MAC_STAT_NORCVBUF:
break;
case MAC_STAT_IERRORS:
case ETHER_STAT_MACRCV_ERRORS:
break;
case MAC_STAT_OERRORS:
break;
case MAC_STAT_NOXMTBUF:
break;
case MAC_STAT_COLLISIONS:
val = 0;
break;
case MAC_STAT_RBYTES:
break;
case MAC_STAT_IPACKETS:
break;
case MAC_STAT_OBYTES:
break;
case MAC_STAT_OPACKETS:
break;
case MAC_STAT_LINK_STATE:
break;
case MAC_STAT_LINK_UP:
break;
case MAC_STAT_PROMISC:
break;
case ETHER_STAT_SQE_ERRORS:
val = 0;
break;
case ETHER_STAT_ALIGN_ERRORS:
else
val = 0;
break;
case ETHER_STAT_FCS_ERRORS:
else
val = 0;
break;
val = 0;
break;
val = 0;
break;
val = 0;
break;
case ETHER_STAT_EX_COLLISIONS:
val = 0;
break;
case ETHER_STAT_DEFER_XMTS:
val = 0;
break;
case ETHER_STAT_MACXMT_ERRORS:
} else {
}
break;
} else {
}
break;
} else {
}
break;
case ETHER_STAT_XCVR_ADDR:
break;
case ETHER_STAT_XCVR_ID:
break;
case ETHER_STAT_XCVR_INUSE:
break;
case ETHER_STAT_CAP_1000FDX:
break;
case ETHER_STAT_CAP_1000HDX:
break;
case ETHER_STAT_CAP_100FDX:
break;
case ETHER_STAT_CAP_100HDX:
break;
case ETHER_STAT_CAP_10FDX:
break;
case ETHER_STAT_CAP_10HDX:
break;
case ETHER_STAT_CAP_ASMPAUSE:
val = 1;
break;
case ETHER_STAT_CAP_PAUSE:
break;
case ETHER_STAT_CAP_AUTONEG:
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;
default:
/*
* Shouldn't reach here...
*/
#ifdef NXGE_DEBUG
"nxge_m_stat: unrecognized parameter value = 0x%x",
stat));
#endif
return (ENOTSUP);
}
return (0);
}