diff options
| author | Michal Marek <mmarek@suse.cz> | 2010-10-27 18:15:57 -0400 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.cz> | 2010-10-27 18:15:57 -0400 |
| commit | b74b953b998bcc2db91b694446f3a2619ec32de6 (patch) | |
| tree | 6ce24caabd730f6ae9287ed0676ec32e6ff31e9d /include/linux/ethtool.h | |
| parent | abb438526201c6a79949ad45375c051b6681c253 (diff) | |
| parent | f6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff) | |
Merge commit 'v2.6.36' into kbuild/misc
Update to be able to fix a recent change to scripts/basic/docproc.c
(commit eda603f).
Diffstat (limited to 'include/linux/ethtool.h')
| -rw-r--r-- | include/linux/ethtool.h | 156 |
1 files changed, 126 insertions, 30 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ef4a2d84d922..991269e5b152 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -61,6 +61,13 @@ struct ethtool_drvinfo { | |||
| 61 | /* For PCI devices, use pci_name(pci_dev). */ | 61 | /* For PCI devices, use pci_name(pci_dev). */ |
| 62 | char reserved1[32]; | 62 | char reserved1[32]; |
| 63 | char reserved2[12]; | 63 | char reserved2[12]; |
| 64 | /* | ||
| 65 | * Some struct members below are filled in | ||
| 66 | * using ops->get_sset_count(). Obtaining | ||
| 67 | * this info from ethtool_drvinfo is now | ||
| 68 | * deprecated; Use ETHTOOL_GSSET_INFO | ||
| 69 | * instead. | ||
| 70 | */ | ||
| 64 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ | 71 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ |
| 65 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ | 72 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ |
| 66 | __u32 testinfo_len; | 73 | __u32 testinfo_len; |
| @@ -242,6 +249,7 @@ enum ethtool_stringset { | |||
| 242 | ETH_SS_TEST = 0, | 249 | ETH_SS_TEST = 0, |
| 243 | ETH_SS_STATS, | 250 | ETH_SS_STATS, |
| 244 | ETH_SS_PRIV_FLAGS, | 251 | ETH_SS_PRIV_FLAGS, |
| 252 | ETH_SS_NTUPLE_FILTERS, | ||
| 245 | }; | 253 | }; |
| 246 | 254 | ||
| 247 | /* for passing string sets for data tagging */ | 255 | /* for passing string sets for data tagging */ |
| @@ -252,6 +260,17 @@ struct ethtool_gstrings { | |||
| 252 | __u8 data[0]; | 260 | __u8 data[0]; |
| 253 | }; | 261 | }; |
| 254 | 262 | ||
| 263 | struct ethtool_sset_info { | ||
| 264 | __u32 cmd; /* ETHTOOL_GSSET_INFO */ | ||
| 265 | __u32 reserved; | ||
| 266 | __u64 sset_mask; /* input: each bit selects an sset to query */ | ||
| 267 | /* output: each bit a returned sset */ | ||
| 268 | __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits | ||
| 269 | in sset_mask. One bit implies one | ||
| 270 | __u32, two bits implies two | ||
| 271 | __u32's, etc. */ | ||
| 272 | }; | ||
| 273 | |||
| 255 | enum ethtool_test_flags { | 274 | enum ethtool_test_flags { |
| 256 | ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ | 275 | ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ |
| 257 | ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ | 276 | ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ |
| @@ -290,6 +309,8 @@ struct ethtool_perm_addr { | |||
| 290 | */ | 309 | */ |
| 291 | enum ethtool_flags { | 310 | enum ethtool_flags { |
| 292 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 311 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
| 312 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ | ||
| 313 | ETH_FLAG_RXHASH = (1 << 28), | ||
| 293 | }; | 314 | }; |
| 294 | 315 | ||
| 295 | /* The following structures are for supporting RX network flow | 316 | /* The following structures are for supporting RX network flow |
| @@ -358,11 +379,51 @@ struct ethtool_rxnfc { | |||
| 358 | __u32 flow_type; | 379 | __u32 flow_type; |
| 359 | /* The rx flow hash value or the rule DB size */ | 380 | /* The rx flow hash value or the rule DB size */ |
| 360 | __u64 data; | 381 | __u64 data; |
| 382 | /* The following fields are not valid and must not be used for | ||
| 383 | * the ETHTOOL_{G,X}RXFH commands. */ | ||
| 361 | struct ethtool_rx_flow_spec fs; | 384 | struct ethtool_rx_flow_spec fs; |
| 362 | __u32 rule_cnt; | 385 | __u32 rule_cnt; |
| 363 | __u32 rule_locs[0]; | 386 | __u32 rule_locs[0]; |
| 364 | }; | 387 | }; |
| 365 | 388 | ||
| 389 | struct ethtool_rxfh_indir { | ||
| 390 | __u32 cmd; | ||
| 391 | /* On entry, this is the array size of the user buffer. On | ||
| 392 | * return from ETHTOOL_GRXFHINDIR, this is the array size of | ||
| 393 | * the hardware indirection table. */ | ||
| 394 | __u32 size; | ||
| 395 | __u32 ring_index[0]; /* ring/queue index for each hash value */ | ||
| 396 | }; | ||
| 397 | |||
| 398 | struct ethtool_rx_ntuple_flow_spec { | ||
| 399 | __u32 flow_type; | ||
| 400 | union { | ||
| 401 | struct ethtool_tcpip4_spec tcp_ip4_spec; | ||
| 402 | struct ethtool_tcpip4_spec udp_ip4_spec; | ||
| 403 | struct ethtool_tcpip4_spec sctp_ip4_spec; | ||
| 404 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
| 405 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
| 406 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
| 407 | struct ethtool_ether_spec ether_spec; | ||
| 408 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
| 409 | __u8 hdata[64]; | ||
| 410 | } h_u, m_u; /* entry, mask */ | ||
| 411 | |||
| 412 | __u16 vlan_tag; | ||
| 413 | __u16 vlan_tag_mask; | ||
| 414 | __u64 data; /* user-defined flow spec data */ | ||
| 415 | __u64 data_mask; /* user-defined flow spec mask */ | ||
| 416 | |||
| 417 | /* signed to distinguish between queue and actions (DROP) */ | ||
| 418 | __s32 action; | ||
| 419 | #define ETHTOOL_RXNTUPLE_ACTION_DROP -1 | ||
| 420 | }; | ||
| 421 | |||
| 422 | struct ethtool_rx_ntuple { | ||
| 423 | __u32 cmd; | ||
| 424 | struct ethtool_rx_ntuple_flow_spec fs; | ||
| 425 | }; | ||
| 426 | |||
| 366 | #define ETHTOOL_FLASH_MAX_FILENAME 128 | 427 | #define ETHTOOL_FLASH_MAX_FILENAME 128 |
| 367 | enum ethtool_flash_op_type { | 428 | enum ethtool_flash_op_type { |
| 368 | ETHTOOL_FLASH_ALL_REGIONS = 0, | 429 | ETHTOOL_FLASH_ALL_REGIONS = 0, |
| @@ -377,6 +438,20 @@ struct ethtool_flash { | |||
| 377 | 438 | ||
| 378 | #ifdef __KERNEL__ | 439 | #ifdef __KERNEL__ |
| 379 | 440 | ||
| 441 | #include <linux/rculist.h> | ||
| 442 | |||
| 443 | struct ethtool_rx_ntuple_flow_spec_container { | ||
| 444 | struct ethtool_rx_ntuple_flow_spec fs; | ||
| 445 | struct list_head list; | ||
| 446 | }; | ||
| 447 | |||
| 448 | struct ethtool_rx_ntuple_list { | ||
| 449 | #define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024 | ||
| 450 | #define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14 | ||
| 451 | struct list_head list; | ||
| 452 | unsigned int count; | ||
| 453 | }; | ||
| 454 | |||
| 380 | struct net_device; | 455 | struct net_device; |
| 381 | 456 | ||
| 382 | /* Some generic methods drivers may use in their ethtool_ops */ | 457 | /* Some generic methods drivers may use in their ethtool_ops */ |
| @@ -393,7 +468,8 @@ int ethtool_op_set_tso(struct net_device *dev, u32 data); | |||
| 393 | u32 ethtool_op_get_ufo(struct net_device *dev); | 468 | u32 ethtool_op_get_ufo(struct net_device *dev); |
| 394 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 469 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
| 395 | u32 ethtool_op_get_flags(struct net_device *dev); | 470 | u32 ethtool_op_get_flags(struct net_device *dev); |
| 396 | int ethtool_op_set_flags(struct net_device *dev, u32 data); | 471 | int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported); |
| 472 | void ethtool_ntuple_flush(struct net_device *dev); | ||
| 397 | 473 | ||
| 398 | /** | 474 | /** |
| 399 | * ðtool_ops - Alter and report network device settings | 475 | * ðtool_ops - Alter and report network device settings |
| @@ -426,12 +502,12 @@ int ethtool_op_set_flags(struct net_device *dev, u32 data); | |||
| 426 | * get_ufo: Report whether UDP fragmentation offload is enabled | 502 | * get_ufo: Report whether UDP fragmentation offload is enabled |
| 427 | * set_ufo: Turn UDP fragmentation offload on or off | 503 | * set_ufo: Turn UDP fragmentation offload on or off |
| 428 | * self_test: Run specified self-tests | 504 | * self_test: Run specified self-tests |
| 429 | * get_strings: Return a set of strings that describe the requested objects | 505 | * get_strings: Return a set of strings that describe the requested objects |
| 430 | * phys_id: Identify the device | 506 | * phys_id: Identify the device |
| 431 | * get_stats: Return statistics about the device | 507 | * get_stats: Return statistics about the device |
| 432 | * get_flags: get 32-bit flags bitmap | 508 | * get_flags: get 32-bit flags bitmap |
| 433 | * set_flags: set 32-bit flags bitmap | 509 | * set_flags: set 32-bit flags bitmap |
| 434 | * | 510 | * |
| 435 | * Description: | 511 | * Description: |
| 436 | * | 512 | * |
| 437 | * get_settings: | 513 | * get_settings: |
| @@ -467,14 +543,20 @@ struct ethtool_ops { | |||
| 467 | int (*nway_reset)(struct net_device *); | 543 | int (*nway_reset)(struct net_device *); |
| 468 | u32 (*get_link)(struct net_device *); | 544 | u32 (*get_link)(struct net_device *); |
| 469 | int (*get_eeprom_len)(struct net_device *); | 545 | int (*get_eeprom_len)(struct net_device *); |
| 470 | int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); | 546 | int (*get_eeprom)(struct net_device *, |
| 471 | int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); | 547 | struct ethtool_eeprom *, u8 *); |
| 548 | int (*set_eeprom)(struct net_device *, | ||
| 549 | struct ethtool_eeprom *, u8 *); | ||
| 472 | int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); | 550 | int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); |
| 473 | int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); | 551 | int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); |
| 474 | void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *); | 552 | void (*get_ringparam)(struct net_device *, |
| 475 | int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *); | 553 | struct ethtool_ringparam *); |
| 476 | void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*); | 554 | int (*set_ringparam)(struct net_device *, |
| 477 | int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*); | 555 | struct ethtool_ringparam *); |
| 556 | void (*get_pauseparam)(struct net_device *, | ||
| 557 | struct ethtool_pauseparam*); | ||
| 558 | int (*set_pauseparam)(struct net_device *, | ||
| 559 | struct ethtool_pauseparam*); | ||
| 478 | u32 (*get_rx_csum)(struct net_device *); | 560 | u32 (*get_rx_csum)(struct net_device *); |
| 479 | int (*set_rx_csum)(struct net_device *, u32); | 561 | int (*set_rx_csum)(struct net_device *, u32); |
| 480 | u32 (*get_tx_csum)(struct net_device *); | 562 | u32 (*get_tx_csum)(struct net_device *); |
| @@ -486,20 +568,29 @@ struct ethtool_ops { | |||
| 486 | void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); | 568 | void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); |
| 487 | void (*get_strings)(struct net_device *, u32 stringset, u8 *); | 569 | void (*get_strings)(struct net_device *, u32 stringset, u8 *); |
| 488 | int (*phys_id)(struct net_device *, u32); | 570 | int (*phys_id)(struct net_device *, u32); |
| 489 | void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); | 571 | void (*get_ethtool_stats)(struct net_device *, |
| 572 | struct ethtool_stats *, u64 *); | ||
| 490 | int (*begin)(struct net_device *); | 573 | int (*begin)(struct net_device *); |
| 491 | void (*complete)(struct net_device *); | 574 | void (*complete)(struct net_device *); |
| 492 | u32 (*get_ufo)(struct net_device *); | 575 | u32 (*get_ufo)(struct net_device *); |
| 493 | int (*set_ufo)(struct net_device *, u32); | 576 | int (*set_ufo)(struct net_device *, u32); |
| 494 | u32 (*get_flags)(struct net_device *); | 577 | u32 (*get_flags)(struct net_device *); |
| 495 | int (*set_flags)(struct net_device *, u32); | 578 | int (*set_flags)(struct net_device *, u32); |
| 496 | u32 (*get_priv_flags)(struct net_device *); | 579 | u32 (*get_priv_flags)(struct net_device *); |
| 497 | int (*set_priv_flags)(struct net_device *, u32); | 580 | int (*set_priv_flags)(struct net_device *, u32); |
| 498 | int (*get_sset_count)(struct net_device *, int); | 581 | int (*get_sset_count)(struct net_device *, int); |
| 499 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); | 582 | int (*get_rxnfc)(struct net_device *, |
| 583 | struct ethtool_rxnfc *, void *); | ||
| 500 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 584 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
| 501 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 585 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
| 502 | int (*reset)(struct net_device *, u32 *); | 586 | int (*reset)(struct net_device *, u32 *); |
| 587 | int (*set_rx_ntuple)(struct net_device *, | ||
| 588 | struct ethtool_rx_ntuple *); | ||
| 589 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | ||
| 590 | int (*get_rxfh_indir)(struct net_device *, | ||
| 591 | struct ethtool_rxfh_indir *); | ||
| 592 | int (*set_rxfh_indir)(struct net_device *, | ||
| 593 | const struct ethtool_rxfh_indir *); | ||
| 503 | }; | 594 | }; |
| 504 | #endif /* __KERNEL__ */ | 595 | #endif /* __KERNEL__ */ |
| 505 | 596 | ||
| @@ -546,18 +637,23 @@ struct ethtool_ops { | |||
| 546 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ | 637 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ |
| 547 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ | 638 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ |
| 548 | 639 | ||
| 549 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ | 640 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ |
| 550 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ | 641 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ |
| 551 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ | 642 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ |
| 552 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ | 643 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ |
| 553 | #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */ | 644 | #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */ |
| 554 | #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */ | 645 | #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */ |
| 555 | #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */ | 646 | #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */ |
| 556 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ | 647 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ |
| 557 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ | 648 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ |
| 558 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | 649 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ |
| 559 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 650 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
| 560 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 651 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
| 652 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | ||
| 653 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | ||
| 654 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ | ||
| 655 | #define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */ | ||
| 656 | #define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */ | ||
| 561 | 657 | ||
| 562 | /* compatibility with older code */ | 658 | /* compatibility with older code */ |
| 563 | #define SPARC_ETH_GSET ETHTOOL_GSET | 659 | #define SPARC_ETH_GSET ETHTOOL_GSET |
| @@ -677,8 +773,8 @@ struct ethtool_ops { | |||
| 677 | #define AH_V6_FLOW 0x0b | 773 | #define AH_V6_FLOW 0x0b |
| 678 | #define ESP_V6_FLOW 0x0c | 774 | #define ESP_V6_FLOW 0x0c |
| 679 | #define IP_USER_FLOW 0x0d | 775 | #define IP_USER_FLOW 0x0d |
| 680 | #define IPV4_FLOW 0x10 | 776 | #define IPV4_FLOW 0x10 |
| 681 | #define IPV6_FLOW 0x11 | 777 | #define IPV6_FLOW 0x11 |
| 682 | 778 | ||
| 683 | /* L3-L4 network traffic flow hash options */ | 779 | /* L3-L4 network traffic flow hash options */ |
| 684 | #define RXH_L2DA (1 << 1) | 780 | #define RXH_L2DA (1 << 1) |
