ethtool.h 40 KB

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