blob: be8c41e2dc1589f8e899dee0642418f76628a551 [file] [log] [blame]
David Howells607ca462012-10-13 10:46:48 +01001/*
2 * ethtool.h: Defines for Linux ethtool.
3 *
4 * Copyright (C) 1998 David S. Miller (davem@redhat.com)
5 * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
6 * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
7 * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
8 * christopher.leech@intel.com,
9 * scott.feldman@intel.com)
10 * Portions Copyright (C) Sun Microsystems 2008
11 */
12
13#ifndef _UAPI_LINUX_ETHTOOL_H
14#define _UAPI_LINUX_ETHTOOL_H
15
16#include <linux/types.h>
17#include <linux/if_ether.h>
18
19/* This should work for both 32 and 64 bit userland. */
20struct ethtool_cmd {
21 __u32 cmd;
22 __u32 supported; /* Features this interface supports */
23 __u32 advertising; /* Features this interface advertises */
24 __u16 speed; /* The forced speed (lower bits) in
25 * Mbps. Please use
26 * ethtool_cmd_speed()/_set() to
27 * access it */
28 __u8 duplex; /* Duplex, half or full */
29 __u8 port; /* Which connector port */
30 __u8 phy_address; /* MDIO PHY address (PRTAD for clause 45).
31 * May be read-only or read-write
32 * depending on the driver.
33 */
34 __u8 transceiver; /* Which transceiver to use */
35 __u8 autoneg; /* Enable or disable autonegotiation */
36 __u8 mdio_support; /* MDIO protocols supported. Read-only.
37 * Not set by all drivers.
38 */
39 __u32 maxtxpkt; /* Tx pkts before generating tx int */
40 __u32 maxrxpkt; /* Rx pkts before generating rx int */
41 __u16 speed_hi; /* The forced speed (upper
42 * bits) in Mbps. Please use
43 * ethtool_cmd_speed()/_set() to
44 * access it */
45 __u8 eth_tp_mdix; /* twisted pair MDI-X status */
46 __u8 eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
47 * link should be renegotiated if necessary
48 */
49 __u32 lp_advertising; /* Features the link partner advertises */
50 __u32 reserved[2];
51};
52
53static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
54 __u32 speed)
55{
56
57 ep->speed = (__u16)speed;
58 ep->speed_hi = (__u16)(speed >> 16);
59}
60
61static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
62{
63 return (ep->speed_hi << 16) | ep->speed;
64}
65
66/* Device supports clause 22 register access to PHY or peripherals
67 * using the interface defined in <linux/mii.h>. This should not be
68 * set if there are known to be no such peripherals present or if
69 * the driver only emulates clause 22 registers for compatibility.
70 */
71#define ETH_MDIO_SUPPORTS_C22 1
72
73/* Device supports clause 45 register access to PHY or peripherals
74 * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
75 * This should not be set if there are known to be no such peripherals
76 * present.
77 */
78#define ETH_MDIO_SUPPORTS_C45 2
79
80#define ETHTOOL_FWVERS_LEN 32
81#define ETHTOOL_BUSINFO_LEN 32
82/* these strings are set to whatever the driver author decides... */
83struct ethtool_drvinfo {
84 __u32 cmd;
85 char driver[32]; /* driver short name, "tulip", "eepro100" */
86 char version[32]; /* driver version string */
87 char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
88 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
89 /* For PCI devices, use pci_name(pci_dev). */
90 char reserved1[32];
91 char reserved2[12];
92 /*
93 * Some struct members below are filled in
94 * using ops->get_sset_count(). Obtaining
95 * this info from ethtool_drvinfo is now
96 * deprecated; Use ETHTOOL_GSSET_INFO
97 * instead.
98 */
99 __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
100 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
101 __u32 testinfo_len;
102 __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
103 __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
104};
105
106#define SOPASS_MAX 6
107/* wake-on-lan settings */
108struct ethtool_wolinfo {
109 __u32 cmd;
110 __u32 supported;
111 __u32 wolopts;
112 __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
113};
114
115/* for passing single values */
116struct ethtool_value {
117 __u32 cmd;
118 __u32 data;
119};
120
121/* for passing big chunks of data */
122struct ethtool_regs {
123 __u32 cmd;
124 __u32 version; /* driver-specific, indicates different chips/revs */
125 __u32 len; /* bytes */
126 __u8 data[0];
127};
128
129/* for passing EEPROM chunks */
130struct ethtool_eeprom {
131 __u32 cmd;
132 __u32 magic;
133 __u32 offset; /* in bytes */
134 __u32 len; /* in bytes */
135 __u8 data[0];
136};
137
138/**
139 * struct ethtool_eee - Energy Efficient Ethernet information
140 * @cmd: ETHTOOL_{G,S}EEE
141 * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
142 * for which there is EEE support.
143 * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
144 * advertised as eee capable.
145 * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
146 * combinations advertised by the link partner as eee capable.
147 * @eee_active: Result of the eee auto negotiation.
148 * @eee_enabled: EEE configured mode (enabled/disabled).
149 * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
150 * that eee was negotiated.
151 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
152 * its tx lpi (after reaching 'idle' state). Effective only when eee
153 * was negotiated and tx_lpi_enabled was set.
154 */
155struct ethtool_eee {
156 __u32 cmd;
157 __u32 supported;
158 __u32 advertised;
159 __u32 lp_advertised;
160 __u32 eee_active;
161 __u32 eee_enabled;
162 __u32 tx_lpi_enabled;
163 __u32 tx_lpi_timer;
164 __u32 reserved[2];
165};
166
167/**
168 * struct ethtool_modinfo - plugin module eeprom information
169 * @cmd: %ETHTOOL_GMODULEINFO
170 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
171 * @eeprom_len: Length of the eeprom
172 *
173 * This structure is used to return the information to
174 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
175 * The type code indicates the eeprom data format
176 */
177struct ethtool_modinfo {
178 __u32 cmd;
179 __u32 type;
180 __u32 eeprom_len;
181 __u32 reserved[8];
182};
183
184/**
185 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
186 * @cmd: ETHTOOL_{G,S}COALESCE
187 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
188 * a packet arrives.
189 * @rx_max_coalesced_frames: Maximum number of packets to receive
190 * before an RX interrupt.
191 * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
192 * this value applies while an IRQ is being serviced by the host.
193 * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
194 * except that this value applies while an IRQ is being serviced
195 * by the host.
196 * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
197 * a packet is sent.
198 * @tx_max_coalesced_frames: Maximum number of packets to be sent
199 * before a TX interrupt.
200 * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
201 * this value applies while an IRQ is being serviced by the host.
202 * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
203 * except that this value applies while an IRQ is being serviced
204 * by the host.
205 * @stats_block_coalesce_usecs: How many usecs to delay in-memory
206 * statistics block updates. Some drivers do not have an
207 * in-memory statistic block, and in such cases this value is
208 * ignored. This value must not be zero.
209 * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
210 * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
211 * @pkt_rate_low: Threshold for low packet rate (packets per second).
212 * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
213 * a packet arrives, when the packet rate is below @pkt_rate_low.
214 * @rx_max_coalesced_frames_low: Maximum number of packets to be received
215 * before an RX interrupt, when the packet rate is below @pkt_rate_low.
216 * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
217 * a packet is sent, when the packet rate is below @pkt_rate_low.
218 * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
219 * a TX interrupt, when the packet rate is below @pkt_rate_low.
220 * @pkt_rate_high: Threshold for high packet rate (packets per second).
221 * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
222 * a packet arrives, when the packet rate is above @pkt_rate_high.
223 * @rx_max_coalesced_frames_high: Maximum number of packets to be received
224 * before an RX interrupt, when the packet rate is above @pkt_rate_high.
225 * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
226 * a packet is sent, when the packet rate is above @pkt_rate_high.
227 * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
228 * a TX interrupt, when the packet rate is above @pkt_rate_high.
229 * @rate_sample_interval: How often to do adaptive coalescing packet rate
230 * sampling, measured in seconds. Must not be zero.
231 *
232 * Each pair of (usecs, max_frames) fields specifies this exit
233 * condition for interrupt coalescing:
234 * (usecs > 0 && time_since_first_completion >= usecs) ||
235 * (max_frames > 0 && completed_frames >= max_frames)
236 * It is illegal to set both usecs and max_frames to zero as this
237 * would cause interrupts to never be generated. To disable
238 * coalescing, set usecs = 0 and max_frames = 1.
239 *
240 * Some implementations ignore the value of max_frames and use the
241 * condition:
242 * time_since_first_completion >= usecs
243 * This is deprecated. Drivers for hardware that does not support
244 * counting completions should validate that max_frames == !rx_usecs.
245 *
246 * Adaptive RX/TX coalescing is an algorithm implemented by some
247 * drivers to improve latency under low packet rates and improve
248 * throughput under high packet rates. Some drivers only implement
249 * one of RX or TX adaptive coalescing. Anything not implemented by
250 * the driver causes these values to be silently ignored.
251 *
252 * When the packet rate is below @pkt_rate_high but above
253 * @pkt_rate_low (both measured in packets per second) the
254 * normal {rx,tx}_* coalescing parameters are used.
255 */
256struct ethtool_coalesce {
257 __u32 cmd;
258 __u32 rx_coalesce_usecs;
259 __u32 rx_max_coalesced_frames;
260 __u32 rx_coalesce_usecs_irq;
261 __u32 rx_max_coalesced_frames_irq;
262 __u32 tx_coalesce_usecs;
263 __u32 tx_max_coalesced_frames;
264 __u32 tx_coalesce_usecs_irq;
265 __u32 tx_max_coalesced_frames_irq;
266 __u32 stats_block_coalesce_usecs;
267 __u32 use_adaptive_rx_coalesce;
268 __u32 use_adaptive_tx_coalesce;
269 __u32 pkt_rate_low;
270 __u32 rx_coalesce_usecs_low;
271 __u32 rx_max_coalesced_frames_low;
272 __u32 tx_coalesce_usecs_low;
273 __u32 tx_max_coalesced_frames_low;
274 __u32 pkt_rate_high;
275 __u32 rx_coalesce_usecs_high;
276 __u32 rx_max_coalesced_frames_high;
277 __u32 tx_coalesce_usecs_high;
278 __u32 tx_max_coalesced_frames_high;
279 __u32 rate_sample_interval;
280};
281
282/* for configuring RX/TX ring parameters */
283struct ethtool_ringparam {
284 __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
285
286 /* Read only attributes. These indicate the maximum number
287 * of pending RX/TX ring entries the driver will allow the
288 * user to set.
289 */
290 __u32 rx_max_pending;
291 __u32 rx_mini_max_pending;
292 __u32 rx_jumbo_max_pending;
293 __u32 tx_max_pending;
294
295 /* Values changeable by the user. The valid values are
296 * in the range 1 to the "*_max_pending" counterpart above.
297 */
298 __u32 rx_pending;
299 __u32 rx_mini_pending;
300 __u32 rx_jumbo_pending;
301 __u32 tx_pending;
302};
303
304/**
305 * struct ethtool_channels - configuring number of network channel
306 * @cmd: ETHTOOL_{G,S}CHANNELS
307 * @max_rx: Read only. Maximum number of receive channel the driver support.
308 * @max_tx: Read only. Maximum number of transmit channel the driver support.
309 * @max_other: Read only. Maximum number of other channel the driver support.
310 * @max_combined: Read only. Maximum number of combined channel the driver
311 * support. Set of queues RX, TX or other.
312 * @rx_count: Valid values are in the range 1 to the max_rx.
313 * @tx_count: Valid values are in the range 1 to the max_tx.
314 * @other_count: Valid values are in the range 1 to the max_other.
315 * @combined_count: Valid values are in the range 1 to the max_combined.
316 *
317 * This can be used to configure RX, TX and other channels.
318 */
319
320struct ethtool_channels {
321 __u32 cmd;
322 __u32 max_rx;
323 __u32 max_tx;
324 __u32 max_other;
325 __u32 max_combined;
326 __u32 rx_count;
327 __u32 tx_count;
328 __u32 other_count;
329 __u32 combined_count;
330};
331
332/* for configuring link flow control parameters */
333struct ethtool_pauseparam {
334 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
335
336 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
337 * being true) the user may set 'autoneg' here non-zero to have the
338 * pause parameters be auto-negotiated too. In such a case, the
339 * {rx,tx}_pause values below determine what capabilities are
340 * advertised.
341 *
342 * If 'autoneg' is zero or the link is not being auto-negotiated,
343 * then {rx,tx}_pause force the driver to use/not-use pause
344 * flow control.
345 */
346 __u32 autoneg;
347 __u32 rx_pause;
348 __u32 tx_pause;
349};
350
351#define ETH_GSTRING_LEN 32
352enum ethtool_stringset {
353 ETH_SS_TEST = 0,
354 ETH_SS_STATS,
355 ETH_SS_PRIV_FLAGS,
356 ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
357 ETH_SS_FEATURES,
358};
359
360/* for passing string sets for data tagging */
361struct ethtool_gstrings {
362 __u32 cmd; /* ETHTOOL_GSTRINGS */
363 __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
364 __u32 len; /* number of strings in the string set */
365 __u8 data[0];
366};
367
368struct ethtool_sset_info {
369 __u32 cmd; /* ETHTOOL_GSSET_INFO */
370 __u32 reserved;
371 __u64 sset_mask; /* input: each bit selects an sset to query */
372 /* output: each bit a returned sset */
373 __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits
374 in sset_mask. One bit implies one
375 __u32, two bits implies two
376 __u32's, etc. */
377};
378
379/**
380 * enum ethtool_test_flags - flags definition of ethtool_test
381 * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
382 * only online tests.
383 * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
384 * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
385 * test.
386 * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
387 */
388
389enum ethtool_test_flags {
390 ETH_TEST_FL_OFFLINE = (1 << 0),
391 ETH_TEST_FL_FAILED = (1 << 1),
392 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
393 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
394};
395
396/* for requesting NIC test and getting results*/
397struct ethtool_test {
398 __u32 cmd; /* ETHTOOL_TEST */
399 __u32 flags; /* ETH_TEST_FL_xxx */
400 __u32 reserved;
401 __u32 len; /* result length, in number of u64 elements */
402 __u64 data[0];
403};
404
405/* for dumping NIC-specific statistics */
406struct ethtool_stats {
407 __u32 cmd; /* ETHTOOL_GSTATS */
408 __u32 n_stats; /* number of u64's being returned */
409 __u64 data[0];
410};
411
412struct ethtool_perm_addr {
413 __u32 cmd; /* ETHTOOL_GPERMADDR */
414 __u32 size;
415 __u8 data[0];
416};
417
418/* boolean flags controlling per-interface behavior characteristics.
419 * When reading, the flag indicates whether or not a certain behavior
420 * is enabled/present. When writing, the flag indicates whether
421 * or not the driver should turn on (set) or off (clear) a behavior.
422 *
423 * Some behaviors may read-only (unconditionally absent or present).
424 * If such is the case, return EINVAL in the set-flags operation if the
425 * flag differs from the read-only value.
426 */
427enum ethtool_flags {
428 ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
429 ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
430 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
431 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
432 ETH_FLAG_RXHASH = (1 << 28),
433};
434
435/* The following structures are for supporting RX network flow
436 * classification and RX n-tuple configuration. Note, all multibyte
437 * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
438 * be in network byte order.
439 */
440
441/**
442 * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
443 * @ip4src: Source host
444 * @ip4dst: Destination host
445 * @psrc: Source port
446 * @pdst: Destination port
447 * @tos: Type-of-service
448 *
449 * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
450 */
451struct ethtool_tcpip4_spec {
452 __be32 ip4src;
453 __be32 ip4dst;
454 __be16 psrc;
455 __be16 pdst;
456 __u8 tos;
457};
458
459/**
460 * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
461 * @ip4src: Source host
462 * @ip4dst: Destination host
463 * @spi: Security parameters index
464 * @tos: Type-of-service
465 *
466 * This can be used to specify an IPsec transport or tunnel over IPv4.
467 */
468struct ethtool_ah_espip4_spec {
469 __be32 ip4src;
470 __be32 ip4dst;
471 __be32 spi;
472 __u8 tos;
473};
474
475#define ETH_RX_NFC_IP4 1
476
477/**
478 * struct ethtool_usrip4_spec - general flow specification for IPv4
479 * @ip4src: Source host
480 * @ip4dst: Destination host
481 * @l4_4_bytes: First 4 bytes of transport (layer 4) header
482 * @tos: Type-of-service
483 * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
484 * @proto: Transport protocol number; mask must be 0
485 */
486struct ethtool_usrip4_spec {
487 __be32 ip4src;
488 __be32 ip4dst;
489 __be32 l4_4_bytes;
490 __u8 tos;
491 __u8 ip_ver;
492 __u8 proto;
493};
494
495union ethtool_flow_union {
496 struct ethtool_tcpip4_spec tcp_ip4_spec;
497 struct ethtool_tcpip4_spec udp_ip4_spec;
498 struct ethtool_tcpip4_spec sctp_ip4_spec;
499 struct ethtool_ah_espip4_spec ah_ip4_spec;
500 struct ethtool_ah_espip4_spec esp_ip4_spec;
501 struct ethtool_usrip4_spec usr_ip4_spec;
502 struct ethhdr ether_spec;
Yan Burmand4676ea2012-12-12 02:13:17 +0000503 __u8 hdata[52];
David Howells607ca462012-10-13 10:46:48 +0100504};
505
506struct ethtool_flow_ext {
Yan Burmand4676ea2012-12-12 02:13:17 +0000507 __u8 padding[2];
508 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
509 __be16 vlan_etype;
510 __be16 vlan_tci;
511 __be32 data[2];
David Howells607ca462012-10-13 10:46:48 +0100512};
513
514/**
515 * struct ethtool_rx_flow_spec - classification rule for RX flows
516 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
517 * @h_u: Flow fields to match (dependent on @flow_type)
518 * @h_ext: Additional fields to match
519 * @m_u: Masks for flow field bits to be matched
520 * @m_ext: Masks for additional field bits to be matched
521 * Note, all additional fields must be ignored unless @flow_type
522 * includes the %FLOW_EXT flag.
523 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
524 * if packets should be discarded
525 * @location: Location of rule in the table. Locations must be
526 * numbered such that a flow matching multiple rules will be
527 * classified according to the first (lowest numbered) rule.
528 */
529struct ethtool_rx_flow_spec {
530 __u32 flow_type;
531 union ethtool_flow_union h_u;
532 struct ethtool_flow_ext h_ext;
533 union ethtool_flow_union m_u;
534 struct ethtool_flow_ext m_ext;
535 __u64 ring_cookie;
536 __u32 location;
537};
538
539/**
540 * struct ethtool_rxnfc - command to get or set RX flow classification rules
541 * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
542 * %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
543 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
544 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
545 * @data: Command-dependent value
546 * @fs: Flow classification rule
547 * @rule_cnt: Number of rules to be affected
548 * @rule_locs: Array of used rule locations
549 *
550 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
551 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
552 * structure fields must not be used.
553 *
554 * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
555 * on return.
556 *
557 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
558 * rules on return. If @data is non-zero on return then it is the
559 * size of the rule table, plus the flag %RX_CLS_LOC_SPECIAL if the
560 * driver supports any special location values. If that flag is not
561 * set in @data then special location values should not be used.
562 *
563 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
564 * existing rule on entry and @fs contains the rule on return.
565 *
566 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
567 * user buffer for @rule_locs on entry. On return, @data is the size
568 * of the rule table, @rule_cnt is the number of defined rules, and
569 * @rule_locs contains the locations of the defined rules. Drivers
570 * must use the second parameter to get_rxnfc() instead of @rule_locs.
571 *
572 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
573 * @fs.@location either specifies the location to use or is a special
574 * location value with %RX_CLS_LOC_SPECIAL flag set. On return,
575 * @fs.@location is the actual rule location.
576 *
577 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
578 * existing rule on entry.
579 *
580 * A driver supporting the special location values for
581 * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused
582 * location, and may remove a rule at a later location (lower
583 * priority) that matches exactly the same set of flows. The special
584 * values are: %RX_CLS_LOC_ANY, selecting any location;
585 * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum
586 * priority); and %RX_CLS_LOC_LAST, selecting the last suitable
587 * location (minimum priority). Additional special values may be
588 * defined in future and drivers must return -%EINVAL for any
589 * unrecognised value.
590 */
591struct ethtool_rxnfc {
592 __u32 cmd;
593 __u32 flow_type;
594 __u64 data;
595 struct ethtool_rx_flow_spec fs;
596 __u32 rule_cnt;
597 __u32 rule_locs[0];
598};
599
600
601/**
602 * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
603 * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
604 * @size: On entry, the array size of the user buffer, which may be zero.
605 * On return from %ETHTOOL_GRXFHINDIR, the array size of the hardware
606 * indirection table.
607 * @ring_index: RX ring/queue index for each hash value
608 *
609 * For %ETHTOOL_GRXFHINDIR, a @size of zero means that only the size
610 * should be returned. For %ETHTOOL_SRXFHINDIR, a @size of zero means
611 * the table should be reset to default values. This last feature
612 * is not supported by the original implementations.
613 */
614struct ethtool_rxfh_indir {
615 __u32 cmd;
616 __u32 size;
617 __u32 ring_index[0];
618};
619
620/**
621 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
622 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
623 * @h_u: Flow field values to match (dependent on @flow_type)
624 * @m_u: Masks for flow field value bits to be ignored
625 * @vlan_tag: VLAN tag to match
626 * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
627 * @data: Driver-dependent data to match
628 * @data_mask: Mask for driver-dependent data bits to be ignored
629 * @action: RX ring/queue index to deliver to (non-negative) or other action
630 * (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
631 *
632 * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
633 * a field value and mask are both zero this is treated as if all mask
634 * bits are set i.e. the field is ignored.
635 */
636struct ethtool_rx_ntuple_flow_spec {
637 __u32 flow_type;
638 union {
639 struct ethtool_tcpip4_spec tcp_ip4_spec;
640 struct ethtool_tcpip4_spec udp_ip4_spec;
641 struct ethtool_tcpip4_spec sctp_ip4_spec;
642 struct ethtool_ah_espip4_spec ah_ip4_spec;
643 struct ethtool_ah_espip4_spec esp_ip4_spec;
644 struct ethtool_usrip4_spec usr_ip4_spec;
645 struct ethhdr ether_spec;
646 __u8 hdata[72];
647 } h_u, m_u;
648
649 __u16 vlan_tag;
650 __u16 vlan_tag_mask;
651 __u64 data;
652 __u64 data_mask;
653
654 __s32 action;
655#define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
656#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
657};
658
659/**
660 * struct ethtool_rx_ntuple - command to set or clear RX flow filter
661 * @cmd: Command number - %ETHTOOL_SRXNTUPLE
662 * @fs: Flow filter specification
663 */
664struct ethtool_rx_ntuple {
665 __u32 cmd;
666 struct ethtool_rx_ntuple_flow_spec fs;
667};
668
669#define ETHTOOL_FLASH_MAX_FILENAME 128
670enum ethtool_flash_op_type {
671 ETHTOOL_FLASH_ALL_REGIONS = 0,
672};
673
674/* for passing firmware flashing related parameters */
675struct ethtool_flash {
676 __u32 cmd;
677 __u32 region;
678 char data[ETHTOOL_FLASH_MAX_FILENAME];
679};
680
681/**
682 * struct ethtool_dump - used for retrieving, setting device dump
683 * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
684 * %ETHTOOL_SET_DUMP
685 * @version: FW version of the dump, filled in by driver
686 * @flag: driver dependent flag for dump setting, filled in by driver during
687 * get and filled in by ethtool for set operation.
688 * flag must be initialized by macro ETH_FW_DUMP_DISABLE value when
689 * firmware dump is disabled.
690 * @len: length of dump data, used as the length of the user buffer on entry to
691 * %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver
692 * for %ETHTOOL_GET_DUMP_FLAG command
693 * @data: data collected for get dump data operation
694 */
695
696#define ETH_FW_DUMP_DISABLE 0
697
698struct ethtool_dump {
699 __u32 cmd;
700 __u32 version;
701 __u32 flag;
702 __u32 len;
703 __u8 data[0];
704};
705
706/* for returning and changing feature sets */
707
708/**
709 * struct ethtool_get_features_block - block with state of 32 features
710 * @available: mask of changeable features
711 * @requested: mask of features requested to be enabled if possible
712 * @active: mask of currently enabled features
713 * @never_changed: mask of features not changeable for any device
714 */
715struct ethtool_get_features_block {
716 __u32 available;
717 __u32 requested;
718 __u32 active;
719 __u32 never_changed;
720};
721
722/**
723 * struct ethtool_gfeatures - command to get state of device's features
724 * @cmd: command number = %ETHTOOL_GFEATURES
725 * @size: in: number of elements in the features[] array;
726 * out: number of elements in features[] needed to hold all features
727 * @features: state of features
728 */
729struct ethtool_gfeatures {
730 __u32 cmd;
731 __u32 size;
732 struct ethtool_get_features_block features[0];
733};
734
735/**
736 * struct ethtool_set_features_block - block with request for 32 features
737 * @valid: mask of features to be changed
738 * @requested: values of features to be changed
739 */
740struct ethtool_set_features_block {
741 __u32 valid;
742 __u32 requested;
743};
744
745/**
746 * struct ethtool_sfeatures - command to request change in device's features
747 * @cmd: command number = %ETHTOOL_SFEATURES
748 * @size: array size of the features[] array
749 * @features: feature change masks
750 */
751struct ethtool_sfeatures {
752 __u32 cmd;
753 __u32 size;
754 struct ethtool_set_features_block features[0];
755};
756
757/**
758 * struct ethtool_ts_info - holds a device's timestamping and PHC association
759 * @cmd: command number = %ETHTOOL_GET_TS_INFO
760 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
761 * @phc_index: device index of the associated PHC, or -1 if there is none
762 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
763 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
764 *
765 * The bits in the 'tx_types' and 'rx_filters' fields correspond to
766 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
767 * respectively. For example, if the device supports HWTSTAMP_TX_ON,
768 * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
769 */
770struct ethtool_ts_info {
771 __u32 cmd;
772 __u32 so_timestamping;
773 __s32 phc_index;
774 __u32 tx_types;
775 __u32 tx_reserved[3];
776 __u32 rx_filters;
777 __u32 rx_reserved[3];
778};
779
780/*
781 * %ETHTOOL_SFEATURES changes features present in features[].valid to the
782 * values of corresponding bits in features[].requested. Bits in .requested
783 * not set in .valid or not changeable are ignored.
784 *
785 * Returns %EINVAL when .valid contains undefined or never-changeable bits
786 * or size is not equal to required number of features words (32-bit blocks).
787 * Returns >= 0 if request was completed; bits set in the value mean:
788 * %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
789 * changeable (not present in %ETHTOOL_GFEATURES' features[].available)
790 * those bits were ignored.
791 * %ETHTOOL_F_WISH - some or all changes requested were recorded but the
792 * resulting state of bits masked by .valid is not equal to .requested.
793 * Probably there are other device-specific constraints on some features
794 * in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
795 * here as though ignored bits were cleared.
796 * %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
797 * compatibility functions. Requested offload state cannot be properly
798 * managed by kernel.
799 *
800 * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
801 * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
802 * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
803 * significant bit in features[0] fields. Empty strings mark undefined features.
804 */
805enum ethtool_sfeatures_retval_bits {
806 ETHTOOL_F_UNSUPPORTED__BIT,
807 ETHTOOL_F_WISH__BIT,
808 ETHTOOL_F_COMPAT__BIT,
809};
810
811#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
812#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
813#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
814
815
816/* CMDs currently supported */
817#define ETHTOOL_GSET 0x00000001 /* Get settings. */
818#define ETHTOOL_SSET 0x00000002 /* Set settings. */
819#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
820#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
821#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
822#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
823#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
824#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
825#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
826/* Get link status for host, i.e. whether the interface *and* the
827 * physical port (if there is one) are up (ethtool_value). */
828#define ETHTOOL_GLINK 0x0000000a
829#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
830#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
831#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
832#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
833#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
834#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
835#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
836#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
837#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
838#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
839#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
840#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
841#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
842 * (ethtool_value) */
843#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
844 * (ethtool_value). */
845#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
846#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
847#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
848#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
849#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
850#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
851#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
852#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
853#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
854#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
855#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
856#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
857#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
858#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
859#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
860
861#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
862#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
863#define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */
864#define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */
865#define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */
866#define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */
867#define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */
868#define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
869#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
870#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
871#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
872#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
873#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
874#define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
875#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
876#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
877#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
878
879#define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */
880#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
881#define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
882#define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */
883#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
884#define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */
885#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
886#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
887#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
888#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
889#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
890#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
891
892/* compatibility with older code */
893#define SPARC_ETH_GSET ETHTOOL_GSET
894#define SPARC_ETH_SSET ETHTOOL_SSET
895
896/* Indicates what features are supported by the interface. */
897#define SUPPORTED_10baseT_Half (1 << 0)
898#define SUPPORTED_10baseT_Full (1 << 1)
899#define SUPPORTED_100baseT_Half (1 << 2)
900#define SUPPORTED_100baseT_Full (1 << 3)
901#define SUPPORTED_1000baseT_Half (1 << 4)
902#define SUPPORTED_1000baseT_Full (1 << 5)
903#define SUPPORTED_Autoneg (1 << 6)
904#define SUPPORTED_TP (1 << 7)
905#define SUPPORTED_AUI (1 << 8)
906#define SUPPORTED_MII (1 << 9)
907#define SUPPORTED_FIBRE (1 << 10)
908#define SUPPORTED_BNC (1 << 11)
909#define SUPPORTED_10000baseT_Full (1 << 12)
910#define SUPPORTED_Pause (1 << 13)
911#define SUPPORTED_Asym_Pause (1 << 14)
912#define SUPPORTED_2500baseX_Full (1 << 15)
913#define SUPPORTED_Backplane (1 << 16)
914#define SUPPORTED_1000baseKX_Full (1 << 17)
915#define SUPPORTED_10000baseKX4_Full (1 << 18)
916#define SUPPORTED_10000baseKR_Full (1 << 19)
917#define SUPPORTED_10000baseR_FEC (1 << 20)
918#define SUPPORTED_20000baseMLD2_Full (1 << 21)
919#define SUPPORTED_20000baseKR2_Full (1 << 22)
920#define SUPPORTED_40000baseKR4_Full (1 << 23)
921#define SUPPORTED_40000baseCR4_Full (1 << 24)
922#define SUPPORTED_40000baseSR4_Full (1 << 25)
923#define SUPPORTED_40000baseLR4_Full (1 << 26)
924
925/* Indicates what features are advertised by the interface. */
926#define ADVERTISED_10baseT_Half (1 << 0)
927#define ADVERTISED_10baseT_Full (1 << 1)
928#define ADVERTISED_100baseT_Half (1 << 2)
929#define ADVERTISED_100baseT_Full (1 << 3)
930#define ADVERTISED_1000baseT_Half (1 << 4)
931#define ADVERTISED_1000baseT_Full (1 << 5)
932#define ADVERTISED_Autoneg (1 << 6)
933#define ADVERTISED_TP (1 << 7)
934#define ADVERTISED_AUI (1 << 8)
935#define ADVERTISED_MII (1 << 9)
936#define ADVERTISED_FIBRE (1 << 10)
937#define ADVERTISED_BNC (1 << 11)
938#define ADVERTISED_10000baseT_Full (1 << 12)
939#define ADVERTISED_Pause (1 << 13)
940#define ADVERTISED_Asym_Pause (1 << 14)
941#define ADVERTISED_2500baseX_Full (1 << 15)
942#define ADVERTISED_Backplane (1 << 16)
943#define ADVERTISED_1000baseKX_Full (1 << 17)
944#define ADVERTISED_10000baseKX4_Full (1 << 18)
945#define ADVERTISED_10000baseKR_Full (1 << 19)
946#define ADVERTISED_10000baseR_FEC (1 << 20)
947#define ADVERTISED_20000baseMLD2_Full (1 << 21)
948#define ADVERTISED_20000baseKR2_Full (1 << 22)
949#define ADVERTISED_40000baseKR4_Full (1 << 23)
950#define ADVERTISED_40000baseCR4_Full (1 << 24)
951#define ADVERTISED_40000baseSR4_Full (1 << 25)
952#define ADVERTISED_40000baseLR4_Full (1 << 26)
953
954/* The following are all involved in forcing a particular link
955 * mode for the device for setting things. When getting the
956 * devices settings, these indicate the current mode and whether
957 * it was forced up into this mode or autonegotiated.
958 */
959
960/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
961#define SPEED_10 10
962#define SPEED_100 100
963#define SPEED_1000 1000
964#define SPEED_2500 2500
965#define SPEED_10000 10000
966#define SPEED_UNKNOWN -1
967
968/* Duplex, half or full. */
969#define DUPLEX_HALF 0x00
970#define DUPLEX_FULL 0x01
971#define DUPLEX_UNKNOWN 0xff
972
973/* Which connector port. */
974#define PORT_TP 0x00
975#define PORT_AUI 0x01
976#define PORT_MII 0x02
977#define PORT_FIBRE 0x03
978#define PORT_BNC 0x04
979#define PORT_DA 0x05
980#define PORT_NONE 0xef
981#define PORT_OTHER 0xff
982
983/* Which transceiver to use. */
984#define XCVR_INTERNAL 0x00
985#define XCVR_EXTERNAL 0x01
986#define XCVR_DUMMY1 0x02
987#define XCVR_DUMMY2 0x03
988#define XCVR_DUMMY3 0x04
989
990/* Enable or disable autonegotiation. If this is set to enable,
991 * the forced link modes above are completely ignored.
992 */
993#define AUTONEG_DISABLE 0x00
994#define AUTONEG_ENABLE 0x01
995
996/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
997 * the driver is required to renegotiate link
998 */
999#define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
1000#define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
1001#define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
1002#define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */
1003
1004/* Wake-On-Lan options. */
1005#define WAKE_PHY (1 << 0)
1006#define WAKE_UCAST (1 << 1)
1007#define WAKE_MCAST (1 << 2)
1008#define WAKE_BCAST (1 << 3)
1009#define WAKE_ARP (1 << 4)
1010#define WAKE_MAGIC (1 << 5)
1011#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
1012
1013/* L2-L4 network traffic flow types */
1014#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
1015#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
1016#define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
1017#define AH_ESP_V4_FLOW 0x04 /* hash only */
1018#define TCP_V6_FLOW 0x05 /* hash only */
1019#define UDP_V6_FLOW 0x06 /* hash only */
1020#define SCTP_V6_FLOW 0x07 /* hash only */
1021#define AH_ESP_V6_FLOW 0x08 /* hash only */
1022#define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
1023#define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
1024#define AH_V6_FLOW 0x0b /* hash only */
1025#define ESP_V6_FLOW 0x0c /* hash only */
1026#define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
1027#define IPV4_FLOW 0x10 /* hash only */
1028#define IPV6_FLOW 0x11 /* hash only */
1029#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
1030/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
1031#define FLOW_EXT 0x80000000
Yan Burmand4676ea2012-12-12 02:13:17 +00001032#define FLOW_MAC_EXT 0x40000000
David Howells607ca462012-10-13 10:46:48 +01001033
1034/* L3-L4 network traffic flow hash options */
1035#define RXH_L2DA (1 << 1)
1036#define RXH_VLAN (1 << 2)
1037#define RXH_L3_PROTO (1 << 3)
1038#define RXH_IP_SRC (1 << 4)
1039#define RXH_IP_DST (1 << 5)
1040#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
1041#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
1042#define RXH_DISCARD (1 << 31)
1043
1044#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
1045
1046/* Special RX classification rule insert location values */
1047#define RX_CLS_LOC_SPECIAL 0x80000000 /* flag */
1048#define RX_CLS_LOC_ANY 0xffffffff
1049#define RX_CLS_LOC_FIRST 0xfffffffe
1050#define RX_CLS_LOC_LAST 0xfffffffd
1051
1052/* EEPROM Standards for plug in modules */
1053#define ETH_MODULE_SFF_8079 0x1
1054#define ETH_MODULE_SFF_8079_LEN 256
1055#define ETH_MODULE_SFF_8472 0x2
1056#define ETH_MODULE_SFF_8472_LEN 512
1057
1058/* Reset flags */
1059/* The reset() operation must clear the flags for the components which
1060 * were actually reset. On successful return, the flags indicate the
1061 * components which were not reset, either because they do not exist
1062 * in the hardware or because they cannot be reset independently. The
1063 * driver must never reset any components that were not requested.
1064 */
1065enum ethtool_reset_flags {
1066 /* These flags represent components dedicated to the interface
1067 * the command is addressed to. Shift any flag left by
1068 * ETH_RESET_SHARED_SHIFT to reset a shared component of the
1069 * same type.
1070 */
1071 ETH_RESET_MGMT = 1 << 0, /* Management processor */
1072 ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */
1073 ETH_RESET_DMA = 1 << 2, /* DMA engine */
1074 ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */
1075 ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */
1076 ETH_RESET_MAC = 1 << 5, /* Media access controller */
1077 ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
1078 ETH_RESET_RAM = 1 << 7, /* RAM shared between
1079 * multiple components */
1080
1081 ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to
1082 * this interface */
1083 ETH_RESET_ALL = 0xffffffff, /* All components used by this
1084 * interface, even if shared */
1085};
1086#define ETH_RESET_SHARED_SHIFT 16
1087
1088#endif /* _UAPI_LINUX_ETHTOOL_H */