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 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _UAPI_LINUX_ETHTOOL_H 20 #define _UAPI_LINUX_ETHTOOL_H 21 #include <linux/kernel.h> 22 #include <linux/types.h> 23 #include <linux/if_ether.h> 24 #include <limits.h> 25 struct ethtool_cmd { 26 __u32 cmd; 27 __u32 supported; 28 __u32 advertising; 29 __u16 speed; 30 __u8 duplex; 31 __u8 port; 32 __u8 phy_address; 33 __u8 transceiver; 34 __u8 autoneg; 35 __u8 mdio_support; 36 __u32 maxtxpkt; 37 __u32 maxrxpkt; 38 __u16 speed_hi; 39 __u8 eth_tp_mdix; 40 __u8 eth_tp_mdix_ctrl; 41 __u32 lp_advertising; 42 __u32 reserved[2]; 43 }; 44 #define ETH_MDIO_SUPPORTS_C22 1 45 #define ETH_MDIO_SUPPORTS_C45 2 46 #define ETHTOOL_FWVERS_LEN 32 47 #define ETHTOOL_BUSINFO_LEN 32 48 #define ETHTOOL_EROMVERS_LEN 32 49 struct ethtool_drvinfo { 50 __u32 cmd; 51 char driver[32]; 52 char version[32]; 53 char fw_version[ETHTOOL_FWVERS_LEN]; 54 char bus_info[ETHTOOL_BUSINFO_LEN]; 55 char erom_version[ETHTOOL_EROMVERS_LEN]; 56 char reserved2[12]; 57 __u32 n_priv_flags; 58 __u32 n_stats; 59 __u32 testinfo_len; 60 __u32 eedump_len; 61 __u32 regdump_len; 62 }; 63 #define SOPASS_MAX 6 64 struct ethtool_wolinfo { 65 __u32 cmd; 66 __u32 supported; 67 __u32 wolopts; 68 __u8 sopass[SOPASS_MAX]; 69 }; 70 struct ethtool_value { 71 __u32 cmd; 72 __u32 data; 73 }; 74 #define PFC_STORM_PREVENTION_AUTO 0xffff 75 #define PFC_STORM_PREVENTION_DISABLE 0 76 enum tunable_id { 77 ETHTOOL_ID_UNSPEC, 78 ETHTOOL_RX_COPYBREAK, 79 ETHTOOL_TX_COPYBREAK, 80 ETHTOOL_PFC_PREVENTION_TOUT, 81 __ETHTOOL_TUNABLE_COUNT, 82 }; 83 enum tunable_type_id { 84 ETHTOOL_TUNABLE_UNSPEC, 85 ETHTOOL_TUNABLE_U8, 86 ETHTOOL_TUNABLE_U16, 87 ETHTOOL_TUNABLE_U32, 88 ETHTOOL_TUNABLE_U64, 89 ETHTOOL_TUNABLE_STRING, 90 ETHTOOL_TUNABLE_S8, 91 ETHTOOL_TUNABLE_S16, 92 ETHTOOL_TUNABLE_S32, 93 ETHTOOL_TUNABLE_S64, 94 }; 95 struct ethtool_tunable { 96 __u32 cmd; 97 __u32 id; 98 __u32 type_id; 99 __u32 len; 100 void * data[0]; 101 }; 102 #define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff 103 #define DOWNSHIFT_DEV_DISABLE 0 104 #define ETHTOOL_PHY_FAST_LINK_DOWN_ON 0 105 #define ETHTOOL_PHY_FAST_LINK_DOWN_OFF 0xff 106 #define ETHTOOL_PHY_EDPD_DFLT_TX_MSECS 0xffff 107 #define ETHTOOL_PHY_EDPD_NO_TX 0xfffe 108 #define ETHTOOL_PHY_EDPD_DISABLE 0 109 enum phy_tunable_id { 110 ETHTOOL_PHY_ID_UNSPEC, 111 ETHTOOL_PHY_DOWNSHIFT, 112 ETHTOOL_PHY_FAST_LINK_DOWN, 113 ETHTOOL_PHY_EDPD, 114 __ETHTOOL_PHY_TUNABLE_COUNT, 115 }; 116 struct ethtool_regs { 117 __u32 cmd; 118 __u32 version; 119 __u32 len; 120 __u8 data[0]; 121 }; 122 struct ethtool_eeprom { 123 __u32 cmd; 124 __u32 magic; 125 __u32 offset; 126 __u32 len; 127 __u8 data[0]; 128 }; 129 struct ethtool_eee { 130 __u32 cmd; 131 __u32 supported; 132 __u32 advertised; 133 __u32 lp_advertised; 134 __u32 eee_active; 135 __u32 eee_enabled; 136 __u32 tx_lpi_enabled; 137 __u32 tx_lpi_timer; 138 __u32 reserved[2]; 139 }; 140 struct ethtool_modinfo { 141 __u32 cmd; 142 __u32 type; 143 __u32 eeprom_len; 144 __u32 reserved[8]; 145 }; 146 struct ethtool_coalesce { 147 __u32 cmd; 148 __u32 rx_coalesce_usecs; 149 __u32 rx_max_coalesced_frames; 150 __u32 rx_coalesce_usecs_irq; 151 __u32 rx_max_coalesced_frames_irq; 152 __u32 tx_coalesce_usecs; 153 __u32 tx_max_coalesced_frames; 154 __u32 tx_coalesce_usecs_irq; 155 __u32 tx_max_coalesced_frames_irq; 156 __u32 stats_block_coalesce_usecs; 157 __u32 use_adaptive_rx_coalesce; 158 __u32 use_adaptive_tx_coalesce; 159 __u32 pkt_rate_low; 160 __u32 rx_coalesce_usecs_low; 161 __u32 rx_max_coalesced_frames_low; 162 __u32 tx_coalesce_usecs_low; 163 __u32 tx_max_coalesced_frames_low; 164 __u32 pkt_rate_high; 165 __u32 rx_coalesce_usecs_high; 166 __u32 rx_max_coalesced_frames_high; 167 __u32 tx_coalesce_usecs_high; 168 __u32 tx_max_coalesced_frames_high; 169 __u32 rate_sample_interval; 170 }; 171 struct ethtool_ringparam { 172 __u32 cmd; 173 __u32 rx_max_pending; 174 __u32 rx_mini_max_pending; 175 __u32 rx_jumbo_max_pending; 176 __u32 tx_max_pending; 177 __u32 rx_pending; 178 __u32 rx_mini_pending; 179 __u32 rx_jumbo_pending; 180 __u32 tx_pending; 181 }; 182 struct ethtool_channels { 183 __u32 cmd; 184 __u32 max_rx; 185 __u32 max_tx; 186 __u32 max_other; 187 __u32 max_combined; 188 __u32 rx_count; 189 __u32 tx_count; 190 __u32 other_count; 191 __u32 combined_count; 192 }; 193 struct ethtool_pauseparam { 194 __u32 cmd; 195 __u32 autoneg; 196 __u32 rx_pause; 197 __u32 tx_pause; 198 }; 199 #define ETH_GSTRING_LEN 32 200 enum ethtool_stringset { 201 ETH_SS_TEST = 0, 202 ETH_SS_STATS, 203 ETH_SS_PRIV_FLAGS, 204 ETH_SS_NTUPLE_FILTERS, 205 ETH_SS_FEATURES, 206 ETH_SS_RSS_HASH_FUNCS, 207 ETH_SS_TUNABLES, 208 ETH_SS_PHY_STATS, 209 ETH_SS_PHY_TUNABLES, 210 }; 211 struct ethtool_gstrings { 212 __u32 cmd; 213 __u32 string_set; 214 __u32 len; 215 __u8 data[0]; 216 }; 217 struct ethtool_sset_info { 218 __u32 cmd; 219 __u32 reserved; 220 __u64 sset_mask; 221 __u32 data[0]; 222 }; 223 enum ethtool_test_flags { 224 ETH_TEST_FL_OFFLINE = (1 << 0), 225 ETH_TEST_FL_FAILED = (1 << 1), 226 ETH_TEST_FL_EXTERNAL_LB = (1 << 2), 227 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3), 228 }; 229 struct ethtool_test { 230 __u32 cmd; 231 __u32 flags; 232 __u32 reserved; 233 __u32 len; 234 __u64 data[0]; 235 }; 236 struct ethtool_stats { 237 __u32 cmd; 238 __u32 n_stats; 239 __u64 data[0]; 240 }; 241 struct ethtool_perm_addr { 242 __u32 cmd; 243 __u32 size; 244 __u8 data[0]; 245 }; 246 enum ethtool_flags { 247 ETH_FLAG_TXVLAN = (1 << 7), 248 ETH_FLAG_RXVLAN = (1 << 8), 249 ETH_FLAG_LRO = (1 << 15), 250 ETH_FLAG_NTUPLE = (1 << 27), 251 ETH_FLAG_RXHASH = (1 << 28), 252 }; 253 struct ethtool_tcpip4_spec { 254 __be32 ip4src; 255 __be32 ip4dst; 256 __be16 psrc; 257 __be16 pdst; 258 __u8 tos; 259 }; 260 struct ethtool_ah_espip4_spec { 261 __be32 ip4src; 262 __be32 ip4dst; 263 __be32 spi; 264 __u8 tos; 265 }; 266 #define ETH_RX_NFC_IP4 1 267 struct ethtool_usrip4_spec { 268 __be32 ip4src; 269 __be32 ip4dst; 270 __be32 l4_4_bytes; 271 __u8 tos; 272 __u8 ip_ver; 273 __u8 proto; 274 }; 275 struct ethtool_tcpip6_spec { 276 __be32 ip6src[4]; 277 __be32 ip6dst[4]; 278 __be16 psrc; 279 __be16 pdst; 280 __u8 tclass; 281 }; 282 struct ethtool_ah_espip6_spec { 283 __be32 ip6src[4]; 284 __be32 ip6dst[4]; 285 __be32 spi; 286 __u8 tclass; 287 }; 288 struct ethtool_usrip6_spec { 289 __be32 ip6src[4]; 290 __be32 ip6dst[4]; 291 __be32 l4_4_bytes; 292 __u8 tclass; 293 __u8 l4_proto; 294 }; 295 union ethtool_flow_union { 296 struct ethtool_tcpip4_spec tcp_ip4_spec; 297 struct ethtool_tcpip4_spec udp_ip4_spec; 298 struct ethtool_tcpip4_spec sctp_ip4_spec; 299 struct ethtool_ah_espip4_spec ah_ip4_spec; 300 struct ethtool_ah_espip4_spec esp_ip4_spec; 301 struct ethtool_usrip4_spec usr_ip4_spec; 302 struct ethtool_tcpip6_spec tcp_ip6_spec; 303 struct ethtool_tcpip6_spec udp_ip6_spec; 304 struct ethtool_tcpip6_spec sctp_ip6_spec; 305 struct ethtool_ah_espip6_spec ah_ip6_spec; 306 struct ethtool_ah_espip6_spec esp_ip6_spec; 307 struct ethtool_usrip6_spec usr_ip6_spec; 308 struct ethhdr ether_spec; 309 __u8 hdata[52]; 310 }; 311 struct ethtool_flow_ext { 312 __u8 padding[2]; 313 unsigned char h_dest[ETH_ALEN]; 314 __be16 vlan_etype; 315 __be16 vlan_tci; 316 __be32 data[2]; 317 }; 318 struct ethtool_rx_flow_spec { 319 __u32 flow_type; 320 union ethtool_flow_union h_u; 321 struct ethtool_flow_ext h_ext; 322 union ethtool_flow_union m_u; 323 struct ethtool_flow_ext m_ext; 324 __u64 ring_cookie; 325 __u32 location; 326 }; 327 #define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL 328 #define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL 329 #define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32 330 struct ethtool_rxnfc { 331 __u32 cmd; 332 __u32 flow_type; 333 __u64 data; 334 struct ethtool_rx_flow_spec fs; 335 union { 336 __u32 rule_cnt; 337 __u32 rss_context; 338 }; 339 __u32 rule_locs[0]; 340 }; 341 struct ethtool_rxfh_indir { 342 __u32 cmd; 343 __u32 size; 344 __u32 ring_index[0]; 345 }; 346 struct ethtool_rxfh { 347 __u32 cmd; 348 __u32 rss_context; 349 __u32 indir_size; 350 __u32 key_size; 351 __u8 hfunc; 352 __u8 rsvd8[3]; 353 __u32 rsvd32; 354 __u32 rss_config[0]; 355 }; 356 #define ETH_RXFH_CONTEXT_ALLOC 0xffffffff 357 #define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff 358 struct ethtool_rx_ntuple_flow_spec { 359 __u32 flow_type; 360 union { 361 struct ethtool_tcpip4_spec tcp_ip4_spec; 362 struct ethtool_tcpip4_spec udp_ip4_spec; 363 struct ethtool_tcpip4_spec sctp_ip4_spec; 364 struct ethtool_ah_espip4_spec ah_ip4_spec; 365 struct ethtool_ah_espip4_spec esp_ip4_spec; 366 struct ethtool_usrip4_spec usr_ip4_spec; 367 struct ethhdr ether_spec; 368 __u8 hdata[72]; 369 } h_u, m_u; 370 __u16 vlan_tag; 371 __u16 vlan_tag_mask; 372 __u64 data; 373 __u64 data_mask; 374 __s32 action; 375 #define ETHTOOL_RXNTUPLE_ACTION_DROP (- 1) 376 #define ETHTOOL_RXNTUPLE_ACTION_CLEAR (- 2) 377 }; 378 struct ethtool_rx_ntuple { 379 __u32 cmd; 380 struct ethtool_rx_ntuple_flow_spec fs; 381 }; 382 #define ETHTOOL_FLASH_MAX_FILENAME 128 383 enum ethtool_flash_op_type { 384 ETHTOOL_FLASH_ALL_REGIONS = 0, 385 }; 386 struct ethtool_flash { 387 __u32 cmd; 388 __u32 region; 389 char data[ETHTOOL_FLASH_MAX_FILENAME]; 390 }; 391 struct ethtool_dump { 392 __u32 cmd; 393 __u32 version; 394 __u32 flag; 395 __u32 len; 396 __u8 data[0]; 397 }; 398 #define ETH_FW_DUMP_DISABLE 0 399 struct ethtool_get_features_block { 400 __u32 available; 401 __u32 requested; 402 __u32 active; 403 __u32 never_changed; 404 }; 405 struct ethtool_gfeatures { 406 __u32 cmd; 407 __u32 size; 408 struct ethtool_get_features_block features[0]; 409 }; 410 struct ethtool_set_features_block { 411 __u32 valid; 412 __u32 requested; 413 }; 414 struct ethtool_sfeatures { 415 __u32 cmd; 416 __u32 size; 417 struct ethtool_set_features_block features[0]; 418 }; 419 struct ethtool_ts_info { 420 __u32 cmd; 421 __u32 so_timestamping; 422 __s32 phc_index; 423 __u32 tx_types; 424 __u32 tx_reserved[3]; 425 __u32 rx_filters; 426 __u32 rx_reserved[3]; 427 }; 428 enum ethtool_sfeatures_retval_bits { 429 ETHTOOL_F_UNSUPPORTED__BIT, 430 ETHTOOL_F_WISH__BIT, 431 ETHTOOL_F_COMPAT__BIT, 432 }; 433 #define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT) 434 #define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT) 435 #define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT) 436 #define MAX_NUM_QUEUE 4096 437 struct ethtool_per_queue_op { 438 __u32 cmd; 439 __u32 sub_command; 440 __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)]; 441 char data[]; 442 }; 443 struct ethtool_fecparam { 444 __u32 cmd; 445 __u32 active_fec; 446 __u32 fec; 447 __u32 reserved; 448 }; 449 enum ethtool_fec_config_bits { 450 ETHTOOL_FEC_NONE_BIT, 451 ETHTOOL_FEC_AUTO_BIT, 452 ETHTOOL_FEC_OFF_BIT, 453 ETHTOOL_FEC_RS_BIT, 454 ETHTOOL_FEC_BASER_BIT, 455 }; 456 #define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT) 457 #define ETHTOOL_FEC_AUTO (1 << ETHTOOL_FEC_AUTO_BIT) 458 #define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT) 459 #define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT) 460 #define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT) 461 #define ETHTOOL_GSET 0x00000001 462 #define ETHTOOL_SSET 0x00000002 463 #define ETHTOOL_GDRVINFO 0x00000003 464 #define ETHTOOL_GREGS 0x00000004 465 #define ETHTOOL_GWOL 0x00000005 466 #define ETHTOOL_SWOL 0x00000006 467 #define ETHTOOL_GMSGLVL 0x00000007 468 #define ETHTOOL_SMSGLVL 0x00000008 469 #define ETHTOOL_NWAY_RST 0x00000009 470 #define ETHTOOL_GLINK 0x0000000a 471 #define ETHTOOL_GEEPROM 0x0000000b 472 #define ETHTOOL_SEEPROM 0x0000000c 473 #define ETHTOOL_GCOALESCE 0x0000000e 474 #define ETHTOOL_SCOALESCE 0x0000000f 475 #define ETHTOOL_GRINGPARAM 0x00000010 476 #define ETHTOOL_SRINGPARAM 0x00000011 477 #define ETHTOOL_GPAUSEPARAM 0x00000012 478 #define ETHTOOL_SPAUSEPARAM 0x00000013 479 #define ETHTOOL_GRXCSUM 0x00000014 480 #define ETHTOOL_SRXCSUM 0x00000015 481 #define ETHTOOL_GTXCSUM 0x00000016 482 #define ETHTOOL_STXCSUM 0x00000017 483 #define ETHTOOL_GSG 0x00000018 484 #define ETHTOOL_SSG 0x00000019 485 #define ETHTOOL_TEST 0x0000001a 486 #define ETHTOOL_GSTRINGS 0x0000001b 487 #define ETHTOOL_PHYS_ID 0x0000001c 488 #define ETHTOOL_GSTATS 0x0000001d 489 #define ETHTOOL_GTSO 0x0000001e 490 #define ETHTOOL_STSO 0x0000001f 491 #define ETHTOOL_GPERMADDR 0x00000020 492 #define ETHTOOL_GUFO 0x00000021 493 #define ETHTOOL_SUFO 0x00000022 494 #define ETHTOOL_GGSO 0x00000023 495 #define ETHTOOL_SGSO 0x00000024 496 #define ETHTOOL_GFLAGS 0x00000025 497 #define ETHTOOL_SFLAGS 0x00000026 498 #define ETHTOOL_GPFLAGS 0x00000027 499 #define ETHTOOL_SPFLAGS 0x00000028 500 #define ETHTOOL_GRXFH 0x00000029 501 #define ETHTOOL_SRXFH 0x0000002a 502 #define ETHTOOL_GGRO 0x0000002b 503 #define ETHTOOL_SGRO 0x0000002c 504 #define ETHTOOL_GRXRINGS 0x0000002d 505 #define ETHTOOL_GRXCLSRLCNT 0x0000002e 506 #define ETHTOOL_GRXCLSRULE 0x0000002f 507 #define ETHTOOL_GRXCLSRLALL 0x00000030 508 #define ETHTOOL_SRXCLSRLDEL 0x00000031 509 #define ETHTOOL_SRXCLSRLINS 0x00000032 510 #define ETHTOOL_FLASHDEV 0x00000033 511 #define ETHTOOL_RESET 0x00000034 512 #define ETHTOOL_SRXNTUPLE 0x00000035 513 #define ETHTOOL_GRXNTUPLE 0x00000036 514 #define ETHTOOL_GSSET_INFO 0x00000037 515 #define ETHTOOL_GRXFHINDIR 0x00000038 516 #define ETHTOOL_SRXFHINDIR 0x00000039 517 #define ETHTOOL_GFEATURES 0x0000003a 518 #define ETHTOOL_SFEATURES 0x0000003b 519 #define ETHTOOL_GCHANNELS 0x0000003c 520 #define ETHTOOL_SCHANNELS 0x0000003d 521 #define ETHTOOL_SET_DUMP 0x0000003e 522 #define ETHTOOL_GET_DUMP_FLAG 0x0000003f 523 #define ETHTOOL_GET_DUMP_DATA 0x00000040 524 #define ETHTOOL_GET_TS_INFO 0x00000041 525 #define ETHTOOL_GMODULEINFO 0x00000042 526 #define ETHTOOL_GMODULEEEPROM 0x00000043 527 #define ETHTOOL_GEEE 0x00000044 528 #define ETHTOOL_SEEE 0x00000045 529 #define ETHTOOL_GRSSH 0x00000046 530 #define ETHTOOL_SRSSH 0x00000047 531 #define ETHTOOL_GTUNABLE 0x00000048 532 #define ETHTOOL_STUNABLE 0x00000049 533 #define ETHTOOL_GPHYSTATS 0x0000004a 534 #define ETHTOOL_PERQUEUE 0x0000004b 535 #define ETHTOOL_GLINKSETTINGS 0x0000004c 536 #define ETHTOOL_SLINKSETTINGS 0x0000004d 537 #define ETHTOOL_PHY_GTUNABLE 0x0000004e 538 #define ETHTOOL_PHY_STUNABLE 0x0000004f 539 #define ETHTOOL_GFECPARAM 0x00000050 540 #define ETHTOOL_SFECPARAM 0x00000051 541 #define SPARC_ETH_GSET ETHTOOL_GSET 542 #define SPARC_ETH_SSET ETHTOOL_SSET 543 enum ethtool_link_mode_bit_indices { 544 ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0, 545 ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1, 546 ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2, 547 ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3, 548 ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4, 549 ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5, 550 ETHTOOL_LINK_MODE_Autoneg_BIT = 6, 551 ETHTOOL_LINK_MODE_TP_BIT = 7, 552 ETHTOOL_LINK_MODE_AUI_BIT = 8, 553 ETHTOOL_LINK_MODE_MII_BIT = 9, 554 ETHTOOL_LINK_MODE_FIBRE_BIT = 10, 555 ETHTOOL_LINK_MODE_BNC_BIT = 11, 556 ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12, 557 ETHTOOL_LINK_MODE_Pause_BIT = 13, 558 ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14, 559 ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15, 560 ETHTOOL_LINK_MODE_Backplane_BIT = 16, 561 ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17, 562 ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18, 563 ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19, 564 ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20, 565 ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21, 566 ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22, 567 ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23, 568 ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24, 569 ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25, 570 ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26, 571 ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27, 572 ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28, 573 ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29, 574 ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30, 575 ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31, 576 ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32, 577 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33, 578 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34, 579 ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35, 580 ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36, 581 ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37, 582 ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38, 583 ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39, 584 ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40, 585 ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41, 586 ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42, 587 ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43, 588 ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44, 589 ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45, 590 ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46, 591 ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47, 592 ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48, 593 ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49, 594 ETHTOOL_LINK_MODE_FEC_RS_BIT = 50, 595 ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51, 596 ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 52, 597 ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 53, 598 ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 54, 599 ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 55, 600 ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 56, 601 ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 57, 602 ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 58, 603 ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 59, 604 ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60, 605 ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 61, 606 ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 62, 607 ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 63, 608 ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64, 609 ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65, 610 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66, 611 ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 67, 612 ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 68, 613 ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 69, 614 ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 70, 615 ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71, 616 ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72, 617 ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73, 618 __ETHTOOL_LINK_MODE_MASK_NBITS 619 }; 620 #define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) (1UL << (ETHTOOL_LINK_MODE_ ##base_name ##_BIT)) 621 #define SUPPORTED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half) 622 #define SUPPORTED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full) 623 #define SUPPORTED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half) 624 #define SUPPORTED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full) 625 #define SUPPORTED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half) 626 #define SUPPORTED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full) 627 #define SUPPORTED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg) 628 #define SUPPORTED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP) 629 #define SUPPORTED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI) 630 #define SUPPORTED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII) 631 #define SUPPORTED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE) 632 #define SUPPORTED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC) 633 #define SUPPORTED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full) 634 #define SUPPORTED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause) 635 #define SUPPORTED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause) 636 #define SUPPORTED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full) 637 #define SUPPORTED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane) 638 #define SUPPORTED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full) 639 #define SUPPORTED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full) 640 #define SUPPORTED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full) 641 #define SUPPORTED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC) 642 #define SUPPORTED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full) 643 #define SUPPORTED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full) 644 #define SUPPORTED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full) 645 #define SUPPORTED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full) 646 #define SUPPORTED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full) 647 #define SUPPORTED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full) 648 #define SUPPORTED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full) 649 #define SUPPORTED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full) 650 #define SUPPORTED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full) 651 #define SUPPORTED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full) 652 #define ADVERTISED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half) 653 #define ADVERTISED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full) 654 #define ADVERTISED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half) 655 #define ADVERTISED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full) 656 #define ADVERTISED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half) 657 #define ADVERTISED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full) 658 #define ADVERTISED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg) 659 #define ADVERTISED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP) 660 #define ADVERTISED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI) 661 #define ADVERTISED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII) 662 #define ADVERTISED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE) 663 #define ADVERTISED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC) 664 #define ADVERTISED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full) 665 #define ADVERTISED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause) 666 #define ADVERTISED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause) 667 #define ADVERTISED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full) 668 #define ADVERTISED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane) 669 #define ADVERTISED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full) 670 #define ADVERTISED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full) 671 #define ADVERTISED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full) 672 #define ADVERTISED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC) 673 #define ADVERTISED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full) 674 #define ADVERTISED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full) 675 #define ADVERTISED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full) 676 #define ADVERTISED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full) 677 #define ADVERTISED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full) 678 #define ADVERTISED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full) 679 #define ADVERTISED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full) 680 #define ADVERTISED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full) 681 #define ADVERTISED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full) 682 #define ADVERTISED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full) 683 #define SPEED_10 10 684 #define SPEED_100 100 685 #define SPEED_1000 1000 686 #define SPEED_2500 2500 687 #define SPEED_5000 5000 688 #define SPEED_10000 10000 689 #define SPEED_14000 14000 690 #define SPEED_20000 20000 691 #define SPEED_25000 25000 692 #define SPEED_40000 40000 693 #define SPEED_50000 50000 694 #define SPEED_56000 56000 695 #define SPEED_100000 100000 696 #define SPEED_200000 200000 697 #define SPEED_400000 400000 698 #define SPEED_UNKNOWN - 1 699 #define DUPLEX_HALF 0x00 700 #define DUPLEX_FULL 0x01 701 #define DUPLEX_UNKNOWN 0xff 702 #define PORT_TP 0x00 703 #define PORT_AUI 0x01 704 #define PORT_MII 0x02 705 #define PORT_FIBRE 0x03 706 #define PORT_BNC 0x04 707 #define PORT_DA 0x05 708 #define PORT_NONE 0xef 709 #define PORT_OTHER 0xff 710 #define XCVR_INTERNAL 0x00 711 #define XCVR_EXTERNAL 0x01 712 #define XCVR_DUMMY1 0x02 713 #define XCVR_DUMMY2 0x03 714 #define XCVR_DUMMY3 0x04 715 #define AUTONEG_DISABLE 0x00 716 #define AUTONEG_ENABLE 0x01 717 #define ETH_TP_MDI_INVALID 0x00 718 #define ETH_TP_MDI 0x01 719 #define ETH_TP_MDI_X 0x02 720 #define ETH_TP_MDI_AUTO 0x03 721 #define WAKE_PHY (1 << 0) 722 #define WAKE_UCAST (1 << 1) 723 #define WAKE_MCAST (1 << 2) 724 #define WAKE_BCAST (1 << 3) 725 #define WAKE_ARP (1 << 4) 726 #define WAKE_MAGIC (1 << 5) 727 #define WAKE_MAGICSECURE (1 << 6) 728 #define WAKE_FILTER (1 << 7) 729 #define TCP_V4_FLOW 0x01 730 #define UDP_V4_FLOW 0x02 731 #define SCTP_V4_FLOW 0x03 732 #define AH_ESP_V4_FLOW 0x04 733 #define TCP_V6_FLOW 0x05 734 #define UDP_V6_FLOW 0x06 735 #define SCTP_V6_FLOW 0x07 736 #define AH_ESP_V6_FLOW 0x08 737 #define AH_V4_FLOW 0x09 738 #define ESP_V4_FLOW 0x0a 739 #define AH_V6_FLOW 0x0b 740 #define ESP_V6_FLOW 0x0c 741 #define IPV4_USER_FLOW 0x0d 742 #define IP_USER_FLOW IPV4_USER_FLOW 743 #define IPV6_USER_FLOW 0x0e 744 #define IPV4_FLOW 0x10 745 #define IPV6_FLOW 0x11 746 #define ETHER_FLOW 0x12 747 #define FLOW_EXT 0x80000000 748 #define FLOW_MAC_EXT 0x40000000 749 #define FLOW_RSS 0x20000000 750 #define RXH_L2DA (1 << 1) 751 #define RXH_VLAN (1 << 2) 752 #define RXH_L3_PROTO (1 << 3) 753 #define RXH_IP_SRC (1 << 4) 754 #define RXH_IP_DST (1 << 5) 755 #define RXH_L4_B_0_1 (1 << 6) 756 #define RXH_L4_B_2_3 (1 << 7) 757 #define RXH_DISCARD (1 << 31) 758 #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL 759 #define RX_CLS_FLOW_WAKE 0xfffffffffffffffeULL 760 #define RX_CLS_LOC_SPECIAL 0x80000000 761 #define RX_CLS_LOC_ANY 0xffffffff 762 #define RX_CLS_LOC_FIRST 0xfffffffe 763 #define RX_CLS_LOC_LAST 0xfffffffd 764 #define ETH_MODULE_SFF_8079 0x1 765 #define ETH_MODULE_SFF_8079_LEN 256 766 #define ETH_MODULE_SFF_8472 0x2 767 #define ETH_MODULE_SFF_8472_LEN 512 768 #define ETH_MODULE_SFF_8636 0x3 769 #define ETH_MODULE_SFF_8636_LEN 256 770 #define ETH_MODULE_SFF_8436 0x4 771 #define ETH_MODULE_SFF_8436_LEN 256 772 #define ETH_MODULE_SFF_8636_MAX_LEN 640 773 #define ETH_MODULE_SFF_8436_MAX_LEN 640 774 enum ethtool_reset_flags { 775 ETH_RESET_MGMT = 1 << 0, 776 ETH_RESET_IRQ = 1 << 1, 777 ETH_RESET_DMA = 1 << 2, 778 ETH_RESET_FILTER = 1 << 3, 779 ETH_RESET_OFFLOAD = 1 << 4, 780 ETH_RESET_MAC = 1 << 5, 781 ETH_RESET_PHY = 1 << 6, 782 ETH_RESET_RAM = 1 << 7, 783 ETH_RESET_AP = 1 << 8, 784 ETH_RESET_DEDICATED = 0x0000ffff, 785 ETH_RESET_ALL = 0xffffffff, 786 }; 787 #define ETH_RESET_SHARED_SHIFT 16 788 struct ethtool_link_settings { 789 __u32 cmd; 790 __u32 speed; 791 __u8 duplex; 792 __u8 port; 793 __u8 phy_address; 794 __u8 autoneg; 795 __u8 mdio_support; 796 __u8 eth_tp_mdix; 797 __u8 eth_tp_mdix_ctrl; 798 __s8 link_mode_masks_nwords; 799 __u8 transceiver; 800 __u8 reserved1[3]; 801 __u32 reserved[7]; 802 __u32 link_mode_masks[0]; 803 }; 804 #endif 805