blob: 27c67a5422354dde23433ccd4c50676bd54b4198 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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 */
11
12#ifndef _LINUX_ETHTOOL_H
13#define _LINUX_ETHTOOL_H
14
Kirill A. Shutemove621e692008-03-07 11:11:13 -080015#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17/* This should work for both 32 and 64 bit userland. */
18struct ethtool_cmd {
David Woodhousec3ce7e22006-04-29 01:53:47 +010019 __u32 cmd;
20 __u32 supported; /* Features this interface supports */
21 __u32 advertising; /* Features this interface advertises */
22 __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
23 __u8 duplex; /* Duplex, half or full */
24 __u8 port; /* Which connector port */
25 __u8 phy_address;
26 __u8 transceiver; /* Which transceiver to use */
27 __u8 autoneg; /* Enable or disable autonegotiation */
28 __u32 maxtxpkt; /* Tx pkts before generating tx int */
29 __u32 maxrxpkt; /* Rx pkts before generating rx int */
Brandon Philipsb11f8d82008-07-15 02:18:41 -070030 __u16 speed_hi;
31 __u16 reserved2;
32 __u32 reserved[3];
Linus Torvalds1da177e2005-04-16 15:20:36 -070033};
34
Brandon Philipsb11f8d82008-07-15 02:18:41 -070035static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
36 __u32 speed)
37{
38
39 ep->speed = (__u16)speed;
40 ep->speed_hi = (__u16)(speed >> 16);
41}
42
43static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
44{
45 return (ep->speed_hi << 16) | ep->speed;
46}
47
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#define ETHTOOL_BUSINFO_LEN 32
49/* these strings are set to whatever the driver author decides... */
50struct ethtool_drvinfo {
David Woodhousec3ce7e22006-04-29 01:53:47 +010051 __u32 cmd;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 char driver[32]; /* driver short name, "tulip", "eepro100" */
53 char version[32]; /* driver version string */
54 char fw_version[32]; /* firmware version string, if applicable */
55 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
56 /* For PCI devices, use pci_name(pci_dev). */
57 char reserved1[32];
Jeff Garzik339bf022007-08-15 16:01:32 -070058 char reserved2[12];
59 __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
David Woodhousec3ce7e22006-04-29 01:53:47 +010060 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
61 __u32 testinfo_len;
62 __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
63 __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
Linus Torvalds1da177e2005-04-16 15:20:36 -070064};
65
66#define SOPASS_MAX 6
67/* wake-on-lan settings */
68struct ethtool_wolinfo {
David Woodhousec3ce7e22006-04-29 01:53:47 +010069 __u32 cmd;
70 __u32 supported;
71 __u32 wolopts;
72 __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
Linus Torvalds1da177e2005-04-16 15:20:36 -070073};
74
75/* for passing single values */
76struct ethtool_value {
David Woodhousec3ce7e22006-04-29 01:53:47 +010077 __u32 cmd;
78 __u32 data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070079};
80
81/* for passing big chunks of data */
82struct ethtool_regs {
David Woodhousec3ce7e22006-04-29 01:53:47 +010083 __u32 cmd;
84 __u32 version; /* driver-specific, indicates different chips/revs */
85 __u32 len; /* bytes */
86 __u8 data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -070087};
88
89/* for passing EEPROM chunks */
90struct ethtool_eeprom {
David Woodhousec3ce7e22006-04-29 01:53:47 +010091 __u32 cmd;
92 __u32 magic;
93 __u32 offset; /* in bytes */
94 __u32 len; /* in bytes */
95 __u8 data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -070096};
97
98/* for configuring coalescing parameters of chip */
99struct ethtool_coalesce {
David Woodhousec3ce7e22006-04-29 01:53:47 +0100100 __u32 cmd; /* ETHTOOL_{G,S}COALESCE */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
102 /* How many usecs to delay an RX interrupt after
103 * a packet arrives. If 0, only rx_max_coalesced_frames
104 * is used.
105 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100106 __u32 rx_coalesce_usecs;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107
108 /* How many packets to delay an RX interrupt after
109 * a packet arrives. If 0, only rx_coalesce_usecs is
110 * used. It is illegal to set both usecs and max frames
111 * to zero as this would cause RX interrupts to never be
112 * generated.
113 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100114 __u32 rx_max_coalesced_frames;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115
116 /* Same as above two parameters, except that these values
117 * apply while an IRQ is being serviced by the host. Not
118 * all cards support this feature and the values are ignored
119 * in that case.
120 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100121 __u32 rx_coalesce_usecs_irq;
122 __u32 rx_max_coalesced_frames_irq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123
124 /* How many usecs to delay a TX interrupt after
125 * a packet is sent. If 0, only tx_max_coalesced_frames
126 * is used.
127 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100128 __u32 tx_coalesce_usecs;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129
130 /* How many packets to delay a TX interrupt after
131 * a packet is sent. If 0, only tx_coalesce_usecs is
132 * used. It is illegal to set both usecs and max frames
133 * to zero as this would cause TX interrupts to never be
134 * generated.
135 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100136 __u32 tx_max_coalesced_frames;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137
138 /* Same as above two parameters, except that these values
139 * apply while an IRQ is being serviced by the host. Not
140 * all cards support this feature and the values are ignored
141 * in that case.
142 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100143 __u32 tx_coalesce_usecs_irq;
144 __u32 tx_max_coalesced_frames_irq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145
146 /* How many usecs to delay in-memory statistics
147 * block updates. Some drivers do not have an in-memory
148 * statistic block, and in such cases this value is ignored.
149 * This value must not be zero.
150 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100151 __u32 stats_block_coalesce_usecs;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152
153 /* Adaptive RX/TX coalescing is an algorithm implemented by
154 * some drivers to improve latency under low packet rates and
155 * improve throughput under high packet rates. Some drivers
156 * only implement one of RX or TX adaptive coalescing. Anything
157 * not implemented by the driver causes these values to be
158 * silently ignored.
159 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100160 __u32 use_adaptive_rx_coalesce;
161 __u32 use_adaptive_tx_coalesce;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162
163 /* When the packet rate (measured in packets per second)
164 * is below pkt_rate_low, the {rx,tx}_*_low parameters are
165 * used.
166 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100167 __u32 pkt_rate_low;
168 __u32 rx_coalesce_usecs_low;
169 __u32 rx_max_coalesced_frames_low;
170 __u32 tx_coalesce_usecs_low;
171 __u32 tx_max_coalesced_frames_low;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
173 /* When the packet rate is below pkt_rate_high but above
174 * pkt_rate_low (both measured in packets per second) the
175 * normal {rx,tx}_* coalescing parameters are used.
176 */
177
178 /* When the packet rate is (measured in packets per second)
179 * is above pkt_rate_high, the {rx,tx}_*_high parameters are
180 * used.
181 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100182 __u32 pkt_rate_high;
183 __u32 rx_coalesce_usecs_high;
184 __u32 rx_max_coalesced_frames_high;
185 __u32 tx_coalesce_usecs_high;
186 __u32 tx_max_coalesced_frames_high;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187
188 /* How often to do adaptive coalescing packet rate sampling,
189 * measured in seconds. Must not be zero.
190 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100191 __u32 rate_sample_interval;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192};
193
194/* for configuring RX/TX ring parameters */
195struct ethtool_ringparam {
David Woodhousec3ce7e22006-04-29 01:53:47 +0100196 __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197
198 /* Read only attributes. These indicate the maximum number
199 * of pending RX/TX ring entries the driver will allow the
200 * user to set.
201 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100202 __u32 rx_max_pending;
203 __u32 rx_mini_max_pending;
204 __u32 rx_jumbo_max_pending;
205 __u32 tx_max_pending;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206
207 /* Values changeable by the user. The valid values are
208 * in the range 1 to the "*_max_pending" counterpart above.
209 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100210 __u32 rx_pending;
211 __u32 rx_mini_pending;
212 __u32 rx_jumbo_pending;
213 __u32 tx_pending;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214};
215
216/* for configuring link flow control parameters */
217struct ethtool_pauseparam {
David Woodhousec3ce7e22006-04-29 01:53:47 +0100218 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219
220 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
221 * being true) the user may set 'autonet' here non-zero to have the
222 * pause parameters be auto-negotiated too. In such a case, the
223 * {rx,tx}_pause values below determine what capabilities are
224 * advertised.
225 *
226 * If 'autoneg' is zero or the link is not being auto-negotiated,
227 * then {rx,tx}_pause force the driver to use/not-use pause
228 * flow control.
229 */
David Woodhousec3ce7e22006-04-29 01:53:47 +0100230 __u32 autoneg;
231 __u32 rx_pause;
232 __u32 tx_pause;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233};
234
235#define ETH_GSTRING_LEN 32
236enum ethtool_stringset {
237 ETH_SS_TEST = 0,
238 ETH_SS_STATS,
Jeff Garzik339bf022007-08-15 16:01:32 -0700239 ETH_SS_PRIV_FLAGS,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240};
241
242/* for passing string sets for data tagging */
243struct ethtool_gstrings {
David Woodhousec3ce7e22006-04-29 01:53:47 +0100244 __u32 cmd; /* ETHTOOL_GSTRINGS */
245 __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
246 __u32 len; /* number of strings in the string set */
247 __u8 data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248};
249
250enum ethtool_test_flags {
251 ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */
252 ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */
253};
254
255/* for requesting NIC test and getting results*/
256struct ethtool_test {
David Woodhousec3ce7e22006-04-29 01:53:47 +0100257 __u32 cmd; /* ETHTOOL_TEST */
258 __u32 flags; /* ETH_TEST_FL_xxx */
259 __u32 reserved;
260 __u32 len; /* result length, in number of u64 elements */
261 __u64 data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262};
263
264/* for dumping NIC-specific statistics */
265struct ethtool_stats {
David Woodhousec3ce7e22006-04-29 01:53:47 +0100266 __u32 cmd; /* ETHTOOL_GSTATS */
267 __u32 n_stats; /* number of u64's being returned */
268 __u64 data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269};
270
Jon Wetzela6f9a702005-08-20 17:15:54 -0700271struct ethtool_perm_addr {
David Woodhousec3ce7e22006-04-29 01:53:47 +0100272 __u32 cmd; /* ETHTOOL_GPERMADDR */
273 __u32 size;
274 __u8 data[0];
Jon Wetzela6f9a702005-08-20 17:15:54 -0700275};
276
Jeff Garzik3ae7c0b2007-08-15 16:00:51 -0700277/* boolean flags controlling per-interface behavior characteristics.
278 * When reading, the flag indicates whether or not a certain behavior
279 * is enabled/present. When writing, the flag indicates whether
280 * or not the driver should turn on (set) or off (clear) a behavior.
281 *
282 * Some behaviors may read-only (unconditionally absent or present).
283 * If such is the case, return EINVAL in the set-flags operation if the
284 * flag differs from the read-only value.
285 */
286enum ethtool_flags {
287 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
288};
289
Santwona Behera0853ad62008-07-02 03:47:41 -0700290struct ethtool_rxnfc {
291 __u32 cmd;
292 __u32 flow_type;
293 __u64 data;
294};
295
David Woodhousec3ce7e22006-04-29 01:53:47 +0100296#ifdef __KERNEL__
297
Linus Torvalds1da177e2005-04-16 15:20:36 -0700298struct net_device;
299
300/* Some generic methods drivers may use in their ethtool_ops */
301u32 ethtool_op_get_link(struct net_device *dev);
302u32 ethtool_op_get_tx_csum(struct net_device *dev);
303int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
Jon Mason69f6a0f2005-05-29 20:27:24 -0700304int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
Michael Chan6460d942007-07-14 19:07:52 -0700305int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306u32 ethtool_op_get_sg(struct net_device *dev);
307int ethtool_op_set_sg(struct net_device *dev, u32 data);
308u32 ethtool_op_get_tso(struct net_device *dev);
309int ethtool_op_set_tso(struct net_device *dev, u32 data);
Ananda Rajue89e9cf2005-10-18 15:46:41 -0700310u32 ethtool_op_get_ufo(struct net_device *dev);
311int ethtool_op_set_ufo(struct net_device *dev, u32 data);
Jeff Garzik3ae7c0b2007-08-15 16:00:51 -0700312u32 ethtool_op_get_flags(struct net_device *dev);
313int ethtool_op_set_flags(struct net_device *dev, u32 data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314
315/**
316 * &ethtool_ops - Alter and report network device settings
317 * get_settings: Get device-specific settings
318 * set_settings: Set device-specific settings
319 * get_drvinfo: Report driver information
320 * get_regs: Get device registers
321 * get_wol: Report whether Wake-on-Lan is enabled
322 * set_wol: Turn Wake-on-Lan on or off
323 * get_msglevel: Report driver message level
324 * set_msglevel: Set driver message level
325 * nway_reset: Restart autonegotiation
326 * get_link: Get link status
327 * get_eeprom: Read data from the device EEPROM
328 * set_eeprom: Write data to the device EEPROM
329 * get_coalesce: Get interrupt coalescing parameters
330 * set_coalesce: Set interrupt coalescing parameters
331 * get_ringparam: Report ring sizes
332 * set_ringparam: Set ring sizes
333 * get_pauseparam: Report pause parameters
Joe Perchesfd3f8982008-02-03 17:45:46 +0200334 * set_pauseparam: Set pause parameters
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335 * get_rx_csum: Report whether receive checksums are turned on or off
336 * set_rx_csum: Turn receive checksum on or off
337 * get_tx_csum: Report whether transmit checksums are turned on or off
338 * set_tx_csum: Turn transmit checksums on or off
339 * get_sg: Report whether scatter-gather is enabled
340 * set_sg: Turn scatter-gather on or off
341 * get_tso: Report whether TCP segmentation offload is enabled
342 * set_tso: Turn TCP segmentation offload on or off
Ananda Rajue89e9cf2005-10-18 15:46:41 -0700343 * get_ufo: Report whether UDP fragmentation offload is enabled
344 * set_ufo: Turn UDP fragmentation offload on or off
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345 * self_test: Run specified self-tests
346 * get_strings: Return a set of strings that describe the requested objects
347 * phys_id: Identify the device
348 * get_stats: Return statistics about the device
Jeff Garzik3ae7c0b2007-08-15 16:00:51 -0700349 * get_flags: get 32-bit flags bitmap
350 * set_flags: set 32-bit flags bitmap
Jon Wetzela6f9a702005-08-20 17:15:54 -0700351 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 * Description:
353 *
354 * get_settings:
355 * @get_settings is passed an &ethtool_cmd to fill in. It returns
356 * an negative errno or zero.
357 *
358 * set_settings:
359 * @set_settings is passed an &ethtool_cmd and should attempt to set
360 * all the settings this device supports. It may return an error value
361 * if something goes wrong (otherwise 0).
362 *
363 * get_eeprom:
364 * Should fill in the magic field. Don't need to check len for zero
365 * or wraparound. Fill in the data argument with the eeprom values
366 * from offset to offset + len. Update len to the amount read.
367 * Returns an error or zero.
368 *
369 * set_eeprom:
370 * Should validate the magic field. Don't need to check len for zero
371 * or wraparound. Update len to the amount written. Returns an error
372 * or zero.
373 */
374struct ethtool_ops {
375 int (*get_settings)(struct net_device *, struct ethtool_cmd *);
376 int (*set_settings)(struct net_device *, struct ethtool_cmd *);
377 void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
378 int (*get_regs_len)(struct net_device *);
379 void (*get_regs)(struct net_device *, struct ethtool_regs *, void *);
380 void (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
381 int (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
382 u32 (*get_msglevel)(struct net_device *);
383 void (*set_msglevel)(struct net_device *, u32);
384 int (*nway_reset)(struct net_device *);
385 u32 (*get_link)(struct net_device *);
386 int (*get_eeprom_len)(struct net_device *);
387 int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
388 int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
389 int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
390 int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
391 void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
392 int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
393 void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
394 int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
395 u32 (*get_rx_csum)(struct net_device *);
396 int (*set_rx_csum)(struct net_device *, u32);
397 u32 (*get_tx_csum)(struct net_device *);
398 int (*set_tx_csum)(struct net_device *, u32);
399 u32 (*get_sg)(struct net_device *);
400 int (*set_sg)(struct net_device *, u32);
401 u32 (*get_tso)(struct net_device *);
402 int (*set_tso)(struct net_device *, u32);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
404 void (*get_strings)(struct net_device *, u32 stringset, u8 *);
405 int (*phys_id)(struct net_device *, u32);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
407 int (*begin)(struct net_device *);
408 void (*complete)(struct net_device *);
Ananda Rajue89e9cf2005-10-18 15:46:41 -0700409 u32 (*get_ufo)(struct net_device *);
410 int (*set_ufo)(struct net_device *, u32);
Jeff Garzik3ae7c0b2007-08-15 16:00:51 -0700411 u32 (*get_flags)(struct net_device *);
412 int (*set_flags)(struct net_device *, u32);
Jeff Garzik339bf022007-08-15 16:01:32 -0700413 u32 (*get_priv_flags)(struct net_device *);
414 int (*set_priv_flags)(struct net_device *, u32);
Jeff Garzikff03d492007-08-15 16:01:08 -0700415 int (*get_sset_count)(struct net_device *, int);
416
417 /* the following hooks are obsolete */
418 int (*self_test_count)(struct net_device *);/* use get_sset_count */
419 int (*get_stats_count)(struct net_device *);/* use get_sset_count */
Santwona Behera0853ad62008-07-02 03:47:41 -0700420 int (*get_rxhash)(struct net_device *, struct ethtool_rxnfc *);
421 int (*set_rxhash)(struct net_device *, struct ethtool_rxnfc *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422};
David Woodhousec3ce7e22006-04-29 01:53:47 +0100423#endif /* __KERNEL__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424
425/* CMDs currently supported */
426#define ETHTOOL_GSET 0x00000001 /* Get settings. */
427#define ETHTOOL_SSET 0x00000002 /* Set settings. */
428#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
429#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
430#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
431#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
432#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
433#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
434#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
435#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
436#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
437#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
438#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
439#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
440#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
441#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
442#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
443#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
444#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
445#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
446#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
447#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
448#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
449 * (ethtool_value) */
450#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
451 * (ethtool_value). */
452#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
453#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
454#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
455#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
456#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
457#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
Jon Wetzela6f9a702005-08-20 17:15:54 -0700458#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
Ananda Rajue89e9cf2005-10-18 15:46:41 -0700459#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
460#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
Herbert Xu37c31852006-06-22 03:07:29 -0700461#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
462#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
Jeff Garzik3ae7c0b2007-08-15 16:00:51 -0700463#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
464#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
Jeff Garzik339bf022007-08-15 16:01:32 -0700465#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
466#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467
Santwona Behera0853ad62008-07-02 03:47:41 -0700468#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
469#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
Herbert Xub240a0e2008-12-15 23:44:31 -0800470#define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */
471#define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */
Santwona Behera0853ad62008-07-02 03:47:41 -0700472
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473/* compatibility with older code */
474#define SPARC_ETH_GSET ETHTOOL_GSET
475#define SPARC_ETH_SSET ETHTOOL_SSET
476
477/* Indicates what features are supported by the interface. */
478#define SUPPORTED_10baseT_Half (1 << 0)
479#define SUPPORTED_10baseT_Full (1 << 1)
480#define SUPPORTED_100baseT_Half (1 << 2)
481#define SUPPORTED_100baseT_Full (1 << 3)
482#define SUPPORTED_1000baseT_Half (1 << 4)
483#define SUPPORTED_1000baseT_Full (1 << 5)
484#define SUPPORTED_Autoneg (1 << 6)
485#define SUPPORTED_TP (1 << 7)
486#define SUPPORTED_AUI (1 << 8)
487#define SUPPORTED_MII (1 << 9)
488#define SUPPORTED_FIBRE (1 << 10)
489#define SUPPORTED_BNC (1 << 11)
490#define SUPPORTED_10000baseT_Full (1 << 12)
Andy Fleming00db8182005-07-30 19:31:23 -0400491#define SUPPORTED_Pause (1 << 13)
492#define SUPPORTED_Asym_Pause (1 << 14)
Michael Chan427c2192007-05-03 13:17:25 -0700493#define SUPPORTED_2500baseX_Full (1 << 15)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700494
495/* Indicates what features are advertised by the interface. */
496#define ADVERTISED_10baseT_Half (1 << 0)
497#define ADVERTISED_10baseT_Full (1 << 1)
498#define ADVERTISED_100baseT_Half (1 << 2)
499#define ADVERTISED_100baseT_Full (1 << 3)
500#define ADVERTISED_1000baseT_Half (1 << 4)
501#define ADVERTISED_1000baseT_Full (1 << 5)
502#define ADVERTISED_Autoneg (1 << 6)
503#define ADVERTISED_TP (1 << 7)
504#define ADVERTISED_AUI (1 << 8)
505#define ADVERTISED_MII (1 << 9)
506#define ADVERTISED_FIBRE (1 << 10)
507#define ADVERTISED_BNC (1 << 11)
508#define ADVERTISED_10000baseT_Full (1 << 12)
Andy Fleming00db8182005-07-30 19:31:23 -0400509#define ADVERTISED_Pause (1 << 13)
510#define ADVERTISED_Asym_Pause (1 << 14)
Michael Chan427c2192007-05-03 13:17:25 -0700511#define ADVERTISED_2500baseX_Full (1 << 15)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512
513/* The following are all involved in forcing a particular link
514 * mode for the device for setting things. When getting the
515 * devices settings, these indicate the current mode and whether
516 * it was foced up into this mode or autonegotiated.
517 */
518
Michael Chan5b0c76a2005-11-04 08:45:49 -0800519/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520#define SPEED_10 10
521#define SPEED_100 100
522#define SPEED_1000 1000
Michael Chan5b0c76a2005-11-04 08:45:49 -0800523#define SPEED_2500 2500
Linus Torvalds1da177e2005-04-16 15:20:36 -0700524#define SPEED_10000 10000
525
526/* Duplex, half or full. */
527#define DUPLEX_HALF 0x00
528#define DUPLEX_FULL 0x01
529
530/* Which connector port. */
531#define PORT_TP 0x00
532#define PORT_AUI 0x01
533#define PORT_MII 0x02
534#define PORT_FIBRE 0x03
535#define PORT_BNC 0x04
536
537/* Which transceiver to use. */
538#define XCVR_INTERNAL 0x00
539#define XCVR_EXTERNAL 0x01
540#define XCVR_DUMMY1 0x02
541#define XCVR_DUMMY2 0x03
542#define XCVR_DUMMY3 0x04
543
544/* Enable or disable autonegotiation. If this is set to enable,
545 * the forced link modes above are completely ignored.
546 */
547#define AUTONEG_DISABLE 0x00
548#define AUTONEG_ENABLE 0x01
549
550/* Wake-On-Lan options. */
551#define WAKE_PHY (1 << 0)
552#define WAKE_UCAST (1 << 1)
553#define WAKE_MCAST (1 << 2)
554#define WAKE_BCAST (1 << 3)
555#define WAKE_ARP (1 << 4)
556#define WAKE_MAGIC (1 << 5)
557#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
558
Santwona Behera0853ad62008-07-02 03:47:41 -0700559/* L3-L4 network traffic flow types */
560#define TCP_V4_FLOW 0x01
561#define UDP_V4_FLOW 0x02
562#define SCTP_V4_FLOW 0x03
563#define AH_ESP_V4_FLOW 0x04
564#define TCP_V6_FLOW 0x05
565#define UDP_V6_FLOW 0x06
566#define SCTP_V6_FLOW 0x07
567#define AH_ESP_V6_FLOW 0x08
568
569/* L3-L4 network traffic flow hash options */
570#define RXH_DEV_PORT (1 << 0)
571#define RXH_L2DA (1 << 1)
572#define RXH_VLAN (1 << 2)
573#define RXH_L3_PROTO (1 << 3)
574#define RXH_IP_SRC (1 << 4)
575#define RXH_IP_DST (1 << 5)
576#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
577#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
578#define RXH_DISCARD (1 << 31)
579
580
Linus Torvalds1da177e2005-04-16 15:20:36 -0700581#endif /* _LINUX_ETHTOOL_H */