blob: 04a1d3de3ac92fdd3bbafefdc42acb054e79a8e7 [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,
210};
211enum ethtool_link_ext_substate_autoneg {
212 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1,
213 ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED,
214 ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED,
215 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE,
216 ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE,
217 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD,
218};
219enum ethtool_link_ext_substate_link_training {
220 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1,
221 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT,
222 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY,
223 ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT,
224};
225enum ethtool_link_ext_substate_link_logical_mismatch {
226 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1,
227 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK,
228 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS,
229 ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED,
230 ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED,
231};
232enum ethtool_link_ext_substate_bad_signal_integrity {
233 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1,
234 ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE,
235};
236enum ethtool_link_ext_substate_cable_issue {
237 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1,
238 ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE,
239};
Ben Cheng655a7c02013-10-16 16:09:24 -0700240#define ETH_GSTRING_LEN 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700241enum ethtool_stringset {
Tao Baod7db5942015-01-28 10:07:51 -0800242 ETH_SS_TEST = 0,
243 ETH_SS_STATS,
244 ETH_SS_PRIV_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800245 ETH_SS_NTUPLE_FILTERS,
246 ETH_SS_FEATURES,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800247 ETH_SS_RSS_HASH_FUNCS,
248 ETH_SS_TUNABLES,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700249 ETH_SS_PHY_STATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800250 ETH_SS_PHY_TUNABLES,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700251 ETH_SS_LINK_MODES,
252 ETH_SS_MSG_CLASSES,
253 ETH_SS_WOL_MODES,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700254 ETH_SS_SOF_TIMESTAMPING,
255 ETH_SS_TS_TX_TYPES,
256 ETH_SS_TS_RX_FILTERS,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700257 ETH_SS_UDP_TUNNEL_TYPES,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000258 ETH_SS_STATS_STD,
259 ETH_SS_STATS_ETH_PHY,
260 ETH_SS_STATS_ETH_MAC,
261 ETH_SS_STATS_ETH_CTRL,
262 ETH_SS_STATS_RMON,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700263 ETH_SS_COUNT
Ben Cheng655a7c02013-10-16 16:09:24 -0700264};
265struct ethtool_gstrings {
Tao Baod7db5942015-01-28 10:07:51 -0800266 __u32 cmd;
267 __u32 string_set;
268 __u32 len;
269 __u8 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700270};
271struct ethtool_sset_info {
Tao Baod7db5942015-01-28 10:07:51 -0800272 __u32 cmd;
273 __u32 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800274 __u64 sset_mask;
275 __u32 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700276};
277enum ethtool_test_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800278 ETH_TEST_FL_OFFLINE = (1 << 0),
279 ETH_TEST_FL_FAILED = (1 << 1),
280 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
281 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
Ben Cheng655a7c02013-10-16 16:09:24 -0700282};
283struct ethtool_test {
Tao Baod7db5942015-01-28 10:07:51 -0800284 __u32 cmd;
285 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800286 __u32 reserved;
287 __u32 len;
288 __u64 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700289};
Ben Cheng655a7c02013-10-16 16:09:24 -0700290struct ethtool_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800291 __u32 cmd;
292 __u32 n_stats;
293 __u64 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700294};
295struct ethtool_perm_addr {
Tao Baod7db5942015-01-28 10:07:51 -0800296 __u32 cmd;
297 __u32 size;
Tao Baod7db5942015-01-28 10:07:51 -0800298 __u8 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700299};
300enum ethtool_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800301 ETH_FLAG_TXVLAN = (1 << 7),
Tao Baod7db5942015-01-28 10:07:51 -0800302 ETH_FLAG_RXVLAN = (1 << 8),
303 ETH_FLAG_LRO = (1 << 15),
304 ETH_FLAG_NTUPLE = (1 << 27),
305 ETH_FLAG_RXHASH = (1 << 28),
Ben Cheng655a7c02013-10-16 16:09:24 -0700306};
307struct ethtool_tcpip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800308 __be32 ip4src;
309 __be32 ip4dst;
Tao Baod7db5942015-01-28 10:07:51 -0800310 __be16 psrc;
311 __be16 pdst;
312 __u8 tos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700313};
Ben Cheng655a7c02013-10-16 16:09:24 -0700314struct ethtool_ah_espip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800315 __be32 ip4src;
316 __be32 ip4dst;
317 __be32 spi;
Tao Baod7db5942015-01-28 10:07:51 -0800318 __u8 tos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700319};
320#define ETH_RX_NFC_IP4 1
321struct ethtool_usrip4_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800322 __be32 ip4src;
323 __be32 ip4dst;
324 __be32 l4_4_bytes;
325 __u8 tos;
Tao Baod7db5942015-01-28 10:07:51 -0800326 __u8 ip_ver;
327 __u8 proto;
Ben Cheng655a7c02013-10-16 16:09:24 -0700328};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700329struct ethtool_tcpip6_spec {
330 __be32 ip6src[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700331 __be32 ip6dst[4];
332 __be16 psrc;
333 __be16 pdst;
334 __u8 tclass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700335};
336struct ethtool_ah_espip6_spec {
337 __be32 ip6src[4];
338 __be32 ip6dst[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700339 __be32 spi;
340 __u8 tclass;
341};
342struct ethtool_usrip6_spec {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700343 __be32 ip6src[4];
344 __be32 ip6dst[4];
345 __be32 l4_4_bytes;
346 __u8 tclass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700347 __u8 l4_proto;
348};
349union ethtool_flow_union {
Tao Baod7db5942015-01-28 10:07:51 -0800350 struct ethtool_tcpip4_spec tcp_ip4_spec;
351 struct ethtool_tcpip4_spec udp_ip4_spec;
352 struct ethtool_tcpip4_spec sctp_ip4_spec;
353 struct ethtool_ah_espip4_spec ah_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800354 struct ethtool_ah_espip4_spec esp_ip4_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700355 struct ethtool_usrip4_spec usr_ip4_spec;
356 struct ethtool_tcpip6_spec tcp_ip6_spec;
357 struct ethtool_tcpip6_spec udp_ip6_spec;
358 struct ethtool_tcpip6_spec sctp_ip6_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700359 struct ethtool_ah_espip6_spec ah_ip6_spec;
360 struct ethtool_ah_espip6_spec esp_ip6_spec;
361 struct ethtool_usrip6_spec usr_ip6_spec;
362 struct ethhdr ether_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700363 __u8 hdata[52];
Ben Cheng655a7c02013-10-16 16:09:24 -0700364};
365struct ethtool_flow_ext {
Tao Baod7db5942015-01-28 10:07:51 -0800366 __u8 padding[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700367 unsigned char h_dest[ETH_ALEN];
Tao Baod7db5942015-01-28 10:07:51 -0800368 __be16 vlan_etype;
369 __be16 vlan_tci;
370 __be32 data[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700371};
Ben Cheng655a7c02013-10-16 16:09:24 -0700372struct ethtool_rx_flow_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800373 __u32 flow_type;
374 union ethtool_flow_union h_u;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700375 struct ethtool_flow_ext h_ext;
Tao Baod7db5942015-01-28 10:07:51 -0800376 union ethtool_flow_union m_u;
377 struct ethtool_flow_ext m_ext;
378 __u64 ring_cookie;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700379 __u32 location;
Ben Cheng655a7c02013-10-16 16:09:24 -0700380};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800381#define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL
382#define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL
Christopher Ferris106b3a82016-08-24 12:15:38 -0700383#define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
Christopher Ferris9ce28842018-10-25 12:11:39 -0700384struct ethtool_rxnfc {
385 __u32 cmd;
386 __u32 flow_type;
387 __u64 data;
388 struct ethtool_rx_flow_spec fs;
389 union {
390 __u32 rule_cnt;
391 __u32 rss_context;
392 };
393 __u32 rule_locs[0];
394};
Ben Cheng655a7c02013-10-16 16:09:24 -0700395struct ethtool_rxfh_indir {
Tao Baod7db5942015-01-28 10:07:51 -0800396 __u32 cmd;
397 __u32 size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700398 __u32 ring_index[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700399};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700400struct ethtool_rxfh {
Tao Baod7db5942015-01-28 10:07:51 -0800401 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700402 __u32 rss_context;
Tao Baod7db5942015-01-28 10:07:51 -0800403 __u32 indir_size;
404 __u32 key_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800405 __u8 hfunc;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700406 __u8 rsvd8[3];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800407 __u32 rsvd32;
Tao Baod7db5942015-01-28 10:07:51 -0800408 __u32 rss_config[0];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700409};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700410#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff
Christopher Ferris106b3a82016-08-24 12:15:38 -0700411#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
Christopher Ferris05d08e92016-02-04 13:16:38 -0800412struct ethtool_rx_ntuple_flow_spec {
Tao Baod7db5942015-01-28 10:07:51 -0800413 __u32 flow_type;
414 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700415 struct ethtool_tcpip4_spec tcp_ip4_spec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800416 struct ethtool_tcpip4_spec udp_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800417 struct ethtool_tcpip4_spec sctp_ip4_spec;
418 struct ethtool_ah_espip4_spec ah_ip4_spec;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700419 struct ethtool_ah_espip4_spec esp_ip4_spec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800420 struct ethtool_usrip4_spec usr_ip4_spec;
Tao Baod7db5942015-01-28 10:07:51 -0800421 struct ethhdr ether_spec;
422 __u8 hdata[72];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700423 } h_u, m_u;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800424 __u16 vlan_tag;
Tao Baod7db5942015-01-28 10:07:51 -0800425 __u16 vlan_tag_mask;
426 __u64 data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700427 __u64 data_mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800428 __s32 action;
Tao Baod7db5942015-01-28 10:07:51 -0800429#define ETHTOOL_RXNTUPLE_ACTION_DROP (- 1)
430#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (- 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700431};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800432struct ethtool_rx_ntuple {
Tao Baod7db5942015-01-28 10:07:51 -0800433 __u32 cmd;
434 struct ethtool_rx_ntuple_flow_spec fs;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700435};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800436#define ETHTOOL_FLASH_MAX_FILENAME 128
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700437enum ethtool_flash_op_type {
Tao Baod7db5942015-01-28 10:07:51 -0800438 ETHTOOL_FLASH_ALL_REGIONS = 0,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700439};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800440struct ethtool_flash {
Tao Baod7db5942015-01-28 10:07:51 -0800441 __u32 cmd;
442 __u32 region;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700443 char data[ETHTOOL_FLASH_MAX_FILENAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800444};
Ben Cheng655a7c02013-10-16 16:09:24 -0700445struct ethtool_dump {
Tao Baod7db5942015-01-28 10:07:51 -0800446 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700447 __u32 version;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800448 __u32 flag;
Tao Baod7db5942015-01-28 10:07:51 -0800449 __u32 len;
450 __u8 data[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700451};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800452#define ETH_FW_DUMP_DISABLE 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700453struct ethtool_get_features_block {
Tao Baod7db5942015-01-28 10:07:51 -0800454 __u32 available;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700455 __u32 requested;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800456 __u32 active;
Tao Baod7db5942015-01-28 10:07:51 -0800457 __u32 never_changed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700458};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700459struct ethtool_gfeatures {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800460 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800461 __u32 size;
462 struct ethtool_get_features_block features[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700463};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800464struct ethtool_set_features_block {
Tao Baod7db5942015-01-28 10:07:51 -0800465 __u32 valid;
466 __u32 requested;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700467};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800468struct ethtool_sfeatures {
Tao Baod7db5942015-01-28 10:07:51 -0800469 __u32 cmd;
470 __u32 size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700471 struct ethtool_set_features_block features[0];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800472};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700473struct ethtool_ts_info {
Tao Baod7db5942015-01-28 10:07:51 -0800474 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700475 __u32 so_timestamping;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800476 __s32 phc_index;
Tao Baod7db5942015-01-28 10:07:51 -0800477 __u32 tx_types;
478 __u32 tx_reserved[3];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700479 __u32 rx_filters;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800480 __u32 rx_reserved[3];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700481};
Ben Cheng655a7c02013-10-16 16:09:24 -0700482enum ethtool_sfeatures_retval_bits {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700483 ETHTOOL_F_UNSUPPORTED__BIT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800484 ETHTOOL_F_WISH__BIT,
Tao Baod7db5942015-01-28 10:07:51 -0800485 ETHTOOL_F_COMPAT__BIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700486};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700487#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800488#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700489#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700490#define MAX_NUM_QUEUE 4096
Christopher Ferris106b3a82016-08-24 12:15:38 -0700491struct ethtool_per_queue_op {
492 __u32 cmd;
493 __u32 sub_command;
494 __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700495 char data[];
496};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800497struct ethtool_fecparam {
498 __u32 cmd;
499 __u32 active_fec;
500 __u32 fec;
501 __u32 reserved;
502};
503enum ethtool_fec_config_bits {
504 ETHTOOL_FEC_NONE_BIT,
505 ETHTOOL_FEC_AUTO_BIT,
506 ETHTOOL_FEC_OFF_BIT,
507 ETHTOOL_FEC_RS_BIT,
508 ETHTOOL_FEC_BASER_BIT,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700509 ETHTOOL_FEC_LLRS_BIT,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800510};
511#define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT)
512#define ETHTOOL_FEC_AUTO (1 << ETHTOOL_FEC_AUTO_BIT)
513#define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT)
514#define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT)
515#define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700516#define ETHTOOL_FEC_LLRS (1 << ETHTOOL_FEC_LLRS_BIT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700517#define ETHTOOL_GSET 0x00000001
518#define ETHTOOL_SSET 0x00000002
Christopher Ferris05d08e92016-02-04 13:16:38 -0800519#define ETHTOOL_GDRVINFO 0x00000003
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700520#define ETHTOOL_GREGS 0x00000004
Ben Cheng655a7c02013-10-16 16:09:24 -0700521#define ETHTOOL_GWOL 0x00000005
522#define ETHTOOL_SWOL 0x00000006
Christopher Ferris05d08e92016-02-04 13:16:38 -0800523#define ETHTOOL_GMSGLVL 0x00000007
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700524#define ETHTOOL_SMSGLVL 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -0700525#define ETHTOOL_NWAY_RST 0x00000009
526#define ETHTOOL_GLINK 0x0000000a
Christopher Ferris05d08e92016-02-04 13:16:38 -0800527#define ETHTOOL_GEEPROM 0x0000000b
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700528#define ETHTOOL_SEEPROM 0x0000000c
Ben Cheng655a7c02013-10-16 16:09:24 -0700529#define ETHTOOL_GCOALESCE 0x0000000e
530#define ETHTOOL_SCOALESCE 0x0000000f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800531#define ETHTOOL_GRINGPARAM 0x00000010
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700532#define ETHTOOL_SRINGPARAM 0x00000011
Ben Cheng655a7c02013-10-16 16:09:24 -0700533#define ETHTOOL_GPAUSEPARAM 0x00000012
534#define ETHTOOL_SPAUSEPARAM 0x00000013
Christopher Ferris05d08e92016-02-04 13:16:38 -0800535#define ETHTOOL_GRXCSUM 0x00000014
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700536#define ETHTOOL_SRXCSUM 0x00000015
Ben Cheng655a7c02013-10-16 16:09:24 -0700537#define ETHTOOL_GTXCSUM 0x00000016
538#define ETHTOOL_STXCSUM 0x00000017
Christopher Ferris05d08e92016-02-04 13:16:38 -0800539#define ETHTOOL_GSG 0x00000018
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700540#define ETHTOOL_SSG 0x00000019
Ben Cheng655a7c02013-10-16 16:09:24 -0700541#define ETHTOOL_TEST 0x0000001a
542#define ETHTOOL_GSTRINGS 0x0000001b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800543#define ETHTOOL_PHYS_ID 0x0000001c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700544#define ETHTOOL_GSTATS 0x0000001d
Ben Cheng655a7c02013-10-16 16:09:24 -0700545#define ETHTOOL_GTSO 0x0000001e
546#define ETHTOOL_STSO 0x0000001f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800547#define ETHTOOL_GPERMADDR 0x00000020
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700548#define ETHTOOL_GUFO 0x00000021
Ben Cheng655a7c02013-10-16 16:09:24 -0700549#define ETHTOOL_SUFO 0x00000022
550#define ETHTOOL_GGSO 0x00000023
Christopher Ferris05d08e92016-02-04 13:16:38 -0800551#define ETHTOOL_SGSO 0x00000024
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700552#define ETHTOOL_GFLAGS 0x00000025
Ben Cheng655a7c02013-10-16 16:09:24 -0700553#define ETHTOOL_SFLAGS 0x00000026
554#define ETHTOOL_GPFLAGS 0x00000027
Christopher Ferris05d08e92016-02-04 13:16:38 -0800555#define ETHTOOL_SPFLAGS 0x00000028
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700556#define ETHTOOL_GRXFH 0x00000029
Ben Cheng655a7c02013-10-16 16:09:24 -0700557#define ETHTOOL_SRXFH 0x0000002a
558#define ETHTOOL_GGRO 0x0000002b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800559#define ETHTOOL_SGRO 0x0000002c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700560#define ETHTOOL_GRXRINGS 0x0000002d
Ben Cheng655a7c02013-10-16 16:09:24 -0700561#define ETHTOOL_GRXCLSRLCNT 0x0000002e
562#define ETHTOOL_GRXCLSRULE 0x0000002f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800563#define ETHTOOL_GRXCLSRLALL 0x00000030
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700564#define ETHTOOL_SRXCLSRLDEL 0x00000031
Ben Cheng655a7c02013-10-16 16:09:24 -0700565#define ETHTOOL_SRXCLSRLINS 0x00000032
566#define ETHTOOL_FLASHDEV 0x00000033
Christopher Ferris05d08e92016-02-04 13:16:38 -0800567#define ETHTOOL_RESET 0x00000034
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700568#define ETHTOOL_SRXNTUPLE 0x00000035
Ben Cheng655a7c02013-10-16 16:09:24 -0700569#define ETHTOOL_GRXNTUPLE 0x00000036
570#define ETHTOOL_GSSET_INFO 0x00000037
Christopher Ferris05d08e92016-02-04 13:16:38 -0800571#define ETHTOOL_GRXFHINDIR 0x00000038
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700572#define ETHTOOL_SRXFHINDIR 0x00000039
Ben Cheng655a7c02013-10-16 16:09:24 -0700573#define ETHTOOL_GFEATURES 0x0000003a
574#define ETHTOOL_SFEATURES 0x0000003b
Christopher Ferris05d08e92016-02-04 13:16:38 -0800575#define ETHTOOL_GCHANNELS 0x0000003c
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700576#define ETHTOOL_SCHANNELS 0x0000003d
Ben Cheng655a7c02013-10-16 16:09:24 -0700577#define ETHTOOL_SET_DUMP 0x0000003e
578#define ETHTOOL_GET_DUMP_FLAG 0x0000003f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800579#define ETHTOOL_GET_DUMP_DATA 0x00000040
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700580#define ETHTOOL_GET_TS_INFO 0x00000041
Ben Cheng655a7c02013-10-16 16:09:24 -0700581#define ETHTOOL_GMODULEINFO 0x00000042
582#define ETHTOOL_GMODULEEEPROM 0x00000043
Christopher Ferris05d08e92016-02-04 13:16:38 -0800583#define ETHTOOL_GEEE 0x00000044
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700584#define ETHTOOL_SEEE 0x00000045
585#define ETHTOOL_GRSSH 0x00000046
586#define ETHTOOL_SRSSH 0x00000047
Christopher Ferris05d08e92016-02-04 13:16:38 -0800587#define ETHTOOL_GTUNABLE 0x00000048
Christopher Ferris82d75042015-01-26 10:57:07 -0800588#define ETHTOOL_STUNABLE 0x00000049
Christopher Ferris106b3a82016-08-24 12:15:38 -0700589#define ETHTOOL_GPHYSTATS 0x0000004a
590#define ETHTOOL_PERQUEUE 0x0000004b
Christopher Ferris106b3a82016-08-24 12:15:38 -0700591#define ETHTOOL_GLINKSETTINGS 0x0000004c
592#define ETHTOOL_SLINKSETTINGS 0x0000004d
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800593#define ETHTOOL_PHY_GTUNABLE 0x0000004e
594#define ETHTOOL_PHY_STUNABLE 0x0000004f
Christopher Ferris1308ad32017-11-14 17:32:13 -0800595#define ETHTOOL_GFECPARAM 0x00000050
596#define ETHTOOL_SFECPARAM 0x00000051
Christopher Ferris82d75042015-01-26 10:57:07 -0800597#define SPARC_ETH_GSET ETHTOOL_GSET
Ben Cheng655a7c02013-10-16 16:09:24 -0700598#define SPARC_ETH_SSET ETHTOOL_SSET
Christopher Ferris106b3a82016-08-24 12:15:38 -0700599enum ethtool_link_mode_bit_indices {
600 ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0,
601 ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1,
602 ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700603 ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3,
604 ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4,
605 ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5,
606 ETHTOOL_LINK_MODE_Autoneg_BIT = 6,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700607 ETHTOOL_LINK_MODE_TP_BIT = 7,
608 ETHTOOL_LINK_MODE_AUI_BIT = 8,
609 ETHTOOL_LINK_MODE_MII_BIT = 9,
610 ETHTOOL_LINK_MODE_FIBRE_BIT = 10,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700611 ETHTOOL_LINK_MODE_BNC_BIT = 11,
612 ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12,
613 ETHTOOL_LINK_MODE_Pause_BIT = 13,
614 ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700615 ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15,
616 ETHTOOL_LINK_MODE_Backplane_BIT = 16,
617 ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17,
618 ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700619 ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19,
620 ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20,
621 ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21,
622 ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700623 ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23,
624 ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24,
625 ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25,
626 ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700627 ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27,
628 ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28,
629 ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,
630 ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700631 ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,
632 ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,
633 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33,
634 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700635 ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35,
636 ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36,
637 ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37,
638 ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700639 ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800640 ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800641 ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41,
642 ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800643 ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43,
644 ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44,
645 ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45,
646 ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800647 ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47,
648 ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800649 ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49,
650 ETHTOOL_LINK_MODE_FEC_RS_BIT = 50,
651 ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700652 ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 52,
653 ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 53,
654 ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 54,
655 ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 55,
656 ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 56,
657 ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 57,
658 ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 58,
659 ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 59,
660 ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60,
661 ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 61,
662 ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 62,
663 ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 63,
664 ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64,
665 ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65,
666 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700667 ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 67,
668 ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 68,
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800669 ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 69,
670 ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 70,
671 ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71,
672 ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72,
673 ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700674 ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 74,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700675 ETHTOOL_LINK_MODE_100000baseKR_Full_BIT = 75,
676 ETHTOOL_LINK_MODE_100000baseSR_Full_BIT = 76,
677 ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT = 77,
678 ETHTOOL_LINK_MODE_100000baseCR_Full_BIT = 78,
679 ETHTOOL_LINK_MODE_100000baseDR_Full_BIT = 79,
680 ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT = 80,
681 ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT = 81,
682 ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT = 82,
683 ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT = 83,
684 ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT = 84,
685 ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT = 85,
686 ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT = 86,
687 ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87,
688 ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 88,
689 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800690 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
691 ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700692 __ETHTOOL_LINK_MODE_MASK_NBITS
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800693};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800694#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) (1UL << (ETHTOOL_LINK_MODE_ ##base_name ##_BIT))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700695#define SUPPORTED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
696#define SUPPORTED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
697#define SUPPORTED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800698#define SUPPORTED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700699#define SUPPORTED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
700#define SUPPORTED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
701#define SUPPORTED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800702#define SUPPORTED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700703#define SUPPORTED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
704#define SUPPORTED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
705#define SUPPORTED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800706#define SUPPORTED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700707#define SUPPORTED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
708#define SUPPORTED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
709#define SUPPORTED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800710#define SUPPORTED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700711#define SUPPORTED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
712#define SUPPORTED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
713#define SUPPORTED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800714#define SUPPORTED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700715#define SUPPORTED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
716#define SUPPORTED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
717#define SUPPORTED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800718#define SUPPORTED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700719#define SUPPORTED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
720#define SUPPORTED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
721#define SUPPORTED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800722#define SUPPORTED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700723#define SUPPORTED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
724#define SUPPORTED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
725#define SUPPORTED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800726#define ADVERTISED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700727#define ADVERTISED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
728#define ADVERTISED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
729#define ADVERTISED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800730#define ADVERTISED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700731#define ADVERTISED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
732#define ADVERTISED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
733#define ADVERTISED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800734#define ADVERTISED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700735#define ADVERTISED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
736#define ADVERTISED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
737#define ADVERTISED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800738#define ADVERTISED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700739#define ADVERTISED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
740#define ADVERTISED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
741#define ADVERTISED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800742#define ADVERTISED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700743#define ADVERTISED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
744#define ADVERTISED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
745#define ADVERTISED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800746#define ADVERTISED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700747#define ADVERTISED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
748#define ADVERTISED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
749#define ADVERTISED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800750#define ADVERTISED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700751#define ADVERTISED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
752#define ADVERTISED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
753#define ADVERTISED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800754#define ADVERTISED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700755#define ADVERTISED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
756#define ADVERTISED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Ben Cheng655a7c02013-10-16 16:09:24 -0700757#define SPEED_10 10
Christopher Ferris49f525c2016-12-12 14:55:36 -0800758#define SPEED_100 100
Christopher Ferris05d08e92016-02-04 13:16:38 -0800759#define SPEED_1000 1000
Ben Cheng655a7c02013-10-16 16:09:24 -0700760#define SPEED_2500 2500
Christopher Ferris05d08e92016-02-04 13:16:38 -0800761#define SPEED_5000 5000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800762#define SPEED_10000 10000
Christopher Ferris525ce912017-07-26 13:12:53 -0700763#define SPEED_14000 14000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800764#define SPEED_20000 20000
765#define SPEED_25000 25000
766#define SPEED_40000 40000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800767#define SPEED_50000 50000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800768#define SPEED_56000 56000
769#define SPEED_100000 100000
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700770#define SPEED_200000 200000
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800771#define SPEED_400000 400000
Tao Baod7db5942015-01-28 10:07:51 -0800772#define SPEED_UNKNOWN - 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800773#define DUPLEX_HALF 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -0700774#define DUPLEX_FULL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700775#define DUPLEX_UNKNOWN 0xff
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700776#define MASTER_SLAVE_CFG_UNSUPPORTED 0
777#define MASTER_SLAVE_CFG_UNKNOWN 1
778#define MASTER_SLAVE_CFG_MASTER_PREFERRED 2
779#define MASTER_SLAVE_CFG_SLAVE_PREFERRED 3
780#define MASTER_SLAVE_CFG_MASTER_FORCE 4
781#define MASTER_SLAVE_CFG_SLAVE_FORCE 5
782#define MASTER_SLAVE_STATE_UNSUPPORTED 0
783#define MASTER_SLAVE_STATE_UNKNOWN 1
784#define MASTER_SLAVE_STATE_MASTER 2
785#define MASTER_SLAVE_STATE_SLAVE 3
786#define MASTER_SLAVE_STATE_ERR 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700787#define PORT_TP 0x00
Christopher Ferris49f525c2016-12-12 14:55:36 -0800788#define PORT_AUI 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700789#define PORT_MII 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700790#define PORT_FIBRE 0x03
791#define PORT_BNC 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800792#define PORT_DA 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700793#define PORT_NONE 0xef
Ben Cheng655a7c02013-10-16 16:09:24 -0700794#define PORT_OTHER 0xff
795#define XCVR_INTERNAL 0x00
Christopher Ferris49f525c2016-12-12 14:55:36 -0800796#define XCVR_EXTERNAL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700797#define XCVR_DUMMY1 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700798#define XCVR_DUMMY2 0x03
799#define XCVR_DUMMY3 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800800#define AUTONEG_DISABLE 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -0700801#define AUTONEG_ENABLE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700802#define ETH_TP_MDI_INVALID 0x00
803#define ETH_TP_MDI 0x01
Christopher Ferris49f525c2016-12-12 14:55:36 -0800804#define ETH_TP_MDI_X 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700805#define ETH_TP_MDI_AUTO 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700806#define WAKE_PHY (1 << 0)
807#define WAKE_UCAST (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800808#define WAKE_MCAST (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700809#define WAKE_BCAST (1 << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700810#define WAKE_ARP (1 << 4)
811#define WAKE_MAGIC (1 << 5)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800812#define WAKE_MAGICSECURE (1 << 6)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700813#define WAKE_FILTER (1 << 7)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700814#define WOL_MODE_COUNT 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700815#define TCP_V4_FLOW 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700816#define UDP_V4_FLOW 0x02
817#define SCTP_V4_FLOW 0x03
Christopher Ferris49f525c2016-12-12 14:55:36 -0800818#define AH_ESP_V4_FLOW 0x04
Ben Cheng655a7c02013-10-16 16:09:24 -0700819#define TCP_V6_FLOW 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700820#define UDP_V6_FLOW 0x06
821#define SCTP_V6_FLOW 0x07
Christopher Ferris49f525c2016-12-12 14:55:36 -0800822#define AH_ESP_V6_FLOW 0x08
Ben Cheng655a7c02013-10-16 16:09:24 -0700823#define AH_V4_FLOW 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -0700824#define ESP_V4_FLOW 0x0a
825#define AH_V6_FLOW 0x0b
Christopher Ferris49f525c2016-12-12 14:55:36 -0800826#define ESP_V6_FLOW 0x0c
Christopher Ferris106b3a82016-08-24 12:15:38 -0700827#define IPV4_USER_FLOW 0x0d
828#define IP_USER_FLOW IPV4_USER_FLOW
829#define IPV6_USER_FLOW 0x0e
Christopher Ferris49f525c2016-12-12 14:55:36 -0800830#define IPV4_FLOW 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700831#define IPV6_FLOW 0x11
832#define ETHER_FLOW 0x12
833#define FLOW_EXT 0x80000000
Christopher Ferris49f525c2016-12-12 14:55:36 -0800834#define FLOW_MAC_EXT 0x40000000
Christopher Ferris76a1d452018-06-27 14:12:29 -0700835#define FLOW_RSS 0x20000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700836#define RXH_L2DA (1 << 1)
837#define RXH_VLAN (1 << 2)
838#define RXH_L3_PROTO (1 << 3)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800839#define RXH_IP_SRC (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -0700840#define RXH_IP_DST (1 << 5)
841#define RXH_L4_B_0_1 (1 << 6)
842#define RXH_L4_B_2_3 (1 << 7)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800843#define RXH_DISCARD (1 << 31)
Ben Cheng655a7c02013-10-16 16:09:24 -0700844#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
Christopher Ferris9ce28842018-10-25 12:11:39 -0700845#define RX_CLS_FLOW_WAKE 0xfffffffffffffffeULL
Ben Cheng655a7c02013-10-16 16:09:24 -0700846#define RX_CLS_LOC_SPECIAL 0x80000000
847#define RX_CLS_LOC_ANY 0xffffffff
Christopher Ferris49f525c2016-12-12 14:55:36 -0800848#define RX_CLS_LOC_FIRST 0xfffffffe
Ben Cheng655a7c02013-10-16 16:09:24 -0700849#define RX_CLS_LOC_LAST 0xfffffffd
850#define ETH_MODULE_SFF_8079 0x1
851#define ETH_MODULE_SFF_8079_LEN 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800852#define ETH_MODULE_SFF_8472 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -0700853#define ETH_MODULE_SFF_8472_LEN 512
Christopher Ferris05d08e92016-02-04 13:16:38 -0800854#define ETH_MODULE_SFF_8636 0x3
Christopher Ferris05d08e92016-02-04 13:16:38 -0800855#define ETH_MODULE_SFF_8636_LEN 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800856#define ETH_MODULE_SFF_8436 0x4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800857#define ETH_MODULE_SFF_8436_LEN 256
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700858#define ETH_MODULE_SFF_8636_MAX_LEN 640
859#define ETH_MODULE_SFF_8436_MAX_LEN 640
Ben Cheng655a7c02013-10-16 16:09:24 -0700860enum ethtool_reset_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800861 ETH_RESET_MGMT = 1 << 0,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800862 ETH_RESET_IRQ = 1 << 1,
Tao Baod7db5942015-01-28 10:07:51 -0800863 ETH_RESET_DMA = 1 << 2,
864 ETH_RESET_FILTER = 1 << 3,
Tao Baod7db5942015-01-28 10:07:51 -0800865 ETH_RESET_OFFLOAD = 1 << 4,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800866 ETH_RESET_MAC = 1 << 5,
Tao Baod7db5942015-01-28 10:07:51 -0800867 ETH_RESET_PHY = 1 << 6,
868 ETH_RESET_RAM = 1 << 7,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700869 ETH_RESET_AP = 1 << 8,
Tao Baod7db5942015-01-28 10:07:51 -0800870 ETH_RESET_DEDICATED = 0x0000ffff,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800871 ETH_RESET_ALL = 0xffffffff,
Ben Cheng655a7c02013-10-16 16:09:24 -0700872};
873#define ETH_RESET_SHARED_SHIFT 16
Christopher Ferris106b3a82016-08-24 12:15:38 -0700874struct ethtool_link_settings {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800875 __u32 cmd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700876 __u32 speed;
877 __u8 duplex;
878 __u8 port;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800879 __u8 phy_address;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700880 __u8 autoneg;
881 __u8 mdio_support;
882 __u8 eth_tp_mdix;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800883 __u8 eth_tp_mdix_ctrl;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700884 __s8 link_mode_masks_nwords;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800885 __u8 transceiver;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700886 __u8 master_slave_cfg;
887 __u8 master_slave_state;
888 __u8 reserved1[1];
Christopher Ferris1308ad32017-11-14 17:32:13 -0800889 __u32 reserved[7];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700890 __u32 link_mode_masks[0];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800891};
Ben Cheng655a7c02013-10-16 16:09:24 -0700892#endif