Lines Matching +full:half +full:- +full:duplex

1 // SPDX-License-Identifier: GPL-2.0-only
17 [NETIF_F_SG_BIT] = "tx-scatter-gather",
18 [NETIF_F_IP_CSUM_BIT] = "tx-checksum-ipv4",
19 [NETIF_F_HW_CSUM_BIT] = "tx-checksum-ip-generic",
20 [NETIF_F_IPV6_CSUM_BIT] = "tx-checksum-ipv6",
22 [NETIF_F_FRAGLIST_BIT] = "tx-scatter-gather-fraglist",
23 [NETIF_F_HW_VLAN_CTAG_TX_BIT] = "tx-vlan-hw-insert",
25 [NETIF_F_HW_VLAN_CTAG_RX_BIT] = "rx-vlan-hw-parse",
26 [NETIF_F_HW_VLAN_CTAG_FILTER_BIT] = "rx-vlan-filter",
27 [NETIF_F_HW_VLAN_STAG_TX_BIT] = "tx-vlan-stag-hw-insert",
28 [NETIF_F_HW_VLAN_STAG_RX_BIT] = "rx-vlan-stag-hw-parse",
29 [NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter",
30 [NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged",
31 [NETIF_F_GSO_BIT] = "tx-generic-segmentation",
32 [NETIF_F_GRO_BIT] = "rx-gro",
33 [NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
34 [NETIF_F_LRO_BIT] = "rx-lro",
36 [NETIF_F_TSO_BIT] = "tx-tcp-segmentation",
37 [NETIF_F_GSO_ROBUST_BIT] = "tx-gso-robust",
38 [NETIF_F_TSO_ECN_BIT] = "tx-tcp-ecn-segmentation",
39 [NETIF_F_TSO_MANGLEID_BIT] = "tx-tcp-mangleid-segmentation",
40 [NETIF_F_TSO6_BIT] = "tx-tcp6-segmentation",
41 [NETIF_F_FSO_BIT] = "tx-fcoe-segmentation",
42 [NETIF_F_GSO_GRE_BIT] = "tx-gre-segmentation",
43 [NETIF_F_GSO_GRE_CSUM_BIT] = "tx-gre-csum-segmentation",
44 [NETIF_F_GSO_IPXIP4_BIT] = "tx-ipxip4-segmentation",
45 [NETIF_F_GSO_IPXIP6_BIT] = "tx-ipxip6-segmentation",
46 [NETIF_F_GSO_UDP_TUNNEL_BIT] = "tx-udp_tnl-segmentation",
47 [NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT] = "tx-udp_tnl-csum-segmentation",
48 [NETIF_F_GSO_PARTIAL_BIT] = "tx-gso-partial",
49 [NETIF_F_GSO_TUNNEL_REMCSUM_BIT] = "tx-tunnel-remcsum-segmentation",
50 [NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation",
51 [NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation",
52 [NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation",
53 [NETIF_F_GSO_FRAGLIST_BIT] = "tx-gso-list",
55 [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
56 [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
57 [NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter",
58 [NETIF_F_RXHASH_BIT] = "rx-hashing",
59 [NETIF_F_RXCSUM_BIT] = "rx-checksum",
60 [NETIF_F_NOCACHE_COPY_BIT] = "tx-nocache-copy",
62 [NETIF_F_RXFCS_BIT] = "rx-fcs",
63 [NETIF_F_RXALL_BIT] = "rx-all",
64 [NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload",
65 [NETIF_F_HW_TC_BIT] = "hw-tc-offload",
66 [NETIF_F_HW_ESP_BIT] = "esp-hw-offload",
67 [NETIF_F_HW_ESP_TX_CSUM_BIT] = "esp-tx-csum-hw-offload",
68 [NETIF_F_RX_UDP_TUNNEL_PORT_BIT] = "rx-udp_tunnel-port-offload",
69 [NETIF_F_HW_TLS_RECORD_BIT] = "tls-hw-record",
70 [NETIF_F_HW_TLS_TX_BIT] = "tls-hw-tx-offload",
71 [NETIF_F_HW_TLS_RX_BIT] = "tls-hw-rx-offload",
72 [NETIF_F_GRO_FRAGLIST_BIT] = "rx-gro-list",
73 [NETIF_F_HW_MACSEC_BIT] = "macsec-hw-offload",
74 [NETIF_F_GRO_UDP_FWD_BIT] = "rx-udp-gro-forwarding",
75 [NETIF_F_HW_HSR_TAG_INS_BIT] = "hsr-tag-ins-offload",
76 [NETIF_F_HW_HSR_TAG_RM_BIT] = "hsr-tag-rm-offload",
77 [NETIF_F_HW_HSR_FWD_BIT] = "hsr-fwd-offload",
78 [NETIF_F_HW_HSR_DUP_BIT] = "hsr-dup-offload",
91 [ETHTOOL_RX_COPYBREAK] = "rx-copybreak",
92 [ETHTOOL_TX_COPYBREAK] = "tx-copybreak",
93 [ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
94 [ETHTOOL_TX_COPYBREAK_BUF_SIZE] = "tx-copybreak-buf-size",
100 [ETHTOOL_PHY_DOWNSHIFT] = "phy-downshift",
101 [ETHTOOL_PHY_FAST_LINK_DOWN] = "phy-fast-link-down",
102 [ETHTOOL_PHY_EDPD] = "phy-energy-detect-power-down",
105 #define __LINK_MODE_NAME(speed, type, duplex) \ argument
106 #speed "base" #type "/" #duplex
107 #define __DEFINE_LINK_MODE_NAME(speed, type, duplex) \ argument
108 [ETHTOOL_LINK_MODE(speed, type, duplex)] = \
109 __LINK_MODE_NAME(speed, type, duplex)
114 __DEFINE_LINK_MODE_NAME(10, T, Half),
116 __DEFINE_LINK_MODE_NAME(100, T, Half),
118 __DEFINE_LINK_MODE_NAME(1000, T, Half),
204 __DEFINE_LINK_MODE_NAME(100, FX, Half),
214 __DEFINE_LINK_MODE_NAME(10, T1S, Half),
215 __DEFINE_LINK_MODE_NAME(10, T1S_P2MP, Half),
263 .duplex = __DUPLEX_ ## _duplex \
271 .duplex = DUPLEX_UNKNOWN, \
275 __DEFINE_LINK_MODE_PARAMS(10, T, Half),
277 __DEFINE_LINK_MODE_PARAMS(100, T, Half),
279 __DEFINE_LINK_MODE_PARAMS(1000, T, Half),
298 .duplex = DUPLEX_FULL,
369 __DEFINE_LINK_MODE_PARAMS(100, FX, Half),
379 __DEFINE_LINK_MODE_PARAMS(10, T1S, Half),
380 __DEFINE_LINK_MODE_PARAMS(10, T1S_P2MP, Half),
417 [const_ilog2(SOF_TIMESTAMPING_TX_HARDWARE)] = "hardware-transmit",
418 [const_ilog2(SOF_TIMESTAMPING_TX_SOFTWARE)] = "software-transmit",
419 [const_ilog2(SOF_TIMESTAMPING_RX_HARDWARE)] = "hardware-receive",
420 [const_ilog2(SOF_TIMESTAMPING_RX_SOFTWARE)] = "software-receive",
421 [const_ilog2(SOF_TIMESTAMPING_SOFTWARE)] = "software-system-clock",
422 [const_ilog2(SOF_TIMESTAMPING_SYS_HARDWARE)] = "hardware-legacy-clock",
423 [const_ilog2(SOF_TIMESTAMPING_RAW_HARDWARE)] = "hardware-raw-clock",
424 [const_ilog2(SOF_TIMESTAMPING_OPT_ID)] = "option-id",
425 [const_ilog2(SOF_TIMESTAMPING_TX_SCHED)] = "sched-transmit",
426 [const_ilog2(SOF_TIMESTAMPING_TX_ACK)] = "ack-transmit",
427 [const_ilog2(SOF_TIMESTAMPING_OPT_CMSG)] = "option-cmsg",
428 [const_ilog2(SOF_TIMESTAMPING_OPT_TSONLY)] = "option-tsonly",
429 [const_ilog2(SOF_TIMESTAMPING_OPT_STATS)] = "option-stats",
430 [const_ilog2(SOF_TIMESTAMPING_OPT_PKTINFO)] = "option-pktinfo",
431 [const_ilog2(SOF_TIMESTAMPING_OPT_TX_SWHW)] = "option-tx-swhw",
432 [const_ilog2(SOF_TIMESTAMPING_BIND_PHC)] = "bind-phc",
433 [const_ilog2(SOF_TIMESTAMPING_OPT_ID_TCP)] = "option-id-tcp",
434 [const_ilog2(SOF_TIMESTAMPING_OPT_RX_FILTER)] = "option-rx-filter",
441 [HWTSTAMP_TX_ONESTEP_SYNC] = "onestep-sync",
442 [HWTSTAMP_TX_ONESTEP_P2P] = "onestep-p2p",
450 [HWTSTAMP_FILTER_PTP_V1_L4_EVENT] = "ptpv1-l4-event",
451 [HWTSTAMP_FILTER_PTP_V1_L4_SYNC] = "ptpv1-l4-sync",
452 [HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ] = "ptpv1-l4-delay-req",
453 [HWTSTAMP_FILTER_PTP_V2_L4_EVENT] = "ptpv2-l4-event",
454 [HWTSTAMP_FILTER_PTP_V2_L4_SYNC] = "ptpv2-l4-sync",
455 [HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ] = "ptpv2-l4-delay-req",
456 [HWTSTAMP_FILTER_PTP_V2_L2_EVENT] = "ptpv2-l2-event",
457 [HWTSTAMP_FILTER_PTP_V2_L2_SYNC] = "ptpv2-l2-sync",
458 [HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ] = "ptpv2-l2-delay-req",
459 [HWTSTAMP_FILTER_PTP_V2_EVENT] = "ptpv2-event",
460 [HWTSTAMP_FILTER_PTP_V2_SYNC] = "ptpv2-sync",
461 [HWTSTAMP_FILTER_PTP_V2_DELAY_REQ] = "ptpv2-delay-req",
462 [HWTSTAMP_FILTER_NTP_ALL] = "ntp-all",
467 [const_ilog2(HWTSTAMP_FLAG_BONDED_PHC_INDEX)] = "bonded-phc-index",
474 [ETHTOOL_UDP_TUNNEL_TYPE_VXLAN_GPE] = "vxlan-gpe",
479 /* return false if legacy contained non-0 deprecated fields
495 if (legacy_settings->maxtxpkt || in convert_legacy_settings_to_link_ksettings()
496 legacy_settings->maxrxpkt) in convert_legacy_settings_to_link_ksettings()
500 link_ksettings->link_modes.supported, in convert_legacy_settings_to_link_ksettings()
501 legacy_settings->supported); in convert_legacy_settings_to_link_ksettings()
503 link_ksettings->link_modes.advertising, in convert_legacy_settings_to_link_ksettings()
504 legacy_settings->advertising); in convert_legacy_settings_to_link_ksettings()
506 link_ksettings->link_modes.lp_advertising, in convert_legacy_settings_to_link_ksettings()
507 legacy_settings->lp_advertising); in convert_legacy_settings_to_link_ksettings()
508 link_ksettings->base.speed in convert_legacy_settings_to_link_ksettings()
510 link_ksettings->base.duplex in convert_legacy_settings_to_link_ksettings()
511 = legacy_settings->duplex; in convert_legacy_settings_to_link_ksettings()
512 link_ksettings->base.port in convert_legacy_settings_to_link_ksettings()
513 = legacy_settings->port; in convert_legacy_settings_to_link_ksettings()
514 link_ksettings->base.phy_address in convert_legacy_settings_to_link_ksettings()
515 = legacy_settings->phy_address; in convert_legacy_settings_to_link_ksettings()
516 link_ksettings->base.autoneg in convert_legacy_settings_to_link_ksettings()
517 = legacy_settings->autoneg; in convert_legacy_settings_to_link_ksettings()
518 link_ksettings->base.mdio_support in convert_legacy_settings_to_link_ksettings()
519 = legacy_settings->mdio_support; in convert_legacy_settings_to_link_ksettings()
520 link_ksettings->base.eth_tp_mdix in convert_legacy_settings_to_link_ksettings()
521 = legacy_settings->eth_tp_mdix; in convert_legacy_settings_to_link_ksettings()
522 link_ksettings->base.eth_tp_mdix_ctrl in convert_legacy_settings_to_link_ksettings()
523 = legacy_settings->eth_tp_mdix_ctrl; in convert_legacy_settings_to_link_ksettings()
529 if (!dev->ethtool_ops->get_link) in __ethtool_get_link()
530 return -EOPNOTSUPP; in __ethtool_get_link()
532 return netif_running(dev) && dev->ethtool_ops->get_link(dev); in __ethtool_get_link()
537 const struct ethtool_ops *ops = dev->ethtool_ops; in ethtool_get_rxnfc_rule_count()
543 err = ops->get_rxnfc(dev, &info, NULL); in ethtool_get_rxnfc_rule_count()
559 for (i = 0; i < ctx->indir_size; i++) in ethtool_get_rss_ctx_max_channel()
566 const struct ethtool_ops *ops = dev->ethtool_ops; in ethtool_get_max_rxnfc_channel()
571 if (!ops->get_rxnfc) in ethtool_get_max_rxnfc_channel()
572 return -EOPNOTSUPP; in ethtool_get_max_rxnfc_channel()
576 return -EINVAL; in ethtool_get_max_rxnfc_channel()
580 return -ENOMEM; in ethtool_get_max_rxnfc_channel()
582 info->cmd = ETHTOOL_GRXCLSRLALL; in ethtool_get_max_rxnfc_channel()
583 info->rule_cnt = rule_cnt; in ethtool_get_max_rxnfc_channel()
584 err = ops->get_rxnfc(dev, info, info->rule_locs); in ethtool_get_max_rxnfc_channel()
591 .fs.location = info->rule_locs[i], in ethtool_get_max_rxnfc_channel()
594 err = ops->get_rxnfc(dev, &rule_info, NULL); in ethtool_get_max_rxnfc_channel()
606 ctx = xa_load(&dev->ethtool->rss_ctx, in ethtool_get_max_rxnfc_channel()
630 mutex_lock(&dev->ethtool->rss_lock); in ethtool_get_max_rss_ctx_channel()
631 xa_for_each(&dev->ethtool->rss_ctx, context, ctx) in ethtool_get_max_rss_ctx_channel()
633 mutex_unlock(&dev->ethtool->rss_lock); in ethtool_get_max_rss_ctx_channel()
646 * Assume drivers won't auto-regenerate the additional tables, in ethtool_get_max_rxfh_channel()
654 if (!dev->ethtool_ops->get_rxfh_indir_size || in ethtool_get_max_rxfh_channel()
655 !dev->ethtool_ops->get_rxfh) in ethtool_get_max_rxfh_channel()
657 dev_size = dev->ethtool_ops->get_rxfh_indir_size(dev); in ethtool_get_max_rxfh_channel()
665 ret = dev->ethtool_ops->get_rxfh(dev, &rxfh); in ethtool_get_max_rxfh_channel()
671 while (dev_size--) in ethtool_get_max_rxfh_channel()
696 return -EINVAL; in ethtool_check_max_channel()
701 return -EINVAL; in ethtool_check_max_channel()
708 return -EINVAL; in ethtool_check_max_channel()
716 const struct ethtool_ops *ops = dev->ethtool_ops; in ethtool_check_rss_ctx_busy()
720 if (!ops->get_rxnfc) in ethtool_check_rss_ctx_busy()
728 return -EINVAL; in ethtool_check_rss_ctx_busy()
732 return -ENOMEM; in ethtool_check_rss_ctx_busy()
734 info->cmd = ETHTOOL_GRXCLSRLALL; in ethtool_check_rss_ctx_busy()
735 info->rule_cnt = rule_cnt; in ethtool_check_rss_ctx_busy()
736 rc = ops->get_rxnfc(dev, info, info->rule_locs); in ethtool_check_rss_ctx_busy()
743 .fs.location = info->rule_locs[i], in ethtool_check_rss_ctx_busy()
746 rc = ops->get_rxnfc(dev, &rule_info, NULL); in ethtool_check_rss_ctx_busy()
752 rc = -EBUSY; in ethtool_check_rss_ctx_busy()
764 if (WARN_ON(ops->set_coalesce && !ops->supported_coalesce_params)) in ethtool_check_ops()
765 return -EINVAL; in ethtool_check_ops()
766 if (WARN_ON(ops->rxfh_max_num_contexts == 1)) in ethtool_check_ops()
767 return -EINVAL; in ethtool_check_ops()
783 param->cmd = ETHTOOL_GRINGPARAM; in ethtool_ringparam_get_cfg()
784 dev->ethtool_ops->get_ringparam(dev, param, kparam, extack); in ethtool_ringparam_get_cfg()
787 kparam->tcp_data_split = dev->cfg->hds_config; in ethtool_ringparam_get_cfg()
793 info->cmd = ETHTOOL_GET_TS_INFO; in ethtool_init_tsinfo()
794 info->phc_index = -1; in ethtool_init_tsinfo()
801 const struct ethtool_ops *ops = dev->ethtool_ops; in ethtool_net_get_ts_info_by_phc()
804 if (!ops->get_ts_info) in ethtool_net_get_ts_info_by_phc()
805 return -ENODEV; in ethtool_net_get_ts_info_by_phc()
809 info->phc_qualifier = hwprov_desc->qualifier; in ethtool_net_get_ts_info_by_phc()
810 err = ops->get_ts_info(dev, info); in ethtool_net_get_ts_info_by_phc()
814 if (info->phc_index == hwprov_desc->index && in ethtool_net_get_ts_info_by_phc()
815 net_support_hwtstamp_qualifier(dev, hwprov_desc->qualifier)) in ethtool_net_get_ts_info_by_phc()
818 return -ENODEV; in ethtool_net_get_ts_info_by_phc()
829 if (hwprov_desc->qualifier != HWTSTAMP_PROVIDER_QUALIFIER_PRECISE) in ethtool_phy_get_ts_info_by_phc()
830 return ERR_PTR(-ENODEV); in ethtool_phy_get_ts_info_by_phc()
833 if (dev->link_topo) { in ethtool_phy_get_ts_info_by_phc()
837 xa_for_each(&dev->link_topo->phys, phy_index, pdn) { in ethtool_phy_get_ts_info_by_phc()
838 if (!phy_has_tsinfo(pdn->phy)) in ethtool_phy_get_ts_info_by_phc()
842 err = phy_ts_info(pdn->phy, info); in ethtool_phy_get_ts_info_by_phc()
846 if (info->phc_index == hwprov_desc->index) in ethtool_phy_get_ts_info_by_phc()
847 return pdn->phy; in ethtool_phy_get_ts_info_by_phc()
849 return ERR_PTR(-ENODEV); in ethtool_phy_get_ts_info_by_phc()
852 /* Look on the dev->phydev */ in ethtool_phy_get_ts_info_by_phc()
853 if (phy_has_tsinfo(dev->phydev)) { in ethtool_phy_get_ts_info_by_phc()
855 err = phy_ts_info(dev->phydev, info); in ethtool_phy_get_ts_info_by_phc()
859 if (info->phc_index == hwprov_desc->index) in ethtool_phy_get_ts_info_by_phc()
860 return dev->phydev; in ethtool_phy_get_ts_info_by_phc()
863 return ERR_PTR(-ENODEV); in ethtool_phy_get_ts_info_by_phc()
873 if (err == -ENODEV) { in ethtool_get_ts_info_by_phc()
883 info->so_timestamping |= SOF_TIMESTAMPING_RX_SOFTWARE | in ethtool_get_ts_info_by_phc()
896 hwprov = rcu_dereference(dev->hwprov); in __ethtool_get_ts_info()
899 const struct ethtool_ops *ops = dev->ethtool_ops; in __ethtool_get_ts_info()
900 struct phy_device *phydev = dev->phydev; in __ethtool_get_ts_info()
906 else if (ops->get_ts_info) in __ethtool_get_ts_info()
907 err = ops->get_ts_info(dev, info); in __ethtool_get_ts_info()
909 info->so_timestamping |= SOF_TIMESTAMPING_RX_SOFTWARE | in __ethtool_get_ts_info()
916 err = ethtool_get_ts_info_by_phc(dev, info, &hwprov->desc); in __ethtool_get_ts_info()
924 const struct ethtool_ops *ops = dev->ethtool_ops; in net_support_hwtstamp_qualifier()
932 if (!ops->supported_hwtstamp_qualifiers && in net_support_hwtstamp_qualifier()
936 if (ops->supported_hwtstamp_qualifiers & BIT(qualifier)) in net_support_hwtstamp_qualifier()
979 link_ksettings->base.speed = link_info->speed; in ethtool_params_from_link_mode()
980 link_ksettings->lanes = link_info->lanes; in ethtool_params_from_link_mode()
981 link_ksettings->base.duplex = link_info->duplex; in ethtool_params_from_link_mode()
999 linkmode_set_bit_array(map->cap_arr, map->arr_size, map->caps); in ethtool_forced_speed_maps_init()
1000 map->cap_arr = NULL; in ethtool_forced_speed_maps_init()
1001 map->arr_size = 0; in ethtool_forced_speed_maps_init()
1011 !lockdep_is_held_type(&dev->ethtool->rss_lock, -1), in ethtool_rxfh_context_lost()
1015 ctx = xa_erase(&dev->ethtool->rss_ctx, context_id); in ethtool_rxfh_context_lost()