diff options
author | Yuval Mintz <yuvalmin@broadcom.com> | 2012-06-06 13:13:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-07 16:18:54 -0400 |
commit | 80f12eccce775dc6bb93dba9b52529740f929237 (patch) | |
tree | 128d6e76e0140a6df12540b23adf0cc00c71f13a /include/linux/ethtool.h | |
parent | 94b6042cfed02229b05e04002ab00085b60f8213 (diff) |
Added kernel support in EEE Ethtool commands
This patch extends the kernel's ethtool interface by adding support
for 2 new EEE commands - get_eee and set_eee.
Thanks goes to Giuseppe Cavallaro for his original patch adding this support.
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r-- | include/linux/ethtool.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index e17fa714058..297370a6cb1 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -137,6 +137,35 @@ struct ethtool_eeprom { | |||
137 | }; | 137 | }; |
138 | 138 | ||
139 | /** | 139 | /** |
140 | * struct ethtool_eee - Energy Efficient Ethernet information | ||
141 | * @cmd: ETHTOOL_{G,S}EEE | ||
142 | * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations | ||
143 | * for which there is EEE support. | ||
144 | * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations | ||
145 | * advertised as eee capable. | ||
146 | * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex | ||
147 | * combinations advertised by the link partner as eee capable. | ||
148 | * @eee_active: Result of the eee auto negotiation. | ||
149 | * @eee_enabled: EEE configured mode (enabled/disabled). | ||
150 | * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given | ||
151 | * that eee was negotiated. | ||
152 | * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting | ||
153 | * its tx lpi (after reaching 'idle' state). Effective only when eee | ||
154 | * was negotiated and tx_lpi_enabled was set. | ||
155 | */ | ||
156 | struct ethtool_eee { | ||
157 | __u32 cmd; | ||
158 | __u32 supported; | ||
159 | __u32 advertised; | ||
160 | __u32 lp_advertised; | ||
161 | __u32 eee_active; | ||
162 | __u32 eee_enabled; | ||
163 | __u32 tx_lpi_enabled; | ||
164 | __u32 tx_lpi_timer; | ||
165 | __u32 reserved[2]; | ||
166 | }; | ||
167 | |||
168 | /** | ||
140 | * struct ethtool_modinfo - plugin module eeprom information | 169 | * struct ethtool_modinfo - plugin module eeprom information |
141 | * @cmd: %ETHTOOL_GMODULEINFO | 170 | * @cmd: %ETHTOOL_GMODULEINFO |
142 | * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx | 171 | * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx |
@@ -945,6 +974,8 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings) | |||
945 | * @get_module_info: Get the size and type of the eeprom contained within | 974 | * @get_module_info: Get the size and type of the eeprom contained within |
946 | * a plug-in module. | 975 | * a plug-in module. |
947 | * @get_module_eeprom: Get the eeprom information from the plug-in module | 976 | * @get_module_eeprom: Get the eeprom information from the plug-in module |
977 | * @get_eee: Get Energy-Efficient (EEE) supported and status. | ||
978 | * @set_eee: Set EEE status (enable/disable) as well as LPI timers. | ||
948 | * | 979 | * |
949 | * All operations are optional (i.e. the function pointer may be set | 980 | * All operations are optional (i.e. the function pointer may be set |
950 | * to %NULL) and callers must take this into account. Callers must | 981 | * to %NULL) and callers must take this into account. Callers must |
@@ -1011,6 +1042,8 @@ struct ethtool_ops { | |||
1011 | struct ethtool_modinfo *); | 1042 | struct ethtool_modinfo *); |
1012 | int (*get_module_eeprom)(struct net_device *, | 1043 | int (*get_module_eeprom)(struct net_device *, |
1013 | struct ethtool_eeprom *, u8 *); | 1044 | struct ethtool_eeprom *, u8 *); |
1045 | int (*get_eee)(struct net_device *, struct ethtool_eee *); | ||
1046 | int (*set_eee)(struct net_device *, struct ethtool_eee *); | ||
1014 | 1047 | ||
1015 | 1048 | ||
1016 | }; | 1049 | }; |
@@ -1089,6 +1122,8 @@ struct ethtool_ops { | |||
1089 | #define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ | 1122 | #define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ |
1090 | #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */ | 1123 | #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */ |
1091 | #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */ | 1124 | #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */ |
1125 | #define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */ | ||
1126 | #define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */ | ||
1092 | 1127 | ||
1093 | /* compatibility with older code */ | 1128 | /* compatibility with older code */ |
1094 | #define SPARC_ETH_GSET ETHTOOL_GSET | 1129 | #define SPARC_ETH_GSET ETHTOOL_GSET |