blob: baf417d0bf03b5c53cab2327824b01a3e56a15ff [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 Ferris05d08e92016-02-04 13:16:38 -080081 __ETHTOOL_TUNABLE_COUNT,
Christopher Ferris82d75042015-01-26 10:57:07 -080082};
83enum tunable_type_id {
Tao Baod7db5942015-01-28 10:07:51 -080084 ETHTOOL_TUNABLE_UNSPEC,
85 ETHTOOL_TUNABLE_U8,
Tao Baod7db5942015-01-28 10:07:51 -080086 ETHTOOL_TUNABLE_U16,
87 ETHTOOL_TUNABLE_U32,
88 ETHTOOL_TUNABLE_U64,
89 ETHTOOL_TUNABLE_STRING,
Tao Baod7db5942015-01-28 10:07:51 -080090 ETHTOOL_TUNABLE_S8,
91 ETHTOOL_TUNABLE_S16,
92 ETHTOOL_TUNABLE_S32,
93 ETHTOOL_TUNABLE_S64,
Christopher Ferris82d75042015-01-26 10:57:07 -080094};
95struct ethtool_tunable {
Tao Baod7db5942015-01-28 10:07:51 -080096 __u32 cmd;
97 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080098 __u32 type_id;
99 __u32 len;
100 void * data[0];
Christopher Ferris82d75042015-01-26 10:57:07 -0800101};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800102#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
103#define DOWNSHIFT_DEV_DISABLE 0
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700104#define ETHTOOL_PHY_FAST_LINK_DOWN_ON 0
105#define ETHTOOL_PHY_FAST_LINK_DOWN_OFF 0xff
Christopher Ferris9584fa42019-12-09 15:36:13 -0800106#define ETHTOOL_PHY_EDPD_DFLT_TX_MSECS 0xffff
107#define ETHTOOL_PHY_EDPD_NO_TX 0xfffe
108#define ETHTOOL_PHY_EDPD_DISABLE 0
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800109enum phy_tunable_id {
110 ETHTOOL_PHY_ID_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800111 ETHTOOL_PHY_DOWNSHIFT,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700112 ETHTOOL_PHY_FAST_LINK_DOWN,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800113 ETHTOOL_PHY_EDPD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800114 __ETHTOOL_PHY_TUNABLE_COUNT,
115};
Ben Cheng655a7c02013-10-16 16:09:24 -0700116struct ethtool_regs {
Tao Baod7db5942015-01-28 10:07:51 -0800117 __u32 cmd;
118 __u32 version;
119 __u32 len;
Tao Baod7db5942015-01-28 10:07:51 -0800120 __u8 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700121};
122struct ethtool_eeprom {
Tao Baod7db5942015-01-28 10:07:51 -0800123 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u32 magic;
125 __u32 offset;
126 __u32 len;
127 __u8 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700128};
129struct ethtool_eee {
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u32 cmd;
131 __u32 supported;
Tao Baod7db5942015-01-28 10:07:51 -0800132 __u32 advertised;
133 __u32 lp_advertised;
134 __u32 eee_active;
135 __u32 eee_enabled;
Tao Baod7db5942015-01-28 10:07:51 -0800136 __u32 tx_lpi_enabled;
137 __u32 tx_lpi_timer;
138 __u32 reserved[2];
Ben Cheng655a7c02013-10-16 16:09:24 -0700139};
Ben Cheng655a7c02013-10-16 16:09:24 -0700140struct ethtool_modinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800141 __u32 cmd;
142 __u32 type;
143 __u32 eeprom_len;
Tao Baod7db5942015-01-28 10:07:51 -0800144 __u32 reserved[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700145};
146struct ethtool_coalesce {
Tao Baod7db5942015-01-28 10:07:51 -0800147 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800148 __u32 rx_coalesce_usecs;
149 __u32 rx_max_coalesced_frames;
150 __u32 rx_coalesce_usecs_irq;
151 __u32 rx_max_coalesced_frames_irq;
Tao Baod7db5942015-01-28 10:07:51 -0800152 __u32 tx_coalesce_usecs;
153 __u32 tx_max_coalesced_frames;
154 __u32 tx_coalesce_usecs_irq;
155 __u32 tx_max_coalesced_frames_irq;
Tao Baod7db5942015-01-28 10:07:51 -0800156 __u32 stats_block_coalesce_usecs;
157 __u32 use_adaptive_rx_coalesce;
158 __u32 use_adaptive_tx_coalesce;
159 __u32 pkt_rate_low;
Tao Baod7db5942015-01-28 10:07:51 -0800160 __u32 rx_coalesce_usecs_low;
161 __u32 rx_max_coalesced_frames_low;
162 __u32 tx_coalesce_usecs_low;
163 __u32 tx_max_coalesced_frames_low;
Tao Baod7db5942015-01-28 10:07:51 -0800164 __u32 pkt_rate_high;
165 __u32 rx_coalesce_usecs_high;
166 __u32 rx_max_coalesced_frames_high;
167 __u32 tx_coalesce_usecs_high;
Tao Baod7db5942015-01-28 10:07:51 -0800168 __u32 tx_max_coalesced_frames_high;
169 __u32 rate_sample_interval;
Ben Cheng655a7c02013-10-16 16:09:24 -0700170};
171struct ethtool_ringparam {
Tao Baod7db5942015-01-28 10:07:51 -0800172 __u32 cmd;
173 __u32 rx_max_pending;
174 __u32 rx_mini_max_pending;
175 __u32 rx_jumbo_max_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800176 __u32 tx_max_pending;
177 __u32 rx_pending;
178 __u32 rx_mini_pending;
179 __u32 rx_jumbo_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800180 __u32 tx_pending;
Ben Cheng655a7c02013-10-16 16:09:24 -0700181};
182struct ethtool_channels {
Tao Baod7db5942015-01-28 10:07:51 -0800183 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u32 max_rx;
185 __u32 max_tx;
186 __u32 max_other;
187 __u32 max_combined;
Tao Baod7db5942015-01-28 10:07:51 -0800188 __u32 rx_count;
189 __u32 tx_count;
190 __u32 other_count;
191 __u32 combined_count;
Ben Cheng655a7c02013-10-16 16:09:24 -0700192};
193struct ethtool_pauseparam {
Tao Baod7db5942015-01-28 10:07:51 -0800194 __u32 cmd;
195 __u32 autoneg;
Tao Baod7db5942015-01-28 10:07:51 -0800196 __u32 rx_pause;
197 __u32 tx_pause;
Ben Cheng655a7c02013-10-16 16:09:24 -0700198};
Christopher Ferris25c18d42020-10-14 17:42:58 -0700199enum ethtool_link_ext_state {
200 ETHTOOL_LINK_EXT_STATE_AUTONEG,
201 ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE,
202 ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH,
203 ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY,
204 ETHTOOL_LINK_EXT_STATE_NO_CABLE,
205 ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE,
206 ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE,
207 ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE,
208 ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED,
209 ETHTOOL_LINK_EXT_STATE_OVERHEAT,
Christopher Ferrisa4792612022-01-10 13:51:15 -0800210 ETHTOOL_LINK_EXT_STATE_MODULE,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700211};
212enum ethtool_link_ext_substate_autoneg {
213 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1,
214 ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED,
215 ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED,
216 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE,
217 ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE,
218 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD,
219};
220enum ethtool_link_ext_substate_link_training {
221 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1,
222 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT,
223 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY,
224 ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT,
225};
226enum ethtool_link_ext_substate_link_logical_mismatch {
227 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1,
228 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK,
229 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS,
230 ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED,
231 ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED,
232};
233enum ethtool_link_ext_substate_bad_signal_integrity {
234 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1,
235 ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700236 ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_REFERENCE_CLOCK_LOST,
237 ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_ALOS,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700238};
239enum ethtool_link_ext_substate_cable_issue {
240 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1,
241 ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE,
242};
Christopher Ferrisa4792612022-01-10 13:51:15 -0800243enum ethtool_link_ext_substate_module {
244 ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY = 1,
245};
Ben Cheng655a7c02013-10-16 16:09:24 -0700246#define ETH_GSTRING_LEN 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700247enum ethtool_stringset {
Tao Baod7db5942015-01-28 10:07:51 -0800248 ETH_SS_TEST = 0,
249 ETH_SS_STATS,
250 ETH_SS_PRIV_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800251 ETH_SS_NTUPLE_FILTERS,
252 ETH_SS_FEATURES,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800253 ETH_SS_RSS_HASH_FUNCS,
254 ETH_SS_TUNABLES,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700255 ETH_SS_PHY_STATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800256 ETH_SS_PHY_TUNABLES,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700257 ETH_SS_LINK_MODES,
258 ETH_SS_MSG_CLASSES,
259 ETH_SS_WOL_MODES,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700260 ETH_SS_SOF_TIMESTAMPING,
261 ETH_SS_TS_TX_TYPES,
262 ETH_SS_TS_RX_FILTERS,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700263 ETH_SS_UDP_TUNNEL_TYPES,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000264 ETH_SS_STATS_STD,
265 ETH_SS_STATS_ETH_PHY,
266 ETH_SS_STATS_ETH_MAC,
267 ETH_SS_STATS_ETH_CTRL,
268 ETH_SS_STATS_RMON,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700269 ETH_SS_COUNT
Ben Cheng655a7c02013-10-16 16:09:24 -0700270};
Christopher Ferrisa4792612022-01-10 13:51:15 -0800271enum ethtool_module_power_mode_policy {
272 ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH = 1,
273 ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO,
274};
275enum ethtool_module_power_mode {
276 ETHTOOL_MODULE_POWER_MODE_LOW = 1,
277 ETHTOOL_MODULE_POWER_MODE_HIGH,
278};
Ben Cheng655a7c02013-10-16 16:09:24 -0700279struct ethtool_gstrings {
Tao Baod7db5942015-01-28 10:07:51 -0800280 __u32 cmd;
281 __u32 string_set;
282 __u32 len;
283 __u8 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700284};
285struct ethtool_sset_info {
Tao Baod7db5942015-01-28 10:07:51 -0800286 __u32 cmd;
287 __u32 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800288 __u64 sset_mask;
289 __u32 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700290};
291enum ethtool_test_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800292 ETH_TEST_FL_OFFLINE = (1 << 0),
293 ETH_TEST_FL_FAILED = (1 << 1),
294 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
295 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
Ben Cheng655a7c02013-10-16 16:09:24 -0700296};
297struct ethtool_test {
Tao Baod7db5942015-01-28 10:07:51 -0800298 __u32 cmd;
299 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800300 __u32 reserved;
301 __u32 len;
302 __u64 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700303};
Ben Cheng655a7c02013-10-16 16:09:24 -0700304struct ethtool_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800305 __u32 cmd;
306 __u32 n_stats;
307 __u64 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700308};
309struct ethtool_perm_addr {
Tao Baod7db5942015-01-28 10:07:51 -0800310 __u32 cmd;
311 __u32 size;
Tao Baod7db5942015-01-28 10:07:51 -0800312 __u8 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700313};
314enum ethtool_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800315 ETH_FLAG_TXVLAN = (1 << 7),
Tao Baod7db5942015-01-28 10:07:51 -0800316 ETH_FLAG_RXVLAN = (1 << 8),
317 ETH_FLAG_LRO = (1 << 15),
318 ETH_FLAG_NTUPLE = (1 << 27),
319 ETH_FLAG_RXHASH = (1 << 28),
Ben Cheng655a7c02013-10-16 16:09:24 -0700320};
321struct ethtool_tcpip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800322 __be32 ip4src;
323 __be32 ip4dst;
Tao Baod7db5942015-01-28 10:07:51 -0800324 __be16 psrc;
325 __be16 pdst;
326 __u8 tos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700327};
Ben Cheng655a7c02013-10-16 16:09:24 -0700328struct ethtool_ah_espip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800329 __be32 ip4src;
330 __be32 ip4dst;
331 __be32 spi;
Tao Baod7db5942015-01-28 10:07:51 -0800332 __u8 tos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700333};
334#define ETH_RX_NFC_IP4 1
335struct ethtool_usrip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800336 __be32 ip4src;
337 __be32 ip4dst;
338 __be32 l4_4_bytes;
339 __u8 tos;
Tao Baod7db5942015-01-28 10:07:51 -0800340 __u8 ip_ver;
341 __u8 proto;
Ben Cheng655a7c02013-10-16 16:09:24 -0700342};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700343struct ethtool_tcpip6_spec {
344 __be32 ip6src[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700345 __be32 ip6dst[4];
346 __be16 psrc;
347 __be16 pdst;
348 __u8 tclass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700349};
350struct ethtool_ah_espip6_spec {
351 __be32 ip6src[4];
352 __be32 ip6dst[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700353 __be32 spi;
354 __u8 tclass;
355};
356struct ethtool_usrip6_spec {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700357 __be32 ip6src[4];
358 __be32 ip6dst[4];
359 __be32 l4_4_bytes;
360 __u8 tclass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700361 __u8 l4_proto;
362};
363union ethtool_flow_union {
Tao Baod7db5942015-01-28 10:07:51 -0800364 struct ethtool_tcpip4_spec tcp_ip4_spec;
365 struct ethtool_tcpip4_spec udp_ip4_spec;
366 struct ethtool_tcpip4_spec sctp_ip4_spec;
367 struct ethtool_ah_espip4_spec ah_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800368 struct ethtool_ah_espip4_spec esp_ip4_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700369 struct ethtool_usrip4_spec usr_ip4_spec;
370 struct ethtool_tcpip6_spec tcp_ip6_spec;
371 struct ethtool_tcpip6_spec udp_ip6_spec;
372 struct ethtool_tcpip6_spec sctp_ip6_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700373 struct ethtool_ah_espip6_spec ah_ip6_spec;
374 struct ethtool_ah_espip6_spec esp_ip6_spec;
375 struct ethtool_usrip6_spec usr_ip6_spec;
376 struct ethhdr ether_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700377 __u8 hdata[52];
Ben Cheng655a7c02013-10-16 16:09:24 -0700378};
379struct ethtool_flow_ext {
Tao Baod7db5942015-01-28 10:07:51 -0800380 __u8 padding[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700381 unsigned char h_dest[ETH_ALEN];
Tao Baod7db5942015-01-28 10:07:51 -0800382 __be16 vlan_etype;
383 __be16 vlan_tci;
384 __be32 data[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700385};
Ben Cheng655a7c02013-10-16 16:09:24 -0700386struct ethtool_rx_flow_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800387 __u32 flow_type;
388 union ethtool_flow_union h_u;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700389 struct ethtool_flow_ext h_ext;
Tao Baod7db5942015-01-28 10:07:51 -0800390 union ethtool_flow_union m_u;
391 struct ethtool_flow_ext m_ext;
392 __u64 ring_cookie;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700393 __u32 location;
Ben Cheng655a7c02013-10-16 16:09:24 -0700394};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800395#define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL
396#define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL
Christopher Ferris106b3a82016-08-24 12:15:38 -0700397#define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
Christopher Ferris9ce28842018-10-25 12:11:39 -0700398struct ethtool_rxnfc {
399 __u32 cmd;
400 __u32 flow_type;
401 __u64 data;
402 struct ethtool_rx_flow_spec fs;
403 union {
404 __u32 rule_cnt;
405 __u32 rss_context;
406 };
407 __u32 rule_locs[0];
408};
Ben Cheng655a7c02013-10-16 16:09:24 -0700409struct ethtool_rxfh_indir {
Tao Baod7db5942015-01-28 10:07:51 -0800410 __u32 cmd;
411 __u32 size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700412 __u32 ring_index[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700413};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700414struct ethtool_rxfh {
Tao Baod7db5942015-01-28 10:07:51 -0800415 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700416 __u32 rss_context;
Tao Baod7db5942015-01-28 10:07:51 -0800417 __u32 indir_size;
418 __u32 key_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800419 __u8 hfunc;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700420 __u8 rsvd8[3];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800421 __u32 rsvd32;
Tao Baod7db5942015-01-28 10:07:51 -0800422 __u32 rss_config[0];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700423};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700424#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff
Christopher Ferris106b3a82016-08-24 12:15:38 -0700425#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
Christopher Ferris05d08e92016-02-04 13:16:38 -0800426struct ethtool_rx_ntuple_flow_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800427 __u32 flow_type;
428 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700429 struct ethtool_tcpip4_spec tcp_ip4_spec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800430 struct ethtool_tcpip4_spec udp_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800431 struct ethtool_tcpip4_spec sctp_ip4_spec;
432 struct ethtool_ah_espip4_spec ah_ip4_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700433 struct ethtool_ah_espip4_spec esp_ip4_spec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800434 struct ethtool_usrip4_spec usr_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800435 struct ethhdr ether_spec;
436 __u8 hdata[72];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700437 } h_u, m_u;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800438 __u16 vlan_tag;
Tao Baod7db5942015-01-28 10:07:51 -0800439 __u16 vlan_tag_mask;
440 __u64 data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700441 __u64 data_mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800442 __s32 action;
Tao Baod7db5942015-01-28 10:07:51 -0800443#define ETHTOOL_RXNTUPLE_ACTION_DROP (- 1)
444#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (- 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700445};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800446struct ethtool_rx_ntuple {
Tao Baod7db5942015-01-28 10:07:51 -0800447 __u32 cmd;
448 struct ethtool_rx_ntuple_flow_spec fs;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700449};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800450#define ETHTOOL_FLASH_MAX_FILENAME 128
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700451enum ethtool_flash_op_type {
Tao Baod7db5942015-01-28 10:07:51 -0800452 ETHTOOL_FLASH_ALL_REGIONS = 0,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700453};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800454struct ethtool_flash {
Tao Baod7db5942015-01-28 10:07:51 -0800455 __u32 cmd;
456 __u32 region;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700457 char data[ETHTOOL_FLASH_MAX_FILENAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800458};
Ben Cheng655a7c02013-10-16 16:09:24 -0700459struct ethtool_dump {
Tao Baod7db5942015-01-28 10:07:51 -0800460 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700461 __u32 version;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800462 __u32 flag;
Tao Baod7db5942015-01-28 10:07:51 -0800463 __u32 len;
464 __u8 data[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700465};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800466#define ETH_FW_DUMP_DISABLE 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700467struct ethtool_get_features_block {
Tao Baod7db5942015-01-28 10:07:51 -0800468 __u32 available;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700469 __u32 requested;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800470 __u32 active;
Tao Baod7db5942015-01-28 10:07:51 -0800471 __u32 never_changed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700472};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700473struct ethtool_gfeatures {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800474 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800475 __u32 size;
476 struct ethtool_get_features_block features[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700477};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800478struct ethtool_set_features_block {
Tao Baod7db5942015-01-28 10:07:51 -0800479 __u32 valid;
480 __u32 requested;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700481};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800482struct ethtool_sfeatures {
Tao Baod7db5942015-01-28 10:07:51 -0800483 __u32 cmd;
484 __u32 size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700485 struct ethtool_set_features_block features[0];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800486};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700487struct ethtool_ts_info {
Tao Baod7db5942015-01-28 10:07:51 -0800488 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700489 __u32 so_timestamping;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800490 __s32 phc_index;
Tao Baod7db5942015-01-28 10:07:51 -0800491 __u32 tx_types;
492 __u32 tx_reserved[3];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700493 __u32 rx_filters;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800494 __u32 rx_reserved[3];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700495};
Ben Cheng655a7c02013-10-16 16:09:24 -0700496enum ethtool_sfeatures_retval_bits {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700497 ETHTOOL_F_UNSUPPORTED__BIT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800498 ETHTOOL_F_WISH__BIT,
Tao Baod7db5942015-01-28 10:07:51 -0800499 ETHTOOL_F_COMPAT__BIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700500};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700501#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800502#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700503#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700504#define MAX_NUM_QUEUE 4096
Christopher Ferris106b3a82016-08-24 12:15:38 -0700505struct ethtool_per_queue_op {
506 __u32 cmd;
507 __u32 sub_command;
508 __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700509 char data[];
510};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800511struct ethtool_fecparam {
512 __u32 cmd;
513 __u32 active_fec;
514 __u32 fec;
515 __u32 reserved;
516};
517enum ethtool_fec_config_bits {
518 ETHTOOL_FEC_NONE_BIT,
519 ETHTOOL_FEC_AUTO_BIT,
520 ETHTOOL_FEC_OFF_BIT,
521 ETHTOOL_FEC_RS_BIT,
522 ETHTOOL_FEC_BASER_BIT,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700523 ETHTOOL_FEC_LLRS_BIT,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800524};
525#define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT)
526#define ETHTOOL_FEC_AUTO (1 << ETHTOOL_FEC_AUTO_BIT)
527#define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT)
528#define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT)
529#define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700530#define ETHTOOL_FEC_LLRS (1 << ETHTOOL_FEC_LLRS_BIT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700531#define ETHTOOL_GSET 0x00000001
532#define ETHTOOL_SSET 0x00000002
Christopher Ferris05d08e92016-02-04 13:16:38 -0800533#define ETHTOOL_GDRVINFO 0x00000003
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700534#define ETHTOOL_GREGS 0x00000004
Ben Cheng655a7c02013-10-16 16:09:24 -0700535#define ETHTOOL_GWOL 0x00000005
536#define ETHTOOL_SWOL 0x00000006
Christopher Ferris05d08e92016-02-04 13:16:38 -0800537#define ETHTOOL_GMSGLVL 0x00000007
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700538#define ETHTOOL_SMSGLVL 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -0700539#define ETHTOOL_NWAY_RST 0x00000009
540#define ETHTOOL_GLINK 0x0000000a
Christopher Ferris05d08e92016-02-04 13:16:38 -0800541#define ETHTOOL_GEEPROM 0x0000000b
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700542#define ETHTOOL_SEEPROM 0x0000000c
Ben Cheng655a7c02013-10-16 16:09:24 -0700543#define ETHTOOL_GCOALESCE 0x0000000e
544#define ETHTOOL_SCOALESCE 0x0000000f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800545#define ETHTOOL_GRINGPARAM 0x00000010
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700546#define ETHTOOL_SRINGPARAM 0x00000011
Ben Cheng655a7c02013-10-16 16:09:24 -0700547#define ETHTOOL_GPAUSEPARAM 0x00000012
548#define ETHTOOL_SPAUSEPARAM 0x00000013
Christopher Ferris05d08e92016-02-04 13:16:38 -0800549#define ETHTOOL_GRXCSUM 0x00000014
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700550#define ETHTOOL_SRXCSUM 0x00000015
Ben Cheng655a7c02013-10-16 16:09:24 -0700551#define ETHTOOL_GTXCSUM 0x00000016
552#define ETHTOOL_STXCSUM 0x00000017
Christopher Ferris05d08e92016-02-04 13:16:38 -0800553#define ETHTOOL_GSG 0x00000018
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700554#define ETHTOOL_SSG 0x00000019
Ben Cheng655a7c02013-10-16 16:09:24 -0700555#define ETHTOOL_TEST 0x0000001a
556#define ETHTOOL_GSTRINGS 0x0000001b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800557#define ETHTOOL_PHYS_ID 0x0000001c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700558#define ETHTOOL_GSTATS 0x0000001d
Ben Cheng655a7c02013-10-16 16:09:24 -0700559#define ETHTOOL_GTSO 0x0000001e
560#define ETHTOOL_STSO 0x0000001f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800561#define ETHTOOL_GPERMADDR 0x00000020
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700562#define ETHTOOL_GUFO 0x00000021
Ben Cheng655a7c02013-10-16 16:09:24 -0700563#define ETHTOOL_SUFO 0x00000022
564#define ETHTOOL_GGSO 0x00000023
Christopher Ferris05d08e92016-02-04 13:16:38 -0800565#define ETHTOOL_SGSO 0x00000024
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700566#define ETHTOOL_GFLAGS 0x00000025
Ben Cheng655a7c02013-10-16 16:09:24 -0700567#define ETHTOOL_SFLAGS 0x00000026
568#define ETHTOOL_GPFLAGS 0x00000027
Christopher Ferris05d08e92016-02-04 13:16:38 -0800569#define ETHTOOL_SPFLAGS 0x00000028
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700570#define ETHTOOL_GRXFH 0x00000029
Ben Cheng655a7c02013-10-16 16:09:24 -0700571#define ETHTOOL_SRXFH 0x0000002a
572#define ETHTOOL_GGRO 0x0000002b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800573#define ETHTOOL_SGRO 0x0000002c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700574#define ETHTOOL_GRXRINGS 0x0000002d
Ben Cheng655a7c02013-10-16 16:09:24 -0700575#define ETHTOOL_GRXCLSRLCNT 0x0000002e
576#define ETHTOOL_GRXCLSRULE 0x0000002f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800577#define ETHTOOL_GRXCLSRLALL 0x00000030
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700578#define ETHTOOL_SRXCLSRLDEL 0x00000031
Ben Cheng655a7c02013-10-16 16:09:24 -0700579#define ETHTOOL_SRXCLSRLINS 0x00000032
580#define ETHTOOL_FLASHDEV 0x00000033
Christopher Ferris05d08e92016-02-04 13:16:38 -0800581#define ETHTOOL_RESET 0x00000034
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700582#define ETHTOOL_SRXNTUPLE 0x00000035
Ben Cheng655a7c02013-10-16 16:09:24 -0700583#define ETHTOOL_GRXNTUPLE 0x00000036
584#define ETHTOOL_GSSET_INFO 0x00000037
Christopher Ferris05d08e92016-02-04 13:16:38 -0800585#define ETHTOOL_GRXFHINDIR 0x00000038
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700586#define ETHTOOL_SRXFHINDIR 0x00000039
Ben Cheng655a7c02013-10-16 16:09:24 -0700587#define ETHTOOL_GFEATURES 0x0000003a
588#define ETHTOOL_SFEATURES 0x0000003b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800589#define ETHTOOL_GCHANNELS 0x0000003c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700590#define ETHTOOL_SCHANNELS 0x0000003d
Ben Cheng655a7c02013-10-16 16:09:24 -0700591#define ETHTOOL_SET_DUMP 0x0000003e
592#define ETHTOOL_GET_DUMP_FLAG 0x0000003f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800593#define ETHTOOL_GET_DUMP_DATA 0x00000040
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700594#define ETHTOOL_GET_TS_INFO 0x00000041
Ben Cheng655a7c02013-10-16 16:09:24 -0700595#define ETHTOOL_GMODULEINFO 0x00000042
596#define ETHTOOL_GMODULEEEPROM 0x00000043
Christopher Ferris05d08e92016-02-04 13:16:38 -0800597#define ETHTOOL_GEEE 0x00000044
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700598#define ETHTOOL_SEEE 0x00000045
599#define ETHTOOL_GRSSH 0x00000046
600#define ETHTOOL_SRSSH 0x00000047
Christopher Ferris05d08e92016-02-04 13:16:38 -0800601#define ETHTOOL_GTUNABLE 0x00000048
Christopher Ferris82d75042015-01-26 10:57:07 -0800602#define ETHTOOL_STUNABLE 0x00000049
Christopher Ferris106b3a82016-08-24 12:15:38 -0700603#define ETHTOOL_GPHYSTATS 0x0000004a
604#define ETHTOOL_PERQUEUE 0x0000004b
Christopher Ferris106b3a82016-08-24 12:15:38 -0700605#define ETHTOOL_GLINKSETTINGS 0x0000004c
606#define ETHTOOL_SLINKSETTINGS 0x0000004d
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800607#define ETHTOOL_PHY_GTUNABLE 0x0000004e
608#define ETHTOOL_PHY_STUNABLE 0x0000004f
Christopher Ferris1308ad32017-11-14 17:32:13 -0800609#define ETHTOOL_GFECPARAM 0x00000050
610#define ETHTOOL_SFECPARAM 0x00000051
Christopher Ferris82d75042015-01-26 10:57:07 -0800611#define SPARC_ETH_GSET ETHTOOL_GSET
Ben Cheng655a7c02013-10-16 16:09:24 -0700612#define SPARC_ETH_SSET ETHTOOL_SSET
Christopher Ferris106b3a82016-08-24 12:15:38 -0700613enum ethtool_link_mode_bit_indices {
614 ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0,
615 ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1,
616 ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700617 ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3,
618 ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4,
619 ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5,
620 ETHTOOL_LINK_MODE_Autoneg_BIT = 6,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700621 ETHTOOL_LINK_MODE_TP_BIT = 7,
622 ETHTOOL_LINK_MODE_AUI_BIT = 8,
623 ETHTOOL_LINK_MODE_MII_BIT = 9,
624 ETHTOOL_LINK_MODE_FIBRE_BIT = 10,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700625 ETHTOOL_LINK_MODE_BNC_BIT = 11,
626 ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12,
627 ETHTOOL_LINK_MODE_Pause_BIT = 13,
628 ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700629 ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15,
630 ETHTOOL_LINK_MODE_Backplane_BIT = 16,
631 ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17,
632 ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700633 ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19,
634 ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20,
635 ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21,
636 ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700637 ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23,
638 ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24,
639 ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25,
640 ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700641 ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27,
642 ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28,
643 ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,
644 ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700645 ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,
646 ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,
647 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33,
648 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700649 ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35,
650 ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36,
651 ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37,
652 ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700653 ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800654 ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800655 ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41,
656 ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800657 ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43,
658 ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44,
659 ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45,
660 ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800661 ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47,
662 ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800663 ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49,
664 ETHTOOL_LINK_MODE_FEC_RS_BIT = 50,
665 ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700666 ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 52,
667 ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 53,
668 ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 54,
669 ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 55,
670 ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 56,
671 ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 57,
672 ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 58,
673 ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 59,
674 ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60,
675 ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 61,
676 ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 62,
677 ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 63,
678 ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64,
679 ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65,
680 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700681 ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 67,
682 ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 68,
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800683 ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 69,
684 ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 70,
685 ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71,
686 ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72,
687 ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700688 ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 74,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700689 ETHTOOL_LINK_MODE_100000baseKR_Full_BIT = 75,
690 ETHTOOL_LINK_MODE_100000baseSR_Full_BIT = 76,
691 ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT = 77,
692 ETHTOOL_LINK_MODE_100000baseCR_Full_BIT = 78,
693 ETHTOOL_LINK_MODE_100000baseDR_Full_BIT = 79,
694 ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT = 80,
695 ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT = 81,
696 ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT = 82,
697 ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT = 83,
698 ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT = 84,
699 ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT = 85,
700 ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT = 86,
701 ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87,
702 ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 88,
703 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800704 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
705 ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700706 __ETHTOOL_LINK_MODE_MASK_NBITS
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800707};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800708#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) (1UL << (ETHTOOL_LINK_MODE_ ##base_name ##_BIT))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700709#define SUPPORTED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
710#define SUPPORTED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
711#define SUPPORTED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800712#define SUPPORTED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700713#define SUPPORTED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
714#define SUPPORTED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
715#define SUPPORTED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800716#define SUPPORTED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700717#define SUPPORTED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
718#define SUPPORTED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
719#define SUPPORTED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800720#define SUPPORTED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700721#define SUPPORTED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
722#define SUPPORTED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
723#define SUPPORTED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800724#define SUPPORTED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700725#define SUPPORTED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
726#define SUPPORTED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
727#define SUPPORTED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800728#define SUPPORTED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700729#define SUPPORTED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
730#define SUPPORTED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
731#define SUPPORTED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800732#define SUPPORTED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700733#define SUPPORTED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
734#define SUPPORTED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
735#define SUPPORTED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800736#define SUPPORTED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700737#define SUPPORTED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
738#define SUPPORTED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
739#define SUPPORTED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800740#define ADVERTISED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700741#define ADVERTISED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
742#define ADVERTISED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
743#define ADVERTISED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800744#define ADVERTISED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700745#define ADVERTISED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
746#define ADVERTISED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
747#define ADVERTISED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800748#define ADVERTISED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700749#define ADVERTISED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
750#define ADVERTISED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
751#define ADVERTISED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800752#define ADVERTISED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700753#define ADVERTISED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
754#define ADVERTISED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
755#define ADVERTISED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800756#define ADVERTISED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700757#define ADVERTISED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
758#define ADVERTISED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
759#define ADVERTISED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800760#define ADVERTISED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700761#define ADVERTISED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
762#define ADVERTISED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
763#define ADVERTISED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800764#define ADVERTISED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700765#define ADVERTISED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
766#define ADVERTISED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
767#define ADVERTISED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800768#define ADVERTISED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700769#define ADVERTISED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
770#define ADVERTISED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Ben Cheng655a7c02013-10-16 16:09:24 -0700771#define SPEED_10 10
Christopher Ferris49f525c2016-12-12 14:55:36 -0800772#define SPEED_100 100
Christopher Ferris05d08e92016-02-04 13:16:38 -0800773#define SPEED_1000 1000
Ben Cheng655a7c02013-10-16 16:09:24 -0700774#define SPEED_2500 2500
Christopher Ferris05d08e92016-02-04 13:16:38 -0800775#define SPEED_5000 5000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800776#define SPEED_10000 10000
Christopher Ferris525ce912017-07-26 13:12:53 -0700777#define SPEED_14000 14000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800778#define SPEED_20000 20000
779#define SPEED_25000 25000
780#define SPEED_40000 40000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800781#define SPEED_50000 50000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800782#define SPEED_56000 56000
783#define SPEED_100000 100000
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700784#define SPEED_200000 200000
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800785#define SPEED_400000 400000
Tao Baod7db5942015-01-28 10:07:51 -0800786#define SPEED_UNKNOWN - 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800787#define DUPLEX_HALF 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -0700788#define DUPLEX_FULL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700789#define DUPLEX_UNKNOWN 0xff
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700790#define MASTER_SLAVE_CFG_UNSUPPORTED 0
791#define MASTER_SLAVE_CFG_UNKNOWN 1
792#define MASTER_SLAVE_CFG_MASTER_PREFERRED 2
793#define MASTER_SLAVE_CFG_SLAVE_PREFERRED 3
794#define MASTER_SLAVE_CFG_MASTER_FORCE 4
795#define MASTER_SLAVE_CFG_SLAVE_FORCE 5
796#define MASTER_SLAVE_STATE_UNSUPPORTED 0
797#define MASTER_SLAVE_STATE_UNKNOWN 1
798#define MASTER_SLAVE_STATE_MASTER 2
799#define MASTER_SLAVE_STATE_SLAVE 3
800#define MASTER_SLAVE_STATE_ERR 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700801#define PORT_TP 0x00
Christopher Ferris49f525c2016-12-12 14:55:36 -0800802#define PORT_AUI 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700803#define PORT_MII 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700804#define PORT_FIBRE 0x03
805#define PORT_BNC 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800806#define PORT_DA 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700807#define PORT_NONE 0xef
Ben Cheng655a7c02013-10-16 16:09:24 -0700808#define PORT_OTHER 0xff
809#define XCVR_INTERNAL 0x00
Christopher Ferris49f525c2016-12-12 14:55:36 -0800810#define XCVR_EXTERNAL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700811#define XCVR_DUMMY1 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700812#define XCVR_DUMMY2 0x03
813#define XCVR_DUMMY3 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800814#define AUTONEG_DISABLE 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -0700815#define AUTONEG_ENABLE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700816#define ETH_TP_MDI_INVALID 0x00
817#define ETH_TP_MDI 0x01
Christopher Ferris49f525c2016-12-12 14:55:36 -0800818#define ETH_TP_MDI_X 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700819#define ETH_TP_MDI_AUTO 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700820#define WAKE_PHY (1 << 0)
821#define WAKE_UCAST (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800822#define WAKE_MCAST (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700823#define WAKE_BCAST (1 << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700824#define WAKE_ARP (1 << 4)
825#define WAKE_MAGIC (1 << 5)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800826#define WAKE_MAGICSECURE (1 << 6)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700827#define WAKE_FILTER (1 << 7)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700828#define WOL_MODE_COUNT 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700829#define TCP_V4_FLOW 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700830#define UDP_V4_FLOW 0x02
831#define SCTP_V4_FLOW 0x03
Christopher Ferris49f525c2016-12-12 14:55:36 -0800832#define AH_ESP_V4_FLOW 0x04
Ben Cheng655a7c02013-10-16 16:09:24 -0700833#define TCP_V6_FLOW 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700834#define UDP_V6_FLOW 0x06
835#define SCTP_V6_FLOW 0x07
Christopher Ferris49f525c2016-12-12 14:55:36 -0800836#define AH_ESP_V6_FLOW 0x08
Ben Cheng655a7c02013-10-16 16:09:24 -0700837#define AH_V4_FLOW 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -0700838#define ESP_V4_FLOW 0x0a
839#define AH_V6_FLOW 0x0b
Christopher Ferris49f525c2016-12-12 14:55:36 -0800840#define ESP_V6_FLOW 0x0c
Christopher Ferris106b3a82016-08-24 12:15:38 -0700841#define IPV4_USER_FLOW 0x0d
842#define IP_USER_FLOW IPV4_USER_FLOW
843#define IPV6_USER_FLOW 0x0e
Christopher Ferris49f525c2016-12-12 14:55:36 -0800844#define IPV4_FLOW 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700845#define IPV6_FLOW 0x11
846#define ETHER_FLOW 0x12
847#define FLOW_EXT 0x80000000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800848#define FLOW_MAC_EXT 0x40000000
Christopher Ferris76a1d452018-06-27 14:12:29 -0700849#define FLOW_RSS 0x20000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700850#define RXH_L2DA (1 << 1)
851#define RXH_VLAN (1 << 2)
852#define RXH_L3_PROTO (1 << 3)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800853#define RXH_IP_SRC (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -0700854#define RXH_IP_DST (1 << 5)
855#define RXH_L4_B_0_1 (1 << 6)
856#define RXH_L4_B_2_3 (1 << 7)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800857#define RXH_DISCARD (1 << 31)
Ben Cheng655a7c02013-10-16 16:09:24 -0700858#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
Christopher Ferris9ce28842018-10-25 12:11:39 -0700859#define RX_CLS_FLOW_WAKE 0xfffffffffffffffeULL
Ben Cheng655a7c02013-10-16 16:09:24 -0700860#define RX_CLS_LOC_SPECIAL 0x80000000
861#define RX_CLS_LOC_ANY 0xffffffff
Christopher Ferris49f525c2016-12-12 14:55:36 -0800862#define RX_CLS_LOC_FIRST 0xfffffffe
Ben Cheng655a7c02013-10-16 16:09:24 -0700863#define RX_CLS_LOC_LAST 0xfffffffd
864#define ETH_MODULE_SFF_8079 0x1
865#define ETH_MODULE_SFF_8079_LEN 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800866#define ETH_MODULE_SFF_8472 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -0700867#define ETH_MODULE_SFF_8472_LEN 512
Christopher Ferris05d08e92016-02-04 13:16:38 -0800868#define ETH_MODULE_SFF_8636 0x3
Christopher Ferris05d08e92016-02-04 13:16:38 -0800869#define ETH_MODULE_SFF_8636_LEN 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800870#define ETH_MODULE_SFF_8436 0x4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800871#define ETH_MODULE_SFF_8436_LEN 256
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700872#define ETH_MODULE_SFF_8636_MAX_LEN 640
873#define ETH_MODULE_SFF_8436_MAX_LEN 640
Ben Cheng655a7c02013-10-16 16:09:24 -0700874enum ethtool_reset_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800875 ETH_RESET_MGMT = 1 << 0,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800876 ETH_RESET_IRQ = 1 << 1,
Tao Baod7db5942015-01-28 10:07:51 -0800877 ETH_RESET_DMA = 1 << 2,
878 ETH_RESET_FILTER = 1 << 3,
Tao Baod7db5942015-01-28 10:07:51 -0800879 ETH_RESET_OFFLOAD = 1 << 4,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800880 ETH_RESET_MAC = 1 << 5,
Tao Baod7db5942015-01-28 10:07:51 -0800881 ETH_RESET_PHY = 1 << 6,
882 ETH_RESET_RAM = 1 << 7,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700883 ETH_RESET_AP = 1 << 8,
Tao Baod7db5942015-01-28 10:07:51 -0800884 ETH_RESET_DEDICATED = 0x0000ffff,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800885 ETH_RESET_ALL = 0xffffffff,
Ben Cheng655a7c02013-10-16 16:09:24 -0700886};
887#define ETH_RESET_SHARED_SHIFT 16
Christopher Ferris106b3a82016-08-24 12:15:38 -0700888struct ethtool_link_settings {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800889 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700890 __u32 speed;
891 __u8 duplex;
892 __u8 port;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800893 __u8 phy_address;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700894 __u8 autoneg;
895 __u8 mdio_support;
896 __u8 eth_tp_mdix;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800897 __u8 eth_tp_mdix_ctrl;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700898 __s8 link_mode_masks_nwords;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800899 __u8 transceiver;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700900 __u8 master_slave_cfg;
901 __u8 master_slave_state;
902 __u8 reserved1[1];
Christopher Ferris1308ad32017-11-14 17:32:13 -0800903 __u32 reserved[7];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700904 __u32 link_mode_masks[0];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800905};
Ben Cheng655a7c02013-10-16 16:09:24 -0700906#endif