blob: 8bdd62216f614da806136d0440196ed047d65e72 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_ETHTOOL_H
20#define _UAPI_LINUX_ETHTOOL_H
Christopher Ferris05667cd2021-02-16 16:01:34 -080021#include <linux/const.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#include <linux/types.h>
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#include <linux/if_ether.h>
24#include <limits.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070025struct ethtool_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080026 __u32 cmd;
27 __u32 supported;
28 __u32 advertising;
Tao Baod7db5942015-01-28 10:07:51 -080029 __u16 speed;
30 __u8 duplex;
31 __u8 port;
32 __u8 phy_address;
Tao Baod7db5942015-01-28 10:07:51 -080033 __u8 transceiver;
34 __u8 autoneg;
35 __u8 mdio_support;
36 __u32 maxtxpkt;
Tao Baod7db5942015-01-28 10:07:51 -080037 __u32 maxrxpkt;
38 __u16 speed_hi;
39 __u8 eth_tp_mdix;
40 __u8 eth_tp_mdix_ctrl;
Tao Baod7db5942015-01-28 10:07:51 -080041 __u32 lp_advertising;
42 __u32 reserved[2];
Ben Cheng655a7c02013-10-16 16:09:24 -070043};
44#define ETH_MDIO_SUPPORTS_C22 1
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define ETH_MDIO_SUPPORTS_C45 2
46#define ETHTOOL_FWVERS_LEN 32
47#define ETHTOOL_BUSINFO_LEN 32
Christopher Ferris05d08e92016-02-04 13:16:38 -080048#define ETHTOOL_EROMVERS_LEN 32
Christopher Ferris05d08e92016-02-04 13:16:38 -080049struct ethtool_drvinfo {
Tao Baod7db5942015-01-28 10:07:51 -080050 __u32 cmd;
51 char driver[32];
52 char version[32];
53 char fw_version[ETHTOOL_FWVERS_LEN];
Tao Baod7db5942015-01-28 10:07:51 -080054 char bus_info[ETHTOOL_BUSINFO_LEN];
Christopher Ferris05d08e92016-02-04 13:16:38 -080055 char erom_version[ETHTOOL_EROMVERS_LEN];
Tao Baod7db5942015-01-28 10:07:51 -080056 char reserved2[12];
Christopher Ferris05d08e92016-02-04 13:16:38 -080057 __u32 n_priv_flags;
Tao Baod7db5942015-01-28 10:07:51 -080058 __u32 n_stats;
59 __u32 testinfo_len;
60 __u32 eedump_len;
Christopher Ferris05d08e92016-02-04 13:16:38 -080061 __u32 regdump_len;
Ben Cheng655a7c02013-10-16 16:09:24 -070062};
63#define SOPASS_MAX 6
64struct ethtool_wolinfo {
Christopher Ferris05d08e92016-02-04 13:16:38 -080065 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -080066 __u32 supported;
67 __u32 wolopts;
68 __u8 sopass[SOPASS_MAX];
Christopher Ferris05d08e92016-02-04 13:16:38 -080069};
Ben Cheng655a7c02013-10-16 16:09:24 -070070struct ethtool_value {
Tao Baod7db5942015-01-28 10:07:51 -080071 __u32 cmd;
72 __u32 data;
Christopher Ferris05d08e92016-02-04 13:16:38 -080073};
Christopher Ferris76a1d452018-06-27 14:12:29 -070074#define PFC_STORM_PREVENTION_AUTO 0xffff
75#define PFC_STORM_PREVENTION_DISABLE 0
Christopher Ferris82d75042015-01-26 10:57:07 -080076enum tunable_id {
Tao Baod7db5942015-01-28 10:07:51 -080077 ETHTOOL_ID_UNSPEC,
78 ETHTOOL_RX_COPYBREAK,
Christopher Ferris05d08e92016-02-04 13:16:38 -080079 ETHTOOL_TX_COPYBREAK,
Christopher Ferris76a1d452018-06-27 14:12:29 -070080 ETHTOOL_PFC_PREVENTION_TOUT,
Christopher Ferris1ed55342022-03-22 16:06:25 -070081 ETHTOOL_TX_COPYBREAK_BUF_SIZE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080082 __ETHTOOL_TUNABLE_COUNT,
Christopher Ferris82d75042015-01-26 10:57:07 -080083};
84enum tunable_type_id {
Tao Baod7db5942015-01-28 10:07:51 -080085 ETHTOOL_TUNABLE_UNSPEC,
86 ETHTOOL_TUNABLE_U8,
Tao Baod7db5942015-01-28 10:07:51 -080087 ETHTOOL_TUNABLE_U16,
88 ETHTOOL_TUNABLE_U32,
89 ETHTOOL_TUNABLE_U64,
90 ETHTOOL_TUNABLE_STRING,
Tao Baod7db5942015-01-28 10:07:51 -080091 ETHTOOL_TUNABLE_S8,
92 ETHTOOL_TUNABLE_S16,
93 ETHTOOL_TUNABLE_S32,
94 ETHTOOL_TUNABLE_S64,
Christopher Ferris82d75042015-01-26 10:57:07 -080095};
96struct ethtool_tunable {
Tao Baod7db5942015-01-28 10:07:51 -080097 __u32 cmd;
98 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080099 __u32 type_id;
100 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700101 void * data[];
Christopher Ferris82d75042015-01-26 10:57:07 -0800102};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800103#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
104#define DOWNSHIFT_DEV_DISABLE 0
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700105#define ETHTOOL_PHY_FAST_LINK_DOWN_ON 0
106#define ETHTOOL_PHY_FAST_LINK_DOWN_OFF 0xff
Christopher Ferris9584fa42019-12-09 15:36:13 -0800107#define ETHTOOL_PHY_EDPD_DFLT_TX_MSECS 0xffff
108#define ETHTOOL_PHY_EDPD_NO_TX 0xfffe
109#define ETHTOOL_PHY_EDPD_DISABLE 0
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800110enum phy_tunable_id {
111 ETHTOOL_PHY_ID_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800112 ETHTOOL_PHY_DOWNSHIFT,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700113 ETHTOOL_PHY_FAST_LINK_DOWN,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800114 ETHTOOL_PHY_EDPD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800115 __ETHTOOL_PHY_TUNABLE_COUNT,
116};
Ben Cheng655a7c02013-10-16 16:09:24 -0700117struct ethtool_regs {
Tao Baod7db5942015-01-28 10:07:51 -0800118 __u32 cmd;
119 __u32 version;
120 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700121 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700122};
123struct ethtool_eeprom {
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800125 __u32 magic;
126 __u32 offset;
127 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700128 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700129};
130struct ethtool_eee {
Tao Baod7db5942015-01-28 10:07:51 -0800131 __u32 cmd;
132 __u32 supported;
Tao Baod7db5942015-01-28 10:07:51 -0800133 __u32 advertised;
134 __u32 lp_advertised;
135 __u32 eee_active;
136 __u32 eee_enabled;
Tao Baod7db5942015-01-28 10:07:51 -0800137 __u32 tx_lpi_enabled;
138 __u32 tx_lpi_timer;
139 __u32 reserved[2];
Ben Cheng655a7c02013-10-16 16:09:24 -0700140};
Ben Cheng655a7c02013-10-16 16:09:24 -0700141struct ethtool_modinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u32 cmd;
143 __u32 type;
144 __u32 eeprom_len;
Tao Baod7db5942015-01-28 10:07:51 -0800145 __u32 reserved[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700146};
147struct ethtool_coalesce {
Tao Baod7db5942015-01-28 10:07:51 -0800148 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800149 __u32 rx_coalesce_usecs;
150 __u32 rx_max_coalesced_frames;
151 __u32 rx_coalesce_usecs_irq;
152 __u32 rx_max_coalesced_frames_irq;
Tao Baod7db5942015-01-28 10:07:51 -0800153 __u32 tx_coalesce_usecs;
154 __u32 tx_max_coalesced_frames;
155 __u32 tx_coalesce_usecs_irq;
156 __u32 tx_max_coalesced_frames_irq;
Tao Baod7db5942015-01-28 10:07:51 -0800157 __u32 stats_block_coalesce_usecs;
158 __u32 use_adaptive_rx_coalesce;
159 __u32 use_adaptive_tx_coalesce;
160 __u32 pkt_rate_low;
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u32 rx_coalesce_usecs_low;
162 __u32 rx_max_coalesced_frames_low;
163 __u32 tx_coalesce_usecs_low;
164 __u32 tx_max_coalesced_frames_low;
Tao Baod7db5942015-01-28 10:07:51 -0800165 __u32 pkt_rate_high;
166 __u32 rx_coalesce_usecs_high;
167 __u32 rx_max_coalesced_frames_high;
168 __u32 tx_coalesce_usecs_high;
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u32 tx_max_coalesced_frames_high;
170 __u32 rate_sample_interval;
Ben Cheng655a7c02013-10-16 16:09:24 -0700171};
172struct ethtool_ringparam {
Tao Baod7db5942015-01-28 10:07:51 -0800173 __u32 cmd;
174 __u32 rx_max_pending;
175 __u32 rx_mini_max_pending;
176 __u32 rx_jumbo_max_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u32 tx_max_pending;
178 __u32 rx_pending;
179 __u32 rx_mini_pending;
180 __u32 rx_jumbo_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800181 __u32 tx_pending;
Ben Cheng655a7c02013-10-16 16:09:24 -0700182};
183struct ethtool_channels {
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800185 __u32 max_rx;
186 __u32 max_tx;
187 __u32 max_other;
188 __u32 max_combined;
Tao Baod7db5942015-01-28 10:07:51 -0800189 __u32 rx_count;
190 __u32 tx_count;
191 __u32 other_count;
192 __u32 combined_count;
Ben Cheng655a7c02013-10-16 16:09:24 -0700193};
194struct ethtool_pauseparam {
Tao Baod7db5942015-01-28 10:07:51 -0800195 __u32 cmd;
196 __u32 autoneg;
Tao Baod7db5942015-01-28 10:07:51 -0800197 __u32 rx_pause;
198 __u32 tx_pause;
Ben Cheng655a7c02013-10-16 16:09:24 -0700199};
Christopher Ferris25c18d42020-10-14 17:42:58 -0700200enum ethtool_link_ext_state {
201 ETHTOOL_LINK_EXT_STATE_AUTONEG,
202 ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE,
203 ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH,
204 ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY,
205 ETHTOOL_LINK_EXT_STATE_NO_CABLE,
206 ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE,
207 ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE,
208 ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE,
209 ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED,
210 ETHTOOL_LINK_EXT_STATE_OVERHEAT,
Christopher Ferrisa4792612022-01-10 13:51:15 -0800211 ETHTOOL_LINK_EXT_STATE_MODULE,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700212};
213enum ethtool_link_ext_substate_autoneg {
214 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1,
215 ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED,
216 ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED,
217 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE,
218 ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE,
219 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD,
220};
221enum ethtool_link_ext_substate_link_training {
222 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1,
223 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT,
224 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY,
225 ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT,
226};
227enum ethtool_link_ext_substate_link_logical_mismatch {
228 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1,
229 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK,
230 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS,
231 ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED,
232 ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED,
233};
234enum ethtool_link_ext_substate_bad_signal_integrity {
235 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1,
236 ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700237 ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_REFERENCE_CLOCK_LOST,
238 ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_ALOS,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700239};
240enum ethtool_link_ext_substate_cable_issue {
241 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1,
242 ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE,
243};
Christopher Ferrisa4792612022-01-10 13:51:15 -0800244enum ethtool_link_ext_substate_module {
245 ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY = 1,
246};
Ben Cheng655a7c02013-10-16 16:09:24 -0700247#define ETH_GSTRING_LEN 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700248enum ethtool_stringset {
Tao Baod7db5942015-01-28 10:07:51 -0800249 ETH_SS_TEST = 0,
250 ETH_SS_STATS,
251 ETH_SS_PRIV_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800252 ETH_SS_NTUPLE_FILTERS,
253 ETH_SS_FEATURES,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800254 ETH_SS_RSS_HASH_FUNCS,
255 ETH_SS_TUNABLES,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700256 ETH_SS_PHY_STATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800257 ETH_SS_PHY_TUNABLES,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700258 ETH_SS_LINK_MODES,
259 ETH_SS_MSG_CLASSES,
260 ETH_SS_WOL_MODES,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700261 ETH_SS_SOF_TIMESTAMPING,
262 ETH_SS_TS_TX_TYPES,
263 ETH_SS_TS_RX_FILTERS,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700264 ETH_SS_UDP_TUNNEL_TYPES,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000265 ETH_SS_STATS_STD,
266 ETH_SS_STATS_ETH_PHY,
267 ETH_SS_STATS_ETH_MAC,
268 ETH_SS_STATS_ETH_CTRL,
269 ETH_SS_STATS_RMON,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700270 ETH_SS_COUNT
Ben Cheng655a7c02013-10-16 16:09:24 -0700271};
Christopher Ferrisa4792612022-01-10 13:51:15 -0800272enum ethtool_module_power_mode_policy {
273 ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH = 1,
274 ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO,
275};
276enum ethtool_module_power_mode {
277 ETHTOOL_MODULE_POWER_MODE_LOW = 1,
278 ETHTOOL_MODULE_POWER_MODE_HIGH,
279};
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000280enum ethtool_podl_pse_admin_state {
281 ETHTOOL_PODL_PSE_ADMIN_STATE_UNKNOWN = 1,
282 ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED,
283 ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED,
284};
285enum ethtool_podl_pse_pw_d_status {
286 ETHTOOL_PODL_PSE_PW_D_STATUS_UNKNOWN = 1,
287 ETHTOOL_PODL_PSE_PW_D_STATUS_DISABLED,
288 ETHTOOL_PODL_PSE_PW_D_STATUS_SEARCHING,
289 ETHTOOL_PODL_PSE_PW_D_STATUS_DELIVERING,
290 ETHTOOL_PODL_PSE_PW_D_STATUS_SLEEP,
291 ETHTOOL_PODL_PSE_PW_D_STATUS_IDLE,
292 ETHTOOL_PODL_PSE_PW_D_STATUS_ERROR,
293};
Ben Cheng655a7c02013-10-16 16:09:24 -0700294struct ethtool_gstrings {
Tao Baod7db5942015-01-28 10:07:51 -0800295 __u32 cmd;
296 __u32 string_set;
297 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700298 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700299};
300struct ethtool_sset_info {
Tao Baod7db5942015-01-28 10:07:51 -0800301 __u32 cmd;
302 __u32 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800303 __u64 sset_mask;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700304 __u32 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700305};
306enum ethtool_test_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800307 ETH_TEST_FL_OFFLINE = (1 << 0),
308 ETH_TEST_FL_FAILED = (1 << 1),
309 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
310 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
Ben Cheng655a7c02013-10-16 16:09:24 -0700311};
312struct ethtool_test {
Tao Baod7db5942015-01-28 10:07:51 -0800313 __u32 cmd;
314 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800315 __u32 reserved;
316 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700317 __u64 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700318};
Ben Cheng655a7c02013-10-16 16:09:24 -0700319struct ethtool_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800320 __u32 cmd;
321 __u32 n_stats;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700322 __u64 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700323};
324struct ethtool_perm_addr {
Tao Baod7db5942015-01-28 10:07:51 -0800325 __u32 cmd;
326 __u32 size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700327 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700328};
329enum ethtool_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800330 ETH_FLAG_TXVLAN = (1 << 7),
Tao Baod7db5942015-01-28 10:07:51 -0800331 ETH_FLAG_RXVLAN = (1 << 8),
332 ETH_FLAG_LRO = (1 << 15),
333 ETH_FLAG_NTUPLE = (1 << 27),
334 ETH_FLAG_RXHASH = (1 << 28),
Ben Cheng655a7c02013-10-16 16:09:24 -0700335};
336struct ethtool_tcpip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800337 __be32 ip4src;
338 __be32 ip4dst;
Tao Baod7db5942015-01-28 10:07:51 -0800339 __be16 psrc;
340 __be16 pdst;
341 __u8 tos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700342};
Ben Cheng655a7c02013-10-16 16:09:24 -0700343struct ethtool_ah_espip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800344 __be32 ip4src;
345 __be32 ip4dst;
346 __be32 spi;
Tao Baod7db5942015-01-28 10:07:51 -0800347 __u8 tos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700348};
349#define ETH_RX_NFC_IP4 1
350struct ethtool_usrip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800351 __be32 ip4src;
352 __be32 ip4dst;
353 __be32 l4_4_bytes;
354 __u8 tos;
Tao Baod7db5942015-01-28 10:07:51 -0800355 __u8 ip_ver;
356 __u8 proto;
Ben Cheng655a7c02013-10-16 16:09:24 -0700357};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700358struct ethtool_tcpip6_spec {
359 __be32 ip6src[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700360 __be32 ip6dst[4];
361 __be16 psrc;
362 __be16 pdst;
363 __u8 tclass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700364};
365struct ethtool_ah_espip6_spec {
366 __be32 ip6src[4];
367 __be32 ip6dst[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700368 __be32 spi;
369 __u8 tclass;
370};
371struct ethtool_usrip6_spec {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700372 __be32 ip6src[4];
373 __be32 ip6dst[4];
374 __be32 l4_4_bytes;
375 __u8 tclass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700376 __u8 l4_proto;
377};
378union ethtool_flow_union {
Tao Baod7db5942015-01-28 10:07:51 -0800379 struct ethtool_tcpip4_spec tcp_ip4_spec;
380 struct ethtool_tcpip4_spec udp_ip4_spec;
381 struct ethtool_tcpip4_spec sctp_ip4_spec;
382 struct ethtool_ah_espip4_spec ah_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800383 struct ethtool_ah_espip4_spec esp_ip4_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700384 struct ethtool_usrip4_spec usr_ip4_spec;
385 struct ethtool_tcpip6_spec tcp_ip6_spec;
386 struct ethtool_tcpip6_spec udp_ip6_spec;
387 struct ethtool_tcpip6_spec sctp_ip6_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700388 struct ethtool_ah_espip6_spec ah_ip6_spec;
389 struct ethtool_ah_espip6_spec esp_ip6_spec;
390 struct ethtool_usrip6_spec usr_ip6_spec;
391 struct ethhdr ether_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700392 __u8 hdata[52];
Ben Cheng655a7c02013-10-16 16:09:24 -0700393};
394struct ethtool_flow_ext {
Tao Baod7db5942015-01-28 10:07:51 -0800395 __u8 padding[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700396 unsigned char h_dest[ETH_ALEN];
Tao Baod7db5942015-01-28 10:07:51 -0800397 __be16 vlan_etype;
398 __be16 vlan_tci;
399 __be32 data[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700400};
Ben Cheng655a7c02013-10-16 16:09:24 -0700401struct ethtool_rx_flow_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800402 __u32 flow_type;
403 union ethtool_flow_union h_u;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700404 struct ethtool_flow_ext h_ext;
Tao Baod7db5942015-01-28 10:07:51 -0800405 union ethtool_flow_union m_u;
406 struct ethtool_flow_ext m_ext;
407 __u64 ring_cookie;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700408 __u32 location;
Ben Cheng655a7c02013-10-16 16:09:24 -0700409};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800410#define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL
411#define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL
Christopher Ferris106b3a82016-08-24 12:15:38 -0700412#define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
Christopher Ferris9ce28842018-10-25 12:11:39 -0700413struct ethtool_rxnfc {
414 __u32 cmd;
415 __u32 flow_type;
416 __u64 data;
417 struct ethtool_rx_flow_spec fs;
418 union {
419 __u32 rule_cnt;
420 __u32 rss_context;
421 };
422 __u32 rule_locs[0];
423};
Ben Cheng655a7c02013-10-16 16:09:24 -0700424struct ethtool_rxfh_indir {
Tao Baod7db5942015-01-28 10:07:51 -0800425 __u32 cmd;
426 __u32 size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700427 __u32 ring_index[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700428};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700429struct ethtool_rxfh {
Tao Baod7db5942015-01-28 10:07:51 -0800430 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700431 __u32 rss_context;
Tao Baod7db5942015-01-28 10:07:51 -0800432 __u32 indir_size;
433 __u32 key_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800434 __u8 hfunc;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700435 __u8 rsvd8[3];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800436 __u32 rsvd32;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700437 __u32 rss_config[];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700438};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700439#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff
Christopher Ferris106b3a82016-08-24 12:15:38 -0700440#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
Christopher Ferris05d08e92016-02-04 13:16:38 -0800441struct ethtool_rx_ntuple_flow_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800442 __u32 flow_type;
443 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700444 struct ethtool_tcpip4_spec tcp_ip4_spec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800445 struct ethtool_tcpip4_spec udp_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800446 struct ethtool_tcpip4_spec sctp_ip4_spec;
447 struct ethtool_ah_espip4_spec ah_ip4_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700448 struct ethtool_ah_espip4_spec esp_ip4_spec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800449 struct ethtool_usrip4_spec usr_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800450 struct ethhdr ether_spec;
451 __u8 hdata[72];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700452 } h_u, m_u;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800453 __u16 vlan_tag;
Tao Baod7db5942015-01-28 10:07:51 -0800454 __u16 vlan_tag_mask;
455 __u64 data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700456 __u64 data_mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800457 __s32 action;
Tao Baod7db5942015-01-28 10:07:51 -0800458#define ETHTOOL_RXNTUPLE_ACTION_DROP (- 1)
459#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (- 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700460};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800461struct ethtool_rx_ntuple {
Tao Baod7db5942015-01-28 10:07:51 -0800462 __u32 cmd;
463 struct ethtool_rx_ntuple_flow_spec fs;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700464};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800465#define ETHTOOL_FLASH_MAX_FILENAME 128
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700466enum ethtool_flash_op_type {
Tao Baod7db5942015-01-28 10:07:51 -0800467 ETHTOOL_FLASH_ALL_REGIONS = 0,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700468};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800469struct ethtool_flash {
Tao Baod7db5942015-01-28 10:07:51 -0800470 __u32 cmd;
471 __u32 region;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700472 char data[ETHTOOL_FLASH_MAX_FILENAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800473};
Ben Cheng655a7c02013-10-16 16:09:24 -0700474struct ethtool_dump {
Tao Baod7db5942015-01-28 10:07:51 -0800475 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700476 __u32 version;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800477 __u32 flag;
Tao Baod7db5942015-01-28 10:07:51 -0800478 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700479 __u8 data[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700480};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800481#define ETH_FW_DUMP_DISABLE 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700482struct ethtool_get_features_block {
Tao Baod7db5942015-01-28 10:07:51 -0800483 __u32 available;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700484 __u32 requested;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800485 __u32 active;
Tao Baod7db5942015-01-28 10:07:51 -0800486 __u32 never_changed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700487};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700488struct ethtool_gfeatures {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800489 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800490 __u32 size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700491 struct ethtool_get_features_block features[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700492};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800493struct ethtool_set_features_block {
Tao Baod7db5942015-01-28 10:07:51 -0800494 __u32 valid;
495 __u32 requested;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700496};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800497struct ethtool_sfeatures {
Tao Baod7db5942015-01-28 10:07:51 -0800498 __u32 cmd;
499 __u32 size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700500 struct ethtool_set_features_block features[];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800501};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700502struct ethtool_ts_info {
Tao Baod7db5942015-01-28 10:07:51 -0800503 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700504 __u32 so_timestamping;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800505 __s32 phc_index;
Tao Baod7db5942015-01-28 10:07:51 -0800506 __u32 tx_types;
507 __u32 tx_reserved[3];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700508 __u32 rx_filters;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800509 __u32 rx_reserved[3];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700510};
Ben Cheng655a7c02013-10-16 16:09:24 -0700511enum ethtool_sfeatures_retval_bits {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700512 ETHTOOL_F_UNSUPPORTED__BIT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800513 ETHTOOL_F_WISH__BIT,
Tao Baod7db5942015-01-28 10:07:51 -0800514 ETHTOOL_F_COMPAT__BIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700515};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700516#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800517#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700518#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700519#define MAX_NUM_QUEUE 4096
Christopher Ferris106b3a82016-08-24 12:15:38 -0700520struct ethtool_per_queue_op {
521 __u32 cmd;
522 __u32 sub_command;
523 __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700524 char data[];
525};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800526struct ethtool_fecparam {
527 __u32 cmd;
528 __u32 active_fec;
529 __u32 fec;
530 __u32 reserved;
531};
532enum ethtool_fec_config_bits {
533 ETHTOOL_FEC_NONE_BIT,
534 ETHTOOL_FEC_AUTO_BIT,
535 ETHTOOL_FEC_OFF_BIT,
536 ETHTOOL_FEC_RS_BIT,
537 ETHTOOL_FEC_BASER_BIT,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700538 ETHTOOL_FEC_LLRS_BIT,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800539};
540#define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT)
541#define ETHTOOL_FEC_AUTO (1 << ETHTOOL_FEC_AUTO_BIT)
542#define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT)
543#define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT)
544#define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700545#define ETHTOOL_FEC_LLRS (1 << ETHTOOL_FEC_LLRS_BIT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700546#define ETHTOOL_GSET 0x00000001
547#define ETHTOOL_SSET 0x00000002
Christopher Ferris05d08e92016-02-04 13:16:38 -0800548#define ETHTOOL_GDRVINFO 0x00000003
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700549#define ETHTOOL_GREGS 0x00000004
Ben Cheng655a7c02013-10-16 16:09:24 -0700550#define ETHTOOL_GWOL 0x00000005
551#define ETHTOOL_SWOL 0x00000006
Christopher Ferris05d08e92016-02-04 13:16:38 -0800552#define ETHTOOL_GMSGLVL 0x00000007
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700553#define ETHTOOL_SMSGLVL 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -0700554#define ETHTOOL_NWAY_RST 0x00000009
555#define ETHTOOL_GLINK 0x0000000a
Christopher Ferris05d08e92016-02-04 13:16:38 -0800556#define ETHTOOL_GEEPROM 0x0000000b
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700557#define ETHTOOL_SEEPROM 0x0000000c
Ben Cheng655a7c02013-10-16 16:09:24 -0700558#define ETHTOOL_GCOALESCE 0x0000000e
559#define ETHTOOL_SCOALESCE 0x0000000f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800560#define ETHTOOL_GRINGPARAM 0x00000010
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700561#define ETHTOOL_SRINGPARAM 0x00000011
Ben Cheng655a7c02013-10-16 16:09:24 -0700562#define ETHTOOL_GPAUSEPARAM 0x00000012
563#define ETHTOOL_SPAUSEPARAM 0x00000013
Christopher Ferris05d08e92016-02-04 13:16:38 -0800564#define ETHTOOL_GRXCSUM 0x00000014
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700565#define ETHTOOL_SRXCSUM 0x00000015
Ben Cheng655a7c02013-10-16 16:09:24 -0700566#define ETHTOOL_GTXCSUM 0x00000016
567#define ETHTOOL_STXCSUM 0x00000017
Christopher Ferris05d08e92016-02-04 13:16:38 -0800568#define ETHTOOL_GSG 0x00000018
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700569#define ETHTOOL_SSG 0x00000019
Ben Cheng655a7c02013-10-16 16:09:24 -0700570#define ETHTOOL_TEST 0x0000001a
571#define ETHTOOL_GSTRINGS 0x0000001b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800572#define ETHTOOL_PHYS_ID 0x0000001c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700573#define ETHTOOL_GSTATS 0x0000001d
Ben Cheng655a7c02013-10-16 16:09:24 -0700574#define ETHTOOL_GTSO 0x0000001e
575#define ETHTOOL_STSO 0x0000001f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800576#define ETHTOOL_GPERMADDR 0x00000020
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700577#define ETHTOOL_GUFO 0x00000021
Ben Cheng655a7c02013-10-16 16:09:24 -0700578#define ETHTOOL_SUFO 0x00000022
579#define ETHTOOL_GGSO 0x00000023
Christopher Ferris05d08e92016-02-04 13:16:38 -0800580#define ETHTOOL_SGSO 0x00000024
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700581#define ETHTOOL_GFLAGS 0x00000025
Ben Cheng655a7c02013-10-16 16:09:24 -0700582#define ETHTOOL_SFLAGS 0x00000026
583#define ETHTOOL_GPFLAGS 0x00000027
Christopher Ferris05d08e92016-02-04 13:16:38 -0800584#define ETHTOOL_SPFLAGS 0x00000028
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700585#define ETHTOOL_GRXFH 0x00000029
Ben Cheng655a7c02013-10-16 16:09:24 -0700586#define ETHTOOL_SRXFH 0x0000002a
587#define ETHTOOL_GGRO 0x0000002b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800588#define ETHTOOL_SGRO 0x0000002c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700589#define ETHTOOL_GRXRINGS 0x0000002d
Ben Cheng655a7c02013-10-16 16:09:24 -0700590#define ETHTOOL_GRXCLSRLCNT 0x0000002e
591#define ETHTOOL_GRXCLSRULE 0x0000002f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800592#define ETHTOOL_GRXCLSRLALL 0x00000030
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700593#define ETHTOOL_SRXCLSRLDEL 0x00000031
Ben Cheng655a7c02013-10-16 16:09:24 -0700594#define ETHTOOL_SRXCLSRLINS 0x00000032
595#define ETHTOOL_FLASHDEV 0x00000033
Christopher Ferris05d08e92016-02-04 13:16:38 -0800596#define ETHTOOL_RESET 0x00000034
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700597#define ETHTOOL_SRXNTUPLE 0x00000035
Ben Cheng655a7c02013-10-16 16:09:24 -0700598#define ETHTOOL_GRXNTUPLE 0x00000036
599#define ETHTOOL_GSSET_INFO 0x00000037
Christopher Ferris05d08e92016-02-04 13:16:38 -0800600#define ETHTOOL_GRXFHINDIR 0x00000038
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700601#define ETHTOOL_SRXFHINDIR 0x00000039
Ben Cheng655a7c02013-10-16 16:09:24 -0700602#define ETHTOOL_GFEATURES 0x0000003a
603#define ETHTOOL_SFEATURES 0x0000003b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800604#define ETHTOOL_GCHANNELS 0x0000003c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700605#define ETHTOOL_SCHANNELS 0x0000003d
Ben Cheng655a7c02013-10-16 16:09:24 -0700606#define ETHTOOL_SET_DUMP 0x0000003e
607#define ETHTOOL_GET_DUMP_FLAG 0x0000003f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800608#define ETHTOOL_GET_DUMP_DATA 0x00000040
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700609#define ETHTOOL_GET_TS_INFO 0x00000041
Ben Cheng655a7c02013-10-16 16:09:24 -0700610#define ETHTOOL_GMODULEINFO 0x00000042
611#define ETHTOOL_GMODULEEEPROM 0x00000043
Christopher Ferris05d08e92016-02-04 13:16:38 -0800612#define ETHTOOL_GEEE 0x00000044
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700613#define ETHTOOL_SEEE 0x00000045
614#define ETHTOOL_GRSSH 0x00000046
615#define ETHTOOL_SRSSH 0x00000047
Christopher Ferris05d08e92016-02-04 13:16:38 -0800616#define ETHTOOL_GTUNABLE 0x00000048
Christopher Ferris82d75042015-01-26 10:57:07 -0800617#define ETHTOOL_STUNABLE 0x00000049
Christopher Ferris106b3a82016-08-24 12:15:38 -0700618#define ETHTOOL_GPHYSTATS 0x0000004a
619#define ETHTOOL_PERQUEUE 0x0000004b
Christopher Ferris106b3a82016-08-24 12:15:38 -0700620#define ETHTOOL_GLINKSETTINGS 0x0000004c
621#define ETHTOOL_SLINKSETTINGS 0x0000004d
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800622#define ETHTOOL_PHY_GTUNABLE 0x0000004e
623#define ETHTOOL_PHY_STUNABLE 0x0000004f
Christopher Ferris1308ad32017-11-14 17:32:13 -0800624#define ETHTOOL_GFECPARAM 0x00000050
625#define ETHTOOL_SFECPARAM 0x00000051
Christopher Ferris82d75042015-01-26 10:57:07 -0800626#define SPARC_ETH_GSET ETHTOOL_GSET
Ben Cheng655a7c02013-10-16 16:09:24 -0700627#define SPARC_ETH_SSET ETHTOOL_SSET
Christopher Ferris106b3a82016-08-24 12:15:38 -0700628enum ethtool_link_mode_bit_indices {
629 ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0,
630 ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1,
631 ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700632 ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3,
633 ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4,
634 ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5,
635 ETHTOOL_LINK_MODE_Autoneg_BIT = 6,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700636 ETHTOOL_LINK_MODE_TP_BIT = 7,
637 ETHTOOL_LINK_MODE_AUI_BIT = 8,
638 ETHTOOL_LINK_MODE_MII_BIT = 9,
639 ETHTOOL_LINK_MODE_FIBRE_BIT = 10,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700640 ETHTOOL_LINK_MODE_BNC_BIT = 11,
641 ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12,
642 ETHTOOL_LINK_MODE_Pause_BIT = 13,
643 ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700644 ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15,
645 ETHTOOL_LINK_MODE_Backplane_BIT = 16,
646 ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17,
647 ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700648 ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19,
649 ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20,
650 ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21,
651 ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700652 ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23,
653 ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24,
654 ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25,
655 ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700656 ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27,
657 ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28,
658 ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,
659 ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700660 ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,
661 ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,
662 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33,
663 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700664 ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35,
665 ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36,
666 ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37,
667 ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700668 ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800669 ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800670 ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41,
671 ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800672 ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43,
673 ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44,
674 ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45,
675 ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800676 ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47,
677 ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800678 ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49,
679 ETHTOOL_LINK_MODE_FEC_RS_BIT = 50,
680 ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700681 ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 52,
682 ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 53,
683 ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 54,
684 ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 55,
685 ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 56,
686 ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 57,
687 ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 58,
688 ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 59,
689 ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60,
690 ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 61,
691 ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 62,
692 ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 63,
693 ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64,
694 ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65,
695 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700696 ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 67,
697 ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 68,
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800698 ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 69,
699 ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 70,
700 ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71,
701 ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72,
702 ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700703 ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 74,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700704 ETHTOOL_LINK_MODE_100000baseKR_Full_BIT = 75,
705 ETHTOOL_LINK_MODE_100000baseSR_Full_BIT = 76,
706 ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT = 77,
707 ETHTOOL_LINK_MODE_100000baseCR_Full_BIT = 78,
708 ETHTOOL_LINK_MODE_100000baseDR_Full_BIT = 79,
709 ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT = 80,
710 ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT = 81,
711 ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT = 82,
712 ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT = 83,
713 ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT = 84,
714 ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT = 85,
715 ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT = 86,
716 ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87,
717 ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 88,
718 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800719 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
720 ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700721 ETHTOOL_LINK_MODE_10baseT1L_Full_BIT = 92,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700722 __ETHTOOL_LINK_MODE_MASK_NBITS
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800723};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800724#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) (1UL << (ETHTOOL_LINK_MODE_ ##base_name ##_BIT))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700725#define SUPPORTED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
726#define SUPPORTED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
727#define SUPPORTED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800728#define SUPPORTED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700729#define SUPPORTED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
730#define SUPPORTED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
731#define SUPPORTED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800732#define SUPPORTED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700733#define SUPPORTED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
734#define SUPPORTED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
735#define SUPPORTED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800736#define SUPPORTED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700737#define SUPPORTED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
738#define SUPPORTED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
739#define SUPPORTED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800740#define SUPPORTED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700741#define SUPPORTED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
742#define SUPPORTED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
743#define SUPPORTED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800744#define SUPPORTED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700745#define SUPPORTED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
746#define SUPPORTED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
747#define SUPPORTED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800748#define SUPPORTED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700749#define SUPPORTED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
750#define SUPPORTED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
751#define SUPPORTED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800752#define SUPPORTED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700753#define SUPPORTED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
754#define SUPPORTED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
755#define SUPPORTED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800756#define ADVERTISED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700757#define ADVERTISED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
758#define ADVERTISED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
759#define ADVERTISED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800760#define ADVERTISED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700761#define ADVERTISED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
762#define ADVERTISED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
763#define ADVERTISED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800764#define ADVERTISED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700765#define ADVERTISED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
766#define ADVERTISED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
767#define ADVERTISED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800768#define ADVERTISED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700769#define ADVERTISED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
770#define ADVERTISED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
771#define ADVERTISED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800772#define ADVERTISED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700773#define ADVERTISED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
774#define ADVERTISED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
775#define ADVERTISED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800776#define ADVERTISED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700777#define ADVERTISED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
778#define ADVERTISED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
779#define ADVERTISED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800780#define ADVERTISED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700781#define ADVERTISED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
782#define ADVERTISED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
783#define ADVERTISED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800784#define ADVERTISED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700785#define ADVERTISED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
786#define ADVERTISED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Ben Cheng655a7c02013-10-16 16:09:24 -0700787#define SPEED_10 10
Christopher Ferris49f525c2016-12-12 14:55:36 -0800788#define SPEED_100 100
Christopher Ferris05d08e92016-02-04 13:16:38 -0800789#define SPEED_1000 1000
Ben Cheng655a7c02013-10-16 16:09:24 -0700790#define SPEED_2500 2500
Christopher Ferris05d08e92016-02-04 13:16:38 -0800791#define SPEED_5000 5000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800792#define SPEED_10000 10000
Christopher Ferris525ce912017-07-26 13:12:53 -0700793#define SPEED_14000 14000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800794#define SPEED_20000 20000
795#define SPEED_25000 25000
796#define SPEED_40000 40000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800797#define SPEED_50000 50000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800798#define SPEED_56000 56000
799#define SPEED_100000 100000
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700800#define SPEED_200000 200000
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800801#define SPEED_400000 400000
Tao Baod7db5942015-01-28 10:07:51 -0800802#define SPEED_UNKNOWN - 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800803#define DUPLEX_HALF 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -0700804#define DUPLEX_FULL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700805#define DUPLEX_UNKNOWN 0xff
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700806#define MASTER_SLAVE_CFG_UNSUPPORTED 0
807#define MASTER_SLAVE_CFG_UNKNOWN 1
808#define MASTER_SLAVE_CFG_MASTER_PREFERRED 2
809#define MASTER_SLAVE_CFG_SLAVE_PREFERRED 3
810#define MASTER_SLAVE_CFG_MASTER_FORCE 4
811#define MASTER_SLAVE_CFG_SLAVE_FORCE 5
812#define MASTER_SLAVE_STATE_UNSUPPORTED 0
813#define MASTER_SLAVE_STATE_UNKNOWN 1
814#define MASTER_SLAVE_STATE_MASTER 2
815#define MASTER_SLAVE_STATE_SLAVE 3
816#define MASTER_SLAVE_STATE_ERR 4
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000817#define RATE_MATCH_NONE 0
818#define RATE_MATCH_PAUSE 1
819#define RATE_MATCH_CRS 2
820#define RATE_MATCH_OPEN_LOOP 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700821#define PORT_TP 0x00
Christopher Ferris49f525c2016-12-12 14:55:36 -0800822#define PORT_AUI 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700823#define PORT_MII 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700824#define PORT_FIBRE 0x03
825#define PORT_BNC 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800826#define PORT_DA 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700827#define PORT_NONE 0xef
Ben Cheng655a7c02013-10-16 16:09:24 -0700828#define PORT_OTHER 0xff
829#define XCVR_INTERNAL 0x00
Christopher Ferris49f525c2016-12-12 14:55:36 -0800830#define XCVR_EXTERNAL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700831#define XCVR_DUMMY1 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700832#define XCVR_DUMMY2 0x03
833#define XCVR_DUMMY3 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800834#define AUTONEG_DISABLE 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -0700835#define AUTONEG_ENABLE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700836#define ETH_TP_MDI_INVALID 0x00
837#define ETH_TP_MDI 0x01
Christopher Ferris49f525c2016-12-12 14:55:36 -0800838#define ETH_TP_MDI_X 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700839#define ETH_TP_MDI_AUTO 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700840#define WAKE_PHY (1 << 0)
841#define WAKE_UCAST (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800842#define WAKE_MCAST (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700843#define WAKE_BCAST (1 << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700844#define WAKE_ARP (1 << 4)
845#define WAKE_MAGIC (1 << 5)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800846#define WAKE_MAGICSECURE (1 << 6)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700847#define WAKE_FILTER (1 << 7)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700848#define WOL_MODE_COUNT 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700849#define TCP_V4_FLOW 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700850#define UDP_V4_FLOW 0x02
851#define SCTP_V4_FLOW 0x03
Christopher Ferris49f525c2016-12-12 14:55:36 -0800852#define AH_ESP_V4_FLOW 0x04
Ben Cheng655a7c02013-10-16 16:09:24 -0700853#define TCP_V6_FLOW 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700854#define UDP_V6_FLOW 0x06
855#define SCTP_V6_FLOW 0x07
Christopher Ferris49f525c2016-12-12 14:55:36 -0800856#define AH_ESP_V6_FLOW 0x08
Ben Cheng655a7c02013-10-16 16:09:24 -0700857#define AH_V4_FLOW 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -0700858#define ESP_V4_FLOW 0x0a
859#define AH_V6_FLOW 0x0b
Christopher Ferris49f525c2016-12-12 14:55:36 -0800860#define ESP_V6_FLOW 0x0c
Christopher Ferris106b3a82016-08-24 12:15:38 -0700861#define IPV4_USER_FLOW 0x0d
862#define IP_USER_FLOW IPV4_USER_FLOW
863#define IPV6_USER_FLOW 0x0e
Christopher Ferris49f525c2016-12-12 14:55:36 -0800864#define IPV4_FLOW 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700865#define IPV6_FLOW 0x11
866#define ETHER_FLOW 0x12
867#define FLOW_EXT 0x80000000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800868#define FLOW_MAC_EXT 0x40000000
Christopher Ferris76a1d452018-06-27 14:12:29 -0700869#define FLOW_RSS 0x20000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700870#define RXH_L2DA (1 << 1)
871#define RXH_VLAN (1 << 2)
872#define RXH_L3_PROTO (1 << 3)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800873#define RXH_IP_SRC (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -0700874#define RXH_IP_DST (1 << 5)
875#define RXH_L4_B_0_1 (1 << 6)
876#define RXH_L4_B_2_3 (1 << 7)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800877#define RXH_DISCARD (1 << 31)
Ben Cheng655a7c02013-10-16 16:09:24 -0700878#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
Christopher Ferris9ce28842018-10-25 12:11:39 -0700879#define RX_CLS_FLOW_WAKE 0xfffffffffffffffeULL
Ben Cheng655a7c02013-10-16 16:09:24 -0700880#define RX_CLS_LOC_SPECIAL 0x80000000
881#define RX_CLS_LOC_ANY 0xffffffff
Christopher Ferris49f525c2016-12-12 14:55:36 -0800882#define RX_CLS_LOC_FIRST 0xfffffffe
Ben Cheng655a7c02013-10-16 16:09:24 -0700883#define RX_CLS_LOC_LAST 0xfffffffd
884#define ETH_MODULE_SFF_8079 0x1
885#define ETH_MODULE_SFF_8079_LEN 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800886#define ETH_MODULE_SFF_8472 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -0700887#define ETH_MODULE_SFF_8472_LEN 512
Christopher Ferris05d08e92016-02-04 13:16:38 -0800888#define ETH_MODULE_SFF_8636 0x3
Christopher Ferris05d08e92016-02-04 13:16:38 -0800889#define ETH_MODULE_SFF_8636_LEN 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800890#define ETH_MODULE_SFF_8436 0x4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800891#define ETH_MODULE_SFF_8436_LEN 256
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700892#define ETH_MODULE_SFF_8636_MAX_LEN 640
893#define ETH_MODULE_SFF_8436_MAX_LEN 640
Ben Cheng655a7c02013-10-16 16:09:24 -0700894enum ethtool_reset_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800895 ETH_RESET_MGMT = 1 << 0,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800896 ETH_RESET_IRQ = 1 << 1,
Tao Baod7db5942015-01-28 10:07:51 -0800897 ETH_RESET_DMA = 1 << 2,
898 ETH_RESET_FILTER = 1 << 3,
Tao Baod7db5942015-01-28 10:07:51 -0800899 ETH_RESET_OFFLOAD = 1 << 4,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800900 ETH_RESET_MAC = 1 << 5,
Tao Baod7db5942015-01-28 10:07:51 -0800901 ETH_RESET_PHY = 1 << 6,
902 ETH_RESET_RAM = 1 << 7,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700903 ETH_RESET_AP = 1 << 8,
Tao Baod7db5942015-01-28 10:07:51 -0800904 ETH_RESET_DEDICATED = 0x0000ffff,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800905 ETH_RESET_ALL = 0xffffffff,
Ben Cheng655a7c02013-10-16 16:09:24 -0700906};
907#define ETH_RESET_SHARED_SHIFT 16
Christopher Ferris106b3a82016-08-24 12:15:38 -0700908struct ethtool_link_settings {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800909 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700910 __u32 speed;
911 __u8 duplex;
912 __u8 port;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800913 __u8 phy_address;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700914 __u8 autoneg;
915 __u8 mdio_support;
916 __u8 eth_tp_mdix;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800917 __u8 eth_tp_mdix_ctrl;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700918 __s8 link_mode_masks_nwords;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800919 __u8 transceiver;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700920 __u8 master_slave_cfg;
921 __u8 master_slave_state;
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000922 __u8 rate_matching;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800923 __u32 reserved[7];
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700924 __u32 link_mode_masks[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800925};
Ben Cheng655a7c02013-10-16 16:09:24 -0700926#endif