aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-04-06 15:27:34 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-06 15:27:34 -0400
commit4c844d97d269a7ec4a6ba7d530aa876ac64dfb76 (patch)
tree67198ffbe0d8652f9a26548a7435f7514912a8cc /include/linux
parent66ee33bfda6237b009b6fb0e48690e31800ff334 (diff)
parentc5e129ac2fc72c119b85db79a629de66332f136d (diff)
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next-2.6
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ethtool.h180
1 files changed, 130 insertions, 50 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c8fcbdd2b0e7..c04d1316d221 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -663,6 +663,22 @@ struct ethtool_rx_ntuple_list {
663 unsigned int count; 663 unsigned int count;
664}; 664};
665 665
666/**
667 * enum ethtool_phys_id_state - indicator state for physical identification
668 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
669 * @ETHTOOL_ID_ACTIVE: Physical ID indicator should be activated
670 * @ETHTOOL_ID_ON: LED should be turned on (used iff %ETHTOOL_ID_ACTIVE
671 * is not supported)
672 * @ETHTOOL_ID_OFF: LED should be turned off (used iff %ETHTOOL_ID_ACTIVE
673 * is not supported)
674 */
675enum ethtool_phys_id_state {
676 ETHTOOL_ID_INACTIVE,
677 ETHTOOL_ID_ACTIVE,
678 ETHTOOL_ID_ON,
679 ETHTOOL_ID_OFF
680};
681
666struct net_device; 682struct net_device;
667 683
668/* Some generic methods drivers may use in their ethtool_ops */ 684/* Some generic methods drivers may use in their ethtool_ops */
@@ -683,63 +699,126 @@ void ethtool_ntuple_flush(struct net_device *dev);
683bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); 699bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
684 700
685/** 701/**
686 * &ethtool_ops - Alter and report network device settings 702 * struct ethtool_ops - optional netdev operations
687 * get_settings: Get device-specific settings 703 * @get_settings: Get various device settings including Ethernet link
688 * set_settings: Set device-specific settings 704 * settings. Returns a negative error code or zero.
689 * get_drvinfo: Report driver information 705 * @set_settings: Set various device settings including Ethernet link
690 * get_regs: Get device registers 706 * settings. Returns a negative error code or zero.
691 * get_wol: Report whether Wake-on-Lan is enabled 707 * @get_drvinfo: Report driver/device information. Should only set the
692 * set_wol: Turn Wake-on-Lan on or off 708 * @driver, @version, @fw_version and @bus_info fields. If not
693 * get_msglevel: Report driver message level 709 * implemented, the @driver and @bus_info fields will be filled in
694 * set_msglevel: Set driver message level 710 * according to the netdev's parent device.
695 * nway_reset: Restart autonegotiation 711 * @get_regs_len: Get buffer length required for @get_regs
696 * get_link: Get link status 712 * @get_regs: Get device registers
697 * get_eeprom: Read data from the device EEPROM 713 * @get_wol: Report whether Wake-on-Lan is enabled
698 * set_eeprom: Write data to the device EEPROM 714 * @set_wol: Turn Wake-on-Lan on or off. Returns a negative error code
699 * get_coalesce: Get interrupt coalescing parameters 715 * or zero.
700 * set_coalesce: Set interrupt coalescing parameters 716 * @get_msglevel: Report driver message level. This should be the value
701 * get_ringparam: Report ring sizes 717 * of the @msg_enable field used by netif logging functions.
702 * set_ringparam: Set ring sizes 718 * @set_msglevel: Set driver message level
703 * get_pauseparam: Report pause parameters 719 * @nway_reset: Restart autonegotiation. Returns a negative error code
704 * set_pauseparam: Set pause parameters 720 * or zero.
705 * get_rx_csum: Report whether receive checksums are turned on or off 721 * @get_link: Report whether physical link is up. Will only be called if
706 * set_rx_csum: Turn receive checksum on or off 722 * the netdev is up. Should usually be set to ethtool_op_get_link(),
707 * get_tx_csum: Report whether transmit checksums are turned on or off 723 * which uses netif_carrier_ok().
708 * set_tx_csum: Turn transmit checksums on or off 724 * @get_eeprom: Read data from the device EEPROM.
709 * get_sg: Report whether scatter-gather is enabled
710 * set_sg: Turn scatter-gather on or off
711 * get_tso: Report whether TCP segmentation offload is enabled
712 * set_tso: Turn TCP segmentation offload on or off
713 * get_ufo: Report whether UDP fragmentation offload is enabled
714 * set_ufo: Turn UDP fragmentation offload on or off
715 * self_test: Run specified self-tests
716 * get_strings: Return a set of strings that describe the requested objects
717 * phys_id: Identify the device
718 * get_stats: Return statistics about the device
719 * get_flags: get 32-bit flags bitmap
720 * set_flags: set 32-bit flags bitmap
721 *
722 * Description:
723 *
724 * get_settings:
725 * @get_settings is passed an &ethtool_cmd to fill in. It returns
726 * an negative errno or zero.
727 *
728 * set_settings:
729 * @set_settings is passed an &ethtool_cmd and should attempt to set
730 * all the settings this device supports. It may return an error value
731 * if something goes wrong (otherwise 0).
732 *
733 * get_eeprom:
734 * Should fill in the magic field. Don't need to check len for zero 725 * Should fill in the magic field. Don't need to check len for zero
735 * or wraparound. Fill in the data argument with the eeprom values 726 * or wraparound. Fill in the data argument with the eeprom values
736 * from offset to offset + len. Update len to the amount read. 727 * from offset to offset + len. Update len to the amount read.
737 * Returns an error or zero. 728 * Returns an error or zero.
738 * 729 * @set_eeprom: Write data to the device EEPROM.
739 * set_eeprom:
740 * Should validate the magic field. Don't need to check len for zero 730 * Should validate the magic field. Don't need to check len for zero
741 * or wraparound. Update len to the amount written. Returns an error 731 * or wraparound. Update len to the amount written. Returns an error
742 * or zero. 732 * or zero.
733 * @get_coalesce: Get interrupt coalescing parameters. Returns a negative
734 * error code or zero.
735 * @set_coalesce: Set interrupt coalescing parameters. Returns a negative
736 * error code or zero.
737 * @get_ringparam: Report ring sizes
738 * @set_ringparam: Set ring sizes. Returns a negative error code or zero.
739 * @get_pauseparam: Report pause parameters
740 * @set_pauseparam: Set pause parameters. Returns a negative error code
741 * or zero.
742 * @get_rx_csum: Deprecated in favour of the netdev feature %NETIF_F_RXCSUM.
743 * Report whether receive checksums are turned on or off.
744 * @set_rx_csum: Deprecated in favour of generic netdev features. Turn
745 * receive checksum on or off. Returns a negative error code or zero.
746 * @get_tx_csum: Deprecated as redundant. Report whether transmit checksums
747 * are turned on or off.
748 * @set_tx_csum: Deprecated in favour of generic netdev features. Turn
749 * transmit checksums on or off. Returns a egative error code or zero.
750 * @get_sg: Deprecated as redundant. Report whether scatter-gather is
751 * enabled.
752 * @set_sg: Deprecated in favour of generic netdev features. Turn
753 * scatter-gather on or off. Returns a negative error code or zero.
754 * @get_tso: Deprecated as redundant. Report whether TCP segmentation
755 * offload is enabled.
756 * @set_tso: Deprecated in favour of generic netdev features. Turn TCP
757 * segmentation offload on or off. Returns a negative error code or zero.
758 * @self_test: Run specified self-tests
759 * @get_strings: Return a set of strings that describe the requested objects
760 * @set_phys_id: Identify the physical devices, e.g. by flashing an LED
761 * attached to it. The implementation may update the indicator
762 * asynchronously or synchronously, but in either case it must return
763 * quickly. It is initially called with the argument %ETHTOOL_ID_ACTIVE,
764 * and must either activate asynchronous updates or return -%EINVAL.
765 * If it returns -%EINVAL then it will be called again at intervals with
766 * argument %ETHTOOL_ID_ON or %ETHTOOL_ID_OFF and should set the state of
767 * the indicator accordingly. Finally, it is called with the argument
768 * %ETHTOOL_ID_INACTIVE and must deactivate the indicator. Returns a
769 * negative error code or zero.
770 * @phys_id: Deprecated in favour of @set_phys_id.
771 * Identify the physical device, e.g. by flashing an LED
772 * attached to it until interrupted by a signal or the given time
773 * (in seconds) elapses. If the given time is zero, use a default
774 * time limit. Returns a negative error code or zero. Being
775 * interrupted by a signal is not an error.
776 * @get_ethtool_stats: Return extended statistics about the device.
777 * This is only useful if the device maintains statistics not
778 * included in &struct rtnl_link_stats64.
779 * @begin: Function to be called before any other operation. Returns a
780 * negative error code or zero.
781 * @complete: Function to be called after any other operation except
782 * @begin. Will be called even if the other operation failed.
783 * @get_ufo: Deprecated as redundant. Report whether UDP fragmentation
784 * offload is enabled.
785 * @set_ufo: Deprecated in favour of generic netdev features. Turn UDP
786 * fragmentation offload on or off. Returns a negative error code or zero.
787 * @get_flags: Deprecated as redundant. Report features included in
788 * &enum ethtool_flags that are enabled.
789 * @set_flags: Deprecated in favour of generic netdev features. Turn
790 * features included in &enum ethtool_flags on or off. Returns a
791 * negative error code or zero.
792 * @get_priv_flags: Report driver-specific feature flags.
793 * @set_priv_flags: Set driver-specific feature flags. Returns a negative
794 * error code or zero.
795 * @get_sset_count: Get number of strings that @get_strings will write.
796 * @get_rxnfc: Get RX flow classification rules. Returns a negative
797 * error code or zero.
798 * @set_rxnfc: Set RX flow classification rules. Returns a negative
799 * error code or zero.
800 * @flash_device: Write a firmware image to device's flash memory.
801 * Returns a negative error code or zero.
802 * @reset: Reset (part of) the device, as specified by a bitmask of
803 * flags from &enum ethtool_reset_flags. Returns a negative
804 * error code or zero.
805 * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code
806 * or zero.
807 * @get_rx_ntuple: Deprecated.
808 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
809 * Returns a negative error code or zero.
810 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
811 * Returns a negative error code or zero.
812 *
813 * All operations are optional (i.e. the function pointer may be set
814 * to %NULL) and callers must take this into account. Callers must
815 * hold the RTNL, except that for @get_drvinfo the caller may or may
816 * not hold the RTNL.
817 *
818 * See the structures used by these operations for further documentation.
819 *
820 * See &struct net_device and &struct net_device_ops for documentation
821 * of the generic netdev features interface.
743 */ 822 */
744struct ethtool_ops { 823struct ethtool_ops {
745 int (*get_settings)(struct net_device *, struct ethtool_cmd *); 824 int (*get_settings)(struct net_device *, struct ethtool_cmd *);
@@ -778,6 +857,7 @@ struct ethtool_ops {
778 int (*set_tso)(struct net_device *, u32); 857 int (*set_tso)(struct net_device *, u32);
779 void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); 858 void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
780 void (*get_strings)(struct net_device *, u32 stringset, u8 *); 859 void (*get_strings)(struct net_device *, u32 stringset, u8 *);
860 int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state);
781 int (*phys_id)(struct net_device *, u32); 861 int (*phys_id)(struct net_device *, u32);
782 void (*get_ethtool_stats)(struct net_device *, 862 void (*get_ethtool_stats)(struct net_device *,
783 struct ethtool_stats *, u64 *); 863 struct ethtool_stats *, u64 *);