Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ethtool.h
Go to the documentation of this file.
1 /*
2  * ethtool.h: Defines for Linux ethtool.
3  *
4  * Copyright (C) 1998 David S. Miller ([email protected])
5  * Copyright 2001 Jeff Garzik <[email protected]>
6  * Portions Copyright 2001 Sun Microsystems ([email protected])
7  * Portions Copyright 2002 Intel ([email protected],
10  * Portions Copyright (C) Sun Microsystems 2008
11  */
12 
13 #ifndef _UAPI_LINUX_ETHTOOL_H
14 #define _UAPI_LINUX_ETHTOOL_H
15 
16 #include <linux/types.h>
17 #include <linux/if_ether.h>
18 
19 /* This should work for both 32 and 64 bit userland. */
20 struct ethtool_cmd {
22  __u32 supported; /* Features this interface supports */
23  __u32 advertising; /* Features this interface advertises */
24  __u16 speed; /* The forced speed (lower bits) in
25  * Mbps. Please use
26  * ethtool_cmd_speed()/_set() to
27  * access it */
28  __u8 duplex; /* Duplex, half or full */
29  __u8 port; /* Which connector port */
30  __u8 phy_address; /* MDIO PHY address (PRTAD for clause 45).
31  * May be read-only or read-write
32  * depending on the driver.
33  */
34  __u8 transceiver; /* Which transceiver to use */
35  __u8 autoneg; /* Enable or disable autonegotiation */
36  __u8 mdio_support; /* MDIO protocols supported. Read-only.
37  * Not set by all drivers.
38  */
39  __u32 maxtxpkt; /* Tx pkts before generating tx int */
40  __u32 maxrxpkt; /* Rx pkts before generating rx int */
41  __u16 speed_hi; /* The forced speed (upper
42  * bits) in Mbps. Please use
43  * ethtool_cmd_speed()/_set() to
44  * access it */
45  __u8 eth_tp_mdix; /* twisted pair MDI-X status */
46  __u8 eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
47  * link should be renegotiated if necessary
48  */
49  __u32 lp_advertising; /* Features the link partner advertises */
51 };
52 
53 static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
54  __u32 speed)
55 {
56 
57  ep->speed = (__u16)speed;
58  ep->speed_hi = (__u16)(speed >> 16);
59 }
60 
61 static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
62 {
63  return (ep->speed_hi << 16) | ep->speed;
64 }
65 
66 /* Device supports clause 22 register access to PHY or peripherals
67  * using the interface defined in <linux/mii.h>. This should not be
68  * set if there are known to be no such peripherals present or if
69  * the driver only emulates clause 22 registers for compatibility.
70  */
71 #define ETH_MDIO_SUPPORTS_C22 1
72 
73 /* Device supports clause 45 register access to PHY or peripherals
74  * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
75  * This should not be set if there are known to be no such peripherals
76  * present.
77  */
78 #define ETH_MDIO_SUPPORTS_C45 2
79 
80 #define ETHTOOL_FWVERS_LEN 32
81 #define ETHTOOL_BUSINFO_LEN 32
82 /* these strings are set to whatever the driver author decides... */
85  char driver[32]; /* driver short name, "tulip", "eepro100" */
86  char version[32]; /* driver version string */
87  char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
88  char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
89  /* For PCI devices, use pci_name(pci_dev). */
90  char reserved1[32];
91  char reserved2[12];
92  /*
93  * Some struct members below are filled in
94  * using ops->get_sset_count(). Obtaining
95  * this info from ethtool_drvinfo is now
96  * deprecated; Use ETHTOOL_GSSET_INFO
97  * instead.
98  */
99  __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
100  __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
102  __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
103  __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
104 };
105 
106 #define SOPASS_MAX 6
107 /* wake-on-lan settings */
112  __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
113 };
114 
115 /* for passing single values */
119 };
120 
121 /* for passing big chunks of data */
122 struct ethtool_regs {
124  __u32 version; /* driver-specific, indicates different chips/revs */
125  __u32 len; /* bytes */
126  __u8 data[0];
127 };
128 
129 /* for passing EEPROM chunks */
133  __u32 offset; /* in bytes */
134  __u32 len; /* in bytes */
135  __u8 data[0];
136 };
137 
155 struct ethtool_eee {
165 };
166 
182 };
183 
280 };
281 
282 /* for configuring RX/TX ring parameters */
284  __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
285 
286  /* Read only attributes. These indicate the maximum number
287  * of pending RX/TX ring entries the driver will allow the
288  * user to set.
289  */
294 
295  /* Values changeable by the user. The valid values are
296  * in the range 1 to the "*_max_pending" counterpart above.
297  */
302 };
303 
330 };
331 
332 /* for configuring link flow control parameters */
334  __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
335 
336  /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
337  * being true) the user may set 'autoneg' here non-zero to have the
338  * pause parameters be auto-negotiated too. In such a case, the
339  * {rx,tx}_pause values below determine what capabilities are
340  * advertised.
341  *
342  * If 'autoneg' is zero or the link is not being auto-negotiated,
343  * then {rx,tx}_pause force the driver to use/not-use pause
344  * flow control.
345  */
349 };
350 
351 #define ETH_GSTRING_LEN 32
356  ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
358 };
359 
360 /* for passing string sets for data tagging */
362  __u32 cmd; /* ETHTOOL_GSTRINGS */
363  __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
364  __u32 len; /* number of strings in the string set */
365  __u8 data[0];
366 };
367 
369  __u32 cmd; /* ETHTOOL_GSSET_INFO */
371  __u64 sset_mask; /* input: each bit selects an sset to query */
372  /* output: each bit a returned sset */
373  __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits
374  in sset_mask. One bit implies one
375  __u32, two bits implies two
376  __u32's, etc. */
377 };
378 
391  ETH_TEST_FL_FAILED = (1 << 1),
394 };
395 
396 /* for requesting NIC test and getting results*/
397 struct ethtool_test {
398  __u32 cmd; /* ETHTOOL_TEST */
399  __u32 flags; /* ETH_TEST_FL_xxx */
401  __u32 len; /* result length, in number of u64 elements */
403 };
404 
405 /* for dumping NIC-specific statistics */
407  __u32 cmd; /* ETHTOOL_GSTATS */
408  __u32 n_stats; /* number of u64's being returned */
410 };
411 
413  __u32 cmd; /* ETHTOOL_GPERMADDR */
415  __u8 data[0];
416 };
417 
418 /* boolean flags controlling per-interface behavior characteristics.
419  * When reading, the flag indicates whether or not a certain behavior
420  * is enabled/present. When writing, the flag indicates whether
421  * or not the driver should turn on (set) or off (clear) a behavior.
422  *
423  * Some behaviors may read-only (unconditionally absent or present).
424  * If such is the case, return EINVAL in the set-flags operation if the
425  * flag differs from the read-only value.
426  */
428  ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
429  ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
430  ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
431  ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
432  ETH_FLAG_RXHASH = (1 << 28),
433 };
434 
435 /* The following structures are for supporting RX network flow
436  * classification and RX n-tuple configuration. Note, all multibyte
437  * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
438  * be in network byte order.
439  */
440 
457 };
458 
473 };
474 
475 #define ETH_RX_NFC_IP4 1
476 
493 };
494 
503  __u8 hdata[60];
504 };
505 
510 };
511 
535 };
536 
596 };
597 
598 
616 };
617 
636  union {
644  __u8 hdata[72];
645  } h_u, m_u;
646 
651 
653 #define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
654 #define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
655 };
656 
665 };
666 
667 #define ETHTOOL_FLASH_MAX_FILENAME 128
670 };
671 
672 /* for passing firmware flashing related parameters */
677 };
678 
694 #define ETH_FW_DUMP_DISABLE 0
695 
696 struct ethtool_dump {
701  __u8 data[0];
702 };
703 
704 /* for returning and changing feature sets */
705 
718 };
719 
731 };
732 
741 };
742 
753 };
754 
776 };
777 
778 /*
779  * %ETHTOOL_SFEATURES changes features present in features[].valid to the
780  * values of corresponding bits in features[].requested. Bits in .requested
781  * not set in .valid or not changeable are ignored.
782  *
783  * Returns %EINVAL when .valid contains undefined or never-changeable bits
784  * or size is not equal to required number of features words (32-bit blocks).
785  * Returns >= 0 if request was completed; bits set in the value mean:
786  * %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
787  * changeable (not present in %ETHTOOL_GFEATURES' features[].available)
788  * those bits were ignored.
789  * %ETHTOOL_F_WISH - some or all changes requested were recorded but the
790  * resulting state of bits masked by .valid is not equal to .requested.
791  * Probably there are other device-specific constraints on some features
792  * in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
793  * here as though ignored bits were cleared.
794  * %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
795  * compatibility functions. Requested offload state cannot be properly
796  * managed by kernel.
797  *
798  * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
799  * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
800  * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
801  * significant bit in features[0] fields. Empty strings mark undefined features.
802  */
807 };
808 
809 #define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
810 #define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
811 #define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
812 
813 
814 /* CMDs currently supported */
815 #define ETHTOOL_GSET 0x00000001 /* Get settings. */
816 #define ETHTOOL_SSET 0x00000002 /* Set settings. */
817 #define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
818 #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
819 #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
820 #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
821 #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
822 #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
823 #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
824 /* Get link status for host, i.e. whether the interface *and* the
825  * physical port (if there is one) are up (ethtool_value). */
826 #define ETHTOOL_GLINK 0x0000000a
827 #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
828 #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
829 #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
830 #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
831 #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
832 #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
833 #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
834 #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
835 #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
836 #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
837 #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
838 #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
839 #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
840  * (ethtool_value) */
841 #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
842  * (ethtool_value). */
843 #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
844 #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
845 #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
846 #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
847 #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
848 #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
849 #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
850 #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
851 #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
852 #define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
853 #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
854 #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
855 #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
856 #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
857 #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
859 #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
860 #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
861 #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */
862 #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */
863 #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */
864 #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */
865 #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */
866 #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
867 #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
868 #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
869 #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
870 #define ETHTOOL_RESET 0x00000034 /* Reset hardware */
871 #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
872 #define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
873 #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
874 #define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
875 #define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
877 #define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */
878 #define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
879 #define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
880 #define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */
881 #define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
882 #define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */
883 #define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
884 #define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
885 #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
886 #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
887 #define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
888 #define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
890 /* compatibility with older code */
891 #define SPARC_ETH_GSET ETHTOOL_GSET
892 #define SPARC_ETH_SSET ETHTOOL_SSET
894 /* Indicates what features are supported by the interface. */
895 #define SUPPORTED_10baseT_Half (1 << 0)
896 #define SUPPORTED_10baseT_Full (1 << 1)
897 #define SUPPORTED_100baseT_Half (1 << 2)
898 #define SUPPORTED_100baseT_Full (1 << 3)
899 #define SUPPORTED_1000baseT_Half (1 << 4)
900 #define SUPPORTED_1000baseT_Full (1 << 5)
901 #define SUPPORTED_Autoneg (1 << 6)
902 #define SUPPORTED_TP (1 << 7)
903 #define SUPPORTED_AUI (1 << 8)
904 #define SUPPORTED_MII (1 << 9)
905 #define SUPPORTED_FIBRE (1 << 10)
906 #define SUPPORTED_BNC (1 << 11)
907 #define SUPPORTED_10000baseT_Full (1 << 12)
908 #define SUPPORTED_Pause (1 << 13)
909 #define SUPPORTED_Asym_Pause (1 << 14)
910 #define SUPPORTED_2500baseX_Full (1 << 15)
911 #define SUPPORTED_Backplane (1 << 16)
912 #define SUPPORTED_1000baseKX_Full (1 << 17)
913 #define SUPPORTED_10000baseKX4_Full (1 << 18)
914 #define SUPPORTED_10000baseKR_Full (1 << 19)
915 #define SUPPORTED_10000baseR_FEC (1 << 20)
916 #define SUPPORTED_20000baseMLD2_Full (1 << 21)
917 #define SUPPORTED_20000baseKR2_Full (1 << 22)
918 #define SUPPORTED_40000baseKR4_Full (1 << 23)
919 #define SUPPORTED_40000baseCR4_Full (1 << 24)
920 #define SUPPORTED_40000baseSR4_Full (1 << 25)
921 #define SUPPORTED_40000baseLR4_Full (1 << 26)
923 /* Indicates what features are advertised by the interface. */
924 #define ADVERTISED_10baseT_Half (1 << 0)
925 #define ADVERTISED_10baseT_Full (1 << 1)
926 #define ADVERTISED_100baseT_Half (1 << 2)
927 #define ADVERTISED_100baseT_Full (1 << 3)
928 #define ADVERTISED_1000baseT_Half (1 << 4)
929 #define ADVERTISED_1000baseT_Full (1 << 5)
930 #define ADVERTISED_Autoneg (1 << 6)
931 #define ADVERTISED_TP (1 << 7)
932 #define ADVERTISED_AUI (1 << 8)
933 #define ADVERTISED_MII (1 << 9)
934 #define ADVERTISED_FIBRE (1 << 10)
935 #define ADVERTISED_BNC (1 << 11)
936 #define ADVERTISED_10000baseT_Full (1 << 12)
937 #define ADVERTISED_Pause (1 << 13)
938 #define ADVERTISED_Asym_Pause (1 << 14)
939 #define ADVERTISED_2500baseX_Full (1 << 15)
940 #define ADVERTISED_Backplane (1 << 16)
941 #define ADVERTISED_1000baseKX_Full (1 << 17)
942 #define ADVERTISED_10000baseKX4_Full (1 << 18)
943 #define ADVERTISED_10000baseKR_Full (1 << 19)
944 #define ADVERTISED_10000baseR_FEC (1 << 20)
945 #define ADVERTISED_20000baseMLD2_Full (1 << 21)
946 #define ADVERTISED_20000baseKR2_Full (1 << 22)
947 #define ADVERTISED_40000baseKR4_Full (1 << 23)
948 #define ADVERTISED_40000baseCR4_Full (1 << 24)
949 #define ADVERTISED_40000baseSR4_Full (1 << 25)
950 #define ADVERTISED_40000baseLR4_Full (1 << 26)
951 
952 /* The following are all involved in forcing a particular link
953  * mode for the device for setting things. When getting the
954  * devices settings, these indicate the current mode and whether
955  * it was forced up into this mode or autonegotiated.
956  */
958 /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
959 #define SPEED_10 10
960 #define SPEED_100 100
961 #define SPEED_1000 1000
962 #define SPEED_2500 2500
963 #define SPEED_10000 10000
964 #define SPEED_UNKNOWN -1
966 /* Duplex, half or full. */
967 #define DUPLEX_HALF 0x00
968 #define DUPLEX_FULL 0x01
969 #define DUPLEX_UNKNOWN 0xff
971 /* Which connector port. */
972 #define PORT_TP 0x00
973 #define PORT_AUI 0x01
974 #define PORT_MII 0x02
975 #define PORT_FIBRE 0x03
976 #define PORT_BNC 0x04
977 #define PORT_DA 0x05
978 #define PORT_NONE 0xef
979 #define PORT_OTHER 0xff
981 /* Which transceiver to use. */
982 #define XCVR_INTERNAL 0x00
983 #define XCVR_EXTERNAL 0x01
984 #define XCVR_DUMMY1 0x02
985 #define XCVR_DUMMY2 0x03
986 #define XCVR_DUMMY3 0x04
987 
988 /* Enable or disable autonegotiation. If this is set to enable,
989  * the forced link modes above are completely ignored.
990  */
991 #define AUTONEG_DISABLE 0x00
992 #define AUTONEG_ENABLE 0x01
993 
994 /* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
995  * the driver is required to renegotiate link
996  */
997 #define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
998 #define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
999 #define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
1000 #define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */
1002 /* Wake-On-Lan options. */
1003 #define WAKE_PHY (1 << 0)
1004 #define WAKE_UCAST (1 << 1)
1005 #define WAKE_MCAST (1 << 2)
1006 #define WAKE_BCAST (1 << 3)
1007 #define WAKE_ARP (1 << 4)
1008 #define WAKE_MAGIC (1 << 5)
1009 #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
1011 /* L2-L4 network traffic flow types */
1012 #define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
1013 #define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
1014 #define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
1015 #define AH_ESP_V4_FLOW 0x04 /* hash only */
1016 #define TCP_V6_FLOW 0x05 /* hash only */
1017 #define UDP_V6_FLOW 0x06 /* hash only */
1018 #define SCTP_V6_FLOW 0x07 /* hash only */
1019 #define AH_ESP_V6_FLOW 0x08 /* hash only */
1020 #define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
1021 #define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
1022 #define AH_V6_FLOW 0x0b /* hash only */
1023 #define ESP_V6_FLOW 0x0c /* hash only */
1024 #define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
1025 #define IPV4_FLOW 0x10 /* hash only */
1026 #define IPV6_FLOW 0x11 /* hash only */
1027 #define ETHER_FLOW 0x12 /* spec only (ether_spec) */
1028 /* Flag to enable additional fields in struct ethtool_rx_flow_spec */
1029 #define FLOW_EXT 0x80000000
1031 /* L3-L4 network traffic flow hash options */
1032 #define RXH_L2DA (1 << 1)
1033 #define RXH_VLAN (1 << 2)
1034 #define RXH_L3_PROTO (1 << 3)
1035 #define RXH_IP_SRC (1 << 4)
1036 #define RXH_IP_DST (1 << 5)
1037 #define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
1038 #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
1039 #define RXH_DISCARD (1 << 31)
1040 
1041 #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
1043 /* Special RX classification rule insert location values */
1044 #define RX_CLS_LOC_SPECIAL 0x80000000 /* flag */
1045 #define RX_CLS_LOC_ANY 0xffffffff
1046 #define RX_CLS_LOC_FIRST 0xfffffffe
1047 #define RX_CLS_LOC_LAST 0xfffffffd
1049 /* EEPROM Standards for plug in modules */
1050 #define ETH_MODULE_SFF_8079 0x1
1051 #define ETH_MODULE_SFF_8079_LEN 256
1052 #define ETH_MODULE_SFF_8472 0x2
1053 #define ETH_MODULE_SFF_8472_LEN 512
1054 
1055 /* Reset flags */
1056 /* The reset() operation must clear the flags for the components which
1057  * were actually reset. On successful return, the flags indicate the
1058  * components which were not reset, either because they do not exist
1059  * in the hardware or because they cannot be reset independently. The
1060  * driver must never reset any components that were not requested.
1061  */
1062 enum ethtool_reset_flags {
1063  /* These flags represent components dedicated to the interface
1064  * the command is addressed to. Shift any flag left by
1065  * ETH_RESET_SHARED_SHIFT to reset a shared component of the
1066  * same type.
1067  */
1068  ETH_RESET_MGMT = 1 << 0, /* Management processor */
1069  ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */
1070  ETH_RESET_DMA = 1 << 2, /* DMA engine */
1071  ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */
1072  ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */
1073  ETH_RESET_MAC = 1 << 5, /* Media access controller */
1074  ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
1075  ETH_RESET_RAM = 1 << 7, /* RAM shared between
1076  * multiple components */
1077 
1078  ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to
1079  * this interface */
1080  ETH_RESET_ALL = 0xffffffff, /* All components used by this
1081  * interface, even if shared */
1082 };
1083 #define ETH_RESET_SHARED_SHIFT 16
1084 
1085 #endif /* _UAPI_LINUX_ETHTOOL_H */