ethtool.h 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441
  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. /* All structures exposed to userland should be defined such that they
  17. * have the same layout for 32-bit and 64-bit userland.
  18. */
  19. /**
  20. * struct ethtool_cmd - link control and status
  21. * @cmd: Command number = %ETHTOOL_GSET or %ETHTOOL_SSET
  22. * @supported: Bitmask of %SUPPORTED_* flags for the link modes,
  23. * physical connectors and other link features for which the
  24. * interface supports autonegotiation or auto-detection.
  25. * Read-only.
  26. * @advertising: Bitmask of %ADVERTISED_* flags for the link modes,
  27. * physical connectors and other link features that are
  28. * advertised through autonegotiation or enabled for
  29. * auto-detection.
  30. * @speed: Low bits of the speed
  31. * @duplex: Duplex mode; one of %DUPLEX_*
  32. * @port: Physical connector type; one of %PORT_*
  33. * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
  34. * applicable. For clause 45 PHYs this is the PRTAD.
  35. * @transceiver: Historically used to distinguish different possible
  36. * PHY types, but not in a consistent way. Deprecated.
  37. * @autoneg: Enable/disable autonegotiation and auto-detection;
  38. * either %AUTONEG_DISABLE or %AUTONEG_ENABLE
  39. * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
  40. * protocols supported by the interface; 0 if unknown.
  41. * Read-only.
  42. * @maxtxpkt: Historically used to report TX IRQ coalescing; now
  43. * obsoleted by &struct ethtool_coalesce. Read-only; deprecated.
  44. * @maxrxpkt: Historically used to report RX IRQ coalescing; now
  45. * obsoleted by &struct ethtool_coalesce. Read-only; deprecated.
  46. * @speed_hi: High bits of the speed
  47. * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
  48. * %ETH_TP_MDI_*. If the status is unknown or not applicable, the
  49. * value will be %ETH_TP_MDI_INVALID. Read-only.
  50. * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
  51. * %ETH_TP_MDI_*. If MDI(-X) control is not implemented, reads
  52. * yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected.
  53. * When written successfully, the link should be renegotiated if
  54. * necessary.
  55. * @lp_advertising: Bitmask of %ADVERTISED_* flags for the link modes
  56. * and other link features that the link partner advertised
  57. * through autonegotiation; 0 if unknown or not applicable.
  58. * Read-only.
  59. *
  60. * The link speed in Mbps is split between @speed and @speed_hi. Use
  61. * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to
  62. * access it.
  63. *
  64. * If autonegotiation is disabled, the speed and @duplex represent the
  65. * fixed link mode and are writable if the driver supports multiple
  66. * link modes. If it is enabled then they are read-only; if the link
  67. * is up they represent the negotiated link mode; if the link is down,
  68. * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and
  69. * @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode.
  70. *
  71. * Some hardware interfaces may have multiple PHYs and/or physical
  72. * connectors fitted or do not allow the driver to detect which are
  73. * fitted. For these interfaces @port and/or @phy_address may be
  74. * writable, possibly dependent on @autoneg being %AUTONEG_DISABLE.
  75. * Otherwise, attempts to write different values may be ignored or
  76. * rejected.
  77. *
  78. * Users should assume that all fields not marked read-only are
  79. * writable and subject to validation by the driver. They should use
  80. * %ETHTOOL_GSET to get the current values before making specific
  81. * changes and then applying them with %ETHTOOL_SSET.
  82. *
  83. * Drivers that implement set_settings() should validate all fields
  84. * other than @cmd that are not described as read-only or deprecated,
  85. * and must ignore all fields described as read-only.
  86. *
  87. * Deprecated fields should be ignored by both users and drivers.
  88. */
  89. struct ethtool_cmd {
  90. __u32 cmd;
  91. __u32 supported;
  92. __u32 advertising;
  93. __u16 speed;
  94. __u8 duplex;
  95. __u8 port;
  96. __u8 phy_address;
  97. __u8 transceiver;
  98. __u8 autoneg;
  99. __u8 mdio_support;
  100. __u32 maxtxpkt;
  101. __u32 maxrxpkt;
  102. __u16 speed_hi;
  103. __u8 eth_tp_mdix;
  104. __u8 eth_tp_mdix_ctrl;
  105. __u32 lp_advertising;
  106. __u32 reserved[2];
  107. };
  108. static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
  109. __u32 speed)
  110. {
  111. ep->speed = (__u16)speed;
  112. ep->speed_hi = (__u16)(speed >> 16);
  113. }
  114. static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
  115. {
  116. return (ep->speed_hi << 16) | ep->speed;
  117. }
  118. /* Device supports clause 22 register access to PHY or peripherals
  119. * using the interface defined in <linux/mii.h>. This should not be
  120. * set if there are known to be no such peripherals present or if
  121. * the driver only emulates clause 22 registers for compatibility.
  122. */
  123. #define ETH_MDIO_SUPPORTS_C22 1
  124. /* Device supports clause 45 register access to PHY or peripherals
  125. * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
  126. * This should not be set if there are known to be no such peripherals
  127. * present.
  128. */
  129. #define ETH_MDIO_SUPPORTS_C45 2
  130. #define ETHTOOL_FWVERS_LEN 32
  131. #define ETHTOOL_BUSINFO_LEN 32
  132. #define ETHTOOL_EROMVERS_LEN 32
  133. /**
  134. * struct ethtool_drvinfo - general driver and device information
  135. * @cmd: Command number = %ETHTOOL_GDRVINFO
  136. * @driver: Driver short name. This should normally match the name
  137. * in its bus driver structure (e.g. pci_driver::name). Must
  138. * not be an empty string.
  139. * @version: Driver version string; may be an empty string
  140. * @fw_version: Firmware version string; may be an empty string
  141. * @erom_version: Expansion ROM version string; may be an empty string
  142. * @bus_info: Device bus address. This should match the dev_name()
  143. * string for the underlying bus device, if there is one. May be
  144. * an empty string.
  145. * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and
  146. * %ETHTOOL_SPFLAGS commands; also the number of strings in the
  147. * %ETH_SS_PRIV_FLAGS set
  148. * @n_stats: Number of u64 statistics returned by the %ETHTOOL_GSTATS
  149. * command; also the number of strings in the %ETH_SS_STATS set
  150. * @testinfo_len: Number of results returned by the %ETHTOOL_TEST
  151. * command; also the number of strings in the %ETH_SS_TEST set
  152. * @eedump_len: Size of EEPROM accessible through the %ETHTOOL_GEEPROM
  153. * and %ETHTOOL_SEEPROM commands, in bytes
  154. * @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS
  155. * command, in bytes
  156. *
  157. * Users can use the %ETHTOOL_GSSET_INFO command to get the number of
  158. * strings in any string set (from Linux 2.6.34).
  159. *
  160. * Drivers should set at most @driver, @version, @fw_version and
  161. * @bus_info in their get_drvinfo() implementation. The ethtool
  162. * core fills in the other fields using other driver operations.
  163. */
  164. struct ethtool_drvinfo {
  165. __u32 cmd;
  166. char driver[32];
  167. char version[32];
  168. char fw_version[ETHTOOL_FWVERS_LEN];
  169. char bus_info[ETHTOOL_BUSINFO_LEN];
  170. char erom_version[ETHTOOL_EROMVERS_LEN];
  171. char reserved2[12];
  172. __u32 n_priv_flags;
  173. __u32 n_stats;
  174. __u32 testinfo_len;
  175. __u32 eedump_len;
  176. __u32 regdump_len;
  177. };
  178. #define SOPASS_MAX 6
  179. /**
  180. * struct ethtool_wolinfo - Wake-On-Lan configuration
  181. * @cmd: Command number = %ETHTOOL_GWOL or %ETHTOOL_SWOL
  182. * @supported: Bitmask of %WAKE_* flags for supported Wake-On-Lan modes.
  183. * Read-only.
  184. * @wolopts: Bitmask of %WAKE_* flags for enabled Wake-On-Lan modes.
  185. * @sopass: SecureOn(tm) password; meaningful only if %WAKE_MAGICSECURE
  186. * is set in @wolopts.
  187. */
  188. struct ethtool_wolinfo {
  189. __u32 cmd;
  190. __u32 supported;
  191. __u32 wolopts;
  192. __u8 sopass[SOPASS_MAX];
  193. };
  194. /* for passing single values */
  195. struct ethtool_value {
  196. __u32 cmd;
  197. __u32 data;
  198. };
  199. enum tunable_id {
  200. ETHTOOL_ID_UNSPEC,
  201. ETHTOOL_RX_COPYBREAK,
  202. ETHTOOL_TX_COPYBREAK,
  203. /*
  204. * Add your fresh new tubale attribute above and remember to update
  205. * tunable_strings[] in net/core/ethtool.c
  206. */
  207. __ETHTOOL_TUNABLE_COUNT,
  208. };
  209. enum tunable_type_id {
  210. ETHTOOL_TUNABLE_UNSPEC,
  211. ETHTOOL_TUNABLE_U8,
  212. ETHTOOL_TUNABLE_U16,
  213. ETHTOOL_TUNABLE_U32,
  214. ETHTOOL_TUNABLE_U64,
  215. ETHTOOL_TUNABLE_STRING,
  216. ETHTOOL_TUNABLE_S8,
  217. ETHTOOL_TUNABLE_S16,
  218. ETHTOOL_TUNABLE_S32,
  219. ETHTOOL_TUNABLE_S64,
  220. };
  221. struct ethtool_tunable {
  222. __u32 cmd;
  223. __u32 id;
  224. __u32 type_id;
  225. __u32 len;
  226. void *data[0];
  227. };
  228. /**
  229. * struct ethtool_regs - hardware register dump
  230. * @cmd: Command number = %ETHTOOL_GREGS
  231. * @version: Dump format version. This is driver-specific and may
  232. * distinguish different chips/revisions. Drivers must use new
  233. * version numbers whenever the dump format changes in an
  234. * incompatible way.
  235. * @len: On entry, the real length of @data. On return, the number of
  236. * bytes used.
  237. * @data: Buffer for the register dump
  238. *
  239. * Users should use %ETHTOOL_GDRVINFO to find the maximum length of
  240. * a register dump for the interface. They must allocate the buffer
  241. * immediately following this structure.
  242. */
  243. struct ethtool_regs {
  244. __u32 cmd;
  245. __u32 version;
  246. __u32 len;
  247. __u8 data[0];
  248. };
  249. /**
  250. * struct ethtool_eeprom - EEPROM dump
  251. * @cmd: Command number = %ETHTOOL_GEEPROM, %ETHTOOL_GMODULEEEPROM or
  252. * %ETHTOOL_SEEPROM
  253. * @magic: A 'magic cookie' value to guard against accidental changes.
  254. * The value passed in to %ETHTOOL_SEEPROM must match the value
  255. * returned by %ETHTOOL_GEEPROM for the same device. This is
  256. * unused when @cmd is %ETHTOOL_GMODULEEEPROM.
  257. * @offset: Offset within the EEPROM to begin reading/writing, in bytes
  258. * @len: On entry, number of bytes to read/write. On successful
  259. * return, number of bytes actually read/written. In case of
  260. * error, this may indicate at what point the error occurred.
  261. * @data: Buffer to read/write from
  262. *
  263. * Users may use %ETHTOOL_GDRVINFO or %ETHTOOL_GMODULEINFO to find
  264. * the length of an on-board or module EEPROM, respectively. They
  265. * must allocate the buffer immediately following this structure.
  266. */
  267. struct ethtool_eeprom {
  268. __u32 cmd;
  269. __u32 magic;
  270. __u32 offset;
  271. __u32 len;
  272. __u8 data[0];
  273. };
  274. /**
  275. * struct ethtool_eee - Energy Efficient Ethernet information
  276. * @cmd: ETHTOOL_{G,S}EEE
  277. * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
  278. * for which there is EEE support.
  279. * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
  280. * advertised as eee capable.
  281. * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
  282. * combinations advertised by the link partner as eee capable.
  283. * @eee_active: Result of the eee auto negotiation.
  284. * @eee_enabled: EEE configured mode (enabled/disabled).
  285. * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
  286. * that eee was negotiated.
  287. * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
  288. * its tx lpi (after reaching 'idle' state). Effective only when eee
  289. * was negotiated and tx_lpi_enabled was set.
  290. */
  291. struct ethtool_eee {
  292. __u32 cmd;
  293. __u32 supported;
  294. __u32 advertised;
  295. __u32 lp_advertised;
  296. __u32 eee_active;
  297. __u32 eee_enabled;
  298. __u32 tx_lpi_enabled;
  299. __u32 tx_lpi_timer;
  300. __u32 reserved[2];
  301. };
  302. /**
  303. * struct ethtool_modinfo - plugin module eeprom information
  304. * @cmd: %ETHTOOL_GMODULEINFO
  305. * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
  306. * @eeprom_len: Length of the eeprom
  307. *
  308. * This structure is used to return the information to
  309. * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
  310. * The type code indicates the eeprom data format
  311. */
  312. struct ethtool_modinfo {
  313. __u32 cmd;
  314. __u32 type;
  315. __u32 eeprom_len;
  316. __u32 reserved[8];
  317. };
  318. /**
  319. * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
  320. * @cmd: ETHTOOL_{G,S}COALESCE
  321. * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
  322. * a packet arrives.
  323. * @rx_max_coalesced_frames: Maximum number of packets to receive
  324. * before an RX interrupt.
  325. * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
  326. * this value applies while an IRQ is being serviced by the host.
  327. * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
  328. * except that this value applies while an IRQ is being serviced
  329. * by the host.
  330. * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
  331. * a packet is sent.
  332. * @tx_max_coalesced_frames: Maximum number of packets to be sent
  333. * before a TX interrupt.
  334. * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
  335. * this value applies while an IRQ is being serviced by the host.
  336. * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
  337. * except that this value applies while an IRQ is being serviced
  338. * by the host.
  339. * @stats_block_coalesce_usecs: How many usecs to delay in-memory
  340. * statistics block updates. Some drivers do not have an
  341. * in-memory statistic block, and in such cases this value is
  342. * ignored. This value must not be zero.
  343. * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
  344. * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
  345. * @pkt_rate_low: Threshold for low packet rate (packets per second).
  346. * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
  347. * a packet arrives, when the packet rate is below @pkt_rate_low.
  348. * @rx_max_coalesced_frames_low: Maximum number of packets to be received
  349. * before an RX interrupt, when the packet rate is below @pkt_rate_low.
  350. * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
  351. * a packet is sent, when the packet rate is below @pkt_rate_low.
  352. * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
  353. * a TX interrupt, when the packet rate is below @pkt_rate_low.
  354. * @pkt_rate_high: Threshold for high packet rate (packets per second).
  355. * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
  356. * a packet arrives, when the packet rate is above @pkt_rate_high.
  357. * @rx_max_coalesced_frames_high: Maximum number of packets to be received
  358. * before an RX interrupt, when the packet rate is above @pkt_rate_high.
  359. * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
  360. * a packet is sent, when the packet rate is above @pkt_rate_high.
  361. * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
  362. * a TX interrupt, when the packet rate is above @pkt_rate_high.
  363. * @rate_sample_interval: How often to do adaptive coalescing packet rate
  364. * sampling, measured in seconds. Must not be zero.
  365. *
  366. * Each pair of (usecs, max_frames) fields specifies that interrupts
  367. * should be coalesced until
  368. * (usecs > 0 && time_since_first_completion >= usecs) ||
  369. * (max_frames > 0 && completed_frames >= max_frames)
  370. *
  371. * It is illegal to set both usecs and max_frames to zero as this
  372. * would cause interrupts to never be generated. To disable
  373. * coalescing, set usecs = 0 and max_frames = 1.
  374. *
  375. * Some implementations ignore the value of max_frames and use the
  376. * condition time_since_first_completion >= usecs
  377. *
  378. * This is deprecated. Drivers for hardware that does not support
  379. * counting completions should validate that max_frames == !rx_usecs.
  380. *
  381. * Adaptive RX/TX coalescing is an algorithm implemented by some
  382. * drivers to improve latency under low packet rates and improve
  383. * throughput under high packet rates. Some drivers only implement
  384. * one of RX or TX adaptive coalescing. Anything not implemented by
  385. * the driver causes these values to be silently ignored.
  386. *
  387. * When the packet rate is below @pkt_rate_high but above
  388. * @pkt_rate_low (both measured in packets per second) the
  389. * normal {rx,tx}_* coalescing parameters are used.
  390. */
  391. struct ethtool_coalesce {
  392. __u32 cmd;
  393. __u32 rx_coalesce_usecs;
  394. __u32 rx_max_coalesced_frames;
  395. __u32 rx_coalesce_usecs_irq;
  396. __u32 rx_max_coalesced_frames_irq;
  397. __u32 tx_coalesce_usecs;
  398. __u32 tx_max_coalesced_frames;
  399. __u32 tx_coalesce_usecs_irq;
  400. __u32 tx_max_coalesced_frames_irq;
  401. __u32 stats_block_coalesce_usecs;
  402. __u32 use_adaptive_rx_coalesce;
  403. __u32 use_adaptive_tx_coalesce;
  404. __u32 pkt_rate_low;
  405. __u32 rx_coalesce_usecs_low;
  406. __u32 rx_max_coalesced_frames_low;
  407. __u32 tx_coalesce_usecs_low;
  408. __u32 tx_max_coalesced_frames_low;
  409. __u32 pkt_rate_high;
  410. __u32 rx_coalesce_usecs_high;
  411. __u32 rx_max_coalesced_frames_high;
  412. __u32 tx_coalesce_usecs_high;
  413. __u32 tx_max_coalesced_frames_high;
  414. __u32 rate_sample_interval;
  415. };
  416. /**
  417. * struct ethtool_ringparam - RX/TX ring parameters
  418. * @cmd: Command number = %ETHTOOL_GRINGPARAM or %ETHTOOL_SRINGPARAM
  419. * @rx_max_pending: Maximum supported number of pending entries per
  420. * RX ring. Read-only.
  421. * @rx_mini_max_pending: Maximum supported number of pending entries
  422. * per RX mini ring. Read-only.
  423. * @rx_jumbo_max_pending: Maximum supported number of pending entries
  424. * per RX jumbo ring. Read-only.
  425. * @tx_max_pending: Maximum supported number of pending entries per
  426. * TX ring. Read-only.
  427. * @rx_pending: Current maximum number of pending entries per RX ring
  428. * @rx_mini_pending: Current maximum number of pending entries per RX
  429. * mini ring
  430. * @rx_jumbo_pending: Current maximum number of pending entries per RX
  431. * jumbo ring
  432. * @tx_pending: Current maximum supported number of pending entries
  433. * per TX ring
  434. *
  435. * If the interface does not have separate RX mini and/or jumbo rings,
  436. * @rx_mini_max_pending and/or @rx_jumbo_max_pending will be 0.
  437. *
  438. * There may also be driver-dependent minimum values for the number
  439. * of entries per ring.
  440. */
  441. struct ethtool_ringparam {
  442. __u32 cmd;
  443. __u32 rx_max_pending;
  444. __u32 rx_mini_max_pending;
  445. __u32 rx_jumbo_max_pending;
  446. __u32 tx_max_pending;
  447. __u32 rx_pending;
  448. __u32 rx_mini_pending;
  449. __u32 rx_jumbo_pending;
  450. __u32 tx_pending;
  451. };
  452. /**
  453. * struct ethtool_channels - configuring number of network channel
  454. * @cmd: ETHTOOL_{G,S}CHANNELS
  455. * @max_rx: Read only. Maximum number of receive channel the driver support.
  456. * @max_tx: Read only. Maximum number of transmit channel the driver support.
  457. * @max_other: Read only. Maximum number of other channel the driver support.
  458. * @max_combined: Read only. Maximum number of combined channel the driver
  459. * support. Set of queues RX, TX or other.
  460. * @rx_count: Valid values are in the range 1 to the max_rx.
  461. * @tx_count: Valid values are in the range 1 to the max_tx.
  462. * @other_count: Valid values are in the range 1 to the max_other.
  463. * @combined_count: Valid values are in the range 1 to the max_combined.
  464. *
  465. * This can be used to configure RX, TX and other channels.
  466. */
  467. struct ethtool_channels {
  468. __u32 cmd;
  469. __u32 max_rx;
  470. __u32 max_tx;
  471. __u32 max_other;
  472. __u32 max_combined;
  473. __u32 rx_count;
  474. __u32 tx_count;
  475. __u32 other_count;
  476. __u32 combined_count;
  477. };
  478. /**
  479. * struct ethtool_pauseparam - Ethernet pause (flow control) parameters
  480. * @cmd: Command number = %ETHTOOL_GPAUSEPARAM or %ETHTOOL_SPAUSEPARAM
  481. * @autoneg: Flag to enable autonegotiation of pause frame use
  482. * @rx_pause: Flag to enable reception of pause frames
  483. * @tx_pause: Flag to enable transmission of pause frames
  484. *
  485. * Drivers should reject a non-zero setting of @autoneg when
  486. * autoneogotiation is disabled (or not supported) for the link.
  487. *
  488. * If the link is autonegotiated, drivers should use
  489. * mii_advertise_flowctrl() or similar code to set the advertised
  490. * pause frame capabilities based on the @rx_pause and @tx_pause flags,
  491. * even if @autoneg is zero. They should also allow the advertised
  492. * pause frame capabilities to be controlled directly through the
  493. * advertising field of &struct ethtool_cmd.
  494. *
  495. * If @autoneg is non-zero, the MAC is configured to send and/or
  496. * receive pause frames according to the result of autonegotiation.
  497. * Otherwise, it is configured directly based on the @rx_pause and
  498. * @tx_pause flags.
  499. */
  500. struct ethtool_pauseparam {
  501. __u32 cmd;
  502. __u32 autoneg;
  503. __u32 rx_pause;
  504. __u32 tx_pause;
  505. };
  506. #define ETH_GSTRING_LEN 32
  507. /**
  508. * enum ethtool_stringset - string set ID
  509. * @ETH_SS_TEST: Self-test result names, for use with %ETHTOOL_TEST
  510. * @ETH_SS_STATS: Statistic names, for use with %ETHTOOL_GSTATS
  511. * @ETH_SS_PRIV_FLAGS: Driver private flag names, for use with
  512. * %ETHTOOL_GPFLAGS and %ETHTOOL_SPFLAGS
  513. * @ETH_SS_NTUPLE_FILTERS: Previously used with %ETHTOOL_GRXNTUPLE;
  514. * now deprecated
  515. * @ETH_SS_FEATURES: Device feature names
  516. * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
  517. */
  518. enum ethtool_stringset {
  519. ETH_SS_TEST = 0,
  520. ETH_SS_STATS,
  521. ETH_SS_PRIV_FLAGS,
  522. ETH_SS_NTUPLE_FILTERS,
  523. ETH_SS_FEATURES,
  524. ETH_SS_RSS_HASH_FUNCS,
  525. ETH_SS_TUNABLES,
  526. };
  527. /**
  528. * struct ethtool_gstrings - string set for data tagging
  529. * @cmd: Command number = %ETHTOOL_GSTRINGS
  530. * @string_set: String set ID; one of &enum ethtool_stringset
  531. * @len: On return, the number of strings in the string set
  532. * @data: Buffer for strings. Each string is null-padded to a size of
  533. * %ETH_GSTRING_LEN.
  534. *
  535. * Users must use %ETHTOOL_GSSET_INFO to find the number of strings in
  536. * the string set. They must allocate a buffer of the appropriate
  537. * size immediately following this structure.
  538. */
  539. struct ethtool_gstrings {
  540. __u32 cmd;
  541. __u32 string_set;
  542. __u32 len;
  543. __u8 data[0];
  544. };
  545. /**
  546. * struct ethtool_sset_info - string set information
  547. * @cmd: Command number = %ETHTOOL_GSSET_INFO
  548. * @sset_mask: On entry, a bitmask of string sets to query, with bits
  549. * numbered according to &enum ethtool_stringset. On return, a
  550. * bitmask of those string sets queried that are supported.
  551. * @data: Buffer for string set sizes. On return, this contains the
  552. * size of each string set that was queried and supported, in
  553. * order of ID.
  554. *
  555. * Example: The user passes in @sset_mask = 0x7 (sets 0, 1, 2) and on
  556. * return @sset_mask == 0x6 (sets 1, 2). Then @data[0] contains the
  557. * size of set 1 and @data[1] contains the size of set 2.
  558. *
  559. * Users must allocate a buffer of the appropriate size (4 * number of
  560. * sets queried) immediately following this structure.
  561. */
  562. struct ethtool_sset_info {
  563. __u32 cmd;
  564. __u32 reserved;
  565. __u64 sset_mask;
  566. __u32 data[0];
  567. };
  568. /**
  569. * enum ethtool_test_flags - flags definition of ethtool_test
  570. * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
  571. * only online tests.
  572. * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
  573. * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
  574. * test.
  575. * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
  576. */
  577. enum ethtool_test_flags {
  578. ETH_TEST_FL_OFFLINE = (1 << 0),
  579. ETH_TEST_FL_FAILED = (1 << 1),
  580. ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
  581. ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
  582. };
  583. /**
  584. * struct ethtool_test - device self-test invocation
  585. * @cmd: Command number = %ETHTOOL_TEST
  586. * @flags: A bitmask of flags from &enum ethtool_test_flags. Some
  587. * flags may be set by the user on entry; others may be set by
  588. * the driver on return.
  589. * @len: On return, the number of test results
  590. * @data: Array of test results
  591. *
  592. * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
  593. * number of test results that will be returned. They must allocate a
  594. * buffer of the appropriate size (8 * number of results) immediately
  595. * following this structure.
  596. */
  597. struct ethtool_test {
  598. __u32 cmd;
  599. __u32 flags;
  600. __u32 reserved;
  601. __u32 len;
  602. __u64 data[0];
  603. };
  604. /**
  605. * struct ethtool_stats - device-specific statistics
  606. * @cmd: Command number = %ETHTOOL_GSTATS
  607. * @n_stats: On return, the number of statistics
  608. * @data: Array of statistics
  609. *
  610. * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
  611. * number of statistics that will be returned. They must allocate a
  612. * buffer of the appropriate size (8 * number of statistics)
  613. * immediately following this structure.
  614. */
  615. struct ethtool_stats {
  616. __u32 cmd;
  617. __u32 n_stats;
  618. __u64 data[0];
  619. };
  620. /**
  621. * struct ethtool_perm_addr - permanent hardware address
  622. * @cmd: Command number = %ETHTOOL_GPERMADDR
  623. * @size: On entry, the size of the buffer. On return, the size of the
  624. * address. The command fails if the buffer is too small.
  625. * @data: Buffer for the address
  626. *
  627. * Users must allocate the buffer immediately following this structure.
  628. * A buffer size of %MAX_ADDR_LEN should be sufficient for any address
  629. * type.
  630. */
  631. struct ethtool_perm_addr {
  632. __u32 cmd;
  633. __u32 size;
  634. __u8 data[0];
  635. };
  636. /* boolean flags controlling per-interface behavior characteristics.
  637. * When reading, the flag indicates whether or not a certain behavior
  638. * is enabled/present. When writing, the flag indicates whether
  639. * or not the driver should turn on (set) or off (clear) a behavior.
  640. *
  641. * Some behaviors may read-only (unconditionally absent or present).
  642. * If such is the case, return EINVAL in the set-flags operation if the
  643. * flag differs from the read-only value.
  644. */
  645. enum ethtool_flags {
  646. ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
  647. ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
  648. ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
  649. ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
  650. ETH_FLAG_RXHASH = (1 << 28),
  651. };
  652. /* The following structures are for supporting RX network flow
  653. * classification and RX n-tuple configuration. Note, all multibyte
  654. * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
  655. * be in network byte order.
  656. */
  657. /**
  658. * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
  659. * @ip4src: Source host
  660. * @ip4dst: Destination host
  661. * @psrc: Source port
  662. * @pdst: Destination port
  663. * @tos: Type-of-service
  664. *
  665. * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
  666. */
  667. struct ethtool_tcpip4_spec {
  668. __be32 ip4src;
  669. __be32 ip4dst;
  670. __be16 psrc;
  671. __be16 pdst;
  672. __u8 tos;
  673. };
  674. /**
  675. * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
  676. * @ip4src: Source host
  677. * @ip4dst: Destination host
  678. * @spi: Security parameters index
  679. * @tos: Type-of-service
  680. *
  681. * This can be used to specify an IPsec transport or tunnel over IPv4.
  682. */
  683. struct ethtool_ah_espip4_spec {
  684. __be32 ip4src;
  685. __be32 ip4dst;
  686. __be32 spi;
  687. __u8 tos;
  688. };
  689. #define ETH_RX_NFC_IP4 1
  690. /**
  691. * struct ethtool_usrip4_spec - general flow specification for IPv4
  692. * @ip4src: Source host
  693. * @ip4dst: Destination host
  694. * @l4_4_bytes: First 4 bytes of transport (layer 4) header
  695. * @tos: Type-of-service
  696. * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
  697. * @proto: Transport protocol number; mask must be 0
  698. */
  699. struct ethtool_usrip4_spec {
  700. __be32 ip4src;
  701. __be32 ip4dst;
  702. __be32 l4_4_bytes;
  703. __u8 tos;
  704. __u8 ip_ver;
  705. __u8 proto;
  706. };
  707. union ethtool_flow_union {
  708. struct ethtool_tcpip4_spec tcp_ip4_spec;
  709. struct ethtool_tcpip4_spec udp_ip4_spec;
  710. struct ethtool_tcpip4_spec sctp_ip4_spec;
  711. struct ethtool_ah_espip4_spec ah_ip4_spec;
  712. struct ethtool_ah_espip4_spec esp_ip4_spec;
  713. struct ethtool_usrip4_spec usr_ip4_spec;
  714. struct ethhdr ether_spec;
  715. __u8 hdata[52];
  716. };
  717. /**
  718. * struct ethtool_flow_ext - additional RX flow fields
  719. * @h_dest: destination MAC address
  720. * @vlan_etype: VLAN EtherType
  721. * @vlan_tci: VLAN tag control information
  722. * @data: user defined data
  723. *
  724. * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT
  725. * is set in &struct ethtool_rx_flow_spec @flow_type.
  726. * @h_dest is valid if %FLOW_MAC_EXT is set.
  727. */
  728. struct ethtool_flow_ext {
  729. __u8 padding[2];
  730. unsigned char h_dest[ETH_ALEN];
  731. __be16 vlan_etype;
  732. __be16 vlan_tci;
  733. __be32 data[2];
  734. };
  735. /**
  736. * struct ethtool_rx_flow_spec - classification rule for RX flows
  737. * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
  738. * @h_u: Flow fields to match (dependent on @flow_type)
  739. * @h_ext: Additional fields to match
  740. * @m_u: Masks for flow field bits to be matched
  741. * @m_ext: Masks for additional field bits to be matched
  742. * Note, all additional fields must be ignored unless @flow_type
  743. * includes the %FLOW_EXT or %FLOW_MAC_EXT flag
  744. * (see &struct ethtool_flow_ext description).
  745. * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
  746. * if packets should be discarded
  747. * @location: Location of rule in the table. Locations must be
  748. * numbered such that a flow matching multiple rules will be
  749. * classified according to the first (lowest numbered) rule.
  750. */
  751. struct ethtool_rx_flow_spec {
  752. __u32 flow_type;
  753. union ethtool_flow_union h_u;
  754. struct ethtool_flow_ext h_ext;
  755. union ethtool_flow_union m_u;
  756. struct ethtool_flow_ext m_ext;
  757. __u64 ring_cookie;
  758. __u32 location;
  759. };
  760. /* How rings are layed out when accessing virtual functions or
  761. * offloaded queues is device specific. To allow users to do flow
  762. * steering and specify these queues the ring cookie is partitioned
  763. * into a 32bit queue index with an 8 bit virtual function id.
  764. * This also leaves the 3bytes for further specifiers. It is possible
  765. * future devices may support more than 256 virtual functions if
  766. * devices start supporting PCIe w/ARI. However at the moment I
  767. * do not know of any devices that support this so I do not reserve
  768. * space for this at this time. If a future patch consumes the next
  769. * byte it should be aware of this possiblity.
  770. */
  771. #define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL
  772. #define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL
  773. #define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
  774. static inline __u64 ethtool_get_flow_spec_ring(__u64 ring_cookie)
  775. {
  776. return ETHTOOL_RX_FLOW_SPEC_RING & ring_cookie;
  777. }
  778. static inline __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
  779. {
  780. return (ETHTOOL_RX_FLOW_SPEC_RING_VF & ring_cookie) >>
  781. ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF;
  782. }
  783. /**
  784. * struct ethtool_rxnfc - command to get or set RX flow classification rules
  785. * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
  786. * %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
  787. * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
  788. * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
  789. * @data: Command-dependent value
  790. * @fs: Flow classification rule
  791. * @rule_cnt: Number of rules to be affected
  792. * @rule_locs: Array of used rule locations
  793. *
  794. * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
  795. * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
  796. * structure fields must not be used.
  797. *
  798. * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
  799. * on return.
  800. *
  801. * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
  802. * rules on return. If @data is non-zero on return then it is the
  803. * size of the rule table, plus the flag %RX_CLS_LOC_SPECIAL if the
  804. * driver supports any special location values. If that flag is not
  805. * set in @data then special location values should not be used.
  806. *
  807. * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
  808. * existing rule on entry and @fs contains the rule on return.
  809. *
  810. * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
  811. * user buffer for @rule_locs on entry. On return, @data is the size
  812. * of the rule table, @rule_cnt is the number of defined rules, and
  813. * @rule_locs contains the locations of the defined rules. Drivers
  814. * must use the second parameter to get_rxnfc() instead of @rule_locs.
  815. *
  816. * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
  817. * @fs.@location either specifies the location to use or is a special
  818. * location value with %RX_CLS_LOC_SPECIAL flag set. On return,
  819. * @fs.@location is the actual rule location.
  820. *
  821. * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
  822. * existing rule on entry.
  823. *
  824. * A driver supporting the special location values for
  825. * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused
  826. * location, and may remove a rule at a later location (lower
  827. * priority) that matches exactly the same set of flows. The special
  828. * values are %RX_CLS_LOC_ANY, selecting any location;
  829. * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum
  830. * priority); and %RX_CLS_LOC_LAST, selecting the last suitable
  831. * location (minimum priority). Additional special values may be
  832. * defined in future and drivers must return -%EINVAL for any
  833. * unrecognised value.
  834. */
  835. struct ethtool_rxnfc {
  836. __u32 cmd;
  837. __u32 flow_type;
  838. __u64 data;
  839. struct ethtool_rx_flow_spec fs;
  840. __u32 rule_cnt;
  841. __u32 rule_locs[0];
  842. };
  843. /**
  844. * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
  845. * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
  846. * @size: On entry, the array size of the user buffer, which may be zero.
  847. * On return from %ETHTOOL_GRXFHINDIR, the array size of the hardware
  848. * indirection table.
  849. * @ring_index: RX ring/queue index for each hash value
  850. *
  851. * For %ETHTOOL_GRXFHINDIR, a @size of zero means that only the size
  852. * should be returned. For %ETHTOOL_SRXFHINDIR, a @size of zero means
  853. * the table should be reset to default values. This last feature
  854. * is not supported by the original implementations.
  855. */
  856. struct ethtool_rxfh_indir {
  857. __u32 cmd;
  858. __u32 size;
  859. __u32 ring_index[0];
  860. };
  861. /**
  862. * struct ethtool_rxfh - command to get/set RX flow hash indir or/and hash key.
  863. * @cmd: Specific command number - %ETHTOOL_GRSSH or %ETHTOOL_SRSSH
  864. * @rss_context: RSS context identifier.
  865. * @indir_size: On entry, the array size of the user buffer for the
  866. * indirection table, which may be zero, or (for %ETHTOOL_SRSSH),
  867. * %ETH_RXFH_INDIR_NO_CHANGE. On return from %ETHTOOL_GRSSH,
  868. * the array size of the hardware indirection table.
  869. * @key_size: On entry, the array size of the user buffer for the hash key,
  870. * which may be zero. On return from %ETHTOOL_GRSSH, the size of the
  871. * hardware hash key.
  872. * @hfunc: Defines the current RSS hash function used by HW (or to be set to).
  873. * Valid values are one of the %ETH_RSS_HASH_*.
  874. * @rsvd: Reserved for future extensions.
  875. * @rss_config: RX ring/queue index for each hash value i.e., indirection table
  876. * of @indir_size __u32 elements, followed by hash key of @key_size
  877. * bytes.
  878. *
  879. * For %ETHTOOL_GRSSH, a @indir_size and key_size of zero means that only the
  880. * size should be returned. For %ETHTOOL_SRSSH, an @indir_size of
  881. * %ETH_RXFH_INDIR_NO_CHANGE means that indir table setting is not requested
  882. * and a @indir_size of zero means the indir table should be reset to default
  883. * values. An hfunc of zero means that hash function setting is not requested.
  884. */
  885. struct ethtool_rxfh {
  886. __u32 cmd;
  887. __u32 rss_context;
  888. __u32 indir_size;
  889. __u32 key_size;
  890. __u8 hfunc;
  891. __u8 rsvd8[3];
  892. __u32 rsvd32;
  893. __u32 rss_config[0];
  894. };
  895. #define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
  896. /**
  897. * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
  898. * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
  899. * @h_u: Flow field values to match (dependent on @flow_type)
  900. * @m_u: Masks for flow field value bits to be ignored
  901. * @vlan_tag: VLAN tag to match
  902. * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
  903. * @data: Driver-dependent data to match
  904. * @data_mask: Mask for driver-dependent data bits to be ignored
  905. * @action: RX ring/queue index to deliver to (non-negative) or other action
  906. * (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
  907. *
  908. * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
  909. * a field value and mask are both zero this is treated as if all mask
  910. * bits are set i.e. the field is ignored.
  911. */
  912. struct ethtool_rx_ntuple_flow_spec {
  913. __u32 flow_type;
  914. union {
  915. struct ethtool_tcpip4_spec tcp_ip4_spec;
  916. struct ethtool_tcpip4_spec udp_ip4_spec;
  917. struct ethtool_tcpip4_spec sctp_ip4_spec;
  918. struct ethtool_ah_espip4_spec ah_ip4_spec;
  919. struct ethtool_ah_espip4_spec esp_ip4_spec;
  920. struct ethtool_usrip4_spec usr_ip4_spec;
  921. struct ethhdr ether_spec;
  922. __u8 hdata[72];
  923. } h_u, m_u;
  924. __u16 vlan_tag;
  925. __u16 vlan_tag_mask;
  926. __u64 data;
  927. __u64 data_mask;
  928. __s32 action;
  929. #define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
  930. #define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
  931. };
  932. /**
  933. * struct ethtool_rx_ntuple - command to set or clear RX flow filter
  934. * @cmd: Command number - %ETHTOOL_SRXNTUPLE
  935. * @fs: Flow filter specification
  936. */
  937. struct ethtool_rx_ntuple {
  938. __u32 cmd;
  939. struct ethtool_rx_ntuple_flow_spec fs;
  940. };
  941. #define ETHTOOL_FLASH_MAX_FILENAME 128
  942. enum ethtool_flash_op_type {
  943. ETHTOOL_FLASH_ALL_REGIONS = 0,
  944. };
  945. /* for passing firmware flashing related parameters */
  946. struct ethtool_flash {
  947. __u32 cmd;
  948. __u32 region;
  949. char data[ETHTOOL_FLASH_MAX_FILENAME];
  950. };
  951. /**
  952. * struct ethtool_dump - used for retrieving, setting device dump
  953. * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
  954. * %ETHTOOL_SET_DUMP
  955. * @version: FW version of the dump, filled in by driver
  956. * @flag: driver dependent flag for dump setting, filled in by driver during
  957. * get and filled in by ethtool for set operation.
  958. * flag must be initialized by macro ETH_FW_DUMP_DISABLE value when
  959. * firmware dump is disabled.
  960. * @len: length of dump data, used as the length of the user buffer on entry to
  961. * %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver
  962. * for %ETHTOOL_GET_DUMP_FLAG command
  963. * @data: data collected for get dump data operation
  964. */
  965. struct ethtool_dump {
  966. __u32 cmd;
  967. __u32 version;
  968. __u32 flag;
  969. __u32 len;
  970. __u8 data[0];
  971. };
  972. #define ETH_FW_DUMP_DISABLE 0
  973. /* for returning and changing feature sets */
  974. /**
  975. * struct ethtool_get_features_block - block with state of 32 features
  976. * @available: mask of changeable features
  977. * @requested: mask of features requested to be enabled if possible
  978. * @active: mask of currently enabled features
  979. * @never_changed: mask of features not changeable for any device
  980. */
  981. struct ethtool_get_features_block {
  982. __u32 available;
  983. __u32 requested;
  984. __u32 active;
  985. __u32 never_changed;
  986. };
  987. /**
  988. * struct ethtool_gfeatures - command to get state of device's features
  989. * @cmd: command number = %ETHTOOL_GFEATURES
  990. * @size: On entry, the number of elements in the features[] array;
  991. * on return, the number of elements in features[] needed to hold
  992. * all features
  993. * @features: state of features
  994. */
  995. struct ethtool_gfeatures {
  996. __u32 cmd;
  997. __u32 size;
  998. struct ethtool_get_features_block features[0];
  999. };
  1000. /**
  1001. * struct ethtool_set_features_block - block with request for 32 features
  1002. * @valid: mask of features to be changed
  1003. * @requested: values of features to be changed
  1004. */
  1005. struct ethtool_set_features_block {
  1006. __u32 valid;
  1007. __u32 requested;
  1008. };
  1009. /**
  1010. * struct ethtool_sfeatures - command to request change in device's features
  1011. * @cmd: command number = %ETHTOOL_SFEATURES
  1012. * @size: array size of the features[] array
  1013. * @features: feature change masks
  1014. */
  1015. struct ethtool_sfeatures {
  1016. __u32 cmd;
  1017. __u32 size;
  1018. struct ethtool_set_features_block features[0];
  1019. };
  1020. /**
  1021. * struct ethtool_ts_info - holds a device's timestamping and PHC association
  1022. * @cmd: command number = %ETHTOOL_GET_TS_INFO
  1023. * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
  1024. * @phc_index: device index of the associated PHC, or -1 if there is none
  1025. * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
  1026. * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
  1027. *
  1028. * The bits in the 'tx_types' and 'rx_filters' fields correspond to
  1029. * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
  1030. * respectively. For example, if the device supports HWTSTAMP_TX_ON,
  1031. * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
  1032. *
  1033. * Drivers should only report the filters they actually support without
  1034. * upscaling in the SIOCSHWTSTAMP ioctl. If the SIOCSHWSTAMP request for
  1035. * HWTSTAMP_FILTER_V1_SYNC is supported by HWTSTAMP_FILTER_V1_EVENT, then the
  1036. * driver should only report HWTSTAMP_FILTER_V1_EVENT in this op.
  1037. */
  1038. struct ethtool_ts_info {
  1039. __u32 cmd;
  1040. __u32 so_timestamping;
  1041. __s32 phc_index;
  1042. __u32 tx_types;
  1043. __u32 tx_reserved[3];
  1044. __u32 rx_filters;
  1045. __u32 rx_reserved[3];
  1046. };
  1047. /*
  1048. * %ETHTOOL_SFEATURES changes features present in features[].valid to the
  1049. * values of corresponding bits in features[].requested. Bits in .requested
  1050. * not set in .valid or not changeable are ignored.
  1051. *
  1052. * Returns %EINVAL when .valid contains undefined or never-changeable bits
  1053. * or size is not equal to required number of features words (32-bit blocks).
  1054. * Returns >= 0 if request was completed; bits set in the value mean:
  1055. * %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
  1056. * changeable (not present in %ETHTOOL_GFEATURES' features[].available)
  1057. * those bits were ignored.
  1058. * %ETHTOOL_F_WISH - some or all changes requested were recorded but the
  1059. * resulting state of bits masked by .valid is not equal to .requested.
  1060. * Probably there are other device-specific constraints on some features
  1061. * in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
  1062. * here as though ignored bits were cleared.
  1063. * %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
  1064. * compatibility functions. Requested offload state cannot be properly
  1065. * managed by kernel.
  1066. *
  1067. * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
  1068. * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
  1069. * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
  1070. * significant bit in features[0] fields. Empty strings mark undefined features.
  1071. */
  1072. enum ethtool_sfeatures_retval_bits {
  1073. ETHTOOL_F_UNSUPPORTED__BIT,
  1074. ETHTOOL_F_WISH__BIT,
  1075. ETHTOOL_F_COMPAT__BIT,
  1076. };
  1077. #define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
  1078. #define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
  1079. #define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
  1080. /* CMDs currently supported */
  1081. #define ETHTOOL_GSET 0x00000001 /* Get settings. */
  1082. #define ETHTOOL_SSET 0x00000002 /* Set settings. */
  1083. #define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
  1084. #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
  1085. #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
  1086. #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
  1087. #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
  1088. #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
  1089. #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
  1090. /* Get link status for host, i.e. whether the interface *and* the
  1091. * physical port (if there is one) are up (ethtool_value). */
  1092. #define ETHTOOL_GLINK 0x0000000a
  1093. #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
  1094. #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
  1095. #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
  1096. #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
  1097. #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
  1098. #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
  1099. #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
  1100. #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
  1101. #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
  1102. #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
  1103. #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
  1104. #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
  1105. #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
  1106. * (ethtool_value) */
  1107. #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
  1108. * (ethtool_value). */
  1109. #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
  1110. #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
  1111. #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
  1112. #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
  1113. #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
  1114. #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
  1115. #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
  1116. #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
  1117. #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
  1118. #define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
  1119. #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
  1120. #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
  1121. #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
  1122. #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
  1123. #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
  1124. #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
  1125. #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
  1126. #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */
  1127. #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */
  1128. #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */
  1129. #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */
  1130. #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */
  1131. #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
  1132. #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
  1133. #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
  1134. #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
  1135. #define ETHTOOL_RESET 0x00000034 /* Reset hardware */
  1136. #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
  1137. #define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
  1138. #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
  1139. #define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
  1140. #define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
  1141. #define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */
  1142. #define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
  1143. #define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
  1144. #define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */
  1145. #define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
  1146. #define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */
  1147. #define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
  1148. #define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
  1149. #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
  1150. #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
  1151. #define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
  1152. #define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
  1153. #define ETHTOOL_GRSSH 0x00000046 /* Get RX flow hash configuration */
  1154. #define ETHTOOL_SRSSH 0x00000047 /* Set RX flow hash configuration */
  1155. #define ETHTOOL_GTUNABLE 0x00000048 /* Get tunable configuration */
  1156. #define ETHTOOL_STUNABLE 0x00000049 /* Set tunable configuration */
  1157. /* compatibility with older code */
  1158. #define SPARC_ETH_GSET ETHTOOL_GSET
  1159. #define SPARC_ETH_SSET ETHTOOL_SSET
  1160. #define SUPPORTED_10baseT_Half (1 << 0)
  1161. #define SUPPORTED_10baseT_Full (1 << 1)
  1162. #define SUPPORTED_100baseT_Half (1 << 2)
  1163. #define SUPPORTED_100baseT_Full (1 << 3)
  1164. #define SUPPORTED_1000baseT_Half (1 << 4)
  1165. #define SUPPORTED_1000baseT_Full (1 << 5)
  1166. #define SUPPORTED_Autoneg (1 << 6)
  1167. #define SUPPORTED_TP (1 << 7)
  1168. #define SUPPORTED_AUI (1 << 8)
  1169. #define SUPPORTED_MII (1 << 9)
  1170. #define SUPPORTED_FIBRE (1 << 10)
  1171. #define SUPPORTED_BNC (1 << 11)
  1172. #define SUPPORTED_10000baseT_Full (1 << 12)
  1173. #define SUPPORTED_Pause (1 << 13)
  1174. #define SUPPORTED_Asym_Pause (1 << 14)
  1175. #define SUPPORTED_2500baseX_Full (1 << 15)
  1176. #define SUPPORTED_Backplane (1 << 16)
  1177. #define SUPPORTED_1000baseKX_Full (1 << 17)
  1178. #define SUPPORTED_10000baseKX4_Full (1 << 18)
  1179. #define SUPPORTED_10000baseKR_Full (1 << 19)
  1180. #define SUPPORTED_10000baseR_FEC (1 << 20)
  1181. #define SUPPORTED_20000baseMLD2_Full (1 << 21)
  1182. #define SUPPORTED_20000baseKR2_Full (1 << 22)
  1183. #define SUPPORTED_40000baseKR4_Full (1 << 23)
  1184. #define SUPPORTED_40000baseCR4_Full (1 << 24)
  1185. #define SUPPORTED_40000baseSR4_Full (1 << 25)
  1186. #define SUPPORTED_40000baseLR4_Full (1 << 26)
  1187. #define SUPPORTED_56000baseKR4_Full (1 << 27)
  1188. #define SUPPORTED_56000baseCR4_Full (1 << 28)
  1189. #define SUPPORTED_56000baseSR4_Full (1 << 29)
  1190. #define SUPPORTED_56000baseLR4_Full (1 << 30)
  1191. #define ADVERTISED_10baseT_Half (1 << 0)
  1192. #define ADVERTISED_10baseT_Full (1 << 1)
  1193. #define ADVERTISED_100baseT_Half (1 << 2)
  1194. #define ADVERTISED_100baseT_Full (1 << 3)
  1195. #define ADVERTISED_1000baseT_Half (1 << 4)
  1196. #define ADVERTISED_1000baseT_Full (1 << 5)
  1197. #define ADVERTISED_Autoneg (1 << 6)
  1198. #define ADVERTISED_TP (1 << 7)
  1199. #define ADVERTISED_AUI (1 << 8)
  1200. #define ADVERTISED_MII (1 << 9)
  1201. #define ADVERTISED_FIBRE (1 << 10)
  1202. #define ADVERTISED_BNC (1 << 11)
  1203. #define ADVERTISED_10000baseT_Full (1 << 12)
  1204. #define ADVERTISED_Pause (1 << 13)
  1205. #define ADVERTISED_Asym_Pause (1 << 14)
  1206. #define ADVERTISED_2500baseX_Full (1 << 15)
  1207. #define ADVERTISED_Backplane (1 << 16)
  1208. #define ADVERTISED_1000baseKX_Full (1 << 17)
  1209. #define ADVERTISED_10000baseKX4_Full (1 << 18)
  1210. #define ADVERTISED_10000baseKR_Full (1 << 19)
  1211. #define ADVERTISED_10000baseR_FEC (1 << 20)
  1212. #define ADVERTISED_20000baseMLD2_Full (1 << 21)
  1213. #define ADVERTISED_20000baseKR2_Full (1 << 22)
  1214. #define ADVERTISED_40000baseKR4_Full (1 << 23)
  1215. #define ADVERTISED_40000baseCR4_Full (1 << 24)
  1216. #define ADVERTISED_40000baseSR4_Full (1 << 25)
  1217. #define ADVERTISED_40000baseLR4_Full (1 << 26)
  1218. #define ADVERTISED_56000baseKR4_Full (1 << 27)
  1219. #define ADVERTISED_56000baseCR4_Full (1 << 28)
  1220. #define ADVERTISED_56000baseSR4_Full (1 << 29)
  1221. #define ADVERTISED_56000baseLR4_Full (1 << 30)
  1222. /* The following are all involved in forcing a particular link
  1223. * mode for the device for setting things. When getting the
  1224. * devices settings, these indicate the current mode and whether
  1225. * it was forced up into this mode or autonegotiated.
  1226. */
  1227. /* The forced speed, 10Mb, 100Mb, gigabit, [2.5|5|10|20|25|40|50|56|100]GbE. */
  1228. #define SPEED_10 10
  1229. #define SPEED_100 100
  1230. #define SPEED_1000 1000
  1231. #define SPEED_2500 2500
  1232. #define SPEED_5000 5000
  1233. #define SPEED_10000 10000
  1234. #define SPEED_20000 20000
  1235. #define SPEED_25000 25000
  1236. #define SPEED_40000 40000
  1237. #define SPEED_50000 50000
  1238. #define SPEED_56000 56000
  1239. #define SPEED_100000 100000
  1240. #define SPEED_UNKNOWN -1
  1241. /* Duplex, half or full. */
  1242. #define DUPLEX_HALF 0x00
  1243. #define DUPLEX_FULL 0x01
  1244. #define DUPLEX_UNKNOWN 0xff
  1245. /* Which connector port. */
  1246. #define PORT_TP 0x00
  1247. #define PORT_AUI 0x01
  1248. #define PORT_MII 0x02
  1249. #define PORT_FIBRE 0x03
  1250. #define PORT_BNC 0x04
  1251. #define PORT_DA 0x05
  1252. #define PORT_NONE 0xef
  1253. #define PORT_OTHER 0xff
  1254. /* Which transceiver to use. */
  1255. #define XCVR_INTERNAL 0x00 /* PHY and MAC are in the same package */
  1256. #define XCVR_EXTERNAL 0x01 /* PHY and MAC are in different packages */
  1257. #define XCVR_DUMMY1 0x02
  1258. #define XCVR_DUMMY2 0x03
  1259. #define XCVR_DUMMY3 0x04
  1260. /* Enable or disable autonegotiation. */
  1261. #define AUTONEG_DISABLE 0x00
  1262. #define AUTONEG_ENABLE 0x01
  1263. /* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
  1264. * the driver is required to renegotiate link
  1265. */
  1266. #define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
  1267. #define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
  1268. #define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
  1269. #define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */
  1270. /* Wake-On-Lan options. */
  1271. #define WAKE_PHY (1 << 0)
  1272. #define WAKE_UCAST (1 << 1)
  1273. #define WAKE_MCAST (1 << 2)
  1274. #define WAKE_BCAST (1 << 3)
  1275. #define WAKE_ARP (1 << 4)
  1276. #define WAKE_MAGIC (1 << 5)
  1277. #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
  1278. /* L2-L4 network traffic flow types */
  1279. #define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
  1280. #define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
  1281. #define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
  1282. #define AH_ESP_V4_FLOW 0x04 /* hash only */
  1283. #define TCP_V6_FLOW 0x05 /* hash only */
  1284. #define UDP_V6_FLOW 0x06 /* hash only */
  1285. #define SCTP_V6_FLOW 0x07 /* hash only */
  1286. #define AH_ESP_V6_FLOW 0x08 /* hash only */
  1287. #define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
  1288. #define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
  1289. #define AH_V6_FLOW 0x0b /* hash only */
  1290. #define ESP_V6_FLOW 0x0c /* hash only */
  1291. #define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
  1292. #define IPV4_FLOW 0x10 /* hash only */
  1293. #define IPV6_FLOW 0x11 /* hash only */
  1294. #define ETHER_FLOW 0x12 /* spec only (ether_spec) */
  1295. /* Flag to enable additional fields in struct ethtool_rx_flow_spec */
  1296. #define FLOW_EXT 0x80000000
  1297. #define FLOW_MAC_EXT 0x40000000
  1298. /* L3-L4 network traffic flow hash options */
  1299. #define RXH_L2DA (1 << 1)
  1300. #define RXH_VLAN (1 << 2)
  1301. #define RXH_L3_PROTO (1 << 3)
  1302. #define RXH_IP_SRC (1 << 4)
  1303. #define RXH_IP_DST (1 << 5)
  1304. #define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
  1305. #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
  1306. #define RXH_DISCARD (1 << 31)
  1307. #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
  1308. /* Special RX classification rule insert location values */
  1309. #define RX_CLS_LOC_SPECIAL 0x80000000 /* flag */
  1310. #define RX_CLS_LOC_ANY 0xffffffff
  1311. #define RX_CLS_LOC_FIRST 0xfffffffe
  1312. #define RX_CLS_LOC_LAST 0xfffffffd
  1313. /* EEPROM Standards for plug in modules */
  1314. #define ETH_MODULE_SFF_8079 0x1
  1315. #define ETH_MODULE_SFF_8079_LEN 256
  1316. #define ETH_MODULE_SFF_8472 0x2
  1317. #define ETH_MODULE_SFF_8472_LEN 512
  1318. #define ETH_MODULE_SFF_8636 0x3
  1319. #define ETH_MODULE_SFF_8636_LEN 256
  1320. #define ETH_MODULE_SFF_8436 0x4
  1321. #define ETH_MODULE_SFF_8436_LEN 256
  1322. /* Reset flags */
  1323. /* The reset() operation must clear the flags for the components which
  1324. * were actually reset. On successful return, the flags indicate the
  1325. * components which were not reset, either because they do not exist
  1326. * in the hardware or because they cannot be reset independently. The
  1327. * driver must never reset any components that were not requested.
  1328. */
  1329. enum ethtool_reset_flags {
  1330. /* These flags represent components dedicated to the interface
  1331. * the command is addressed to. Shift any flag left by
  1332. * ETH_RESET_SHARED_SHIFT to reset a shared component of the
  1333. * same type.
  1334. */
  1335. ETH_RESET_MGMT = 1 << 0, /* Management processor */
  1336. ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */
  1337. ETH_RESET_DMA = 1 << 2, /* DMA engine */
  1338. ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */
  1339. ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */
  1340. ETH_RESET_MAC = 1 << 5, /* Media access controller */
  1341. ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
  1342. ETH_RESET_RAM = 1 << 7, /* RAM shared between
  1343. * multiple components */
  1344. ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to
  1345. * this interface */
  1346. ETH_RESET_ALL = 0xffffffff, /* All components used by this
  1347. * interface, even if shared */
  1348. };
  1349. #define ETH_RESET_SHARED_SHIFT 16
  1350. #endif /* _UAPI_LINUX_ETHTOOL_H */