Lines Matching +full:micro +full:- +full:frames
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2020 Advanced Micro Devices, Inc.
37 #include "xgbe-common.h"
173 #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
244 return(-EINVAL); in exit_bad_op()
252 printf("%s: len:0x%li idx:0x%li\n", __func__, req->newlen, in get_ubuf()
253 req->newidx); in get_ubuf()
254 if (req->newlen >= SYSCTL_BUF_LEN) in get_ubuf()
255 return (-EINVAL); in get_ubuf()
257 rc = SYSCTL_IN(req, ubuf, req->newlen); in get_ubuf()
260 ubuf[req->newlen] = '\0'; in get_ubuf()
322 sys_op->rx_coalesce_usecs = value; in fill_data()
325 sys_op->rx_max_coalesced_frames = value; in fill_data()
328 sys_op->rx_coalesce_usecs_irq = value; in fill_data()
331 sys_op->rx_max_coalesced_frames_irq = value; in fill_data()
334 sys_op->tx_coalesce_usecs = value; in fill_data()
337 sys_op->tx_max_coalesced_frames = value; in fill_data()
340 sys_op->tx_coalesce_usecs_irq = value; in fill_data()
343 sys_op->tx_max_coalesced_frames_irq = value; in fill_data()
346 sys_op->stats_block_coalesce_usecs = value; in fill_data()
349 sys_op->use_adaptive_rx_coalesce = value; in fill_data()
352 sys_op->use_adaptive_tx_coalesce = value; in fill_data()
355 sys_op->pkt_rate_low = value; in fill_data()
358 sys_op->rx_coalesce_usecs_low = value; in fill_data()
361 sys_op->rx_max_coalesced_frames_low = value; in fill_data()
364 sys_op->tx_coalesce_usecs_low = value; in fill_data()
367 sys_op->tx_max_coalesced_frames_low = value; in fill_data()
370 sys_op->pkt_rate_high = value; in fill_data()
373 sys_op->rx_coalesce_usecs_high = value; in fill_data()
376 sys_op->rx_max_coalesced_frames_high = value; in fill_data()
379 sys_op->tx_coalesce_usecs_high = value; in fill_data()
382 sys_op->tx_max_coalesced_frames_high = value; in fill_data()
385 sys_op->rate_sample_interval = value; in fill_data()
388 sys_op->autoneg = value; in fill_data()
391 sys_op->rx_pause = value; in fill_data()
394 sys_op->tx_pause = value; in fill_data()
397 sys_op->speed = value; in fill_data()
400 sys_op->duplex = value; in fill_data()
403 sys_op->rx_pending = value; in fill_data()
406 sys_op->rx_mini_pending = value; in fill_data()
409 sys_op->rx_jumbo_pending = value; in fill_data()
412 sys_op->tx_pending = value; in fill_data()
423 struct sysctl_op *sys_op = pdata->sys_op; in parse_generic_sysctl()
438 "not-supported") == 0){ in parse_generic_sysctl()
439 axgbe_printf(1, "ignoring not-supported " in parse_generic_sysctl()
496 if (req->newptr == NULL) { in sysctl_xgmac_reg_addr_handler()
504 pdata->sysctl_xgmac_reg); in sysctl_xgmac_reg_addr_handler()
506 pdata->sysctl_xgmac_reg); in sysctl_xgmac_reg_addr_handler()
516 pdata->sysctl_xgmac_reg = reg; in sysctl_xgmac_reg_addr_handler()
527 struct xgbe_hw_features *hw_feat = &pdata->hw_feat; in sysctl_get_drv_info_handler()
532 if (req->newptr == NULL) { in sysctl_get_drv_info_handler()
541 sbuf_printf(sb, "\nfirmware-version: %d.%d.%d", in sysctl_get_drv_info_handler()
542 XGMAC_GET_BITS(hw_feat->version, MAC_VR, USERVER), in sysctl_get_drv_info_handler()
543 XGMAC_GET_BITS(hw_feat->version, MAC_VR, DEVID), in sysctl_get_drv_info_handler()
544 XGMAC_GET_BITS(hw_feat->version, MAC_VR, SNPSVER)); in sysctl_get_drv_info_handler()
545 sbuf_printf(sb, "\nbus-info: %04d:%02d:%02d", in sysctl_get_drv_info_handler()
546 pdata->pcie_bus, pdata->pcie_device, pdata->pcie_func); in sysctl_get_drv_info_handler()
553 return (-EINVAL); in sysctl_get_drv_info_handler()
564 if (req->newptr == NULL) { in sysctl_get_link_info_handler()
571 sbuf_printf(sb, "\nLink is %s", pdata->phy.link ? "Up" : "Down"); in sysctl_get_link_info_handler()
577 return (-EINVAL); in sysctl_get_link_info_handler()
582 { "adaptive-rx", SYSL_BOOL, use_adaptive_rx_coalesce, "not-supported" }, \
583 { "adaptive-tx", SYSL_BOOL, use_adaptive_tx_coalesce, "not-supported" }, \
584 { "sample-interval", SYSL_S32, rate_sample_interval, "not-supported" }, \
585 { "stats-block-usecs", SYSL_S32, stats_block_coalesce_usecs, "not-supported" }, \
586 { "pkt-rate-low", SYSL_S32, pkt_rate_low, "not-supported" }, \
587 { "pkt-rate-high", SYSL_S32, pkt_rate_high, "not-supported" }, \
588 { "rx-usecs", SYSL_S32, rx_coalesce_usecs, "supported" }, \
589 { "rx-frames", SYSL_S32, rx_max_coalesced_frames, "supported" }, \
590 { "rx-usecs-irq", SYSL_S32, rx_coalesce_usecs_irq, "not-supported" }, \
591 { "rx-frames-irq", SYSL_S32, rx_max_coalesced_frames_irq, "not-supported" }, \
592 { "tx-usecs", SYSL_S32, tx_coalesce_usecs, "not-supported" }, \
593 { "tx-frames", SYSL_S32, tx_max_coalesced_frames, "supported" }, \
594 { "tx-usecs-irq", SYSL_S32, tx_coalesce_usecs_irq, "not-supported" }, \
595 { "tx-frames-irq", SYSL_S32, tx_max_coalesced_frames_irq, "not-supported" }, \
596 { "rx-usecs-low", SYSL_S32, rx_coalesce_usecs_low, "not-supported" }, \
597 { "rx-frames-low", SYSL_S32, rx_max_coalesced_frames_low, "not-supported"}, \
598 { "tx-usecs-low", SYSL_S32, tx_coalesce_usecs_low, "not-supported" }, \
599 { "tx-frames-low", SYSL_S32, tx_max_coalesced_frames_low, "not-supported" }, \
600 { "rx-usecs-high", SYSL_S32, rx_coalesce_usecs_high, "not-supported" }, \
601 { "rx-frames-high", SYSL_S32, rx_max_coalesced_frames_high, "not-supported" }, \
602 { "tx-usecs-high", SYSL_S32, tx_coalesce_usecs_high, "not-supported" }, \
603 { "tx-frames-high", SYSL_S32, tx_max_coalesced_frames_high, "not-supported" }, \
610 struct xgbe_hw_if *hw_if = &pdata->hw_if; in sysctl_coalesce_handler()
611 struct sysctl_op *sys_op = pdata->sys_op; in sysctl_coalesce_handler()
620 if (req->newptr == NULL) { in sysctl_coalesce_handler()
626 sys_op->rx_coalesce_usecs = pdata->rx_usecs; in sysctl_coalesce_handler()
627 sys_op->rx_max_coalesced_frames = pdata->rx_frames; in sysctl_coalesce_handler()
628 sys_op->tx_max_coalesced_frames = pdata->tx_frames; in sysctl_coalesce_handler()
631 sys_op->use_adaptive_rx_coalesce ? "on" : "off", in sysctl_coalesce_handler()
632 sys_op->use_adaptive_tx_coalesce ? "on" : "off"); in sysctl_coalesce_handler()
634 sbuf_printf(sb, "stats-block-usecs: %u\n" in sysctl_coalesce_handler()
635 "sample-interval: %u\n" in sysctl_coalesce_handler()
636 "pkt-rate-low: %u\n" in sysctl_coalesce_handler()
637 "pkt-rate-high: %u\n" in sysctl_coalesce_handler()
639 "rx-usecs: %u\n" in sysctl_coalesce_handler()
640 "rx-frames: %u\n" in sysctl_coalesce_handler()
641 "rx-usecs-irq: %u\n" in sysctl_coalesce_handler()
642 "rx-frames-irq: %u\n" in sysctl_coalesce_handler()
644 "tx-usecs: %u\n" in sysctl_coalesce_handler()
645 "tx-frames: %u\n" in sysctl_coalesce_handler()
646 "tx-usecs-irq: %u\n" in sysctl_coalesce_handler()
647 "tx-frames-irq: %u\n" in sysctl_coalesce_handler()
649 "rx-usecs-low: %u\n" in sysctl_coalesce_handler()
650 "rx-frames-low: %u\n" in sysctl_coalesce_handler()
651 "tx-usecs-low: %u\n" in sysctl_coalesce_handler()
652 "tx-frames-low: %u\n" in sysctl_coalesce_handler()
654 "rx-usecs-high: %u\n" in sysctl_coalesce_handler()
655 "rx-frames-high: %u\n" in sysctl_coalesce_handler()
656 "tx-usecs-high: %u\n" in sysctl_coalesce_handler()
657 "tx-frames-high: %u\n", in sysctl_coalesce_handler()
658 sys_op->stats_block_coalesce_usecs, in sysctl_coalesce_handler()
659 sys_op->rate_sample_interval, in sysctl_coalesce_handler()
660 sys_op->pkt_rate_low, in sysctl_coalesce_handler()
661 sys_op->pkt_rate_high, in sysctl_coalesce_handler()
663 sys_op->rx_coalesce_usecs, in sysctl_coalesce_handler()
664 sys_op->rx_max_coalesced_frames, in sysctl_coalesce_handler()
665 sys_op->rx_coalesce_usecs_irq, in sysctl_coalesce_handler()
666 sys_op->rx_max_coalesced_frames_irq, in sysctl_coalesce_handler()
668 sys_op->tx_coalesce_usecs, in sysctl_coalesce_handler()
669 sys_op->tx_max_coalesced_frames, in sysctl_coalesce_handler()
670 sys_op->tx_coalesce_usecs_irq, in sysctl_coalesce_handler()
671 sys_op->tx_max_coalesced_frames_irq, in sysctl_coalesce_handler()
673 sys_op->rx_coalesce_usecs_low, in sysctl_coalesce_handler()
674 sys_op->rx_max_coalesced_frames_low, in sysctl_coalesce_handler()
675 sys_op->tx_coalesce_usecs_low, in sysctl_coalesce_handler()
676 sys_op->tx_max_coalesced_frames_low, in sysctl_coalesce_handler()
678 sys_op->rx_coalesce_usecs_high, in sysctl_coalesce_handler()
679 sys_op->rx_max_coalesced_frames_high, in sysctl_coalesce_handler()
680 sys_op->tx_coalesce_usecs_high, in sysctl_coalesce_handler()
681 sys_op->tx_max_coalesced_frames_high); in sysctl_coalesce_handler()
693 rx_riwt = hw_if->usec_to_riwt(pdata, sys_op->rx_coalesce_usecs); in sysctl_coalesce_handler()
694 rx_usecs = sys_op->rx_coalesce_usecs; in sysctl_coalesce_handler()
695 rx_frames = sys_op->rx_max_coalesced_frames; in sysctl_coalesce_handler()
703 axgbe_printf(2, "rx-usec is limited to %d usecs\n", in sysctl_coalesce_handler()
704 hw_if->riwt_to_usec(pdata, XGMAC_MAX_DMA_RIWT)); in sysctl_coalesce_handler()
705 return (-EINVAL); in sysctl_coalesce_handler()
707 if (rx_frames > pdata->rx_desc_count) { in sysctl_coalesce_handler()
708 axgbe_printf(2, "rx-frames is limited to %d frames\n", in sysctl_coalesce_handler()
709 pdata->rx_desc_count); in sysctl_coalesce_handler()
710 return (-EINVAL); in sysctl_coalesce_handler()
713 tx_frames = sys_op->tx_max_coalesced_frames; in sysctl_coalesce_handler()
716 if (tx_frames > pdata->tx_desc_count) { in sysctl_coalesce_handler()
717 axgbe_printf(2, "tx-frames is limited to %d frames\n", in sysctl_coalesce_handler()
718 pdata->tx_desc_count); in sysctl_coalesce_handler()
719 return (-EINVAL); in sysctl_coalesce_handler()
722 pdata->rx_riwt = rx_riwt; in sysctl_coalesce_handler()
723 pdata->rx_usecs = rx_usecs; in sysctl_coalesce_handler()
724 pdata->rx_frames = rx_frames; in sysctl_coalesce_handler()
725 hw_if->config_rx_coalesce(pdata); in sysctl_coalesce_handler()
727 pdata->tx_frames = tx_frames; in sysctl_coalesce_handler()
728 hw_if->config_tx_coalesce(pdata); in sysctl_coalesce_handler()
740 struct sysctl_op *sys_op = pdata->sys_op; in sysctl_pauseparam_handler()
751 if (req->newptr == NULL) { in sysctl_pauseparam_handler()
757 sys_op->autoneg = pdata->phy.pause_autoneg; in sysctl_pauseparam_handler()
758 sys_op->tx_pause = pdata->phy.tx_pause; in sysctl_pauseparam_handler()
759 sys_op->rx_pause = pdata->phy.rx_pause; in sysctl_pauseparam_handler()
765 sys_op->autoneg ? "on" : "off", in sysctl_pauseparam_handler()
766 sys_op->rx_pause ? "on" : "off", in sysctl_pauseparam_handler()
767 sys_op->tx_pause ? "on" : "off"); in sysctl_pauseparam_handler()
769 if (pdata->phy.lp_advertising) { in sysctl_pauseparam_handler()
772 if (pdata->phy.advertising & pdata->phy.lp_advertising & in sysctl_pauseparam_handler()
776 } else if (pdata->phy.advertising & in sysctl_pauseparam_handler()
777 pdata->phy.lp_advertising & ADVERTISED_Asym_Pause) { in sysctl_pauseparam_handler()
778 if (pdata->phy.advertising & ADVERTISED_Pause) in sysctl_pauseparam_handler()
780 else if (pdata->phy.lp_advertising & in sysctl_pauseparam_handler()
785 "\n->\nRX negotiated: %s\n" in sysctl_pauseparam_handler()
800 if (sys_op->autoneg && (pdata->phy.autoneg != AUTONEG_ENABLE)) { in sysctl_pauseparam_handler()
802 return (-EINVAL); in sysctl_pauseparam_handler()
805 pdata->phy.pause_autoneg = sys_op->autoneg; in sysctl_pauseparam_handler()
806 pdata->phy.tx_pause = sys_op->tx_pause; in sysctl_pauseparam_handler()
807 pdata->phy.rx_pause = sys_op->rx_pause; in sysctl_pauseparam_handler()
809 XGBE_CLR_ADV(&pdata->phy, Pause); in sysctl_pauseparam_handler()
810 XGBE_CLR_ADV(&pdata->phy, Asym_Pause); in sysctl_pauseparam_handler()
812 if (sys_op->rx_pause) { in sysctl_pauseparam_handler()
813 XGBE_SET_ADV(&pdata->phy, Pause); in sysctl_pauseparam_handler()
814 XGBE_SET_ADV(&pdata->phy, Asym_Pause); in sysctl_pauseparam_handler()
817 if (sys_op->tx_pause) { in sysctl_pauseparam_handler()
819 if (XGBE_ADV(&pdata->phy, Asym_Pause)) in sysctl_pauseparam_handler()
820 XGBE_CLR_ADV(&pdata->phy, Asym_Pause); in sysctl_pauseparam_handler()
822 XGBE_SET_ADV(&pdata->phy, Asym_Pause); in sysctl_pauseparam_handler()
825 if (test_bit(XGBE_LINK_INIT, &pdata->dev_state)) in sysctl_pauseparam_handler()
826 rc = pdata->phy_if.phy_config_aneg(pdata); in sysctl_pauseparam_handler()
837 struct sysctl_op *sys_op = pdata->sys_op; in sysctl_link_ksettings_handler()
849 if (req->newptr == NULL) { in sysctl_link_ksettings_handler()
855 sys_op->autoneg = pdata->phy.autoneg; in sysctl_link_ksettings_handler()
856 sys_op->speed = pdata->phy.speed; in sysctl_link_ksettings_handler()
857 sys_op->duplex = pdata->phy.duplex; in sysctl_link_ksettings_handler()
859 XGBE_LM_COPY(&pdata->phy, supported, &pdata->phy, supported); in sysctl_link_ksettings_handler()
860 XGBE_LM_COPY(&pdata->phy, advertising, &pdata->phy, advertising); in sysctl_link_ksettings_handler()
861 XGBE_LM_COPY(&pdata->phy, lp_advertising, &pdata->phy, lp_advertising); in sysctl_link_ksettings_handler()
863 switch (sys_op->speed) { in sysctl_link_ksettings_handler()
895 (sys_op->autoneg == AUTONEG_DISABLE) ? "off" : "on", in sysctl_link_ksettings_handler()
898 switch (sys_op->duplex) { in sysctl_link_ksettings_handler()
919 speed = sys_op->speed; in sysctl_link_ksettings_handler()
921 if ((sys_op->autoneg != AUTONEG_ENABLE) && in sysctl_link_ksettings_handler()
922 (sys_op->autoneg != AUTONEG_DISABLE)) { in sysctl_link_ksettings_handler()
924 (unsigned char)sys_op->autoneg); in sysctl_link_ksettings_handler()
925 return (-EINVAL); in sysctl_link_ksettings_handler()
928 if (sys_op->autoneg == AUTONEG_DISABLE) { in sysctl_link_ksettings_handler()
929 if (!pdata->phy_if.phy_valid_speed(pdata, speed)) { in sysctl_link_ksettings_handler()
931 return (-EINVAL); in sysctl_link_ksettings_handler()
934 if (sys_op->duplex != DUPLEX_FULL) { in sysctl_link_ksettings_handler()
936 (unsigned char)sys_op->duplex); in sysctl_link_ksettings_handler()
937 return (-EINVAL); in sysctl_link_ksettings_handler()
941 pdata->phy.autoneg = sys_op->autoneg; in sysctl_link_ksettings_handler()
942 pdata->phy.speed = speed; in sysctl_link_ksettings_handler()
943 pdata->phy.duplex = sys_op->duplex; in sysctl_link_ksettings_handler()
945 if (sys_op->autoneg == AUTONEG_ENABLE) in sysctl_link_ksettings_handler()
946 XGBE_SET_ADV(&pdata->phy, Autoneg); in sysctl_link_ksettings_handler()
948 XGBE_CLR_ADV(&pdata->phy, Autoneg); in sysctl_link_ksettings_handler()
950 if (test_bit(XGBE_LINK_INIT, &pdata->dev_state)) in sysctl_link_ksettings_handler()
951 rc = pdata->phy_if.phy_config_aneg(pdata); in sysctl_link_ksettings_handler()
961 struct sysctl_op *sys_op = pdata->sys_op; in sysctl_ringparam_handler()
964 { "rx-mini", SYSL_S32, rx_mini_pending, "supported" }, in sysctl_ringparam_handler()
965 { "rx-jumbo", SYSL_S32, rx_jumbo_pending, "supported" }, in sysctl_ringparam_handler()
974 if (req->newptr == NULL) { in sysctl_ringparam_handler()
980 sys_op->rx_max_pending = XGBE_RX_DESC_CNT_MAX; in sysctl_ringparam_handler()
981 sys_op->tx_max_pending = XGBE_TX_DESC_CNT_MAX; in sysctl_ringparam_handler()
982 sys_op->rx_pending = pdata->rx_desc_count; in sysctl_ringparam_handler()
983 sys_op->tx_pending = pdata->tx_desc_count; in sysctl_ringparam_handler()
986 "\nPre-set maximums:\n" in sysctl_ringparam_handler()
991 sys_op->rx_max_pending, in sysctl_ringparam_handler()
992 sys_op->rx_mini_max_pending, in sysctl_ringparam_handler()
993 sys_op->rx_jumbo_max_pending, in sysctl_ringparam_handler()
994 sys_op->tx_max_pending); in sysctl_ringparam_handler()
1002 sys_op->rx_pending, in sysctl_ringparam_handler()
1003 sys_op->rx_mini_pending, in sysctl_ringparam_handler()
1004 sys_op->rx_jumbo_pending, in sysctl_ringparam_handler()
1005 sys_op->tx_pending); in sysctl_ringparam_handler()
1017 if (sys_op->rx_mini_pending || sys_op->rx_jumbo_pending) { in sysctl_ringparam_handler()
1019 return (-EINVAL); in sysctl_ringparam_handler()
1022 if ((sys_op->rx_pending < XGBE_RX_DESC_CNT_MIN) || in sysctl_ringparam_handler()
1023 (sys_op->rx_pending > XGBE_RX_DESC_CNT_MAX)) { in sysctl_ringparam_handler()
1026 return (-EINVAL); in sysctl_ringparam_handler()
1029 if ((sys_op->tx_pending < XGBE_TX_DESC_CNT_MIN) || in sysctl_ringparam_handler()
1030 (sys_op->tx_pending > XGBE_TX_DESC_CNT_MAX)) { in sysctl_ringparam_handler()
1033 return (-EINVAL); in sysctl_ringparam_handler()
1036 rx = rounddown_pow_of_two(sys_op->rx_pending); in sysctl_ringparam_handler()
1037 if (rx != sys_op->rx_pending) in sysctl_ringparam_handler()
1041 tx = rounddown_pow_of_two(sys_op->tx_pending); in sysctl_ringparam_handler()
1042 if (tx != sys_op->tx_pending) in sysctl_ringparam_handler()
1046 if ((rx == pdata->rx_desc_count) && in sysctl_ringparam_handler()
1047 (tx == pdata->tx_desc_count)) in sysctl_ringparam_handler()
1050 pdata->rx_desc_count = rx; in sysctl_ringparam_handler()
1051 pdata->tx_desc_count = tx; in sysctl_ringparam_handler()
1053 /* TODO - restart dev */ in sysctl_ringparam_handler()
1064 struct sysctl_op *sys_op = pdata->sys_op; in sysctl_channels_handler()
1077 if (req->newptr == NULL) { in sysctl_channels_handler()
1083 rx = min(pdata->hw_feat.rx_ch_cnt, pdata->rx_max_channel_count); in sysctl_channels_handler()
1084 rx = min(rx, pdata->channel_irq_count); in sysctl_channels_handler()
1085 tx = min(pdata->hw_feat.tx_ch_cnt, pdata->tx_max_channel_count); in sysctl_channels_handler()
1086 tx = min(tx, pdata->channel_irq_count); in sysctl_channels_handler()
1087 tx = min(tx, pdata->tx_max_q_count); in sysctl_channels_handler()
1091 sys_op->max_combined = combined; in sysctl_channels_handler()
1092 sys_op->max_rx = rx ? rx - 1 : 0; in sysctl_channels_handler()
1093 sys_op->max_tx = tx ? tx - 1 : 0; in sysctl_channels_handler()
1096 rx = pdata->rx_ring_count; in sysctl_channels_handler()
1097 tx = pdata->tx_ring_count; in sysctl_channels_handler()
1100 rx -= combined; in sysctl_channels_handler()
1101 tx -= combined; in sysctl_channels_handler()
1103 sys_op->combined_count = combined; in sysctl_channels_handler()
1104 sys_op->rx_count = rx; in sysctl_channels_handler()
1105 sys_op->tx_count = tx; in sysctl_channels_handler()
1108 "\nPre-set maximums:\n" in sysctl_channels_handler()
1113 sys_op->max_rx, sys_op->max_tx, in sysctl_channels_handler()
1114 sys_op->max_other, in sysctl_channels_handler()
1115 sys_op->max_combined); in sysctl_channels_handler()
1123 sys_op->rx_count, sys_op->tx_count, in sysctl_channels_handler()
1124 sys_op->other_count, in sysctl_channels_handler()
1125 sys_op->combined_count); in sysctl_channels_handler()
1137 axgbe_error( "channel inputs: combined=%u, rx-only=%u," in sysctl_channels_handler()
1138 " tx-only=%u\n", sys_op->combined_count, in sysctl_channels_handler()
1139 sys_op->rx_count, sys_op->tx_count); in sysctl_channels_handler()
1155 if (req->newptr == NULL) { in sysctl_mac_stats_handler()
1162 pdata->hw_if.read_mmc_stats(pdata); in sysctl_mac_stats_handler()
1168 for (i = 0; i < pdata->tx_ring_count; i++) { in sysctl_mac_stats_handler()
1172 i, pdata->ext_stats.txq_packets[i], in sysctl_mac_stats_handler()
1173 i, pdata->ext_stats.txq_bytes[i]); in sysctl_mac_stats_handler()
1175 for (i = 0; i < pdata->rx_ring_count; i++) { in sysctl_mac_stats_handler()
1179 i, pdata->ext_stats.rxq_packets[i], in sysctl_mac_stats_handler()
1180 i, pdata->ext_stats.rxq_bytes[i]); in sysctl_mac_stats_handler()
1188 return (-EINVAL); in sysctl_mac_stats_handler()
1201 if (req->newptr == NULL) { in sysctl_xgmac_reg_value_handler()
1208 value = XGMAC_IOREAD(pdata, pdata->sysctl_xgmac_reg); in sysctl_xgmac_reg_value_handler()
1220 XGMAC_IOWRITE(pdata, pdata->sysctl_xgmac_reg, value); in sysctl_xgmac_reg_value_handler()
1237 if (req->newptr == NULL) { in sysctl_xpcs_mmd_reg_handler()
1245 pdata->sysctl_xpcs_mmd); in sysctl_xpcs_mmd_reg_handler()
1247 pdata->sysctl_xpcs_mmd); in sysctl_xpcs_mmd_reg_handler()
1257 pdata->sysctl_xpcs_mmd = reg; in sysctl_xpcs_mmd_reg_handler()
1274 if (req->newptr == NULL) { in sysctl_xpcs_reg_addr_handler()
1282 pdata->sysctl_xpcs_reg); in sysctl_xpcs_reg_addr_handler()
1284 pdata->sysctl_xpcs_reg); in sysctl_xpcs_reg_addr_handler()
1294 pdata->sysctl_xpcs_reg = reg; in sysctl_xpcs_reg_addr_handler()
1311 if (req->newptr == NULL) { in sysctl_xpcs_reg_value_handler()
1318 value = XMDIO_READ(pdata, pdata->sysctl_xpcs_mmd, in sysctl_xpcs_reg_value_handler()
1319 pdata->sysctl_xpcs_reg); in sysctl_xpcs_reg_value_handler()
1331 XMDIO_WRITE(pdata, pdata->sysctl_xpcs_mmd, in sysctl_xpcs_reg_value_handler()
1332 pdata->sysctl_xpcs_reg, value); in sysctl_xpcs_reg_value_handler()
1349 if (req->newptr == NULL) { in sysctl_xprop_reg_addr_handler()
1357 pdata->sysctl_xprop_reg); in sysctl_xprop_reg_addr_handler()
1359 pdata->sysctl_xprop_reg); in sysctl_xprop_reg_addr_handler()
1369 pdata->sysctl_xprop_reg = reg; in sysctl_xprop_reg_addr_handler()
1386 if (req->newptr == NULL) { in sysctl_xprop_reg_value_handler()
1393 value = XP_IOREAD(pdata, pdata->sysctl_xprop_reg); in sysctl_xprop_reg_value_handler()
1405 XP_IOWRITE(pdata, pdata->sysctl_xprop_reg, value); in sysctl_xprop_reg_value_handler()
1422 if (req->newptr == NULL) { in sysctl_xi2c_reg_addr_handler()
1430 pdata->sysctl_xi2c_reg); in sysctl_xi2c_reg_addr_handler()
1432 pdata->sysctl_xi2c_reg); in sysctl_xi2c_reg_addr_handler()
1442 pdata->sysctl_xi2c_reg = reg; in sysctl_xi2c_reg_addr_handler()
1459 if (req->newptr == NULL) { in sysctl_xi2c_reg_value_handler()
1466 value = XI2C_IOREAD(pdata, pdata->sysctl_xi2c_reg); in sysctl_xi2c_reg_value_handler()
1478 XI2C_IOWRITE(pdata, pdata->sysctl_xi2c_reg, value); in sysctl_xi2c_reg_value_handler()
1495 if (req->newptr == NULL) { in sysctl_an_cdr_wr_handler()
1503 pdata->sysctl_an_cdr_workaround); in sysctl_an_cdr_wr_handler()
1504 sbuf_printf(sb, "%d\n", pdata->sysctl_an_cdr_workaround); in sysctl_an_cdr_wr_handler()
1517 pdata->sysctl_an_cdr_workaround = 1; in sysctl_an_cdr_wr_handler()
1519 pdata->sysctl_an_cdr_workaround = 0; in sysctl_an_cdr_wr_handler()
1536 if (req->newptr == NULL) { in sysctl_an_cdr_track_early_handler()
1544 pdata->sysctl_an_cdr_track_early); in sysctl_an_cdr_track_early_handler()
1545 sbuf_printf(sb, "%d\n", pdata->sysctl_an_cdr_track_early); in sysctl_an_cdr_track_early_handler()
1558 pdata->sysctl_an_cdr_track_early = 1; in sysctl_an_cdr_track_early_handler()
1560 pdata->sysctl_an_cdr_track_early = 0; in sysctl_an_cdr_track_early_handler()
1571 if (pdata->sys_op) in axgbe_sysctl_exit()
1572 free(pdata->sys_op, M_AXGBE); in axgbe_sysctl_exit()
1584 pdata->sys_op = sys_op; in axgbe_sysctl_init()
1586 clist = device_get_sysctl_ctx(pdata->dev); in axgbe_sysctl_init()
1587 parent = device_get_sysctl_tree(pdata->dev); in axgbe_sysctl_init()
1591 pdata->sysctl_xgmac_reg = 0; in axgbe_sysctl_init()
1592 pdata->sysctl_xpcs_mmd = 1; in axgbe_sysctl_init()
1593 pdata->sysctl_xpcs_reg = 0; in axgbe_sysctl_init()
1594 pdata->link_workaround = 1; in axgbe_sysctl_init()
1595 pdata->tx_pause = 1; in axgbe_sysctl_init()
1596 pdata->rx_pause = 1; in axgbe_sysctl_init()
1597 pdata->enable_rss = 1; in axgbe_sysctl_init()
1600 &pdata->debug_level, 0, "axgbe log level -- higher is verbose"); in axgbe_sysctl_init()
1603 CTLFLAG_RDTUN, &pdata->sph_enable, 1, in axgbe_sysctl_init()
1604 "shows the split header feature state (1 - enable, 0 - disable"); in axgbe_sysctl_init()
1607 CTLFLAG_RWTUN, &pdata->link_workaround, 0, in axgbe_sysctl_init()
1611 CTLFLAG_RDTUN, &pdata->enable_rss, 1, in axgbe_sysctl_init()
1612 "shows the RSS feature state (1 - enable, 0 - disable)"); in axgbe_sysctl_init()
1615 CTLFLAG_RDTUN, &pdata->tx_pause, 1, in axgbe_sysctl_init()
1616 "shows the Flow Control TX pause feature state (1 - enable, 0 - disable)"); in axgbe_sysctl_init()
1619 CTLFLAG_RDTUN, &pdata->rx_pause, 1, in axgbe_sysctl_init()
1620 "shows the Flow Control RX pause feature state (1 - enable, 0 - disable)"); in axgbe_sysctl_init()
1645 if (pdata->xpcs_res) { in axgbe_sysctl_init()
1657 if (pdata->xpcs_res) { in axgbe_sysctl_init()
1669 if (pdata->vdata->an_cdr_workaround) { in axgbe_sysctl_init()