Lines Matching +full:1 +full:- +full:mdio
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
19 #include "standard-headers/linux/const.h"
20 #include "standard-headers/linux/types.h"
21 #include "standard-headers/linux/if_ether.h"
26 * have the same layout for 32-bit and 64-bit userland.
38 * struct ethtool_cmd - DEPRECATED, link control and status
43 * interface supports autonegotiation or auto-detection.
44 * Read-only.
48 * auto-detection.
49 * @speed: Low bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
52 * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
56 * @autoneg: Enable/disable autonegotiation and auto-detection;
58 * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
60 * Read-only.
62 * obsoleted by &struct ethtool_coalesce. Read-only; deprecated.
64 * obsoleted by &struct ethtool_coalesce. Read-only; deprecated.
65 * @speed_hi: High bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
66 * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
68 * value will be %ETH_TP_MDI_INVALID. Read-only.
69 * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
70 * %ETH_TP_MDI_*. If MDI(-X) control is not implemented, reads
77 * Read-only.
86 * link modes. If it is enabled then they are read-only; if the link
98 * Users should assume that all fields not marked read-only are
128 ep->speed = (uint16_t)(speed & 0xFFFF); in ethtool_cmd_speed_set()
129 ep->speed_hi = (uint16_t)(speed >> 16); in ethtool_cmd_speed_set()
134 return (ep->speed_hi << 16) | ep->speed; in ethtool_cmd_speed()
138 * using the interface defined in "standard-headers/linux/mii.h". This should not be
142 #define ETH_MDIO_SUPPORTS_C22 1
145 * using the interface defined in "standard-headers/linux/mii.h" and <linux/mdio.h>.
156 * struct ethtool_drvinfo - general driver and device information
203 * struct ethtool_wolinfo - Wake-On-Lan configuration
205 * @supported: Bitmask of %WAKE_* flags for supported Wake-On-Lan modes.
206 * Read-only.
207 * @wolopts: Bitmask of %WAKE_* flags for enabled Wake-On-Lan modes.
272 * the PHY's RX & TX blocks are put into a low-power mode when there is no
273 * link detected (typically cable is un-plugged). For RX, only a minimal
274 * link-detection is available, and for TX the PHY wakes up to send link pulses
275 * to avoid any lock-ups in case the peer PHY may also be running in EDPD mode.
277 * Some PHYs may support configuration of the wake-up interval for TX pulses,
282 * The interval units for TX wake-up are in milliseconds, since this should
284 * - from 1 millisecond, which does not sound like much of a power-saver
285 * - to ~65 seconds which is quite a lot to wait for a link to come up when
305 * struct ethtool_regs - hardware register dump
307 * @version: Dump format version. This is driver-specific and may
327 * struct ethtool_eeprom - EEPROM dump
341 * the length of an on-board or module EEPROM, respectively. They
353 * struct ethtool_eee - Energy Efficient Ethernet information
383 * struct ethtool_modinfo - plugin module eeprom information
401 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
421 * @stats_block_coalesce_usecs: How many usecs to delay in-memory
423 * in-memory statistic block, and in such cases this value is
455 * coalescing, set usecs = 0 and max_frames = 1.
500 * struct ethtool_ringparam - RX/TX ring parameters
503 * RX ring. Read-only.
505 * per RX mini ring. Read-only.
507 * per RX jumbo ring. Read-only.
509 * TX ring. Read-only.
521 * There may also be driver-dependent minimum values for the number
537 * struct ethtool_channels - configuring number of network channel
544 * @rx_count: Valid values are in the range 1 to the max_rx.
545 * @tx_count: Valid values are in the range 1 to the max_tx.
546 * @other_count: Valid values are in the range 1 to the max_other.
547 * @combined_count: Valid values are in the range 1 to the max_combined.
565 * struct ethtool_pauseparam - Ethernet pause (flow control) parameters
571 * Drivers should reject a non-zero setting of @autoneg when
581 * If @autoneg is non-zero, the MAC is configured to send and/or
610 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1,
621 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1,
630 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1,
640 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1,
648 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1,
654 ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY = 1,
660 * enum ethtool_stringset - string set ID
661 * @ETH_SS_TEST: Self-test result names, for use with %ETHTOOL_TEST
674 * @ETH_SS_WOL_MODES: wake-on-lan modes
719 * enum ethtool_mac_stats_src - source of ethtool MAC statistics
737 * enum ethtool_module_power_mode_policy - plug-in module power mode policy
745 ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH = 1,
750 * enum ethtool_module_power_mode - plug-in module power mode
755 ETHTOOL_MODULE_POWER_MODE_LOW = 1,
760 * enum ethtool_c33_pse_ext_state - groups of PSE extended states
761 * functions. IEEE 802.3-2022 33.2.4.4 Variables
777 ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION = 1,
789 * enum ethtool_c33_pse_ext_substate_mr_mps_valid - mr_mps_valid states
790 * functions. IEEE 802.3-2022 33.2.4.4 Variables
802 ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD = 1,
807 * enum ethtool_c33_pse_ext_substate_error_condition - error_condition states
808 * functions. IEEE 802.3-2022 33.2.4.4 Variables
810 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT: Non-existing
829 * implementation-specific fault conditions or optionally other system faults
835 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT = 1,
847 * enum ethtool_c33_pse_ext_substate_mr_pse_enable - mr_pse_enable states
848 * functions. IEEE 802.3-2022 33.2.4.4 Variables
857 ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE = 1,
861 * enum ethtool_c33_pse_ext_substate_option_detect_ted - option_detect_ted
862 * states functions. IEEE 802.3-2022 33.2.4.4 Variables
873 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS = 1,
878 * enum ethtool_c33_pse_ext_substate_option_vport_lim - option_vport_lim states
879 * functions. IEEE 802.3-2022 33.2.4.4 Variables
892 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE = 1,
898 * enum ethtool_c33_pse_ext_substate_ovld_detected - ovld_detected states
899 * functions. IEEE 802.3-2022 33.2.4.4 Variables
904 * in an overload condition (see 33.2.7.6) for at least TCUT of a one-second
908 ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD = 1,
912 * enum ethtool_c33_pse_ext_substate_power_not_available - power_not_available
913 * states functions. IEEE 802.3-2022 33.2.4.4 Variables
925 * implementation-dependent manner when the PSE is no longer capable of
930 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED = 1,
937 * enum ethtool_c33_pse_ext_substate_short_detected - short_detected states
938 * functions. IEEE 802.3-2022 33.2.4.4 Variables
947 ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION = 1,
951 * enum ethtool_pse_types - Types of PSE controller.
957 ETHTOOL_PSE_UNKNOWN = 1 << 0,
958 ETHTOOL_PSE_PODL = 1 << 1,
959 ETHTOOL_PSE_C33 = 1 << 2,
963 * enum ethtool_c33_pse_admin_state - operational state of the PoDL PSE
964 * functions. IEEE 802.3-2022 30.9.1.1.2 aPSEAdminState
970 ETHTOOL_C33_PSE_ADMIN_STATE_UNKNOWN = 1,
976 * enum ethtool_c33_pse_pw_d_status - power detection status of the PSE.
977 * IEEE 802.3-2022 30.9.1.1.3 aPoDLPSEPowerDetectionStatus:
996 ETHTOOL_C33_PSE_PW_D_STATUS_UNKNOWN = 1,
1006 * enum ethtool_podl_pse_admin_state - operational state of the PoDL PSE
1007 * functions. IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState
1014 ETHTOOL_PODL_PSE_ADMIN_STATE_UNKNOWN = 1,
1020 * enum ethtool_podl_pse_pw_d_status - power detection status of the PoDL PSE.
1021 * IEEE 802.3-2018 30.15.1.1.3 aPoDLPSEPowerDetectionStatus:
1041 ETHTOOL_PODL_PSE_PW_D_STATUS_UNKNOWN = 1,
1051 * enum ethtool_mm_verify_status - status of MAC Merge Verify function
1076 * enum ethtool_module_fw_flash_status - plug-in module firmware flashing status
1087 ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED = 1,
1094 * struct ethtool_gstrings - string set for data tagging
1098 * @data: Buffer for strings. Each string is null-padded to a size of
1113 * struct ethtool_sset_info - string set information
1123 * Example: The user passes in @sset_mask = 0x7 (sets 0, 1, 2) and on
1124 * return @sset_mask == 0x6 (sets 1, 2). Then @data[0] contains the
1125 * size of set 1 and @data[1] contains the size of set 2.
1138 * enum ethtool_test_flags - flags definition of ethtool_test
1148 ETH_TEST_FL_OFFLINE = (1 << 0),
1149 ETH_TEST_FL_FAILED = (1 << 1),
1150 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
1151 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
1155 * struct ethtool_test - device self-test invocation
1178 * struct ethtool_stats - device-specific statistics
1195 * struct ethtool_perm_addr - permanent hardware address
1211 /* boolean flags controlling per-interface behavior characteristics.
1216 * Some behaviors may read-only (unconditionally absent or present).
1217 * If such is the case, return EINVAL in the set-flags operation if the
1218 * flag differs from the read-only value.
1221 ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
1222 ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
1223 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
1224 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
1225 ETH_FLAG_RXHASH = (1 << 28),
1229 * classification and RX n-tuple configuration. Note, all multibyte
1235 * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
1240 * @tos: Type-of-service
1253 * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
1257 * @tos: Type-of-service
1268 #define ETH_RX_NFC_IP4 1
1271 * struct ethtool_usrip4_spec - general flow specification for IPv4
1275 * @tos: Type-of-service
1289 * struct ethtool_tcpip6_spec - flow specification for TCP/IPv6 etc.
1307 * struct ethtool_ah_espip6_spec - flow specification for IPsec/IPv6
1323 * struct ethtool_usrip6_spec - general flow specification for IPv6
1356 * struct ethtool_flow_ext - additional RX flow fields
1376 * struct ethtool_rx_flow_spec - classification rule for RX flows
1387 * packets should be used for Wake-on-LAN with %WAKE_FILTER
1428 * struct ethtool_rxnfc - command to get or set RX flow classification rules
1429 * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
1433 * @data: Command-dependent value
1449 * rules on return. If @data is non-zero on return then it is the
1485 * defined in future and drivers must return -%EINVAL for any
1502 * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
1503 * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
1521 * struct ethtool_rxfh - command to get/set RX flow hash indir or/and hash key.
1522 * @cmd: Specific command number - %ETHTOOL_GRSSH or %ETHTOOL_SRSSH
1567 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
1573 * @data: Driver-dependent data to match
1574 * @data_mask: Mask for driver-dependent data bits to be ignored
1575 * @action: RX ring/queue index to deliver to (non-negative) or other action
1601 #define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
1602 #define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
1606 * struct ethtool_rx_ntuple - command to set or clear RX flow filter
1607 * @cmd: Command number - %ETHTOOL_SRXNTUPLE
1628 * struct ethtool_dump - used for retrieving, setting device dump
1629 * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
1654 * struct ethtool_get_features_block - block with state of 32 features
1668 * struct ethtool_gfeatures - command to get state of device's features
1682 * struct ethtool_set_features_block - block with request for 32 features
1692 * struct ethtool_sfeatures - command to request change in device's features
1704 * struct ethtool_ts_info - holds a device's timestamping and PHC association
1707 * @phc_index: device index of the associated PHC, or -1 if there is none
1716 * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
1738 * Returns %EINVAL when .valid contains undefined or never-changeable bits
1739 * or size is not equal to required number of features words (32-bit blocks).
1741 * %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
1744 * %ETHTOOL_F_WISH - some or all changes requested were recorded but the
1746 * Probably there are other device-specific constraints on some features
1749 * %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
1754 * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
1764 #define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
1765 #define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
1766 #define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
1771 * struct ethtool_per_queue_op - apply sub command to the queues in mask.
1785 * struct ethtool_fecparam - Ethernet Forward Error Correction parameters
1822 * enum ethtool_fec_config_bits - flags definition of ethtool_fec_configuration
1829 * @ETHTOOL_FEC_RS_BIT: Reed-Solomon FEC Mode
1830 * @ETHTOOL_FEC_BASER_BIT: Base-R/Reed-Solomon FEC Mode
1843 #define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT)
1844 #define ETHTOOL_FEC_AUTO (1 << ETHTOOL_FEC_AUTO_BIT)
1845 #define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT)
1846 #define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT)
1847 #define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT)
1848 #define ETHTOOL_FEC_LLRS (1 << ETHTOOL_FEC_LLRS_BIT)
1859 #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
1860 #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
1879 #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
1881 #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
1883 #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
1886 #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
1896 #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
1897 #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
1911 #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
1925 #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
1926 #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
1934 #define ETHTOOL_GPHYSTATS 0x0000004a /* get PHY-specific statistics */
1952 ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1,
2086 (1UL << (ETHTOOL_LINK_MODE_ ## base_name ## _BIT))
2173 /* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal.
2194 #define SPEED_UNKNOWN -1
2212 return 1; in ethtool_validate_duplex()
2219 #define MASTER_SLAVE_CFG_UNKNOWN 1
2225 #define MASTER_SLAVE_STATE_UNKNOWN 1
2238 #define RATE_MATCH_PAUSE 1
2241 /* The MAC is programmed with a sufficiently-large IPG. */
2265 /* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
2270 #define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
2271 #define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */
2273 /* Wake-On-Lan options. */
2274 #define WAKE_PHY (1 << 0)
2275 #define WAKE_UCAST (1 << 1)
2276 #define WAKE_MCAST (1 << 2)
2277 #define WAKE_BCAST (1 << 3)
2278 #define WAKE_ARP (1 << 4)
2279 #define WAKE_MAGIC (1 << 5)
2280 #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
2281 #define WAKE_FILTER (1 << 7)
2291 #define RXH_XFRM_SYM_XOR (1 << 0)
2295 #define RXH_XFRM_SYM_OR_XOR (1 << 1)
2299 /* L2-L4 network traffic flow types */
2319 /* Used for GTP-U IPv4 and IPv6.
2327 /* Use for GTP-C IPv4 and v6.
2336 /* Use for GTP-C IPv4 and v6.
2344 /* Use for GTP-U and extended headers for the PSC (PDU Session Container).
2352 /* Use for GTP-U IPv4 and v6 PSC (PDU Session Container) extended headers.
2374 /* L3-L4 network traffic flow hash options */
2375 #define RXH_L2DA (1 << 1)
2376 #define RXH_VLAN (1 << 2)
2377 #define RXH_L3_PROTO (1 << 3)
2378 #define RXH_IP_SRC (1 << 4)
2379 #define RXH_IP_DST (1 << 5)
2380 #define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
2381 #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
2382 #define RXH_GTP_TEID (1 << 8) /* teid in case of GTP */
2383 #define RXH_DISCARD (1 << 31)
2420 ETH_RESET_MGMT = 1 << 0, /* Management processor */
2421 ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */
2422 ETH_RESET_DMA = 1 << 2, /* DMA engine */
2423 ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */
2424 ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */
2425 ETH_RESET_MAC = 1 << 5, /* Media access controller */
2426 ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
2427 ETH_RESET_RAM = 1 << 7, /* RAM shared between
2429 ETH_RESET_AP = 1 << 8, /* Application processor */
2440 * struct ethtool_link_settings - link control and status
2443 * user-space tools, please first try %ETHTOOL_GLINKSETTINGS, and
2457 * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
2459 * @autoneg: Enable/disable autonegotiation and auto-detection;
2461 * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
2463 * Read-only.
2464 * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
2466 * value will be %ETH_TP_MDI_INVALID. Read-only.
2467 * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
2468 * %ETH_TP_MDI_*. If MDI(-X) control is not implemented, reads
2472 * @link_mode_masks_nwords: Number of 32-bit words for each of the
2487 * reported consistently by PHYLIB. Read-only.
2496 * link modes. If it is enabled then they are read-only; if the link
2511 * fail if any of them is set to non-zero value.
2513 * Users should assume that all fields not marked read-only are
2525 * and @link_mode_masks_nwords that are not described as read-only or
2526 * deprecated, and must ignore all fields described as read-only.
2530 * - supported: Bitmap with each bit meaning given by
2533 * supports autonegotiation or auto-detection. Read-only.
2534 * - advertising: Bitmap with each bit meaning given by
2537 * autonegotiation or enabled for auto-detection.
2538 * - lp_advertising: Bitmap with each bit meaning given by
2541 * autonegotiation; 0 if unknown or not applicable. Read-only.
2559 /* Linux builds with -Wflex-array-member-not-at-end but does
2562 * -Wfamnae, we'll need a new solution.
2573 * enum phy_upstream - Represents the upstream component a given PHY device
2576 * an intermediate PHY used as a media-converter, which will driver another