1/**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12#ifndef _LINUX_ETHTOOL_H 13#define _LINUX_ETHTOOL_H 14 15#include <linux/types.h> 16 17struct ethtool_cmd { 18 __u32 cmd; 19 __u32 supported; 20 __u32 advertising; 21 __u16 speed; 22 __u8 duplex; 23 __u8 port; 24 __u8 phy_address; 25 __u8 transceiver; 26 __u8 autoneg; 27 __u32 maxtxpkt; 28 __u32 maxrxpkt; 29 __u16 speed_hi; 30 __u16 reserved2; 31 __u32 reserved[3]; 32}; 33 34#define ETHTOOL_BUSINFO_LEN 32 35struct ethtool_drvinfo { 36 __u32 cmd; 37 char driver[32]; 38 char version[32]; 39 char fw_version[32]; 40 char bus_info[ETHTOOL_BUSINFO_LEN]; 41 char reserved1[32]; 42 char reserved2[12]; 43 __u32 n_priv_flags; 44 __u32 n_stats; 45 __u32 testinfo_len; 46 __u32 eedump_len; 47 __u32 regdump_len; 48}; 49 50#define SOPASS_MAX 6 51 52struct ethtool_wolinfo { 53 __u32 cmd; 54 __u32 supported; 55 __u32 wolopts; 56 __u8 sopass[SOPASS_MAX]; 57}; 58 59struct ethtool_value { 60 __u32 cmd; 61 __u32 data; 62}; 63 64struct ethtool_regs { 65 __u32 cmd; 66 __u32 version; 67 __u32 len; 68 __u8 data[0]; 69}; 70 71struct ethtool_eeprom { 72 __u32 cmd; 73 __u32 magic; 74 __u32 offset; 75 __u32 len; 76 __u8 data[0]; 77}; 78 79struct ethtool_coalesce { 80 __u32 cmd; 81 82 __u32 rx_coalesce_usecs; 83 84 __u32 rx_max_coalesced_frames; 85 86 __u32 rx_coalesce_usecs_irq; 87 __u32 rx_max_coalesced_frames_irq; 88 89 __u32 tx_coalesce_usecs; 90 91 __u32 tx_max_coalesced_frames; 92 93 __u32 tx_coalesce_usecs_irq; 94 __u32 tx_max_coalesced_frames_irq; 95 96 __u32 stats_block_coalesce_usecs; 97 98 __u32 use_adaptive_rx_coalesce; 99 __u32 use_adaptive_tx_coalesce; 100 101 __u32 pkt_rate_low; 102 __u32 rx_coalesce_usecs_low; 103 __u32 rx_max_coalesced_frames_low; 104 __u32 tx_coalesce_usecs_low; 105 __u32 tx_max_coalesced_frames_low; 106 107 __u32 pkt_rate_high; 108 __u32 rx_coalesce_usecs_high; 109 __u32 rx_max_coalesced_frames_high; 110 __u32 tx_coalesce_usecs_high; 111 __u32 tx_max_coalesced_frames_high; 112 113 __u32 rate_sample_interval; 114}; 115 116struct ethtool_ringparam { 117 __u32 cmd; 118 119 __u32 rx_max_pending; 120 __u32 rx_mini_max_pending; 121 __u32 rx_jumbo_max_pending; 122 __u32 tx_max_pending; 123 124 __u32 rx_pending; 125 __u32 rx_mini_pending; 126 __u32 rx_jumbo_pending; 127 __u32 tx_pending; 128}; 129 130struct ethtool_pauseparam { 131 __u32 cmd; 132 133 __u32 autoneg; 134 __u32 rx_pause; 135 __u32 tx_pause; 136}; 137 138#define ETH_GSTRING_LEN 32 139enum ethtool_stringset { 140 ETH_SS_TEST = 0, 141 ETH_SS_STATS, 142 ETH_SS_PRIV_FLAGS, 143}; 144 145struct ethtool_gstrings { 146 __u32 cmd; 147 __u32 string_set; 148 __u32 len; 149 __u8 data[0]; 150}; 151 152enum ethtool_test_flags { 153 ETH_TEST_FL_OFFLINE = (1 << 0), 154 ETH_TEST_FL_FAILED = (1 << 1), 155}; 156 157struct ethtool_test { 158 __u32 cmd; 159 __u32 flags; 160 __u32 reserved; 161 __u32 len; 162 __u64 data[0]; 163}; 164 165struct ethtool_stats { 166 __u32 cmd; 167 __u32 n_stats; 168 __u64 data[0]; 169}; 170 171struct ethtool_perm_addr { 172 __u32 cmd; 173 __u32 size; 174 __u8 data[0]; 175}; 176 177enum ethtool_flags { 178 ETH_FLAG_LRO = (1 << 15), 179}; 180 181struct ethtool_rxnfc { 182 __u32 cmd; 183 __u32 flow_type; 184 __u64 data; 185}; 186 187#define ETHTOOL_GSET 0x00000001 188#define ETHTOOL_SSET 0x00000002 189#define ETHTOOL_GDRVINFO 0x00000003 190#define ETHTOOL_GREGS 0x00000004 191#define ETHTOOL_GWOL 0x00000005 192#define ETHTOOL_SWOL 0x00000006 193#define ETHTOOL_GMSGLVL 0x00000007 194#define ETHTOOL_SMSGLVL 0x00000008 195#define ETHTOOL_NWAY_RST 0x00000009 196#define ETHTOOL_GLINK 0x0000000a 197#define ETHTOOL_GEEPROM 0x0000000b 198#define ETHTOOL_SEEPROM 0x0000000c 199#define ETHTOOL_GCOALESCE 0x0000000e 200#define ETHTOOL_SCOALESCE 0x0000000f 201#define ETHTOOL_GRINGPARAM 0x00000010 202#define ETHTOOL_SRINGPARAM 0x00000011 203#define ETHTOOL_GPAUSEPARAM 0x00000012 204#define ETHTOOL_SPAUSEPARAM 0x00000013 205#define ETHTOOL_GRXCSUM 0x00000014 206#define ETHTOOL_SRXCSUM 0x00000015 207#define ETHTOOL_GTXCSUM 0x00000016 208#define ETHTOOL_STXCSUM 0x00000017 209#define ETHTOOL_GSG 0x00000018 210#define ETHTOOL_SSG 0x00000019 211#define ETHTOOL_TEST 0x0000001a 212#define ETHTOOL_GSTRINGS 0x0000001b 213#define ETHTOOL_PHYS_ID 0x0000001c 214#define ETHTOOL_GSTATS 0x0000001d 215#define ETHTOOL_GTSO 0x0000001e 216#define ETHTOOL_STSO 0x0000001f 217#define ETHTOOL_GPERMADDR 0x00000020 218#define ETHTOOL_GUFO 0x00000021 219#define ETHTOOL_SUFO 0x00000022 220#define ETHTOOL_GGSO 0x00000023 221#define ETHTOOL_SGSO 0x00000024 222#define ETHTOOL_GFLAGS 0x00000025 223#define ETHTOOL_SFLAGS 0x00000026 224#define ETHTOOL_GPFLAGS 0x00000027 225#define ETHTOOL_SPFLAGS 0x00000028 226 227#define ETHTOOL_GRXFH 0x00000029 228#define ETHTOOL_SRXFH 0x0000002a 229#define ETHTOOL_GGRO 0x0000002b 230#define ETHTOOL_SGRO 0x0000002c 231 232#define SPARC_ETH_GSET ETHTOOL_GSET 233#define SPARC_ETH_SSET ETHTOOL_SSET 234 235#define SUPPORTED_10baseT_Half (1 << 0) 236#define SUPPORTED_10baseT_Full (1 << 1) 237#define SUPPORTED_100baseT_Half (1 << 2) 238#define SUPPORTED_100baseT_Full (1 << 3) 239#define SUPPORTED_1000baseT_Half (1 << 4) 240#define SUPPORTED_1000baseT_Full (1 << 5) 241#define SUPPORTED_Autoneg (1 << 6) 242#define SUPPORTED_TP (1 << 7) 243#define SUPPORTED_AUI (1 << 8) 244#define SUPPORTED_MII (1 << 9) 245#define SUPPORTED_FIBRE (1 << 10) 246#define SUPPORTED_BNC (1 << 11) 247#define SUPPORTED_10000baseT_Full (1 << 12) 248#define SUPPORTED_Pause (1 << 13) 249#define SUPPORTED_Asym_Pause (1 << 14) 250#define SUPPORTED_2500baseX_Full (1 << 15) 251 252#define ADVERTISED_10baseT_Half (1 << 0) 253#define ADVERTISED_10baseT_Full (1 << 1) 254#define ADVERTISED_100baseT_Half (1 << 2) 255#define ADVERTISED_100baseT_Full (1 << 3) 256#define ADVERTISED_1000baseT_Half (1 << 4) 257#define ADVERTISED_1000baseT_Full (1 << 5) 258#define ADVERTISED_Autoneg (1 << 6) 259#define ADVERTISED_TP (1 << 7) 260#define ADVERTISED_AUI (1 << 8) 261#define ADVERTISED_MII (1 << 9) 262#define ADVERTISED_FIBRE (1 << 10) 263#define ADVERTISED_BNC (1 << 11) 264#define ADVERTISED_10000baseT_Full (1 << 12) 265#define ADVERTISED_Pause (1 << 13) 266#define ADVERTISED_Asym_Pause (1 << 14) 267#define ADVERTISED_2500baseX_Full (1 << 15) 268 269#define SPEED_10 10 270#define SPEED_100 100 271#define SPEED_1000 1000 272#define SPEED_2500 2500 273#define SPEED_10000 10000 274 275#define DUPLEX_HALF 0x00 276#define DUPLEX_FULL 0x01 277 278#define PORT_TP 0x00 279#define PORT_AUI 0x01 280#define PORT_MII 0x02 281#define PORT_FIBRE 0x03 282#define PORT_BNC 0x04 283 284#define XCVR_INTERNAL 0x00 285#define XCVR_EXTERNAL 0x01 286#define XCVR_DUMMY1 0x02 287#define XCVR_DUMMY2 0x03 288#define XCVR_DUMMY3 0x04 289 290#define AUTONEG_DISABLE 0x00 291#define AUTONEG_ENABLE 0x01 292 293#define WAKE_PHY (1 << 0) 294#define WAKE_UCAST (1 << 1) 295#define WAKE_MCAST (1 << 2) 296#define WAKE_BCAST (1 << 3) 297#define WAKE_ARP (1 << 4) 298#define WAKE_MAGIC (1 << 5) 299#define WAKE_MAGICSECURE (1 << 6) 300 301#define TCP_V4_FLOW 0x01 302#define UDP_V4_FLOW 0x02 303#define SCTP_V4_FLOW 0x03 304#define AH_ESP_V4_FLOW 0x04 305#define TCP_V6_FLOW 0x05 306#define UDP_V6_FLOW 0x06 307#define SCTP_V6_FLOW 0x07 308#define AH_ESP_V6_FLOW 0x08 309 310#define RXH_DEV_PORT (1 << 0) 311#define RXH_L2DA (1 << 1) 312#define RXH_VLAN (1 << 2) 313#define RXH_L3_PROTO (1 << 3) 314#define RXH_IP_SRC (1 << 4) 315#define RXH_IP_DST (1 << 5) 316#define RXH_L4_B_0_1 (1 << 6) 317#define RXH_L4_B_2_3 (1 << 7) 318#define RXH_DISCARD (1 << 31) 319 320#endif 321 322