blob: e213ba1b8c87d01e873eb65b04c093126094a1f2 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_LINUX_ETHTOOL_H
8#define _UAPI_LINUX_ETHTOOL_H
Christopher Ferris05667cd2021-02-16 16:01:34 -08009#include <linux/const.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070010#include <linux/types.h>
Christopher Ferris106b3a82016-08-24 12:15:38 -070011#include <linux/if_ether.h>
12#include <limits.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070013struct ethtool_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080014 __u32 cmd;
15 __u32 supported;
16 __u32 advertising;
Tao Baod7db5942015-01-28 10:07:51 -080017 __u16 speed;
18 __u8 duplex;
19 __u8 port;
20 __u8 phy_address;
Tao Baod7db5942015-01-28 10:07:51 -080021 __u8 transceiver;
22 __u8 autoneg;
23 __u8 mdio_support;
24 __u32 maxtxpkt;
Tao Baod7db5942015-01-28 10:07:51 -080025 __u32 maxrxpkt;
26 __u16 speed_hi;
27 __u8 eth_tp_mdix;
28 __u8 eth_tp_mdix_ctrl;
Tao Baod7db5942015-01-28 10:07:51 -080029 __u32 lp_advertising;
30 __u32 reserved[2];
Ben Cheng655a7c02013-10-16 16:09:24 -070031};
32#define ETH_MDIO_SUPPORTS_C22 1
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define ETH_MDIO_SUPPORTS_C45 2
34#define ETHTOOL_FWVERS_LEN 32
35#define ETHTOOL_BUSINFO_LEN 32
Christopher Ferris05d08e92016-02-04 13:16:38 -080036#define ETHTOOL_EROMVERS_LEN 32
Christopher Ferris05d08e92016-02-04 13:16:38 -080037struct ethtool_drvinfo {
Tao Baod7db5942015-01-28 10:07:51 -080038 __u32 cmd;
39 char driver[32];
40 char version[32];
41 char fw_version[ETHTOOL_FWVERS_LEN];
Tao Baod7db5942015-01-28 10:07:51 -080042 char bus_info[ETHTOOL_BUSINFO_LEN];
Christopher Ferris05d08e92016-02-04 13:16:38 -080043 char erom_version[ETHTOOL_EROMVERS_LEN];
Tao Baod7db5942015-01-28 10:07:51 -080044 char reserved2[12];
Christopher Ferris05d08e92016-02-04 13:16:38 -080045 __u32 n_priv_flags;
Tao Baod7db5942015-01-28 10:07:51 -080046 __u32 n_stats;
47 __u32 testinfo_len;
48 __u32 eedump_len;
Christopher Ferris05d08e92016-02-04 13:16:38 -080049 __u32 regdump_len;
Ben Cheng655a7c02013-10-16 16:09:24 -070050};
51#define SOPASS_MAX 6
52struct ethtool_wolinfo {
Christopher Ferris05d08e92016-02-04 13:16:38 -080053 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -080054 __u32 supported;
55 __u32 wolopts;
56 __u8 sopass[SOPASS_MAX];
Christopher Ferris05d08e92016-02-04 13:16:38 -080057};
Ben Cheng655a7c02013-10-16 16:09:24 -070058struct ethtool_value {
Tao Baod7db5942015-01-28 10:07:51 -080059 __u32 cmd;
60 __u32 data;
Christopher Ferris05d08e92016-02-04 13:16:38 -080061};
Christopher Ferris76a1d452018-06-27 14:12:29 -070062#define PFC_STORM_PREVENTION_AUTO 0xffff
63#define PFC_STORM_PREVENTION_DISABLE 0
Christopher Ferris82d75042015-01-26 10:57:07 -080064enum tunable_id {
Tao Baod7db5942015-01-28 10:07:51 -080065 ETHTOOL_ID_UNSPEC,
66 ETHTOOL_RX_COPYBREAK,
Christopher Ferris05d08e92016-02-04 13:16:38 -080067 ETHTOOL_TX_COPYBREAK,
Christopher Ferris76a1d452018-06-27 14:12:29 -070068 ETHTOOL_PFC_PREVENTION_TOUT,
Christopher Ferris1ed55342022-03-22 16:06:25 -070069 ETHTOOL_TX_COPYBREAK_BUF_SIZE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080070 __ETHTOOL_TUNABLE_COUNT,
Christopher Ferris82d75042015-01-26 10:57:07 -080071};
72enum tunable_type_id {
Tao Baod7db5942015-01-28 10:07:51 -080073 ETHTOOL_TUNABLE_UNSPEC,
74 ETHTOOL_TUNABLE_U8,
Tao Baod7db5942015-01-28 10:07:51 -080075 ETHTOOL_TUNABLE_U16,
76 ETHTOOL_TUNABLE_U32,
77 ETHTOOL_TUNABLE_U64,
78 ETHTOOL_TUNABLE_STRING,
Tao Baod7db5942015-01-28 10:07:51 -080079 ETHTOOL_TUNABLE_S8,
80 ETHTOOL_TUNABLE_S16,
81 ETHTOOL_TUNABLE_S32,
82 ETHTOOL_TUNABLE_S64,
Christopher Ferris82d75042015-01-26 10:57:07 -080083};
84struct ethtool_tunable {
Tao Baod7db5942015-01-28 10:07:51 -080085 __u32 cmd;
86 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080087 __u32 type_id;
88 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070089 void * data[];
Christopher Ferris82d75042015-01-26 10:57:07 -080090};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080091#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
92#define DOWNSHIFT_DEV_DISABLE 0
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070093#define ETHTOOL_PHY_FAST_LINK_DOWN_ON 0
94#define ETHTOOL_PHY_FAST_LINK_DOWN_OFF 0xff
Christopher Ferris9584fa42019-12-09 15:36:13 -080095#define ETHTOOL_PHY_EDPD_DFLT_TX_MSECS 0xffff
96#define ETHTOOL_PHY_EDPD_NO_TX 0xfffe
97#define ETHTOOL_PHY_EDPD_DISABLE 0
Christopher Ferris48af7cb2017-02-21 12:35:09 -080098enum phy_tunable_id {
99 ETHTOOL_PHY_ID_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800100 ETHTOOL_PHY_DOWNSHIFT,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700101 ETHTOOL_PHY_FAST_LINK_DOWN,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800102 ETHTOOL_PHY_EDPD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800103 __ETHTOOL_PHY_TUNABLE_COUNT,
104};
Ben Cheng655a7c02013-10-16 16:09:24 -0700105struct ethtool_regs {
Tao Baod7db5942015-01-28 10:07:51 -0800106 __u32 cmd;
107 __u32 version;
108 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700109 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700110};
111struct ethtool_eeprom {
Tao Baod7db5942015-01-28 10:07:51 -0800112 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800113 __u32 magic;
114 __u32 offset;
115 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700116 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700117};
118struct ethtool_eee {
Tao Baod7db5942015-01-28 10:07:51 -0800119 __u32 cmd;
120 __u32 supported;
Tao Baod7db5942015-01-28 10:07:51 -0800121 __u32 advertised;
122 __u32 lp_advertised;
123 __u32 eee_active;
124 __u32 eee_enabled;
Tao Baod7db5942015-01-28 10:07:51 -0800125 __u32 tx_lpi_enabled;
126 __u32 tx_lpi_timer;
127 __u32 reserved[2];
Ben Cheng655a7c02013-10-16 16:09:24 -0700128};
Ben Cheng655a7c02013-10-16 16:09:24 -0700129struct ethtool_modinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u32 cmd;
131 __u32 type;
132 __u32 eeprom_len;
Tao Baod7db5942015-01-28 10:07:51 -0800133 __u32 reserved[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700134};
135struct ethtool_coalesce {
Tao Baod7db5942015-01-28 10:07:51 -0800136 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800137 __u32 rx_coalesce_usecs;
138 __u32 rx_max_coalesced_frames;
139 __u32 rx_coalesce_usecs_irq;
140 __u32 rx_max_coalesced_frames_irq;
Tao Baod7db5942015-01-28 10:07:51 -0800141 __u32 tx_coalesce_usecs;
142 __u32 tx_max_coalesced_frames;
143 __u32 tx_coalesce_usecs_irq;
144 __u32 tx_max_coalesced_frames_irq;
Tao Baod7db5942015-01-28 10:07:51 -0800145 __u32 stats_block_coalesce_usecs;
146 __u32 use_adaptive_rx_coalesce;
147 __u32 use_adaptive_tx_coalesce;
148 __u32 pkt_rate_low;
Tao Baod7db5942015-01-28 10:07:51 -0800149 __u32 rx_coalesce_usecs_low;
150 __u32 rx_max_coalesced_frames_low;
151 __u32 tx_coalesce_usecs_low;
152 __u32 tx_max_coalesced_frames_low;
Tao Baod7db5942015-01-28 10:07:51 -0800153 __u32 pkt_rate_high;
154 __u32 rx_coalesce_usecs_high;
155 __u32 rx_max_coalesced_frames_high;
156 __u32 tx_coalesce_usecs_high;
Tao Baod7db5942015-01-28 10:07:51 -0800157 __u32 tx_max_coalesced_frames_high;
158 __u32 rate_sample_interval;
Ben Cheng655a7c02013-10-16 16:09:24 -0700159};
160struct ethtool_ringparam {
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u32 cmd;
162 __u32 rx_max_pending;
163 __u32 rx_mini_max_pending;
164 __u32 rx_jumbo_max_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800165 __u32 tx_max_pending;
166 __u32 rx_pending;
167 __u32 rx_mini_pending;
168 __u32 rx_jumbo_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u32 tx_pending;
Ben Cheng655a7c02013-10-16 16:09:24 -0700170};
171struct ethtool_channels {
Tao Baod7db5942015-01-28 10:07:51 -0800172 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800173 __u32 max_rx;
174 __u32 max_tx;
175 __u32 max_other;
176 __u32 max_combined;
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u32 rx_count;
178 __u32 tx_count;
179 __u32 other_count;
180 __u32 combined_count;
Ben Cheng655a7c02013-10-16 16:09:24 -0700181};
182struct ethtool_pauseparam {
Tao Baod7db5942015-01-28 10:07:51 -0800183 __u32 cmd;
184 __u32 autoneg;
Tao Baod7db5942015-01-28 10:07:51 -0800185 __u32 rx_pause;
186 __u32 tx_pause;
Ben Cheng655a7c02013-10-16 16:09:24 -0700187};
Christopher Ferris25c18d42020-10-14 17:42:58 -0700188enum ethtool_link_ext_state {
189 ETHTOOL_LINK_EXT_STATE_AUTONEG,
190 ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE,
191 ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH,
192 ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY,
193 ETHTOOL_LINK_EXT_STATE_NO_CABLE,
194 ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE,
195 ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE,
196 ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE,
197 ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED,
198 ETHTOOL_LINK_EXT_STATE_OVERHEAT,
Christopher Ferrisa4792612022-01-10 13:51:15 -0800199 ETHTOOL_LINK_EXT_STATE_MODULE,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700200};
201enum ethtool_link_ext_substate_autoneg {
202 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1,
203 ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED,
204 ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED,
205 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE,
206 ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE,
207 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD,
208};
209enum ethtool_link_ext_substate_link_training {
210 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1,
211 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT,
212 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY,
213 ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT,
214};
215enum ethtool_link_ext_substate_link_logical_mismatch {
216 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1,
217 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK,
218 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS,
219 ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED,
220 ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED,
221};
222enum ethtool_link_ext_substate_bad_signal_integrity {
223 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1,
224 ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700225 ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_REFERENCE_CLOCK_LOST,
226 ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_ALOS,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700227};
228enum ethtool_link_ext_substate_cable_issue {
229 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1,
230 ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE,
231};
Christopher Ferrisa4792612022-01-10 13:51:15 -0800232enum ethtool_link_ext_substate_module {
233 ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY = 1,
234};
Ben Cheng655a7c02013-10-16 16:09:24 -0700235#define ETH_GSTRING_LEN 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700236enum ethtool_stringset {
Tao Baod7db5942015-01-28 10:07:51 -0800237 ETH_SS_TEST = 0,
238 ETH_SS_STATS,
239 ETH_SS_PRIV_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800240 ETH_SS_NTUPLE_FILTERS,
241 ETH_SS_FEATURES,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800242 ETH_SS_RSS_HASH_FUNCS,
243 ETH_SS_TUNABLES,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700244 ETH_SS_PHY_STATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800245 ETH_SS_PHY_TUNABLES,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700246 ETH_SS_LINK_MODES,
247 ETH_SS_MSG_CLASSES,
248 ETH_SS_WOL_MODES,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700249 ETH_SS_SOF_TIMESTAMPING,
250 ETH_SS_TS_TX_TYPES,
251 ETH_SS_TS_RX_FILTERS,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700252 ETH_SS_UDP_TUNNEL_TYPES,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000253 ETH_SS_STATS_STD,
254 ETH_SS_STATS_ETH_PHY,
255 ETH_SS_STATS_ETH_MAC,
256 ETH_SS_STATS_ETH_CTRL,
257 ETH_SS_STATS_RMON,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700258 ETH_SS_COUNT
Ben Cheng655a7c02013-10-16 16:09:24 -0700259};
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000260enum ethtool_mac_stats_src {
261 ETHTOOL_MAC_STATS_SRC_AGGREGATE,
262 ETHTOOL_MAC_STATS_SRC_EMAC,
263 ETHTOOL_MAC_STATS_SRC_PMAC,
264};
Christopher Ferrisa4792612022-01-10 13:51:15 -0800265enum ethtool_module_power_mode_policy {
266 ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH = 1,
267 ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO,
268};
269enum ethtool_module_power_mode {
270 ETHTOOL_MODULE_POWER_MODE_LOW = 1,
271 ETHTOOL_MODULE_POWER_MODE_HIGH,
272};
Christopher Ferris4ba54492024-09-18 16:25:22 +0000273enum ethtool_c33_pse_ext_state {
274 ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION = 1,
275 ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID,
276 ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE,
277 ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED,
278 ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM,
279 ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED,
280 ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE,
281 ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE,
282 ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED,
283};
284enum ethtool_c33_pse_ext_substate_mr_mps_valid {
285 ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD = 1,
286 ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN,
287};
288enum ethtool_c33_pse_ext_substate_error_condition {
289 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT = 1,
290 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT,
291 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT,
292 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON,
293 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS,
294 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF,
295 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN,
296 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE,
297 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP,
298};
299enum ethtool_c33_pse_ext_substate_mr_pse_enable {
300 ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE = 1,
301};
302enum ethtool_c33_pse_ext_substate_option_detect_ted {
303 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS = 1,
304 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR,
305};
306enum ethtool_c33_pse_ext_substate_option_vport_lim {
307 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE = 1,
308 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE,
309 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION,
310};
311enum ethtool_c33_pse_ext_substate_ovld_detected {
312 ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD = 1,
313};
314enum ethtool_c33_pse_ext_substate_power_not_available {
315 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED = 1,
316 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET,
317 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT,
318 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT,
319};
320enum ethtool_c33_pse_ext_substate_short_detected {
321 ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION = 1,
322};
Christopher Ferris7ac54f52024-08-07 21:07:12 +0000323enum ethtool_pse_types {
324 ETHTOOL_PSE_UNKNOWN = 1 << 0,
325 ETHTOOL_PSE_PODL = 1 << 1,
326 ETHTOOL_PSE_C33 = 1 << 2,
327};
328enum ethtool_c33_pse_admin_state {
329 ETHTOOL_C33_PSE_ADMIN_STATE_UNKNOWN = 1,
330 ETHTOOL_C33_PSE_ADMIN_STATE_DISABLED,
331 ETHTOOL_C33_PSE_ADMIN_STATE_ENABLED,
332};
333enum ethtool_c33_pse_pw_d_status {
334 ETHTOOL_C33_PSE_PW_D_STATUS_UNKNOWN = 1,
335 ETHTOOL_C33_PSE_PW_D_STATUS_DISABLED,
336 ETHTOOL_C33_PSE_PW_D_STATUS_SEARCHING,
337 ETHTOOL_C33_PSE_PW_D_STATUS_DELIVERING,
338 ETHTOOL_C33_PSE_PW_D_STATUS_TEST,
339 ETHTOOL_C33_PSE_PW_D_STATUS_FAULT,
340 ETHTOOL_C33_PSE_PW_D_STATUS_OTHERFAULT,
341};
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000342enum ethtool_podl_pse_admin_state {
343 ETHTOOL_PODL_PSE_ADMIN_STATE_UNKNOWN = 1,
344 ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED,
345 ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED,
346};
347enum ethtool_podl_pse_pw_d_status {
348 ETHTOOL_PODL_PSE_PW_D_STATUS_UNKNOWN = 1,
349 ETHTOOL_PODL_PSE_PW_D_STATUS_DISABLED,
350 ETHTOOL_PODL_PSE_PW_D_STATUS_SEARCHING,
351 ETHTOOL_PODL_PSE_PW_D_STATUS_DELIVERING,
352 ETHTOOL_PODL_PSE_PW_D_STATUS_SLEEP,
353 ETHTOOL_PODL_PSE_PW_D_STATUS_IDLE,
354 ETHTOOL_PODL_PSE_PW_D_STATUS_ERROR,
355};
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000356enum ethtool_mm_verify_status {
357 ETHTOOL_MM_VERIFY_STATUS_UNKNOWN,
358 ETHTOOL_MM_VERIFY_STATUS_INITIAL,
359 ETHTOOL_MM_VERIFY_STATUS_VERIFYING,
360 ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED,
361 ETHTOOL_MM_VERIFY_STATUS_FAILED,
362 ETHTOOL_MM_VERIFY_STATUS_DISABLED,
363};
Christopher Ferris4ba54492024-09-18 16:25:22 +0000364enum ethtool_module_fw_flash_status {
365 ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED = 1,
366 ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS,
367 ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED,
368 ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR,
369};
Ben Cheng655a7c02013-10-16 16:09:24 -0700370struct ethtool_gstrings {
Tao Baod7db5942015-01-28 10:07:51 -0800371 __u32 cmd;
372 __u32 string_set;
373 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700374 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700375};
376struct ethtool_sset_info {
Tao Baod7db5942015-01-28 10:07:51 -0800377 __u32 cmd;
378 __u32 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800379 __u64 sset_mask;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700380 __u32 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700381};
382enum ethtool_test_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800383 ETH_TEST_FL_OFFLINE = (1 << 0),
384 ETH_TEST_FL_FAILED = (1 << 1),
385 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
386 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
Ben Cheng655a7c02013-10-16 16:09:24 -0700387};
388struct ethtool_test {
Tao Baod7db5942015-01-28 10:07:51 -0800389 __u32 cmd;
390 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800391 __u32 reserved;
392 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700393 __u64 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700394};
Ben Cheng655a7c02013-10-16 16:09:24 -0700395struct ethtool_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800396 __u32 cmd;
397 __u32 n_stats;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700398 __u64 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700399};
400struct ethtool_perm_addr {
Tao Baod7db5942015-01-28 10:07:51 -0800401 __u32 cmd;
402 __u32 size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700403 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700404};
405enum ethtool_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800406 ETH_FLAG_TXVLAN = (1 << 7),
Tao Baod7db5942015-01-28 10:07:51 -0800407 ETH_FLAG_RXVLAN = (1 << 8),
408 ETH_FLAG_LRO = (1 << 15),
409 ETH_FLAG_NTUPLE = (1 << 27),
410 ETH_FLAG_RXHASH = (1 << 28),
Ben Cheng655a7c02013-10-16 16:09:24 -0700411};
412struct ethtool_tcpip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800413 __be32 ip4src;
414 __be32 ip4dst;
Tao Baod7db5942015-01-28 10:07:51 -0800415 __be16 psrc;
416 __be16 pdst;
417 __u8 tos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700418};
Ben Cheng655a7c02013-10-16 16:09:24 -0700419struct ethtool_ah_espip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800420 __be32 ip4src;
421 __be32 ip4dst;
422 __be32 spi;
Tao Baod7db5942015-01-28 10:07:51 -0800423 __u8 tos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700424};
425#define ETH_RX_NFC_IP4 1
426struct ethtool_usrip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800427 __be32 ip4src;
428 __be32 ip4dst;
429 __be32 l4_4_bytes;
430 __u8 tos;
Tao Baod7db5942015-01-28 10:07:51 -0800431 __u8 ip_ver;
432 __u8 proto;
Ben Cheng655a7c02013-10-16 16:09:24 -0700433};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700434struct ethtool_tcpip6_spec {
435 __be32 ip6src[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700436 __be32 ip6dst[4];
437 __be16 psrc;
438 __be16 pdst;
439 __u8 tclass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700440};
441struct ethtool_ah_espip6_spec {
442 __be32 ip6src[4];
443 __be32 ip6dst[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700444 __be32 spi;
445 __u8 tclass;
446};
447struct ethtool_usrip6_spec {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700448 __be32 ip6src[4];
449 __be32 ip6dst[4];
450 __be32 l4_4_bytes;
451 __u8 tclass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700452 __u8 l4_proto;
453};
454union ethtool_flow_union {
Tao Baod7db5942015-01-28 10:07:51 -0800455 struct ethtool_tcpip4_spec tcp_ip4_spec;
456 struct ethtool_tcpip4_spec udp_ip4_spec;
457 struct ethtool_tcpip4_spec sctp_ip4_spec;
458 struct ethtool_ah_espip4_spec ah_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800459 struct ethtool_ah_espip4_spec esp_ip4_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700460 struct ethtool_usrip4_spec usr_ip4_spec;
461 struct ethtool_tcpip6_spec tcp_ip6_spec;
462 struct ethtool_tcpip6_spec udp_ip6_spec;
463 struct ethtool_tcpip6_spec sctp_ip6_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700464 struct ethtool_ah_espip6_spec ah_ip6_spec;
465 struct ethtool_ah_espip6_spec esp_ip6_spec;
466 struct ethtool_usrip6_spec usr_ip6_spec;
467 struct ethhdr ether_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700468 __u8 hdata[52];
Ben Cheng655a7c02013-10-16 16:09:24 -0700469};
470struct ethtool_flow_ext {
Tao Baod7db5942015-01-28 10:07:51 -0800471 __u8 padding[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700472 unsigned char h_dest[ETH_ALEN];
Tao Baod7db5942015-01-28 10:07:51 -0800473 __be16 vlan_etype;
474 __be16 vlan_tci;
475 __be32 data[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700476};
Ben Cheng655a7c02013-10-16 16:09:24 -0700477struct ethtool_rx_flow_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800478 __u32 flow_type;
479 union ethtool_flow_union h_u;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700480 struct ethtool_flow_ext h_ext;
Tao Baod7db5942015-01-28 10:07:51 -0800481 union ethtool_flow_union m_u;
482 struct ethtool_flow_ext m_ext;
483 __u64 ring_cookie;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700484 __u32 location;
Ben Cheng655a7c02013-10-16 16:09:24 -0700485};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800486#define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL
487#define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL
Christopher Ferris106b3a82016-08-24 12:15:38 -0700488#define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
Christopher Ferris9ce28842018-10-25 12:11:39 -0700489struct ethtool_rxnfc {
490 __u32 cmd;
491 __u32 flow_type;
492 __u64 data;
493 struct ethtool_rx_flow_spec fs;
494 union {
495 __u32 rule_cnt;
496 __u32 rss_context;
497 };
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000498 __u32 rule_locs[];
Christopher Ferris9ce28842018-10-25 12:11:39 -0700499};
Ben Cheng655a7c02013-10-16 16:09:24 -0700500struct ethtool_rxfh_indir {
Tao Baod7db5942015-01-28 10:07:51 -0800501 __u32 cmd;
502 __u32 size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700503 __u32 ring_index[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700504};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700505struct ethtool_rxfh {
Tao Baod7db5942015-01-28 10:07:51 -0800506 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700507 __u32 rss_context;
Tao Baod7db5942015-01-28 10:07:51 -0800508 __u32 indir_size;
509 __u32 key_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800510 __u8 hfunc;
Christopher Ferrisb830ddf2024-03-28 11:48:08 -0700511 __u8 input_xfrm;
512 __u8 rsvd8[2];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800513 __u32 rsvd32;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700514 __u32 rss_config[];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700515};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700516#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff
Christopher Ferris106b3a82016-08-24 12:15:38 -0700517#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
Christopher Ferris05d08e92016-02-04 13:16:38 -0800518struct ethtool_rx_ntuple_flow_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800519 __u32 flow_type;
520 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700521 struct ethtool_tcpip4_spec tcp_ip4_spec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800522 struct ethtool_tcpip4_spec udp_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800523 struct ethtool_tcpip4_spec sctp_ip4_spec;
524 struct ethtool_ah_espip4_spec ah_ip4_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700525 struct ethtool_ah_espip4_spec esp_ip4_spec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800526 struct ethtool_usrip4_spec usr_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800527 struct ethhdr ether_spec;
528 __u8 hdata[72];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700529 } h_u, m_u;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800530 __u16 vlan_tag;
Tao Baod7db5942015-01-28 10:07:51 -0800531 __u16 vlan_tag_mask;
532 __u64 data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700533 __u64 data_mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800534 __s32 action;
Tao Baod7db5942015-01-28 10:07:51 -0800535#define ETHTOOL_RXNTUPLE_ACTION_DROP (- 1)
536#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (- 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700537};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800538struct ethtool_rx_ntuple {
Tao Baod7db5942015-01-28 10:07:51 -0800539 __u32 cmd;
540 struct ethtool_rx_ntuple_flow_spec fs;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700541};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800542#define ETHTOOL_FLASH_MAX_FILENAME 128
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700543enum ethtool_flash_op_type {
Tao Baod7db5942015-01-28 10:07:51 -0800544 ETHTOOL_FLASH_ALL_REGIONS = 0,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700545};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800546struct ethtool_flash {
Tao Baod7db5942015-01-28 10:07:51 -0800547 __u32 cmd;
548 __u32 region;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700549 char data[ETHTOOL_FLASH_MAX_FILENAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800550};
Ben Cheng655a7c02013-10-16 16:09:24 -0700551struct ethtool_dump {
Tao Baod7db5942015-01-28 10:07:51 -0800552 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700553 __u32 version;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800554 __u32 flag;
Tao Baod7db5942015-01-28 10:07:51 -0800555 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700556 __u8 data[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700557};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800558#define ETH_FW_DUMP_DISABLE 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700559struct ethtool_get_features_block {
Tao Baod7db5942015-01-28 10:07:51 -0800560 __u32 available;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700561 __u32 requested;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800562 __u32 active;
Tao Baod7db5942015-01-28 10:07:51 -0800563 __u32 never_changed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700564};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700565struct ethtool_gfeatures {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800566 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800567 __u32 size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700568 struct ethtool_get_features_block features[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700569};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800570struct ethtool_set_features_block {
Tao Baod7db5942015-01-28 10:07:51 -0800571 __u32 valid;
572 __u32 requested;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700573};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800574struct ethtool_sfeatures {
Tao Baod7db5942015-01-28 10:07:51 -0800575 __u32 cmd;
576 __u32 size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700577 struct ethtool_set_features_block features[];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800578};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700579struct ethtool_ts_info {
Tao Baod7db5942015-01-28 10:07:51 -0800580 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700581 __u32 so_timestamping;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800582 __s32 phc_index;
Tao Baod7db5942015-01-28 10:07:51 -0800583 __u32 tx_types;
584 __u32 tx_reserved[3];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700585 __u32 rx_filters;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800586 __u32 rx_reserved[3];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700587};
Ben Cheng655a7c02013-10-16 16:09:24 -0700588enum ethtool_sfeatures_retval_bits {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700589 ETHTOOL_F_UNSUPPORTED__BIT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800590 ETHTOOL_F_WISH__BIT,
Tao Baod7db5942015-01-28 10:07:51 -0800591 ETHTOOL_F_COMPAT__BIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700592};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700593#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800594#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700595#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700596#define MAX_NUM_QUEUE 4096
Christopher Ferris106b3a82016-08-24 12:15:38 -0700597struct ethtool_per_queue_op {
598 __u32 cmd;
599 __u32 sub_command;
600 __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700601 char data[];
602};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800603struct ethtool_fecparam {
604 __u32 cmd;
605 __u32 active_fec;
606 __u32 fec;
607 __u32 reserved;
608};
609enum ethtool_fec_config_bits {
610 ETHTOOL_FEC_NONE_BIT,
611 ETHTOOL_FEC_AUTO_BIT,
612 ETHTOOL_FEC_OFF_BIT,
613 ETHTOOL_FEC_RS_BIT,
614 ETHTOOL_FEC_BASER_BIT,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700615 ETHTOOL_FEC_LLRS_BIT,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800616};
617#define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT)
618#define ETHTOOL_FEC_AUTO (1 << ETHTOOL_FEC_AUTO_BIT)
619#define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT)
620#define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT)
621#define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700622#define ETHTOOL_FEC_LLRS (1 << ETHTOOL_FEC_LLRS_BIT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700623#define ETHTOOL_GSET 0x00000001
624#define ETHTOOL_SSET 0x00000002
Christopher Ferris05d08e92016-02-04 13:16:38 -0800625#define ETHTOOL_GDRVINFO 0x00000003
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700626#define ETHTOOL_GREGS 0x00000004
Ben Cheng655a7c02013-10-16 16:09:24 -0700627#define ETHTOOL_GWOL 0x00000005
628#define ETHTOOL_SWOL 0x00000006
Christopher Ferris05d08e92016-02-04 13:16:38 -0800629#define ETHTOOL_GMSGLVL 0x00000007
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700630#define ETHTOOL_SMSGLVL 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -0700631#define ETHTOOL_NWAY_RST 0x00000009
632#define ETHTOOL_GLINK 0x0000000a
Christopher Ferris05d08e92016-02-04 13:16:38 -0800633#define ETHTOOL_GEEPROM 0x0000000b
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700634#define ETHTOOL_SEEPROM 0x0000000c
Ben Cheng655a7c02013-10-16 16:09:24 -0700635#define ETHTOOL_GCOALESCE 0x0000000e
636#define ETHTOOL_SCOALESCE 0x0000000f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800637#define ETHTOOL_GRINGPARAM 0x00000010
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700638#define ETHTOOL_SRINGPARAM 0x00000011
Ben Cheng655a7c02013-10-16 16:09:24 -0700639#define ETHTOOL_GPAUSEPARAM 0x00000012
640#define ETHTOOL_SPAUSEPARAM 0x00000013
Christopher Ferris05d08e92016-02-04 13:16:38 -0800641#define ETHTOOL_GRXCSUM 0x00000014
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700642#define ETHTOOL_SRXCSUM 0x00000015
Ben Cheng655a7c02013-10-16 16:09:24 -0700643#define ETHTOOL_GTXCSUM 0x00000016
644#define ETHTOOL_STXCSUM 0x00000017
Christopher Ferris05d08e92016-02-04 13:16:38 -0800645#define ETHTOOL_GSG 0x00000018
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700646#define ETHTOOL_SSG 0x00000019
Ben Cheng655a7c02013-10-16 16:09:24 -0700647#define ETHTOOL_TEST 0x0000001a
648#define ETHTOOL_GSTRINGS 0x0000001b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800649#define ETHTOOL_PHYS_ID 0x0000001c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700650#define ETHTOOL_GSTATS 0x0000001d
Ben Cheng655a7c02013-10-16 16:09:24 -0700651#define ETHTOOL_GTSO 0x0000001e
652#define ETHTOOL_STSO 0x0000001f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800653#define ETHTOOL_GPERMADDR 0x00000020
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700654#define ETHTOOL_GUFO 0x00000021
Ben Cheng655a7c02013-10-16 16:09:24 -0700655#define ETHTOOL_SUFO 0x00000022
656#define ETHTOOL_GGSO 0x00000023
Christopher Ferris05d08e92016-02-04 13:16:38 -0800657#define ETHTOOL_SGSO 0x00000024
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700658#define ETHTOOL_GFLAGS 0x00000025
Ben Cheng655a7c02013-10-16 16:09:24 -0700659#define ETHTOOL_SFLAGS 0x00000026
660#define ETHTOOL_GPFLAGS 0x00000027
Christopher Ferris05d08e92016-02-04 13:16:38 -0800661#define ETHTOOL_SPFLAGS 0x00000028
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700662#define ETHTOOL_GRXFH 0x00000029
Ben Cheng655a7c02013-10-16 16:09:24 -0700663#define ETHTOOL_SRXFH 0x0000002a
664#define ETHTOOL_GGRO 0x0000002b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800665#define ETHTOOL_SGRO 0x0000002c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700666#define ETHTOOL_GRXRINGS 0x0000002d
Ben Cheng655a7c02013-10-16 16:09:24 -0700667#define ETHTOOL_GRXCLSRLCNT 0x0000002e
668#define ETHTOOL_GRXCLSRULE 0x0000002f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800669#define ETHTOOL_GRXCLSRLALL 0x00000030
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700670#define ETHTOOL_SRXCLSRLDEL 0x00000031
Ben Cheng655a7c02013-10-16 16:09:24 -0700671#define ETHTOOL_SRXCLSRLINS 0x00000032
672#define ETHTOOL_FLASHDEV 0x00000033
Christopher Ferris05d08e92016-02-04 13:16:38 -0800673#define ETHTOOL_RESET 0x00000034
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700674#define ETHTOOL_SRXNTUPLE 0x00000035
Ben Cheng655a7c02013-10-16 16:09:24 -0700675#define ETHTOOL_GRXNTUPLE 0x00000036
676#define ETHTOOL_GSSET_INFO 0x00000037
Christopher Ferris05d08e92016-02-04 13:16:38 -0800677#define ETHTOOL_GRXFHINDIR 0x00000038
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700678#define ETHTOOL_SRXFHINDIR 0x00000039
Ben Cheng655a7c02013-10-16 16:09:24 -0700679#define ETHTOOL_GFEATURES 0x0000003a
680#define ETHTOOL_SFEATURES 0x0000003b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800681#define ETHTOOL_GCHANNELS 0x0000003c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700682#define ETHTOOL_SCHANNELS 0x0000003d
Ben Cheng655a7c02013-10-16 16:09:24 -0700683#define ETHTOOL_SET_DUMP 0x0000003e
684#define ETHTOOL_GET_DUMP_FLAG 0x0000003f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800685#define ETHTOOL_GET_DUMP_DATA 0x00000040
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700686#define ETHTOOL_GET_TS_INFO 0x00000041
Ben Cheng655a7c02013-10-16 16:09:24 -0700687#define ETHTOOL_GMODULEINFO 0x00000042
688#define ETHTOOL_GMODULEEEPROM 0x00000043
Christopher Ferris05d08e92016-02-04 13:16:38 -0800689#define ETHTOOL_GEEE 0x00000044
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700690#define ETHTOOL_SEEE 0x00000045
691#define ETHTOOL_GRSSH 0x00000046
692#define ETHTOOL_SRSSH 0x00000047
Christopher Ferris05d08e92016-02-04 13:16:38 -0800693#define ETHTOOL_GTUNABLE 0x00000048
Christopher Ferris82d75042015-01-26 10:57:07 -0800694#define ETHTOOL_STUNABLE 0x00000049
Christopher Ferris106b3a82016-08-24 12:15:38 -0700695#define ETHTOOL_GPHYSTATS 0x0000004a
696#define ETHTOOL_PERQUEUE 0x0000004b
Christopher Ferris106b3a82016-08-24 12:15:38 -0700697#define ETHTOOL_GLINKSETTINGS 0x0000004c
698#define ETHTOOL_SLINKSETTINGS 0x0000004d
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800699#define ETHTOOL_PHY_GTUNABLE 0x0000004e
700#define ETHTOOL_PHY_STUNABLE 0x0000004f
Christopher Ferris1308ad32017-11-14 17:32:13 -0800701#define ETHTOOL_GFECPARAM 0x00000050
702#define ETHTOOL_SFECPARAM 0x00000051
Christopher Ferris82d75042015-01-26 10:57:07 -0800703#define SPARC_ETH_GSET ETHTOOL_GSET
Ben Cheng655a7c02013-10-16 16:09:24 -0700704#define SPARC_ETH_SSET ETHTOOL_SSET
Christopher Ferris106b3a82016-08-24 12:15:38 -0700705enum ethtool_link_mode_bit_indices {
706 ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0,
707 ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1,
708 ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700709 ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3,
710 ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4,
711 ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5,
712 ETHTOOL_LINK_MODE_Autoneg_BIT = 6,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700713 ETHTOOL_LINK_MODE_TP_BIT = 7,
714 ETHTOOL_LINK_MODE_AUI_BIT = 8,
715 ETHTOOL_LINK_MODE_MII_BIT = 9,
716 ETHTOOL_LINK_MODE_FIBRE_BIT = 10,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700717 ETHTOOL_LINK_MODE_BNC_BIT = 11,
718 ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12,
719 ETHTOOL_LINK_MODE_Pause_BIT = 13,
720 ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700721 ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15,
722 ETHTOOL_LINK_MODE_Backplane_BIT = 16,
723 ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17,
724 ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700725 ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19,
726 ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20,
727 ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21,
728 ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700729 ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23,
730 ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24,
731 ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25,
732 ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700733 ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27,
734 ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28,
735 ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,
736 ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700737 ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,
738 ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,
739 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33,
740 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700741 ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35,
742 ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36,
743 ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37,
744 ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700745 ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800746 ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800747 ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41,
748 ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800749 ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43,
750 ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44,
751 ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45,
752 ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800753 ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47,
754 ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800755 ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49,
756 ETHTOOL_LINK_MODE_FEC_RS_BIT = 50,
757 ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700758 ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 52,
759 ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 53,
760 ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 54,
761 ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 55,
762 ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 56,
763 ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 57,
764 ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 58,
765 ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 59,
766 ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60,
767 ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 61,
768 ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 62,
769 ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 63,
770 ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64,
771 ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65,
772 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700773 ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 67,
774 ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 68,
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800775 ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 69,
776 ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 70,
777 ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71,
778 ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72,
779 ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700780 ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 74,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700781 ETHTOOL_LINK_MODE_100000baseKR_Full_BIT = 75,
782 ETHTOOL_LINK_MODE_100000baseSR_Full_BIT = 76,
783 ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT = 77,
784 ETHTOOL_LINK_MODE_100000baseCR_Full_BIT = 78,
785 ETHTOOL_LINK_MODE_100000baseDR_Full_BIT = 79,
786 ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT = 80,
787 ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT = 81,
788 ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT = 82,
789 ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT = 83,
790 ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT = 84,
791 ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT = 85,
792 ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT = 86,
793 ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87,
794 ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 88,
795 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800796 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
797 ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700798 ETHTOOL_LINK_MODE_10baseT1L_Full_BIT = 92,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800799 ETHTOOL_LINK_MODE_800000baseCR8_Full_BIT = 93,
800 ETHTOOL_LINK_MODE_800000baseKR8_Full_BIT = 94,
801 ETHTOOL_LINK_MODE_800000baseDR8_Full_BIT = 95,
802 ETHTOOL_LINK_MODE_800000baseDR8_2_Full_BIT = 96,
803 ETHTOOL_LINK_MODE_800000baseSR8_Full_BIT = 97,
804 ETHTOOL_LINK_MODE_800000baseVR8_Full_BIT = 98,
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000805 ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99,
806 ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100,
807 ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101,
Christopher Ferris4ba54492024-09-18 16:25:22 +0000808 ETHTOOL_LINK_MODE_10baseT1BRR_Full_BIT = 102,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700809 __ETHTOOL_LINK_MODE_MASK_NBITS
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800810};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800811#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) (1UL << (ETHTOOL_LINK_MODE_ ##base_name ##_BIT))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700812#define SUPPORTED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
813#define SUPPORTED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
814#define SUPPORTED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800815#define SUPPORTED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700816#define SUPPORTED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
817#define SUPPORTED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
818#define SUPPORTED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800819#define SUPPORTED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700820#define SUPPORTED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
821#define SUPPORTED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
822#define SUPPORTED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800823#define SUPPORTED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700824#define SUPPORTED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
825#define SUPPORTED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
826#define SUPPORTED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800827#define SUPPORTED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700828#define SUPPORTED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
829#define SUPPORTED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
830#define SUPPORTED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800831#define SUPPORTED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700832#define SUPPORTED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
833#define SUPPORTED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
834#define SUPPORTED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800835#define SUPPORTED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700836#define SUPPORTED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
837#define SUPPORTED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
838#define SUPPORTED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800839#define SUPPORTED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700840#define SUPPORTED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
841#define SUPPORTED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
842#define SUPPORTED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800843#define ADVERTISED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700844#define ADVERTISED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
845#define ADVERTISED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
846#define ADVERTISED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800847#define ADVERTISED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700848#define ADVERTISED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
849#define ADVERTISED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
850#define ADVERTISED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800851#define ADVERTISED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700852#define ADVERTISED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
853#define ADVERTISED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
854#define ADVERTISED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800855#define ADVERTISED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700856#define ADVERTISED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
857#define ADVERTISED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
858#define ADVERTISED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800859#define ADVERTISED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700860#define ADVERTISED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
861#define ADVERTISED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
862#define ADVERTISED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800863#define ADVERTISED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700864#define ADVERTISED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
865#define ADVERTISED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
866#define ADVERTISED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800867#define ADVERTISED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700868#define ADVERTISED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
869#define ADVERTISED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
870#define ADVERTISED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800871#define ADVERTISED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700872#define ADVERTISED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
873#define ADVERTISED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Ben Cheng655a7c02013-10-16 16:09:24 -0700874#define SPEED_10 10
Christopher Ferris49f525c2016-12-12 14:55:36 -0800875#define SPEED_100 100
Christopher Ferris05d08e92016-02-04 13:16:38 -0800876#define SPEED_1000 1000
Ben Cheng655a7c02013-10-16 16:09:24 -0700877#define SPEED_2500 2500
Christopher Ferris05d08e92016-02-04 13:16:38 -0800878#define SPEED_5000 5000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800879#define SPEED_10000 10000
Christopher Ferris525ce912017-07-26 13:12:53 -0700880#define SPEED_14000 14000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800881#define SPEED_20000 20000
882#define SPEED_25000 25000
883#define SPEED_40000 40000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800884#define SPEED_50000 50000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800885#define SPEED_56000 56000
886#define SPEED_100000 100000
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700887#define SPEED_200000 200000
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800888#define SPEED_400000 400000
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800889#define SPEED_800000 800000
Tao Baod7db5942015-01-28 10:07:51 -0800890#define SPEED_UNKNOWN - 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800891#define DUPLEX_HALF 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -0700892#define DUPLEX_FULL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700893#define DUPLEX_UNKNOWN 0xff
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700894#define MASTER_SLAVE_CFG_UNSUPPORTED 0
895#define MASTER_SLAVE_CFG_UNKNOWN 1
896#define MASTER_SLAVE_CFG_MASTER_PREFERRED 2
897#define MASTER_SLAVE_CFG_SLAVE_PREFERRED 3
898#define MASTER_SLAVE_CFG_MASTER_FORCE 4
899#define MASTER_SLAVE_CFG_SLAVE_FORCE 5
900#define MASTER_SLAVE_STATE_UNSUPPORTED 0
901#define MASTER_SLAVE_STATE_UNKNOWN 1
902#define MASTER_SLAVE_STATE_MASTER 2
903#define MASTER_SLAVE_STATE_SLAVE 3
904#define MASTER_SLAVE_STATE_ERR 4
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000905#define RATE_MATCH_NONE 0
906#define RATE_MATCH_PAUSE 1
907#define RATE_MATCH_CRS 2
908#define RATE_MATCH_OPEN_LOOP 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700909#define PORT_TP 0x00
Christopher Ferris49f525c2016-12-12 14:55:36 -0800910#define PORT_AUI 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700911#define PORT_MII 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700912#define PORT_FIBRE 0x03
913#define PORT_BNC 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800914#define PORT_DA 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700915#define PORT_NONE 0xef
Ben Cheng655a7c02013-10-16 16:09:24 -0700916#define PORT_OTHER 0xff
917#define XCVR_INTERNAL 0x00
Christopher Ferris49f525c2016-12-12 14:55:36 -0800918#define XCVR_EXTERNAL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700919#define XCVR_DUMMY1 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700920#define XCVR_DUMMY2 0x03
921#define XCVR_DUMMY3 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800922#define AUTONEG_DISABLE 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -0700923#define AUTONEG_ENABLE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700924#define ETH_TP_MDI_INVALID 0x00
925#define ETH_TP_MDI 0x01
Christopher Ferris49f525c2016-12-12 14:55:36 -0800926#define ETH_TP_MDI_X 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700927#define ETH_TP_MDI_AUTO 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700928#define WAKE_PHY (1 << 0)
929#define WAKE_UCAST (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800930#define WAKE_MCAST (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700931#define WAKE_BCAST (1 << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700932#define WAKE_ARP (1 << 4)
933#define WAKE_MAGIC (1 << 5)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800934#define WAKE_MAGICSECURE (1 << 6)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700935#define WAKE_FILTER (1 << 7)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700936#define WOL_MODE_COUNT 8
Christopher Ferrisb830ddf2024-03-28 11:48:08 -0700937#define RXH_XFRM_SYM_XOR (1 << 0)
938#define RXH_XFRM_NO_CHANGE 0xff
Ben Cheng655a7c02013-10-16 16:09:24 -0700939#define TCP_V4_FLOW 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700940#define UDP_V4_FLOW 0x02
941#define SCTP_V4_FLOW 0x03
Christopher Ferris49f525c2016-12-12 14:55:36 -0800942#define AH_ESP_V4_FLOW 0x04
Ben Cheng655a7c02013-10-16 16:09:24 -0700943#define TCP_V6_FLOW 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700944#define UDP_V6_FLOW 0x06
945#define SCTP_V6_FLOW 0x07
Christopher Ferris49f525c2016-12-12 14:55:36 -0800946#define AH_ESP_V6_FLOW 0x08
Ben Cheng655a7c02013-10-16 16:09:24 -0700947#define AH_V4_FLOW 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -0700948#define ESP_V4_FLOW 0x0a
949#define AH_V6_FLOW 0x0b
Christopher Ferris49f525c2016-12-12 14:55:36 -0800950#define ESP_V6_FLOW 0x0c
Christopher Ferris106b3a82016-08-24 12:15:38 -0700951#define IPV4_USER_FLOW 0x0d
952#define IP_USER_FLOW IPV4_USER_FLOW
953#define IPV6_USER_FLOW 0x0e
Christopher Ferris49f525c2016-12-12 14:55:36 -0800954#define IPV4_FLOW 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700955#define IPV6_FLOW 0x11
956#define ETHER_FLOW 0x12
Christopher Ferris7f4c8372024-06-03 14:22:19 -0700957#define GTPU_V4_FLOW 0x13
958#define GTPU_V6_FLOW 0x14
959#define GTPC_V4_FLOW 0x15
960#define GTPC_V6_FLOW 0x16
961#define GTPC_TEID_V4_FLOW 0x17
962#define GTPC_TEID_V6_FLOW 0x18
963#define GTPU_EH_V4_FLOW 0x19
964#define GTPU_EH_V6_FLOW 0x1a
965#define GTPU_UL_V4_FLOW 0x1b
966#define GTPU_UL_V6_FLOW 0x1c
967#define GTPU_DL_V4_FLOW 0x1d
968#define GTPU_DL_V6_FLOW 0x1e
Ben Cheng655a7c02013-10-16 16:09:24 -0700969#define FLOW_EXT 0x80000000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800970#define FLOW_MAC_EXT 0x40000000
Christopher Ferris76a1d452018-06-27 14:12:29 -0700971#define FLOW_RSS 0x20000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700972#define RXH_L2DA (1 << 1)
973#define RXH_VLAN (1 << 2)
974#define RXH_L3_PROTO (1 << 3)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800975#define RXH_IP_SRC (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -0700976#define RXH_IP_DST (1 << 5)
977#define RXH_L4_B_0_1 (1 << 6)
978#define RXH_L4_B_2_3 (1 << 7)
Christopher Ferris7f4c8372024-06-03 14:22:19 -0700979#define RXH_GTP_TEID (1 << 8)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800980#define RXH_DISCARD (1 << 31)
Ben Cheng655a7c02013-10-16 16:09:24 -0700981#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
Christopher Ferris9ce28842018-10-25 12:11:39 -0700982#define RX_CLS_FLOW_WAKE 0xfffffffffffffffeULL
Ben Cheng655a7c02013-10-16 16:09:24 -0700983#define RX_CLS_LOC_SPECIAL 0x80000000
984#define RX_CLS_LOC_ANY 0xffffffff
Christopher Ferris49f525c2016-12-12 14:55:36 -0800985#define RX_CLS_LOC_FIRST 0xfffffffe
Ben Cheng655a7c02013-10-16 16:09:24 -0700986#define RX_CLS_LOC_LAST 0xfffffffd
987#define ETH_MODULE_SFF_8079 0x1
988#define ETH_MODULE_SFF_8079_LEN 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800989#define ETH_MODULE_SFF_8472 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -0700990#define ETH_MODULE_SFF_8472_LEN 512
Christopher Ferris05d08e92016-02-04 13:16:38 -0800991#define ETH_MODULE_SFF_8636 0x3
Christopher Ferris05d08e92016-02-04 13:16:38 -0800992#define ETH_MODULE_SFF_8636_LEN 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800993#define ETH_MODULE_SFF_8436 0x4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800994#define ETH_MODULE_SFF_8436_LEN 256
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700995#define ETH_MODULE_SFF_8636_MAX_LEN 640
996#define ETH_MODULE_SFF_8436_MAX_LEN 640
Ben Cheng655a7c02013-10-16 16:09:24 -0700997enum ethtool_reset_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800998 ETH_RESET_MGMT = 1 << 0,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800999 ETH_RESET_IRQ = 1 << 1,
Tao Baod7db5942015-01-28 10:07:51 -08001000 ETH_RESET_DMA = 1 << 2,
1001 ETH_RESET_FILTER = 1 << 3,
Tao Baod7db5942015-01-28 10:07:51 -08001002 ETH_RESET_OFFLOAD = 1 << 4,
Christopher Ferris49f525c2016-12-12 14:55:36 -08001003 ETH_RESET_MAC = 1 << 5,
Tao Baod7db5942015-01-28 10:07:51 -08001004 ETH_RESET_PHY = 1 << 6,
1005 ETH_RESET_RAM = 1 << 7,
Christopher Ferris76a1d452018-06-27 14:12:29 -07001006 ETH_RESET_AP = 1 << 8,
Tao Baod7db5942015-01-28 10:07:51 -08001007 ETH_RESET_DEDICATED = 0x0000ffff,
Christopher Ferris49f525c2016-12-12 14:55:36 -08001008 ETH_RESET_ALL = 0xffffffff,
Ben Cheng655a7c02013-10-16 16:09:24 -07001009};
1010#define ETH_RESET_SHARED_SHIFT 16
Christopher Ferris106b3a82016-08-24 12:15:38 -07001011struct ethtool_link_settings {
Christopher Ferris49f525c2016-12-12 14:55:36 -08001012 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -07001013 __u32 speed;
1014 __u8 duplex;
1015 __u8 port;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001016 __u8 phy_address;
Christopher Ferris106b3a82016-08-24 12:15:38 -07001017 __u8 autoneg;
1018 __u8 mdio_support;
1019 __u8 eth_tp_mdix;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001020 __u8 eth_tp_mdix_ctrl;
Christopher Ferris106b3a82016-08-24 12:15:38 -07001021 __s8 link_mode_masks_nwords;
Christopher Ferris1308ad32017-11-14 17:32:13 -08001022 __u8 transceiver;
Christopher Ferris8177cdf2020-08-03 11:53:55 -07001023 __u8 master_slave_cfg;
1024 __u8 master_slave_state;
Christopher Ferris6cd53a52022-12-12 23:39:16 +00001025 __u8 rate_matching;
Christopher Ferris1308ad32017-11-14 17:32:13 -08001026 __u32 reserved[7];
Christopher Ferris7447a1c2022-10-04 18:24:44 -07001027 __u32 link_mode_masks[];
Christopher Ferris49f525c2016-12-12 14:55:36 -08001028};
Ben Cheng655a7c02013-10-16 16:09:24 -07001029#endif