aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h69
1 files changed, 68 insertions, 1 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index f5647b59a90e..e17fa7140588 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -137,6 +137,23 @@ struct ethtool_eeprom {
137}; 137};
138 138
139/** 139/**
140 * struct ethtool_modinfo - plugin module eeprom information
141 * @cmd: %ETHTOOL_GMODULEINFO
142 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
143 * @eeprom_len: Length of the eeprom
144 *
145 * This structure is used to return the information to
146 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
147 * The type code indicates the eeprom data format
148 */
149struct ethtool_modinfo {
150 __u32 cmd;
151 __u32 type;
152 __u32 eeprom_len;
153 __u32 reserved[8];
154};
155
156/**
140 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates 157 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
141 * @cmd: ETHTOOL_{G,S}COALESCE 158 * @cmd: ETHTOOL_{G,S}COALESCE
142 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after 159 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
@@ -661,12 +678,17 @@ struct ethtool_flash {
661 * %ETHTOOL_SET_DUMP 678 * %ETHTOOL_SET_DUMP
662 * @version: FW version of the dump, filled in by driver 679 * @version: FW version of the dump, filled in by driver
663 * @flag: driver dependent flag for dump setting, filled in by driver during 680 * @flag: driver dependent flag for dump setting, filled in by driver during
664 * get and filled in by ethtool for set operation 681 * get and filled in by ethtool for set operation.
682 * flag must be initialized by macro ETH_FW_DUMP_DISABLE value when
683 * firmware dump is disabled.
665 * @len: length of dump data, used as the length of the user buffer on entry to 684 * @len: length of dump data, used as the length of the user buffer on entry to
666 * %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver 685 * %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver
667 * for %ETHTOOL_GET_DUMP_FLAG command 686 * for %ETHTOOL_GET_DUMP_FLAG command
668 * @data: data collected for get dump data operation 687 * @data: data collected for get dump data operation
669 */ 688 */
689
690#define ETH_FW_DUMP_DISABLE 0
691
670struct ethtool_dump { 692struct ethtool_dump {
671 __u32 cmd; 693 __u32 cmd;
672 __u32 version; 694 __u32 version;
@@ -726,6 +748,29 @@ struct ethtool_sfeatures {
726 struct ethtool_set_features_block features[0]; 748 struct ethtool_set_features_block features[0];
727}; 749};
728 750
751/**
752 * struct ethtool_ts_info - holds a device's timestamping and PHC association
753 * @cmd: command number = %ETHTOOL_GET_TS_INFO
754 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
755 * @phc_index: device index of the associated PHC, or -1 if there is none
756 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
757 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
758 *
759 * The bits in the 'tx_types' and 'rx_filters' fields correspond to
760 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
761 * respectively. For example, if the device supports HWTSTAMP_TX_ON,
762 * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
763 */
764struct ethtool_ts_info {
765 __u32 cmd;
766 __u32 so_timestamping;
767 __s32 phc_index;
768 __u32 tx_types;
769 __u32 tx_reserved[3];
770 __u32 rx_filters;
771 __u32 rx_reserved[3];
772};
773
729/* 774/*
730 * %ETHTOOL_SFEATURES changes features present in features[].valid to the 775 * %ETHTOOL_SFEATURES changes features present in features[].valid to the
731 * values of corresponding bits in features[].requested. Bits in .requested 776 * values of corresponding bits in features[].requested. Bits in .requested
@@ -788,6 +833,7 @@ struct net_device;
788 833
789/* Some generic methods drivers may use in their ethtool_ops */ 834/* Some generic methods drivers may use in their ethtool_ops */
790u32 ethtool_op_get_link(struct net_device *dev); 835u32 ethtool_op_get_link(struct net_device *dev);
836int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti);
791 837
792/** 838/**
793 * ethtool_rxfh_indir_default - get default value for RX flow hash indirection 839 * ethtool_rxfh_indir_default - get default value for RX flow hash indirection
@@ -893,6 +939,12 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
893 * and flag of the device. 939 * and flag of the device.
894 * @get_dump_data: Get dump data. 940 * @get_dump_data: Get dump data.
895 * @set_dump: Set dump specific flags to the device. 941 * @set_dump: Set dump specific flags to the device.
942 * @get_ts_info: Get the time stamping and PTP hardware clock capabilities.
943 * Drivers supporting transmit time stamps in software should set this to
944 * ethtool_op_get_ts_info().
945 * @get_module_info: Get the size and type of the eeprom contained within
946 * a plug-in module.
947 * @get_module_eeprom: Get the eeprom information from the plug-in module
896 * 948 *
897 * All operations are optional (i.e. the function pointer may be set 949 * All operations are optional (i.e. the function pointer may be set
898 * to %NULL) and callers must take this into account. Callers must 950 * to %NULL) and callers must take this into account. Callers must
@@ -954,6 +1006,12 @@ struct ethtool_ops {
954 int (*get_dump_data)(struct net_device *, 1006 int (*get_dump_data)(struct net_device *,
955 struct ethtool_dump *, void *); 1007 struct ethtool_dump *, void *);
956 int (*set_dump)(struct net_device *, struct ethtool_dump *); 1008 int (*set_dump)(struct net_device *, struct ethtool_dump *);
1009 int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *);
1010 int (*get_module_info)(struct net_device *,
1011 struct ethtool_modinfo *);
1012 int (*get_module_eeprom)(struct net_device *,
1013 struct ethtool_eeprom *, u8 *);
1014
957 1015
958}; 1016};
959#endif /* __KERNEL__ */ 1017#endif /* __KERNEL__ */
@@ -1028,6 +1086,9 @@ struct ethtool_ops {
1028#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */ 1086#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
1029#define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */ 1087#define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */
1030#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */ 1088#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
1089#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
1090#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
1091#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
1031 1092
1032/* compatibility with older code */ 1093/* compatibility with older code */
1033#define SPARC_ETH_GSET ETHTOOL_GSET 1094#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -1177,6 +1238,12 @@ struct ethtool_ops {
1177#define RX_CLS_LOC_FIRST 0xfffffffe 1238#define RX_CLS_LOC_FIRST 0xfffffffe
1178#define RX_CLS_LOC_LAST 0xfffffffd 1239#define RX_CLS_LOC_LAST 0xfffffffd
1179 1240
1241/* EEPROM Standards for plug in modules */
1242#define ETH_MODULE_SFF_8079 0x1
1243#define ETH_MODULE_SFF_8079_LEN 256
1244#define ETH_MODULE_SFF_8472 0x2
1245#define ETH_MODULE_SFF_8472_LEN 512
1246
1180/* Reset flags */ 1247/* Reset flags */
1181/* The reset() operation must clear the flags for the components which 1248/* The reset() operation must clear the flags for the components which
1182 * were actually reset. On successful return, the flags indicate the 1249 * were actually reset. On successful return, the flags indicate the