diff options
-rw-r--r-- | include/linux/ethtool.h | 115 | ||||
-rw-r--r-- | net/core/ethtool.c | 141 |
2 files changed, 136 insertions, 120 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index b391969a0dd9..276b40a16835 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -491,12 +491,12 @@ void ethtool_ntuple_flush(struct net_device *dev); | |||
491 | * get_ufo: Report whether UDP fragmentation offload is enabled | 491 | * get_ufo: Report whether UDP fragmentation offload is enabled |
492 | * set_ufo: Turn UDP fragmentation offload on or off | 492 | * set_ufo: Turn UDP fragmentation offload on or off |
493 | * self_test: Run specified self-tests | 493 | * self_test: Run specified self-tests |
494 | * get_strings: Return a set of strings that describe the requested objects | 494 | * get_strings: Return a set of strings that describe the requested objects |
495 | * phys_id: Identify the device | 495 | * phys_id: Identify the device |
496 | * get_stats: Return statistics about the device | 496 | * get_stats: Return statistics about the device |
497 | * get_flags: get 32-bit flags bitmap | 497 | * get_flags: get 32-bit flags bitmap |
498 | * set_flags: set 32-bit flags bitmap | 498 | * set_flags: set 32-bit flags bitmap |
499 | * | 499 | * |
500 | * Description: | 500 | * Description: |
501 | * | 501 | * |
502 | * get_settings: | 502 | * get_settings: |
@@ -532,14 +532,20 @@ struct ethtool_ops { | |||
532 | int (*nway_reset)(struct net_device *); | 532 | int (*nway_reset)(struct net_device *); |
533 | u32 (*get_link)(struct net_device *); | 533 | u32 (*get_link)(struct net_device *); |
534 | int (*get_eeprom_len)(struct net_device *); | 534 | int (*get_eeprom_len)(struct net_device *); |
535 | int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); | 535 | int (*get_eeprom)(struct net_device *, |
536 | int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); | 536 | struct ethtool_eeprom *, u8 *); |
537 | int (*set_eeprom)(struct net_device *, | ||
538 | struct ethtool_eeprom *, u8 *); | ||
537 | int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); | 539 | int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); |
538 | int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); | 540 | int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); |
539 | void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *); | 541 | void (*get_ringparam)(struct net_device *, |
540 | int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *); | 542 | struct ethtool_ringparam *); |
541 | void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*); | 543 | int (*set_ringparam)(struct net_device *, |
542 | int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*); | 544 | struct ethtool_ringparam *); |
545 | void (*get_pauseparam)(struct net_device *, | ||
546 | struct ethtool_pauseparam*); | ||
547 | int (*set_pauseparam)(struct net_device *, | ||
548 | struct ethtool_pauseparam*); | ||
543 | u32 (*get_rx_csum)(struct net_device *); | 549 | u32 (*get_rx_csum)(struct net_device *); |
544 | int (*set_rx_csum)(struct net_device *, u32); | 550 | int (*set_rx_csum)(struct net_device *, u32); |
545 | u32 (*get_tx_csum)(struct net_device *); | 551 | u32 (*get_tx_csum)(struct net_device *); |
@@ -551,21 +557,24 @@ struct ethtool_ops { | |||
551 | void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); | 557 | void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); |
552 | void (*get_strings)(struct net_device *, u32 stringset, u8 *); | 558 | void (*get_strings)(struct net_device *, u32 stringset, u8 *); |
553 | int (*phys_id)(struct net_device *, u32); | 559 | int (*phys_id)(struct net_device *, u32); |
554 | void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); | 560 | void (*get_ethtool_stats)(struct net_device *, |
561 | struct ethtool_stats *, u64 *); | ||
555 | int (*begin)(struct net_device *); | 562 | int (*begin)(struct net_device *); |
556 | void (*complete)(struct net_device *); | 563 | void (*complete)(struct net_device *); |
557 | u32 (*get_ufo)(struct net_device *); | 564 | u32 (*get_ufo)(struct net_device *); |
558 | int (*set_ufo)(struct net_device *, u32); | 565 | int (*set_ufo)(struct net_device *, u32); |
559 | u32 (*get_flags)(struct net_device *); | 566 | u32 (*get_flags)(struct net_device *); |
560 | int (*set_flags)(struct net_device *, u32); | 567 | int (*set_flags)(struct net_device *, u32); |
561 | u32 (*get_priv_flags)(struct net_device *); | 568 | u32 (*get_priv_flags)(struct net_device *); |
562 | int (*set_priv_flags)(struct net_device *, u32); | 569 | int (*set_priv_flags)(struct net_device *, u32); |
563 | int (*get_sset_count)(struct net_device *, int); | 570 | int (*get_sset_count)(struct net_device *, int); |
564 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); | 571 | int (*get_rxnfc)(struct net_device *, |
572 | struct ethtool_rxnfc *, void *); | ||
565 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 573 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
566 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 574 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
567 | int (*reset)(struct net_device *, u32 *); | 575 | int (*reset)(struct net_device *, u32 *); |
568 | int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *); | 576 | int (*set_rx_ntuple)(struct net_device *, |
577 | struct ethtool_rx_ntuple *); | ||
569 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | 578 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); |
570 | }; | 579 | }; |
571 | #endif /* __KERNEL__ */ | 580 | #endif /* __KERNEL__ */ |
@@ -577,29 +586,29 @@ struct ethtool_ops { | |||
577 | #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */ | 586 | #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */ |
578 | #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */ | 587 | #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */ |
579 | #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */ | 588 | #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */ |
580 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ | 589 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ |
581 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ | 590 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ |
582 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ | 591 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ |
583 | #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ | 592 | #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ |
584 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ | 593 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ |
585 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ | 594 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ |
586 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ | 595 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ |
587 | #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */ | 596 | #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */ |
588 | #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */ | 597 | #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */ |
589 | #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */ | 598 | #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */ |
590 | #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */ | 599 | #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */ |
591 | #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */ | 600 | #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */ |
592 | #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */ | 601 | #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */ |
593 | #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */ | 602 | #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */ |
594 | #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */ | 603 | #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */ |
595 | #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */ | 604 | #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */ |
596 | #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable | 605 | #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable |
597 | * (ethtool_value) */ | 606 | * (ethtool_value) */ |
598 | #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable | 607 | #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable |
599 | * (ethtool_value). */ | 608 | * (ethtool_value). */ |
600 | #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */ | 609 | #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */ |
601 | #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */ | 610 | #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */ |
602 | #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */ | 611 | #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */ |
603 | #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ | 612 | #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ |
604 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ | 613 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ |
605 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ | 614 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ |
@@ -610,24 +619,24 @@ struct ethtool_ops { | |||
610 | #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ | 619 | #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ |
611 | #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */ | 620 | #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */ |
612 | #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */ | 621 | #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */ |
613 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ | 622 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ |
614 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ | 623 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ |
615 | 624 | ||
616 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ | 625 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ |
617 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ | 626 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ |
618 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ | 627 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ |
619 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ | 628 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ |
620 | #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */ | 629 | #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */ |
621 | #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */ | 630 | #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */ |
622 | #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */ | 631 | #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */ |
623 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ | 632 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ |
624 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ | 633 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ |
625 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | 634 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ |
626 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 635 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
627 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 636 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
628 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | 637 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ |
629 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | 638 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ |
630 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ | 639 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ |
631 | 640 | ||
632 | /* compatibility with older code */ | 641 | /* compatibility with older code */ |
633 | #define SPARC_ETH_GSET ETHTOOL_GSET | 642 | #define SPARC_ETH_GSET ETHTOOL_GSET |
@@ -636,18 +645,18 @@ struct ethtool_ops { | |||
636 | /* Indicates what features are supported by the interface. */ | 645 | /* Indicates what features are supported by the interface. */ |
637 | #define SUPPORTED_10baseT_Half (1 << 0) | 646 | #define SUPPORTED_10baseT_Half (1 << 0) |
638 | #define SUPPORTED_10baseT_Full (1 << 1) | 647 | #define SUPPORTED_10baseT_Full (1 << 1) |
639 | #define SUPPORTED_100baseT_Half (1 << 2) | 648 | #define SUPPORTED_100baseT_Half (1 << 2) |
640 | #define SUPPORTED_100baseT_Full (1 << 3) | 649 | #define SUPPORTED_100baseT_Full (1 << 3) |
641 | #define SUPPORTED_1000baseT_Half (1 << 4) | 650 | #define SUPPORTED_1000baseT_Half (1 << 4) |
642 | #define SUPPORTED_1000baseT_Full (1 << 5) | 651 | #define SUPPORTED_1000baseT_Full (1 << 5) |
643 | #define SUPPORTED_Autoneg (1 << 6) | 652 | #define SUPPORTED_Autoneg (1 << 6) |
644 | #define SUPPORTED_TP (1 << 7) | 653 | #define SUPPORTED_TP (1 << 7) |
645 | #define SUPPORTED_AUI (1 << 8) | 654 | #define SUPPORTED_AUI (1 << 8) |
646 | #define SUPPORTED_MII (1 << 9) | 655 | #define SUPPORTED_MII (1 << 9) |
647 | #define SUPPORTED_FIBRE (1 << 10) | 656 | #define SUPPORTED_FIBRE (1 << 10) |
648 | #define SUPPORTED_BNC (1 << 11) | 657 | #define SUPPORTED_BNC (1 << 11) |
649 | #define SUPPORTED_10000baseT_Full (1 << 12) | 658 | #define SUPPORTED_10000baseT_Full (1 << 12) |
650 | #define SUPPORTED_Pause (1 << 13) | 659 | #define SUPPORTED_Pause (1 << 13) |
651 | #define SUPPORTED_Asym_Pause (1 << 14) | 660 | #define SUPPORTED_Asym_Pause (1 << 14) |
652 | #define SUPPORTED_2500baseX_Full (1 << 15) | 661 | #define SUPPORTED_2500baseX_Full (1 << 15) |
653 | #define SUPPORTED_Backplane (1 << 16) | 662 | #define SUPPORTED_Backplane (1 << 16) |
@@ -657,8 +666,8 @@ struct ethtool_ops { | |||
657 | #define SUPPORTED_10000baseR_FEC (1 << 20) | 666 | #define SUPPORTED_10000baseR_FEC (1 << 20) |
658 | 667 | ||
659 | /* Indicates what features are advertised by the interface. */ | 668 | /* Indicates what features are advertised by the interface. */ |
660 | #define ADVERTISED_10baseT_Half (1 << 0) | 669 | #define ADVERTISED_10baseT_Half (1 << 0) |
661 | #define ADVERTISED_10baseT_Full (1 << 1) | 670 | #define ADVERTISED_10baseT_Full (1 << 1) |
662 | #define ADVERTISED_100baseT_Half (1 << 2) | 671 | #define ADVERTISED_100baseT_Half (1 << 2) |
663 | #define ADVERTISED_100baseT_Full (1 << 3) | 672 | #define ADVERTISED_100baseT_Full (1 << 3) |
664 | #define ADVERTISED_1000baseT_Half (1 << 4) | 673 | #define ADVERTISED_1000baseT_Half (1 << 4) |
@@ -697,12 +706,12 @@ struct ethtool_ops { | |||
697 | #define DUPLEX_FULL 0x01 | 706 | #define DUPLEX_FULL 0x01 |
698 | 707 | ||
699 | /* Which connector port. */ | 708 | /* Which connector port. */ |
700 | #define PORT_TP 0x00 | 709 | #define PORT_TP 0x00 |
701 | #define PORT_AUI 0x01 | 710 | #define PORT_AUI 0x01 |
702 | #define PORT_MII 0x02 | 711 | #define PORT_MII 0x02 |
703 | #define PORT_FIBRE 0x03 | 712 | #define PORT_FIBRE 0x03 |
704 | #define PORT_BNC 0x04 | 713 | #define PORT_BNC 0x04 |
705 | #define PORT_DA 0x05 | 714 | #define PORT_DA 0x05 |
706 | #define PORT_NONE 0xef | 715 | #define PORT_NONE 0xef |
707 | #define PORT_OTHER 0xff | 716 | #define PORT_OTHER 0xff |
708 | 717 | ||
@@ -716,7 +725,7 @@ struct ethtool_ops { | |||
716 | /* Enable or disable autonegotiation. If this is set to enable, | 725 | /* Enable or disable autonegotiation. If this is set to enable, |
717 | * the forced link modes above are completely ignored. | 726 | * the forced link modes above are completely ignored. |
718 | */ | 727 | */ |
719 | #define AUTONEG_DISABLE 0x00 | 728 | #define AUTONEG_DISABLE 0x00 |
720 | #define AUTONEG_ENABLE 0x01 | 729 | #define AUTONEG_ENABLE 0x01 |
721 | 730 | ||
722 | /* Mode MDI or MDI-X */ | 731 | /* Mode MDI or MDI-X */ |
@@ -747,8 +756,8 @@ struct ethtool_ops { | |||
747 | #define AH_V6_FLOW 0x0b | 756 | #define AH_V6_FLOW 0x0b |
748 | #define ESP_V6_FLOW 0x0c | 757 | #define ESP_V6_FLOW 0x0c |
749 | #define IP_USER_FLOW 0x0d | 758 | #define IP_USER_FLOW 0x0d |
750 | #define IPV4_FLOW 0x10 | 759 | #define IPV4_FLOW 0x10 |
751 | #define IPV6_FLOW 0x11 | 760 | #define IPV6_FLOW 0x11 |
752 | 761 | ||
753 | /* L3-L4 network traffic flow hash options */ | 762 | /* L3-L4 network traffic flow hash options */ |
754 | #define RXH_L2DA (1 << 1) | 763 | #define RXH_L2DA (1 << 1) |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 73c81edde8d9..99e9f850ea07 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/ethtool.h> | 18 | #include <linux/ethtool.h> |
19 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
20 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
21 | #include <asm/uaccess.h> | 21 | #include <linux/uaccess.h> |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * Some useful ethtool_ops methods that're device independent. | 24 | * Some useful ethtool_ops methods that're device independent. |
@@ -30,6 +30,7 @@ u32 ethtool_op_get_link(struct net_device *dev) | |||
30 | { | 30 | { |
31 | return netif_carrier_ok(dev) ? 1 : 0; | 31 | return netif_carrier_ok(dev) ? 1 : 0; |
32 | } | 32 | } |
33 | EXPORT_SYMBOL(ethtool_op_get_link); | ||
33 | 34 | ||
34 | u32 ethtool_op_get_rx_csum(struct net_device *dev) | 35 | u32 ethtool_op_get_rx_csum(struct net_device *dev) |
35 | { | 36 | { |
@@ -62,6 +63,7 @@ int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data) | |||
62 | 63 | ||
63 | return 0; | 64 | return 0; |
64 | } | 65 | } |
66 | EXPORT_SYMBOL(ethtool_op_set_tx_hw_csum); | ||
65 | 67 | ||
66 | int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data) | 68 | int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data) |
67 | { | 69 | { |
@@ -72,11 +74,13 @@ int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data) | |||
72 | 74 | ||
73 | return 0; | 75 | return 0; |
74 | } | 76 | } |
77 | EXPORT_SYMBOL(ethtool_op_set_tx_ipv6_csum); | ||
75 | 78 | ||
76 | u32 ethtool_op_get_sg(struct net_device *dev) | 79 | u32 ethtool_op_get_sg(struct net_device *dev) |
77 | { | 80 | { |
78 | return (dev->features & NETIF_F_SG) != 0; | 81 | return (dev->features & NETIF_F_SG) != 0; |
79 | } | 82 | } |
83 | EXPORT_SYMBOL(ethtool_op_get_sg); | ||
80 | 84 | ||
81 | int ethtool_op_set_sg(struct net_device *dev, u32 data) | 85 | int ethtool_op_set_sg(struct net_device *dev, u32 data) |
82 | { | 86 | { |
@@ -87,11 +91,13 @@ int ethtool_op_set_sg(struct net_device *dev, u32 data) | |||
87 | 91 | ||
88 | return 0; | 92 | return 0; |
89 | } | 93 | } |
94 | EXPORT_SYMBOL(ethtool_op_set_sg); | ||
90 | 95 | ||
91 | u32 ethtool_op_get_tso(struct net_device *dev) | 96 | u32 ethtool_op_get_tso(struct net_device *dev) |
92 | { | 97 | { |
93 | return (dev->features & NETIF_F_TSO) != 0; | 98 | return (dev->features & NETIF_F_TSO) != 0; |
94 | } | 99 | } |
100 | EXPORT_SYMBOL(ethtool_op_get_tso); | ||
95 | 101 | ||
96 | int ethtool_op_set_tso(struct net_device *dev, u32 data) | 102 | int ethtool_op_set_tso(struct net_device *dev, u32 data) |
97 | { | 103 | { |
@@ -102,11 +108,13 @@ int ethtool_op_set_tso(struct net_device *dev, u32 data) | |||
102 | 108 | ||
103 | return 0; | 109 | return 0; |
104 | } | 110 | } |
111 | EXPORT_SYMBOL(ethtool_op_set_tso); | ||
105 | 112 | ||
106 | u32 ethtool_op_get_ufo(struct net_device *dev) | 113 | u32 ethtool_op_get_ufo(struct net_device *dev) |
107 | { | 114 | { |
108 | return (dev->features & NETIF_F_UFO) != 0; | 115 | return (dev->features & NETIF_F_UFO) != 0; |
109 | } | 116 | } |
117 | EXPORT_SYMBOL(ethtool_op_get_ufo); | ||
110 | 118 | ||
111 | int ethtool_op_set_ufo(struct net_device *dev, u32 data) | 119 | int ethtool_op_set_ufo(struct net_device *dev, u32 data) |
112 | { | 120 | { |
@@ -116,6 +124,7 @@ int ethtool_op_set_ufo(struct net_device *dev, u32 data) | |||
116 | dev->features &= ~NETIF_F_UFO; | 124 | dev->features &= ~NETIF_F_UFO; |
117 | return 0; | 125 | return 0; |
118 | } | 126 | } |
127 | EXPORT_SYMBOL(ethtool_op_set_ufo); | ||
119 | 128 | ||
120 | /* the following list of flags are the same as their associated | 129 | /* the following list of flags are the same as their associated |
121 | * NETIF_F_xxx values in include/linux/netdevice.h | 130 | * NETIF_F_xxx values in include/linux/netdevice.h |
@@ -132,6 +141,7 @@ u32 ethtool_op_get_flags(struct net_device *dev) | |||
132 | 141 | ||
133 | return dev->features & flags_dup_features; | 142 | return dev->features & flags_dup_features; |
134 | } | 143 | } |
144 | EXPORT_SYMBOL(ethtool_op_get_flags); | ||
135 | 145 | ||
136 | int ethtool_op_set_flags(struct net_device *dev, u32 data) | 146 | int ethtool_op_set_flags(struct net_device *dev, u32 data) |
137 | { | 147 | { |
@@ -160,6 +170,7 @@ int ethtool_op_set_flags(struct net_device *dev, u32 data) | |||
160 | dev->features = features; | 170 | dev->features = features; |
161 | return 0; | 171 | return 0; |
162 | } | 172 | } |
173 | EXPORT_SYMBOL(ethtool_op_set_flags); | ||
163 | 174 | ||
164 | void ethtool_ntuple_flush(struct net_device *dev) | 175 | void ethtool_ntuple_flush(struct net_device *dev) |
165 | { | 176 | { |
@@ -205,7 +216,8 @@ static int ethtool_set_settings(struct net_device *dev, void __user *useraddr) | |||
205 | return dev->ethtool_ops->set_settings(dev, &cmd); | 216 | return dev->ethtool_ops->set_settings(dev, &cmd); |
206 | } | 217 | } |
207 | 218 | ||
208 | static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, void __user *useraddr) | 219 | static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, |
220 | void __user *useraddr) | ||
209 | { | 221 | { |
210 | struct ethtool_drvinfo info; | 222 | struct ethtool_drvinfo info; |
211 | const struct ethtool_ops *ops = dev->ethtool_ops; | 223 | const struct ethtool_ops *ops = dev->ethtool_ops; |
@@ -245,7 +257,7 @@ static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, void _ | |||
245 | } | 257 | } |
246 | 258 | ||
247 | static noinline_for_stack int ethtool_get_sset_info(struct net_device *dev, | 259 | static noinline_for_stack int ethtool_get_sset_info(struct net_device *dev, |
248 | void __user *useraddr) | 260 | void __user *useraddr) |
249 | { | 261 | { |
250 | struct ethtool_sset_info info; | 262 | struct ethtool_sset_info info; |
251 | const struct ethtool_ops *ops = dev->ethtool_ops; | 263 | const struct ethtool_ops *ops = dev->ethtool_ops; |
@@ -304,7 +316,8 @@ out: | |||
304 | return ret; | 316 | return ret; |
305 | } | 317 | } |
306 | 318 | ||
307 | static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, void __user *useraddr) | 319 | static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, |
320 | void __user *useraddr) | ||
308 | { | 321 | { |
309 | struct ethtool_rxnfc cmd; | 322 | struct ethtool_rxnfc cmd; |
310 | 323 | ||
@@ -317,7 +330,8 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, void __u | |||
317 | return dev->ethtool_ops->set_rxnfc(dev, &cmd); | 330 | return dev->ethtool_ops->set_rxnfc(dev, &cmd); |
318 | } | 331 | } |
319 | 332 | ||
320 | static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, void __user *useraddr) | 333 | static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, |
334 | void __user *useraddr) | ||
321 | { | 335 | { |
322 | struct ethtool_rxnfc info; | 336 | struct ethtool_rxnfc info; |
323 | const struct ethtool_ops *ops = dev->ethtool_ops; | 337 | const struct ethtool_ops *ops = dev->ethtool_ops; |
@@ -362,8 +376,8 @@ err_out: | |||
362 | } | 376 | } |
363 | 377 | ||
364 | static void __rx_ntuple_filter_add(struct ethtool_rx_ntuple_list *list, | 378 | static void __rx_ntuple_filter_add(struct ethtool_rx_ntuple_list *list, |
365 | struct ethtool_rx_ntuple_flow_spec *spec, | 379 | struct ethtool_rx_ntuple_flow_spec *spec, |
366 | struct ethtool_rx_ntuple_flow_spec_container *fsc) | 380 | struct ethtool_rx_ntuple_flow_spec_container *fsc) |
367 | { | 381 | { |
368 | 382 | ||
369 | /* don't add filters forever */ | 383 | /* don't add filters forever */ |
@@ -389,7 +403,8 @@ static void __rx_ntuple_filter_add(struct ethtool_rx_ntuple_list *list, | |||
389 | list->count++; | 403 | list->count++; |
390 | } | 404 | } |
391 | 405 | ||
392 | static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev, void __user *useraddr) | 406 | static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev, |
407 | void __user *useraddr) | ||
393 | { | 408 | { |
394 | struct ethtool_rx_ntuple cmd; | 409 | struct ethtool_rx_ntuple cmd; |
395 | const struct ethtool_ops *ops = dev->ethtool_ops; | 410 | const struct ethtool_ops *ops = dev->ethtool_ops; |
@@ -514,125 +529,125 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr) | |||
514 | case UDP_V4_FLOW: | 529 | case UDP_V4_FLOW: |
515 | case SCTP_V4_FLOW: | 530 | case SCTP_V4_FLOW: |
516 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 531 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
517 | fsc->fs.h_u.tcp_ip4_spec.ip4src); | 532 | fsc->fs.h_u.tcp_ip4_spec.ip4src); |
518 | p += ETH_GSTRING_LEN; | 533 | p += ETH_GSTRING_LEN; |
519 | num_strings++; | 534 | num_strings++; |
520 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 535 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
521 | fsc->fs.m_u.tcp_ip4_spec.ip4src); | 536 | fsc->fs.m_u.tcp_ip4_spec.ip4src); |
522 | p += ETH_GSTRING_LEN; | 537 | p += ETH_GSTRING_LEN; |
523 | num_strings++; | 538 | num_strings++; |
524 | sprintf(p, "\tDest IP addr: 0x%x\n", | 539 | sprintf(p, "\tDest IP addr: 0x%x\n", |
525 | fsc->fs.h_u.tcp_ip4_spec.ip4dst); | 540 | fsc->fs.h_u.tcp_ip4_spec.ip4dst); |
526 | p += ETH_GSTRING_LEN; | 541 | p += ETH_GSTRING_LEN; |
527 | num_strings++; | 542 | num_strings++; |
528 | sprintf(p, "\tDest IP mask: 0x%x\n", | 543 | sprintf(p, "\tDest IP mask: 0x%x\n", |
529 | fsc->fs.m_u.tcp_ip4_spec.ip4dst); | 544 | fsc->fs.m_u.tcp_ip4_spec.ip4dst); |
530 | p += ETH_GSTRING_LEN; | 545 | p += ETH_GSTRING_LEN; |
531 | num_strings++; | 546 | num_strings++; |
532 | sprintf(p, "\tSrc Port: %d, mask: 0x%x\n", | 547 | sprintf(p, "\tSrc Port: %d, mask: 0x%x\n", |
533 | fsc->fs.h_u.tcp_ip4_spec.psrc, | 548 | fsc->fs.h_u.tcp_ip4_spec.psrc, |
534 | fsc->fs.m_u.tcp_ip4_spec.psrc); | 549 | fsc->fs.m_u.tcp_ip4_spec.psrc); |
535 | p += ETH_GSTRING_LEN; | 550 | p += ETH_GSTRING_LEN; |
536 | num_strings++; | 551 | num_strings++; |
537 | sprintf(p, "\tDest Port: %d, mask: 0x%x\n", | 552 | sprintf(p, "\tDest Port: %d, mask: 0x%x\n", |
538 | fsc->fs.h_u.tcp_ip4_spec.pdst, | 553 | fsc->fs.h_u.tcp_ip4_spec.pdst, |
539 | fsc->fs.m_u.tcp_ip4_spec.pdst); | 554 | fsc->fs.m_u.tcp_ip4_spec.pdst); |
540 | p += ETH_GSTRING_LEN; | 555 | p += ETH_GSTRING_LEN; |
541 | num_strings++; | 556 | num_strings++; |
542 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", | 557 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", |
543 | fsc->fs.h_u.tcp_ip4_spec.tos, | 558 | fsc->fs.h_u.tcp_ip4_spec.tos, |
544 | fsc->fs.m_u.tcp_ip4_spec.tos); | 559 | fsc->fs.m_u.tcp_ip4_spec.tos); |
545 | p += ETH_GSTRING_LEN; | 560 | p += ETH_GSTRING_LEN; |
546 | num_strings++; | 561 | num_strings++; |
547 | break; | 562 | break; |
548 | case AH_ESP_V4_FLOW: | 563 | case AH_ESP_V4_FLOW: |
549 | case ESP_V4_FLOW: | 564 | case ESP_V4_FLOW: |
550 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 565 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
551 | fsc->fs.h_u.ah_ip4_spec.ip4src); | 566 | fsc->fs.h_u.ah_ip4_spec.ip4src); |
552 | p += ETH_GSTRING_LEN; | 567 | p += ETH_GSTRING_LEN; |
553 | num_strings++; | 568 | num_strings++; |
554 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 569 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
555 | fsc->fs.m_u.ah_ip4_spec.ip4src); | 570 | fsc->fs.m_u.ah_ip4_spec.ip4src); |
556 | p += ETH_GSTRING_LEN; | 571 | p += ETH_GSTRING_LEN; |
557 | num_strings++; | 572 | num_strings++; |
558 | sprintf(p, "\tDest IP addr: 0x%x\n", | 573 | sprintf(p, "\tDest IP addr: 0x%x\n", |
559 | fsc->fs.h_u.ah_ip4_spec.ip4dst); | 574 | fsc->fs.h_u.ah_ip4_spec.ip4dst); |
560 | p += ETH_GSTRING_LEN; | 575 | p += ETH_GSTRING_LEN; |
561 | num_strings++; | 576 | num_strings++; |
562 | sprintf(p, "\tDest IP mask: 0x%x\n", | 577 | sprintf(p, "\tDest IP mask: 0x%x\n", |
563 | fsc->fs.m_u.ah_ip4_spec.ip4dst); | 578 | fsc->fs.m_u.ah_ip4_spec.ip4dst); |
564 | p += ETH_GSTRING_LEN; | 579 | p += ETH_GSTRING_LEN; |
565 | num_strings++; | 580 | num_strings++; |
566 | sprintf(p, "\tSPI: %d, mask: 0x%x\n", | 581 | sprintf(p, "\tSPI: %d, mask: 0x%x\n", |
567 | fsc->fs.h_u.ah_ip4_spec.spi, | 582 | fsc->fs.h_u.ah_ip4_spec.spi, |
568 | fsc->fs.m_u.ah_ip4_spec.spi); | 583 | fsc->fs.m_u.ah_ip4_spec.spi); |
569 | p += ETH_GSTRING_LEN; | 584 | p += ETH_GSTRING_LEN; |
570 | num_strings++; | 585 | num_strings++; |
571 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", | 586 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", |
572 | fsc->fs.h_u.ah_ip4_spec.tos, | 587 | fsc->fs.h_u.ah_ip4_spec.tos, |
573 | fsc->fs.m_u.ah_ip4_spec.tos); | 588 | fsc->fs.m_u.ah_ip4_spec.tos); |
574 | p += ETH_GSTRING_LEN; | 589 | p += ETH_GSTRING_LEN; |
575 | num_strings++; | 590 | num_strings++; |
576 | break; | 591 | break; |
577 | case IP_USER_FLOW: | 592 | case IP_USER_FLOW: |
578 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 593 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
579 | fsc->fs.h_u.raw_ip4_spec.ip4src); | 594 | fsc->fs.h_u.raw_ip4_spec.ip4src); |
580 | p += ETH_GSTRING_LEN; | 595 | p += ETH_GSTRING_LEN; |
581 | num_strings++; | 596 | num_strings++; |
582 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 597 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
583 | fsc->fs.m_u.raw_ip4_spec.ip4src); | 598 | fsc->fs.m_u.raw_ip4_spec.ip4src); |
584 | p += ETH_GSTRING_LEN; | 599 | p += ETH_GSTRING_LEN; |
585 | num_strings++; | 600 | num_strings++; |
586 | sprintf(p, "\tDest IP addr: 0x%x\n", | 601 | sprintf(p, "\tDest IP addr: 0x%x\n", |
587 | fsc->fs.h_u.raw_ip4_spec.ip4dst); | 602 | fsc->fs.h_u.raw_ip4_spec.ip4dst); |
588 | p += ETH_GSTRING_LEN; | 603 | p += ETH_GSTRING_LEN; |
589 | num_strings++; | 604 | num_strings++; |
590 | sprintf(p, "\tDest IP mask: 0x%x\n", | 605 | sprintf(p, "\tDest IP mask: 0x%x\n", |
591 | fsc->fs.m_u.raw_ip4_spec.ip4dst); | 606 | fsc->fs.m_u.raw_ip4_spec.ip4dst); |
592 | p += ETH_GSTRING_LEN; | 607 | p += ETH_GSTRING_LEN; |
593 | num_strings++; | 608 | num_strings++; |
594 | break; | 609 | break; |
595 | case IPV4_FLOW: | 610 | case IPV4_FLOW: |
596 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 611 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
597 | fsc->fs.h_u.usr_ip4_spec.ip4src); | 612 | fsc->fs.h_u.usr_ip4_spec.ip4src); |
598 | p += ETH_GSTRING_LEN; | 613 | p += ETH_GSTRING_LEN; |
599 | num_strings++; | 614 | num_strings++; |
600 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 615 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
601 | fsc->fs.m_u.usr_ip4_spec.ip4src); | 616 | fsc->fs.m_u.usr_ip4_spec.ip4src); |
602 | p += ETH_GSTRING_LEN; | 617 | p += ETH_GSTRING_LEN; |
603 | num_strings++; | 618 | num_strings++; |
604 | sprintf(p, "\tDest IP addr: 0x%x\n", | 619 | sprintf(p, "\tDest IP addr: 0x%x\n", |
605 | fsc->fs.h_u.usr_ip4_spec.ip4dst); | 620 | fsc->fs.h_u.usr_ip4_spec.ip4dst); |
606 | p += ETH_GSTRING_LEN; | 621 | p += ETH_GSTRING_LEN; |
607 | num_strings++; | 622 | num_strings++; |
608 | sprintf(p, "\tDest IP mask: 0x%x\n", | 623 | sprintf(p, "\tDest IP mask: 0x%x\n", |
609 | fsc->fs.m_u.usr_ip4_spec.ip4dst); | 624 | fsc->fs.m_u.usr_ip4_spec.ip4dst); |
610 | p += ETH_GSTRING_LEN; | 625 | p += ETH_GSTRING_LEN; |
611 | num_strings++; | 626 | num_strings++; |
612 | sprintf(p, "\tL4 bytes: 0x%x, mask: 0x%x\n", | 627 | sprintf(p, "\tL4 bytes: 0x%x, mask: 0x%x\n", |
613 | fsc->fs.h_u.usr_ip4_spec.l4_4_bytes, | 628 | fsc->fs.h_u.usr_ip4_spec.l4_4_bytes, |
614 | fsc->fs.m_u.usr_ip4_spec.l4_4_bytes); | 629 | fsc->fs.m_u.usr_ip4_spec.l4_4_bytes); |
615 | p += ETH_GSTRING_LEN; | 630 | p += ETH_GSTRING_LEN; |
616 | num_strings++; | 631 | num_strings++; |
617 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", | 632 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", |
618 | fsc->fs.h_u.usr_ip4_spec.tos, | 633 | fsc->fs.h_u.usr_ip4_spec.tos, |
619 | fsc->fs.m_u.usr_ip4_spec.tos); | 634 | fsc->fs.m_u.usr_ip4_spec.tos); |
620 | p += ETH_GSTRING_LEN; | 635 | p += ETH_GSTRING_LEN; |
621 | num_strings++; | 636 | num_strings++; |
622 | sprintf(p, "\tIP Version: %d, mask: 0x%x\n", | 637 | sprintf(p, "\tIP Version: %d, mask: 0x%x\n", |
623 | fsc->fs.h_u.usr_ip4_spec.ip_ver, | 638 | fsc->fs.h_u.usr_ip4_spec.ip_ver, |
624 | fsc->fs.m_u.usr_ip4_spec.ip_ver); | 639 | fsc->fs.m_u.usr_ip4_spec.ip_ver); |
625 | p += ETH_GSTRING_LEN; | 640 | p += ETH_GSTRING_LEN; |
626 | num_strings++; | 641 | num_strings++; |
627 | sprintf(p, "\tProtocol: %d, mask: 0x%x\n", | 642 | sprintf(p, "\tProtocol: %d, mask: 0x%x\n", |
628 | fsc->fs.h_u.usr_ip4_spec.proto, | 643 | fsc->fs.h_u.usr_ip4_spec.proto, |
629 | fsc->fs.m_u.usr_ip4_spec.proto); | 644 | fsc->fs.m_u.usr_ip4_spec.proto); |
630 | p += ETH_GSTRING_LEN; | 645 | p += ETH_GSTRING_LEN; |
631 | num_strings++; | 646 | num_strings++; |
632 | break; | 647 | break; |
633 | }; | 648 | }; |
634 | sprintf(p, "\tVLAN: %d, mask: 0x%x\n", | 649 | sprintf(p, "\tVLAN: %d, mask: 0x%x\n", |
635 | fsc->fs.vlan_tag, fsc->fs.vlan_tag_mask); | 650 | fsc->fs.vlan_tag, fsc->fs.vlan_tag_mask); |
636 | p += ETH_GSTRING_LEN; | 651 | p += ETH_GSTRING_LEN; |
637 | num_strings++; | 652 | num_strings++; |
638 | sprintf(p, "\tUser-defined: 0x%Lx\n", fsc->fs.data); | 653 | sprintf(p, "\tUser-defined: 0x%Lx\n", fsc->fs.data); |
@@ -645,7 +660,7 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr) | |||
645 | sprintf(p, "\tAction: Drop\n"); | 660 | sprintf(p, "\tAction: Drop\n"); |
646 | else | 661 | else |
647 | sprintf(p, "\tAction: Direct to queue %d\n", | 662 | sprintf(p, "\tAction: Direct to queue %d\n", |
648 | fsc->fs.action); | 663 | fsc->fs.action); |
649 | p += ETH_GSTRING_LEN; | 664 | p += ETH_GSTRING_LEN; |
650 | num_strings++; | 665 | num_strings++; |
651 | unknown_filter: | 666 | unknown_filter: |
@@ -857,7 +872,8 @@ static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr) | |||
857 | return ret; | 872 | return ret; |
858 | } | 873 | } |
859 | 874 | ||
860 | static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr) | 875 | static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev, |
876 | void __user *useraddr) | ||
861 | { | 877 | { |
862 | struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; | 878 | struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; |
863 | 879 | ||
@@ -871,7 +887,8 @@ static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev, void | |||
871 | return 0; | 887 | return 0; |
872 | } | 888 | } |
873 | 889 | ||
874 | static noinline_for_stack int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr) | 890 | static noinline_for_stack int ethtool_set_coalesce(struct net_device *dev, |
891 | void __user *useraddr) | ||
875 | { | 892 | { |
876 | struct ethtool_coalesce coalesce; | 893 | struct ethtool_coalesce coalesce; |
877 | 894 | ||
@@ -975,6 +992,7 @@ static int ethtool_set_tx_csum(struct net_device *dev, char __user *useraddr) | |||
975 | 992 | ||
976 | return dev->ethtool_ops->set_tx_csum(dev, edata.data); | 993 | return dev->ethtool_ops->set_tx_csum(dev, edata.data); |
977 | } | 994 | } |
995 | EXPORT_SYMBOL(ethtool_op_set_tx_csum); | ||
978 | 996 | ||
979 | static int ethtool_set_rx_csum(struct net_device *dev, char __user *useraddr) | 997 | static int ethtool_set_rx_csum(struct net_device *dev, char __user *useraddr) |
980 | { | 998 | { |
@@ -1046,7 +1064,7 @@ static int ethtool_get_gso(struct net_device *dev, char __user *useraddr) | |||
1046 | 1064 | ||
1047 | edata.data = dev->features & NETIF_F_GSO; | 1065 | edata.data = dev->features & NETIF_F_GSO; |
1048 | if (copy_to_user(useraddr, &edata, sizeof(edata))) | 1066 | if (copy_to_user(useraddr, &edata, sizeof(edata))) |
1049 | return -EFAULT; | 1067 | return -EFAULT; |
1050 | return 0; | 1068 | return 0; |
1051 | } | 1069 | } |
1052 | 1070 | ||
@@ -1069,7 +1087,7 @@ static int ethtool_get_gro(struct net_device *dev, char __user *useraddr) | |||
1069 | 1087 | ||
1070 | edata.data = dev->features & NETIF_F_GRO; | 1088 | edata.data = dev->features & NETIF_F_GRO; |
1071 | if (copy_to_user(useraddr, &edata, sizeof(edata))) | 1089 | if (copy_to_user(useraddr, &edata, sizeof(edata))) |
1072 | return -EFAULT; | 1090 | return -EFAULT; |
1073 | return 0; | 1091 | return 0; |
1074 | } | 1092 | } |
1075 | 1093 | ||
@@ -1281,7 +1299,8 @@ static int ethtool_set_value(struct net_device *dev, char __user *useraddr, | |||
1281 | return actor(dev, edata.data); | 1299 | return actor(dev, edata.data); |
1282 | } | 1300 | } |
1283 | 1301 | ||
1284 | static noinline_for_stack int ethtool_flash_device(struct net_device *dev, char __user *useraddr) | 1302 | static noinline_for_stack int ethtool_flash_device(struct net_device *dev, |
1303 | char __user *useraddr) | ||
1285 | { | 1304 | { |
1286 | struct ethtool_flash efl; | 1305 | struct ethtool_flash efl; |
1287 | 1306 | ||
@@ -1310,11 +1329,11 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1310 | if (!dev->ethtool_ops) | 1329 | if (!dev->ethtool_ops) |
1311 | return -EOPNOTSUPP; | 1330 | return -EOPNOTSUPP; |
1312 | 1331 | ||
1313 | if (copy_from_user(ðcmd, useraddr, sizeof (ethcmd))) | 1332 | if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) |
1314 | return -EFAULT; | 1333 | return -EFAULT; |
1315 | 1334 | ||
1316 | /* Allow some commands to be done by anyone */ | 1335 | /* Allow some commands to be done by anyone */ |
1317 | switch(ethcmd) { | 1336 | switch (ethcmd) { |
1318 | case ETHTOOL_GDRVINFO: | 1337 | case ETHTOOL_GDRVINFO: |
1319 | case ETHTOOL_GMSGLVL: | 1338 | case ETHTOOL_GMSGLVL: |
1320 | case ETHTOOL_GCOALESCE: | 1339 | case ETHTOOL_GCOALESCE: |
@@ -1342,10 +1361,11 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1342 | return -EPERM; | 1361 | return -EPERM; |
1343 | } | 1362 | } |
1344 | 1363 | ||
1345 | if (dev->ethtool_ops->begin) | 1364 | if (dev->ethtool_ops->begin) { |
1346 | if ((rc = dev->ethtool_ops->begin(dev)) < 0) | 1365 | rc = dev->ethtool_ops->begin(dev); |
1366 | if (rc < 0) | ||
1347 | return rc; | 1367 | return rc; |
1348 | 1368 | } | |
1349 | old_features = dev->features; | 1369 | old_features = dev->features; |
1350 | 1370 | ||
1351 | switch (ethcmd) { | 1371 | switch (ethcmd) { |
@@ -1535,16 +1555,3 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1535 | 1555 | ||
1536 | return rc; | 1556 | return rc; |
1537 | } | 1557 | } |
1538 | |||
1539 | EXPORT_SYMBOL(ethtool_op_get_link); | ||
1540 | EXPORT_SYMBOL(ethtool_op_get_sg); | ||
1541 | EXPORT_SYMBOL(ethtool_op_get_tso); | ||
1542 | EXPORT_SYMBOL(ethtool_op_set_sg); | ||
1543 | EXPORT_SYMBOL(ethtool_op_set_tso); | ||
1544 | EXPORT_SYMBOL(ethtool_op_set_tx_csum); | ||
1545 | EXPORT_SYMBOL(ethtool_op_set_tx_hw_csum); | ||
1546 | EXPORT_SYMBOL(ethtool_op_set_tx_ipv6_csum); | ||
1547 | EXPORT_SYMBOL(ethtool_op_set_ufo); | ||
1548 | EXPORT_SYMBOL(ethtool_op_get_ufo); | ||
1549 | EXPORT_SYMBOL(ethtool_op_set_flags); | ||
1550 | EXPORT_SYMBOL(ethtool_op_get_flags); | ||