ethtool.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /*
  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. #ifndef _LINUX_ETHTOOL_H
  12. #define _LINUX_ETHTOOL_H
  13. #include <linux/types.h>
  14. /* This should work for both 32 and 64 bit userland. */
  15. struct ethtool_cmd {
  16. __u32 cmd;
  17. __u32 supported; /* Features this interface supports */
  18. __u32 advertising; /* Features this interface advertises */
  19. __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
  20. __u8 duplex; /* Duplex, half or full */
  21. __u8 port; /* Which connector port */
  22. __u8 phy_address;
  23. __u8 transceiver; /* Which transceiver to use */
  24. __u8 autoneg; /* Enable or disable autonegotiation */
  25. __u32 maxtxpkt; /* Tx pkts before generating tx int */
  26. __u32 maxrxpkt; /* Rx pkts before generating rx int */
  27. __u16 speed_hi;
  28. __u16 reserved2;
  29. __u32 reserved[3];
  30. };
  31. static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
  32. __u32 speed)
  33. {
  34. ep->speed = (__u16)speed;
  35. ep->speed_hi = (__u16)(speed >> 16);
  36. }
  37. static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
  38. {
  39. return (ep->speed_hi << 16) | ep->speed;
  40. }
  41. #define ETHTOOL_BUSINFO_LEN 32
  42. /* these strings are set to whatever the driver author decides... */
  43. struct ethtool_drvinfo {
  44. __u32 cmd;
  45. char driver[32]; /* driver short name, "tulip", "eepro100" */
  46. char version[32]; /* driver version string */
  47. char fw_version[32]; /* firmware version string, if applicable */
  48. char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
  49. /* For PCI devices, use pci_name(pci_dev). */
  50. char reserved1[32];
  51. char reserved2[12];
  52. __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
  53. __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
  54. __u32 testinfo_len;
  55. __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
  56. __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
  57. };
  58. #define SOPASS_MAX 6
  59. /* wake-on-lan settings */
  60. struct ethtool_wolinfo {
  61. __u32 cmd;
  62. __u32 supported;
  63. __u32 wolopts;
  64. __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
  65. };
  66. /* for passing single values */
  67. struct ethtool_value {
  68. __u32 cmd;
  69. __u32 data;
  70. };
  71. /* for passing big chunks of data */
  72. struct ethtool_regs {
  73. __u32 cmd;
  74. __u32 version; /* driver-specific, indicates different chips/revs */
  75. __u32 len; /* bytes */
  76. __u8 data[0];
  77. };
  78. /* for passing EEPROM chunks */
  79. struct ethtool_eeprom {
  80. __u32 cmd;
  81. __u32 magic;
  82. __u32 offset; /* in bytes */
  83. __u32 len; /* in bytes */
  84. __u8 data[0];
  85. };
  86. /* for configuring coalescing parameters of chip */
  87. struct ethtool_coalesce {
  88. __u32 cmd; /* ETHTOOL_{G,S}COALESCE */
  89. /* How many usecs to delay an RX interrupt after
  90. * a packet arrives. If 0, only rx_max_coalesced_frames
  91. * is used.
  92. */
  93. __u32 rx_coalesce_usecs;
  94. /* How many packets to delay an RX interrupt after
  95. * a packet arrives. If 0, only rx_coalesce_usecs is
  96. * used. It is illegal to set both usecs and max frames
  97. * to zero as this would cause RX interrupts to never be
  98. * generated.
  99. */
  100. __u32 rx_max_coalesced_frames;
  101. /* Same as above two parameters, except that these values
  102. * apply while an IRQ is being serviced by the host. Not
  103. * all cards support this feature and the values are ignored
  104. * in that case.
  105. */
  106. __u32 rx_coalesce_usecs_irq;
  107. __u32 rx_max_coalesced_frames_irq;
  108. /* How many usecs to delay a TX interrupt after
  109. * a packet is sent. If 0, only tx_max_coalesced_frames
  110. * is used.
  111. */
  112. __u32 tx_coalesce_usecs;
  113. /* How many packets to delay a TX interrupt after
  114. * a packet is sent. If 0, only tx_coalesce_usecs is
  115. * used. It is illegal to set both usecs and max frames
  116. * to zero as this would cause TX interrupts to never be
  117. * generated.
  118. */
  119. __u32 tx_max_coalesced_frames;
  120. /* Same as above two parameters, except that these values
  121. * apply while an IRQ is being serviced by the host. Not
  122. * all cards support this feature and the values are ignored
  123. * in that case.
  124. */
  125. __u32 tx_coalesce_usecs_irq;
  126. __u32 tx_max_coalesced_frames_irq;
  127. /* How many usecs to delay in-memory statistics
  128. * block updates. Some drivers do not have an in-memory
  129. * statistic block, and in such cases this value is ignored.
  130. * This value must not be zero.
  131. */
  132. __u32 stats_block_coalesce_usecs;
  133. /* Adaptive RX/TX coalescing is an algorithm implemented by
  134. * some drivers to improve latency under low packet rates and
  135. * improve throughput under high packet rates. Some drivers
  136. * only implement one of RX or TX adaptive coalescing. Anything
  137. * not implemented by the driver causes these values to be
  138. * silently ignored.
  139. */
  140. __u32 use_adaptive_rx_coalesce;
  141. __u32 use_adaptive_tx_coalesce;
  142. /* When the packet rate (measured in packets per second)
  143. * is below pkt_rate_low, the {rx,tx}_*_low parameters are
  144. * used.
  145. */
  146. __u32 pkt_rate_low;
  147. __u32 rx_coalesce_usecs_low;
  148. __u32 rx_max_coalesced_frames_low;
  149. __u32 tx_coalesce_usecs_low;
  150. __u32 tx_max_coalesced_frames_low;
  151. /* When the packet rate is below pkt_rate_high but above
  152. * pkt_rate_low (both measured in packets per second) the
  153. * normal {rx,tx}_* coalescing parameters are used.
  154. */
  155. /* When the packet rate is (measured in packets per second)
  156. * is above pkt_rate_high, the {rx,tx}_*_high parameters are
  157. * used.
  158. */
  159. __u32 pkt_rate_high;
  160. __u32 rx_coalesce_usecs_high;
  161. __u32 rx_max_coalesced_frames_high;
  162. __u32 tx_coalesce_usecs_high;
  163. __u32 tx_max_coalesced_frames_high;
  164. /* How often to do adaptive coalescing packet rate sampling,
  165. * measured in seconds. Must not be zero.
  166. */
  167. __u32 rate_sample_interval;
  168. };
  169. /* for configuring RX/TX ring parameters */
  170. struct ethtool_ringparam {
  171. __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
  172. /* Read only attributes. These indicate the maximum number
  173. * of pending RX/TX ring entries the driver will allow the
  174. * user to set.
  175. */
  176. __u32 rx_max_pending;
  177. __u32 rx_mini_max_pending;
  178. __u32 rx_jumbo_max_pending;
  179. __u32 tx_max_pending;
  180. /* Values changeable by the user. The valid values are
  181. * in the range 1 to the "*_max_pending" counterpart above.
  182. */
  183. __u32 rx_pending;
  184. __u32 rx_mini_pending;
  185. __u32 rx_jumbo_pending;
  186. __u32 tx_pending;
  187. };
  188. /* for configuring link flow control parameters */
  189. struct ethtool_pauseparam {
  190. __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
  191. /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
  192. * being true) the user may set 'autonet' here non-zero to have the
  193. * pause parameters be auto-negotiated too. In such a case, the
  194. * {rx,tx}_pause values below determine what capabilities are
  195. * advertised.
  196. *
  197. * If 'autoneg' is zero or the link is not being auto-negotiated,
  198. * then {rx,tx}_pause force the driver to use/not-use pause
  199. * flow control.
  200. */
  201. __u32 autoneg;
  202. __u32 rx_pause;
  203. __u32 tx_pause;
  204. };
  205. #define ETH_GSTRING_LEN 32
  206. enum ethtool_stringset {
  207. ETH_SS_TEST = 0,
  208. ETH_SS_STATS,
  209. ETH_SS_PRIV_FLAGS,
  210. };
  211. /* for passing string sets for data tagging */
  212. struct ethtool_gstrings {
  213. __u32 cmd; /* ETHTOOL_GSTRINGS */
  214. __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
  215. __u32 len; /* number of strings in the string set */
  216. __u8 data[0];
  217. };
  218. enum ethtool_test_flags {
  219. ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */
  220. ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */
  221. };
  222. /* for requesting NIC test and getting results*/
  223. struct ethtool_test {
  224. __u32 cmd; /* ETHTOOL_TEST */
  225. __u32 flags; /* ETH_TEST_FL_xxx */
  226. __u32 reserved;
  227. __u32 len; /* result length, in number of u64 elements */
  228. __u64 data[0];
  229. };
  230. /* for dumping NIC-specific statistics */
  231. struct ethtool_stats {
  232. __u32 cmd; /* ETHTOOL_GSTATS */
  233. __u32 n_stats; /* number of u64's being returned */
  234. __u64 data[0];
  235. };
  236. struct ethtool_perm_addr {
  237. __u32 cmd; /* ETHTOOL_GPERMADDR */
  238. __u32 size;
  239. __u8 data[0];
  240. };
  241. /* boolean flags controlling per-interface behavior characteristics.
  242. * When reading, the flag indicates whether or not a certain behavior
  243. * is enabled/present. When writing, the flag indicates whether
  244. * or not the driver should turn on (set) or off (clear) a behavior.
  245. *
  246. * Some behaviors may read-only (unconditionally absent or present).
  247. * If such is the case, return EINVAL in the set-flags operation if the
  248. * flag differs from the read-only value.
  249. */
  250. enum ethtool_flags {
  251. ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
  252. };
  253. struct ethtool_rxnfc {
  254. __u32 cmd;
  255. __u32 flow_type;
  256. __u64 data;
  257. };
  258. #ifdef __KERNEL__
  259. struct net_device;
  260. /* Some generic methods drivers may use in their ethtool_ops */
  261. u32 ethtool_op_get_link(struct net_device *dev);
  262. u32 ethtool_op_get_tx_csum(struct net_device *dev);
  263. int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
  264. int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
  265. int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data);
  266. u32 ethtool_op_get_sg(struct net_device *dev);
  267. int ethtool_op_set_sg(struct net_device *dev, u32 data);
  268. u32 ethtool_op_get_tso(struct net_device *dev);
  269. int ethtool_op_set_tso(struct net_device *dev, u32 data);
  270. u32 ethtool_op_get_ufo(struct net_device *dev);
  271. int ethtool_op_set_ufo(struct net_device *dev, u32 data);
  272. u32 ethtool_op_get_flags(struct net_device *dev);
  273. int ethtool_op_set_flags(struct net_device *dev, u32 data);
  274. /**
  275. * &ethtool_ops - Alter and report network device settings
  276. * get_settings: Get device-specific settings
  277. * set_settings: Set device-specific settings
  278. * get_drvinfo: Report driver information
  279. * get_regs: Get device registers
  280. * get_wol: Report whether Wake-on-Lan is enabled
  281. * set_wol: Turn Wake-on-Lan on or off
  282. * get_msglevel: Report driver message level
  283. * set_msglevel: Set driver message level
  284. * nway_reset: Restart autonegotiation
  285. * get_link: Get link status
  286. * get_eeprom: Read data from the device EEPROM
  287. * set_eeprom: Write data to the device EEPROM
  288. * get_coalesce: Get interrupt coalescing parameters
  289. * set_coalesce: Set interrupt coalescing parameters
  290. * get_ringparam: Report ring sizes
  291. * set_ringparam: Set ring sizes
  292. * get_pauseparam: Report pause parameters
  293. * set_pauseparam: Set pause parameters
  294. * get_rx_csum: Report whether receive checksums are turned on or off
  295. * set_rx_csum: Turn receive checksum on or off
  296. * get_tx_csum: Report whether transmit checksums are turned on or off
  297. * set_tx_csum: Turn transmit checksums on or off
  298. * get_sg: Report whether scatter-gather is enabled
  299. * set_sg: Turn scatter-gather on or off
  300. * get_tso: Report whether TCP segmentation offload is enabled
  301. * set_tso: Turn TCP segmentation offload on or off
  302. * get_ufo: Report whether UDP fragmentation offload is enabled
  303. * set_ufo: Turn UDP fragmentation offload on or off
  304. * self_test: Run specified self-tests
  305. * get_strings: Return a set of strings that describe the requested objects
  306. * phys_id: Identify the device
  307. * get_stats: Return statistics about the device
  308. * get_flags: get 32-bit flags bitmap
  309. * set_flags: set 32-bit flags bitmap
  310. *
  311. * Description:
  312. *
  313. * get_settings:
  314. * @get_settings is passed an &ethtool_cmd to fill in. It returns
  315. * an negative errno or zero.
  316. *
  317. * set_settings:
  318. * @set_settings is passed an &ethtool_cmd and should attempt to set
  319. * all the settings this device supports. It may return an error value
  320. * if something goes wrong (otherwise 0).
  321. *
  322. * get_eeprom:
  323. * Should fill in the magic field. Don't need to check len for zero
  324. * or wraparound. Fill in the data argument with the eeprom values
  325. * from offset to offset + len. Update len to the amount read.
  326. * Returns an error or zero.
  327. *
  328. * set_eeprom:
  329. * Should validate the magic field. Don't need to check len for zero
  330. * or wraparound. Update len to the amount written. Returns an error
  331. * or zero.
  332. */
  333. struct ethtool_ops {
  334. int (*get_settings)(struct net_device *, struct ethtool_cmd *);
  335. int (*set_settings)(struct net_device *, struct ethtool_cmd *);
  336. void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
  337. int (*get_regs_len)(struct net_device *);
  338. void (*get_regs)(struct net_device *, struct ethtool_regs *, void *);
  339. void (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
  340. int (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
  341. u32 (*get_msglevel)(struct net_device *);
  342. void (*set_msglevel)(struct net_device *, u32);
  343. int (*nway_reset)(struct net_device *);
  344. u32 (*get_link)(struct net_device *);
  345. int (*get_eeprom_len)(struct net_device *);
  346. int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
  347. int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
  348. int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
  349. int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
  350. void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
  351. int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
  352. void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
  353. int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
  354. u32 (*get_rx_csum)(struct net_device *);
  355. int (*set_rx_csum)(struct net_device *, u32);
  356. u32 (*get_tx_csum)(struct net_device *);
  357. int (*set_tx_csum)(struct net_device *, u32);
  358. u32 (*get_sg)(struct net_device *);
  359. int (*set_sg)(struct net_device *, u32);
  360. u32 (*get_tso)(struct net_device *);
  361. int (*set_tso)(struct net_device *, u32);
  362. void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
  363. void (*get_strings)(struct net_device *, u32 stringset, u8 *);
  364. int (*phys_id)(struct net_device *, u32);
  365. void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
  366. int (*begin)(struct net_device *);
  367. void (*complete)(struct net_device *);
  368. u32 (*get_ufo)(struct net_device *);
  369. int (*set_ufo)(struct net_device *, u32);
  370. u32 (*get_flags)(struct net_device *);
  371. int (*set_flags)(struct net_device *, u32);
  372. u32 (*get_priv_flags)(struct net_device *);
  373. int (*set_priv_flags)(struct net_device *, u32);
  374. int (*get_sset_count)(struct net_device *, int);
  375. /* the following hooks are obsolete */
  376. int (*self_test_count)(struct net_device *);/* use get_sset_count */
  377. int (*get_stats_count)(struct net_device *);/* use get_sset_count */
  378. int (*get_rxhash)(struct net_device *, struct ethtool_rxnfc *);
  379. int (*set_rxhash)(struct net_device *, struct ethtool_rxnfc *);
  380. };
  381. #endif /* __KERNEL__ */
  382. /* CMDs currently supported */
  383. #define ETHTOOL_GSET 0x00000001 /* Get settings. */
  384. #define ETHTOOL_SSET 0x00000002 /* Set settings. */
  385. #define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
  386. #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
  387. #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
  388. #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
  389. #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
  390. #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
  391. #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
  392. #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
  393. #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
  394. #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
  395. #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
  396. #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
  397. #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
  398. #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
  399. #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
  400. #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
  401. #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
  402. #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
  403. #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
  404. #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
  405. #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
  406. * (ethtool_value) */
  407. #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
  408. * (ethtool_value). */
  409. #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
  410. #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
  411. #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
  412. #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
  413. #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
  414. #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
  415. #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
  416. #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
  417. #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
  418. #define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
  419. #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
  420. #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
  421. #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
  422. #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
  423. #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
  424. #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
  425. #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
  426. /* compatibility with older code */
  427. #define SPARC_ETH_GSET ETHTOOL_GSET
  428. #define SPARC_ETH_SSET ETHTOOL_SSET
  429. /* Indicates what features are supported by the interface. */
  430. #define SUPPORTED_10baseT_Half (1 << 0)
  431. #define SUPPORTED_10baseT_Full (1 << 1)
  432. #define SUPPORTED_100baseT_Half (1 << 2)
  433. #define SUPPORTED_100baseT_Full (1 << 3)
  434. #define SUPPORTED_1000baseT_Half (1 << 4)
  435. #define SUPPORTED_1000baseT_Full (1 << 5)
  436. #define SUPPORTED_Autoneg (1 << 6)
  437. #define SUPPORTED_TP (1 << 7)
  438. #define SUPPORTED_AUI (1 << 8)
  439. #define SUPPORTED_MII (1 << 9)
  440. #define SUPPORTED_FIBRE (1 << 10)
  441. #define SUPPORTED_BNC (1 << 11)
  442. #define SUPPORTED_10000baseT_Full (1 << 12)
  443. #define SUPPORTED_Pause (1 << 13)
  444. #define SUPPORTED_Asym_Pause (1 << 14)
  445. #define SUPPORTED_2500baseX_Full (1 << 15)
  446. /* Indicates what features are advertised by the interface. */
  447. #define ADVERTISED_10baseT_Half (1 << 0)
  448. #define ADVERTISED_10baseT_Full (1 << 1)
  449. #define ADVERTISED_100baseT_Half (1 << 2)
  450. #define ADVERTISED_100baseT_Full (1 << 3)
  451. #define ADVERTISED_1000baseT_Half (1 << 4)
  452. #define ADVERTISED_1000baseT_Full (1 << 5)
  453. #define ADVERTISED_Autoneg (1 << 6)
  454. #define ADVERTISED_TP (1 << 7)
  455. #define ADVERTISED_AUI (1 << 8)
  456. #define ADVERTISED_MII (1 << 9)
  457. #define ADVERTISED_FIBRE (1 << 10)
  458. #define ADVERTISED_BNC (1 << 11)
  459. #define ADVERTISED_10000baseT_Full (1 << 12)
  460. #define ADVERTISED_Pause (1 << 13)
  461. #define ADVERTISED_Asym_Pause (1 << 14)
  462. #define ADVERTISED_2500baseX_Full (1 << 15)
  463. /* The following are all involved in forcing a particular link
  464. * mode for the device for setting things. When getting the
  465. * devices settings, these indicate the current mode and whether
  466. * it was foced up into this mode or autonegotiated.
  467. */
  468. /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
  469. #define SPEED_10 10
  470. #define SPEED_100 100
  471. #define SPEED_1000 1000
  472. #define SPEED_2500 2500
  473. #define SPEED_10000 10000
  474. /* Duplex, half or full. */
  475. #define DUPLEX_HALF 0x00
  476. #define DUPLEX_FULL 0x01
  477. /* Which connector port. */
  478. #define PORT_TP 0x00
  479. #define PORT_AUI 0x01
  480. #define PORT_MII 0x02
  481. #define PORT_FIBRE 0x03
  482. #define PORT_BNC 0x04
  483. /* Which transceiver to use. */
  484. #define XCVR_INTERNAL 0x00
  485. #define XCVR_EXTERNAL 0x01
  486. #define XCVR_DUMMY1 0x02
  487. #define XCVR_DUMMY2 0x03
  488. #define XCVR_DUMMY3 0x04
  489. /* Enable or disable autonegotiation. If this is set to enable,
  490. * the forced link modes above are completely ignored.
  491. */
  492. #define AUTONEG_DISABLE 0x00
  493. #define AUTONEG_ENABLE 0x01
  494. /* Wake-On-Lan options. */
  495. #define WAKE_PHY (1 << 0)
  496. #define WAKE_UCAST (1 << 1)
  497. #define WAKE_MCAST (1 << 2)
  498. #define WAKE_BCAST (1 << 3)
  499. #define WAKE_ARP (1 << 4)
  500. #define WAKE_MAGIC (1 << 5)
  501. #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
  502. /* L3-L4 network traffic flow types */
  503. #define TCP_V4_FLOW 0x01
  504. #define UDP_V4_FLOW 0x02
  505. #define SCTP_V4_FLOW 0x03
  506. #define AH_ESP_V4_FLOW 0x04
  507. #define TCP_V6_FLOW 0x05
  508. #define UDP_V6_FLOW 0x06
  509. #define SCTP_V6_FLOW 0x07
  510. #define AH_ESP_V6_FLOW 0x08
  511. /* L3-L4 network traffic flow hash options */
  512. #define RXH_DEV_PORT (1 << 0)
  513. #define RXH_L2DA (1 << 1)
  514. #define RXH_VLAN (1 << 2)
  515. #define RXH_L3_PROTO (1 << 3)
  516. #define RXH_IP_SRC (1 << 4)
  517. #define RXH_IP_DST (1 << 5)
  518. #define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
  519. #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
  520. #define RXH_DISCARD (1 << 31)
  521. #endif /* _LINUX_ETHTOOL_H */