Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/fxp/if_fxp.c
Show All 12 Lines | |||||
struct sysctl_ctx_list *ctx; | struct sysctl_ctx_list *ctx; | ||||
struct sysctl_oid_list *child, *parent; | struct sysctl_oid_list *child, *parent; | ||||
struct sysctl_oid *tree; | struct sysctl_oid *tree; | ||||
struct fxp_hwstats *hsp; | struct fxp_hwstats *hsp; | ||||
ctx = device_get_sysctl_ctx(sc->dev); | ctx = device_get_sysctl_ctx(sc->dev); | ||||
child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); | child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); | ||||
SYSCTL_ADD_PROC(ctx, child, | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_delay", | ||||
OID_AUTO, "int_delay", CTLTYPE_INT | CTLFLAG_RW, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
&sc->tunable_int_delay, 0, sysctl_hw_fxp_int_delay, "I", | &sc->tunable_int_delay, 0, sysctl_hw_fxp_int_delay, "I", | ||||
"FXP driver receive interrupt microcode bundling delay"); | "FXP driver receive interrupt microcode bundling delay"); | ||||
SYSCTL_ADD_PROC(ctx, child, | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "bundle_max", | ||||
OID_AUTO, "bundle_max", CTLTYPE_INT | CTLFLAG_RW, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
&sc->tunable_bundle_max, 0, sysctl_hw_fxp_bundle_max, "I", | &sc->tunable_bundle_max, 0, sysctl_hw_fxp_bundle_max, "I", | ||||
"FXP driver receive interrupt microcode bundle size limit"); | "FXP driver receive interrupt microcode bundle size limit"); | ||||
SYSCTL_ADD_INT(ctx, child,OID_AUTO, "rnr", CTLFLAG_RD, &sc->rnr, 0, | SYSCTL_ADD_INT(ctx, child,OID_AUTO, "rnr", CTLFLAG_RD, &sc->rnr, 0, | ||||
"FXP RNR events"); | "FXP RNR events"); | ||||
/* | /* | ||||
* Pull in device tunables. | * Pull in device tunables. | ||||
*/ | */ | ||||
sc->tunable_int_delay = TUNABLE_INT_DELAY; | sc->tunable_int_delay = TUNABLE_INT_DELAY; | ||||
sc->tunable_bundle_max = TUNABLE_BUNDLE_MAX; | sc->tunable_bundle_max = TUNABLE_BUNDLE_MAX; | ||||
(void) resource_int_value(device_get_name(sc->dev), | (void) resource_int_value(device_get_name(sc->dev), | ||||
device_get_unit(sc->dev), "int_delay", &sc->tunable_int_delay); | device_get_unit(sc->dev), "int_delay", &sc->tunable_int_delay); | ||||
(void) resource_int_value(device_get_name(sc->dev), | (void) resource_int_value(device_get_name(sc->dev), | ||||
device_get_unit(sc->dev), "bundle_max", &sc->tunable_bundle_max); | device_get_unit(sc->dev), "bundle_max", &sc->tunable_bundle_max); | ||||
sc->rnr = 0; | sc->rnr = 0; | ||||
hsp = &sc->fxp_hwstats; | hsp = &sc->fxp_hwstats; | ||||
tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", | ||||
NULL, "FXP statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "FXP statistics"); | ||||
parent = SYSCTL_CHILDREN(tree); | parent = SYSCTL_CHILDREN(tree); | ||||
/* Rx MAC statistics. */ | /* Rx MAC statistics. */ | ||||
tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", | ||||
NULL, "Rx MAC statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); | ||||
child = SYSCTL_CHILDREN(tree); | child = SYSCTL_CHILDREN(tree); | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "good_frames", | FXP_SYSCTL_STAT_ADD(ctx, child, "good_frames", | ||||
&hsp->rx_good, "Good frames"); | &hsp->rx_good, "Good frames"); | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "crc_errors", | FXP_SYSCTL_STAT_ADD(ctx, child, "crc_errors", | ||||
&hsp->rx_crc_errors, "CRC errors"); | &hsp->rx_crc_errors, "CRC errors"); | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "alignment_errors", | FXP_SYSCTL_STAT_ADD(ctx, child, "alignment_errors", | ||||
&hsp->rx_alignment_errors, "Alignment errors"); | &hsp->rx_alignment_errors, "Alignment errors"); | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "rnr_errors", | FXP_SYSCTL_STAT_ADD(ctx, child, "rnr_errors", | ||||
Show All 10 Lines | |||||
FXP_SYSCTL_STAT_ADD(ctx, child, "controls", | FXP_SYSCTL_STAT_ADD(ctx, child, "controls", | ||||
&hsp->rx_controls, "Unsupported control frames"); | &hsp->rx_controls, "Unsupported control frames"); | ||||
} | } | ||||
if (sc->revision >= FXP_REV_82559_A0) | if (sc->revision >= FXP_REV_82559_A0) | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "tco", | FXP_SYSCTL_STAT_ADD(ctx, child, "tco", | ||||
&hsp->rx_tco, "TCO frames"); | &hsp->rx_tco, "TCO frames"); | ||||
/* Tx MAC statistics. */ | /* Tx MAC statistics. */ | ||||
tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", | ||||
NULL, "Tx MAC statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); | ||||
child = SYSCTL_CHILDREN(tree); | child = SYSCTL_CHILDREN(tree); | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "good_frames", | FXP_SYSCTL_STAT_ADD(ctx, child, "good_frames", | ||||
&hsp->tx_good, "Good frames"); | &hsp->tx_good, "Good frames"); | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "maxcols", | FXP_SYSCTL_STAT_ADD(ctx, child, "maxcols", | ||||
&hsp->tx_maxcols, "Maximum collisions errors"); | &hsp->tx_maxcols, "Maximum collisions errors"); | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "latecols", | FXP_SYSCTL_STAT_ADD(ctx, child, "latecols", | ||||
&hsp->tx_latecols, "Late collisions errors"); | &hsp->tx_latecols, "Late collisions errors"); | ||||
FXP_SYSCTL_STAT_ADD(ctx, child, "underruns", | FXP_SYSCTL_STAT_ADD(ctx, child, "underruns", | ||||
Show All 12 Lines |