11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * ethtool.h: Defines for Linux ethtool.
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (C) 1998 David S. Miller (davem@redhat.com)
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *                                christopher.leech@intel.com,
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *                                scott.feldman@intel.com)
1059089d8d162ddcb5c434672e915331964d38a754Santwona Behera * Portions Copyright (C) Sun Microsystems 2008
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef _LINUX_ETHTOOL_H
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _LINUX_ETHTOOL_H
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
153a7da39d165e0c363c294feec119db1427032afdBen Hutchings#include <linux/compat.h>
16607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#include <uapi/linux/ethtool.h>
173ae7c0b2e3747b50c3a6c63ebb67469e0a6b3203Jeff Garzik
183a7da39d165e0c363c294feec119db1427032afdBen Hutchings#ifdef CONFIG_COMPAT
193a7da39d165e0c363c294feec119db1427032afdBen Hutchings
203a7da39d165e0c363c294feec119db1427032afdBen Hutchingsstruct compat_ethtool_rx_flow_spec {
213a7da39d165e0c363c294feec119db1427032afdBen Hutchings	u32		flow_type;
22127fe533ae56d7f4e7b5011869870982eba25723Alexander Duyck	union ethtool_flow_union h_u;
23127fe533ae56d7f4e7b5011869870982eba25723Alexander Duyck	struct ethtool_flow_ext h_ext;
24127fe533ae56d7f4e7b5011869870982eba25723Alexander Duyck	union ethtool_flow_union m_u;
25127fe533ae56d7f4e7b5011869870982eba25723Alexander Duyck	struct ethtool_flow_ext m_ext;
263a7da39d165e0c363c294feec119db1427032afdBen Hutchings	compat_u64	ring_cookie;
273a7da39d165e0c363c294feec119db1427032afdBen Hutchings	u32		location;
283a7da39d165e0c363c294feec119db1427032afdBen Hutchings};
293a7da39d165e0c363c294feec119db1427032afdBen Hutchings
303a7da39d165e0c363c294feec119db1427032afdBen Hutchingsstruct compat_ethtool_rxnfc {
313a7da39d165e0c363c294feec119db1427032afdBen Hutchings	u32				cmd;
323a7da39d165e0c363c294feec119db1427032afdBen Hutchings	u32				flow_type;
333a7da39d165e0c363c294feec119db1427032afdBen Hutchings	compat_u64			data;
343a7da39d165e0c363c294feec119db1427032afdBen Hutchings	struct compat_ethtool_rx_flow_spec fs;
353a7da39d165e0c363c294feec119db1427032afdBen Hutchings	u32				rule_cnt;
363a7da39d165e0c363c294feec119db1427032afdBen Hutchings	u32				rule_locs[0];
373a7da39d165e0c363c294feec119db1427032afdBen Hutchings};
383a7da39d165e0c363c294feec119db1427032afdBen Hutchings
393a7da39d165e0c363c294feec119db1427032afdBen Hutchings#endif /* CONFIG_COMPAT */
40c3ce7e203af5d8eab7c3390fc991a1fcb152f741David Woodhouse
41a1467085dcad8214bbb1d7edafbaa295cbd8c0e7David S. Miller#include <linux/rculist.h>
42a1467085dcad8214bbb1d7edafbaa295cbd8c0e7David S. Miller
434bc71cb983fd2844e603bf633df2bb53385182d2Jiri Pirkoextern int __ethtool_get_settings(struct net_device *dev,
444bc71cb983fd2844e603bf633df2bb53385182d2Jiri Pirko				  struct ethtool_cmd *cmd);
454bc71cb983fd2844e603bf633df2bb53385182d2Jiri Pirko
4668f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings/**
4768f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings * enum ethtool_phys_id_state - indicator state for physical identification
4868f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
4968f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings * @ETHTOOL_ID_ACTIVE: Physical ID indicator should be activated
5068f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings * @ETHTOOL_ID_ON: LED should be turned on (used iff %ETHTOOL_ID_ACTIVE
5168f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	is not supported)
5268f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings * @ETHTOOL_ID_OFF: LED should be turned off (used iff %ETHTOOL_ID_ACTIVE
5368f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	is not supported)
5468f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings */
5568f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchingsenum ethtool_phys_id_state {
5668f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings	ETHTOOL_ID_INACTIVE,
5768f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings	ETHTOOL_ID_ACTIVE,
5868f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings	ETHTOOL_ID_ON,
5968f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings	ETHTOOL_ID_OFF
6068f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings};
6168f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings
621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct net_device;
631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Some generic methods drivers may use in their ethtool_ops */
651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsu32 ethtool_op_get_link(struct net_device *dev);
6602eacbd0c405d378d2357e8e0fac5de981bd40f8Richard Cochranint ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti);
671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/**
69278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings * ethtool_rxfh_indir_default - get default value for RX flow hash indirection
70278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings * @index: Index in RX flow hash indirection table
71278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings * @n_rx_rings: Number of RX rings to use
72278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings *
73278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings * This function provides the default policy for RX flow hash indirection.
74278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings */
75278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchingsstatic inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
76278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings{
77278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings	return index % n_rx_rings;
78278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings}
79278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings
80278bc4296bd64ffd1d3913b487dc8a520e423a7aBen Hutchings/**
818717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * struct ethtool_ops - optional netdev operations
828717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_settings: Get various device settings including Ethernet link
838ae6daca85c8bbd6a32c382db5e2a2a989f8bed2David Decotigny *	settings. The @cmd parameter is expected to have been cleared
848ae6daca85c8bbd6a32c382db5e2a2a989f8bed2David Decotigny *	before get_settings is called. Returns a negative error code or
858ae6daca85c8bbd6a32c382db5e2a2a989f8bed2David Decotigny *	zero.
868717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @set_settings: Set various device settings including Ethernet link
878717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	settings.  Returns a negative error code or zero.
888717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_drvinfo: Report driver/device information.  Should only set the
898717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	@driver, @version, @fw_version and @bus_info fields.  If not
908717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	implemented, the @driver and @bus_info fields will be filled in
918717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	according to the netdev's parent device.
928717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_regs_len: Get buffer length required for @get_regs
93e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @get_regs: Get device registers
94e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @get_wol: Report whether Wake-on-Lan is enabled
958717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @set_wol: Turn Wake-on-Lan on or off.  Returns a negative error code
968717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	or zero.
978717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_msglevel: Report driver message level.  This should be the value
988717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	of the @msg_enable field used by netif logging functions.
99e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @set_msglevel: Set driver message level
1008717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @nway_reset: Restart autonegotiation.  Returns a negative error code
1018717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	or zero.
1028717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_link: Report whether physical link is up.  Will only be called if
1038717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	the netdev is up.  Should usually be set to ethtool_op_get_link(),
1048717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	which uses netif_carrier_ok().
105e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @get_eeprom: Read data from the device EEPROM.
1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	Should fill in the magic field.  Don't need to check len for zero
1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	or wraparound.  Fill in the data argument with the eeprom values
1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	from offset to offset + len.  Update len to the amount read.
1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	Returns an error or zero.
110e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @set_eeprom: Write data to the device EEPROM.
1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	Should validate the magic field.  Don't need to check len for zero
1121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	or wraparound.  Update len to the amount written.  Returns an error
1131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	or zero.
1148717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_coalesce: Get interrupt coalescing parameters.  Returns a negative
1158717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	error code or zero.
1168717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @set_coalesce: Set interrupt coalescing parameters.  Returns a negative
1178717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	error code or zero.
118e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @get_ringparam: Report ring sizes
1198717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @set_ringparam: Set ring sizes.  Returns a negative error code or zero.
120e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @get_pauseparam: Report pause parameters
1218717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @set_pauseparam: Set pause parameters.  Returns a negative error code
1228717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	or zero.
123e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @self_test: Run specified self-tests
124e20b5b61a36bd5b80eea064c0f2e73285dbe0d3bBen Hutchings * @get_strings: Return a set of strings that describe the requested objects
12568f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings * @set_phys_id: Identify the physical devices, e.g. by flashing an LED
12668f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	attached to it.  The implementation may update the indicator
12768f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	asynchronously or synchronously, but in either case it must return
12868f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	quickly.  It is initially called with the argument %ETHTOOL_ID_ACTIVE,
129fce55922f5299a04c0a56b170a141fab34f13465Allan, Bruce W *	and must either activate asynchronous updates and return zero, return
130fce55922f5299a04c0a56b170a141fab34f13465Allan, Bruce W *	a negative error or return a positive frequency for synchronous
131fce55922f5299a04c0a56b170a141fab34f13465Allan, Bruce W *	indication (e.g. 1 for one on/off cycle per second).  If it returns
132fce55922f5299a04c0a56b170a141fab34f13465Allan, Bruce W *	a frequency then it will be called again at intervals with the
13368f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	argument %ETHTOOL_ID_ON or %ETHTOOL_ID_OFF and should set the state of
13468f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	the indicator accordingly.  Finally, it is called with the argument
13568f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	%ETHTOOL_ID_INACTIVE and must deactivate the indicator.  Returns a
13668f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings *	negative error code or zero.
1378717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_ethtool_stats: Return extended statistics about the device.
1388717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	This is only useful if the device maintains statistics not
1398717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	included in &struct rtnl_link_stats64.
1408717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @begin: Function to be called before any other operation.  Returns a
1418717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	negative error code or zero.
1428717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @complete: Function to be called after any other operation except
1438717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	@begin.  Will be called even if the other operation failed.
1448717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_priv_flags: Report driver-specific feature flags.
1458717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @set_priv_flags: Set driver-specific feature flags.  Returns a negative
1468717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	error code or zero.
1478717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_sset_count: Get number of strings that @get_strings will write.
1488717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @get_rxnfc: Get RX flow classification rules.  Returns a negative
1498717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	error code or zero.
1508717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @set_rxnfc: Set RX flow classification rules.  Returns a negative
1518717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	error code or zero.
1528717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @flash_device: Write a firmware image to device's flash memory.
1538717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	Returns a negative error code or zero.
1548717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * @reset: Reset (part of) the device, as specified by a bitmask of
1558717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	flags from &enum ethtool_reset_flags.  Returns a negative
1568717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	error code or zero.
1573de0b592394d17b2c41a261a6a493a521213f299Venkata Duvvuru * @get_rxfh_key_size: Get the size of the RX flow hash key.
1583de0b592394d17b2c41a261a6a493a521213f299Venkata Duvvuru *	Returns zero if not supported for this specific device.
1597850f63f1620512631445b901ae11cd149e7375cBen Hutchings * @get_rxfh_indir_size: Get the size of the RX flow hash indirection table.
1607850f63f1620512631445b901ae11cd149e7375cBen Hutchings *	Returns zero if not supported for this specific device.
1613de0b592394d17b2c41a261a6a493a521213f299Venkata Duvvuru * @get_rxfh: Get the contents of the RX flow hash indirection table and hash
1623de0b592394d17b2c41a261a6a493a521213f299Venkata Duvvuru *	key.
163678e30df2e5664619e06fcfea5490a476826d8feBen Hutchings *	Will only be called if one or both of @get_rxfh_indir_size and
164678e30df2e5664619e06fcfea5490a476826d8feBen Hutchings *	@get_rxfh_key_size are implemented and return non-zero.
1658717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	Returns a negative error code or zero.
166678e30df2e5664619e06fcfea5490a476826d8feBen Hutchings * @set_rxfh: Set the contents of the RX flow hash indirection table and/or
16761d88c6811f216de4ec26aafe24e650dc1aeb00eBen Hutchings *	hash key.  In case only the indirection table or hash key is to be
16861d88c6811f216de4ec26aafe24e650dc1aeb00eBen Hutchings *	changed, the other argument will be %NULL.
169678e30df2e5664619e06fcfea5490a476826d8feBen Hutchings *	Will only be called if one or both of @get_rxfh_indir_size and
170678e30df2e5664619e06fcfea5490a476826d8feBen Hutchings *	@get_rxfh_key_size are implemented and return non-zero.
1718717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *	Returns a negative error code or zero.
1728b5933c380fc66a6311739f9b36a812383f82141amit salecha * @get_channels: Get number of channels.
1738b5933c380fc66a6311739f9b36a812383f82141amit salecha * @set_channels: Set number of channels.  Returns a negative error code or
1748b5933c380fc66a6311739f9b36a812383f82141amit salecha *	zero.
17529dd54b72ba8c5ad0dd6dd33584449b5953f700bAnirban Chakraborty * @get_dump_flag: Get dump flag indicating current dump length, version,
17629dd54b72ba8c5ad0dd6dd33584449b5953f700bAnirban Chakraborty * 		   and flag of the device.
17729dd54b72ba8c5ad0dd6dd33584449b5953f700bAnirban Chakraborty * @get_dump_data: Get dump data.
17829dd54b72ba8c5ad0dd6dd33584449b5953f700bAnirban Chakraborty * @set_dump: Set dump specific flags to the device.
179c8f3a8c31069137fe0100e6920558f1a7487ef3cRichard Cochran * @get_ts_info: Get the time stamping and PTP hardware clock capabilities.
180c8f3a8c31069137fe0100e6920558f1a7487ef3cRichard Cochran *	Drivers supporting transmit time stamps in software should set this to
181c8f3a8c31069137fe0100e6920558f1a7487ef3cRichard Cochran *	ethtool_op_get_ts_info().
18241c3cb6d20f0252308e9796fa4f3dacb4960de91Stuart Hodgson * @get_module_info: Get the size and type of the eeprom contained within
18341c3cb6d20f0252308e9796fa4f3dacb4960de91Stuart Hodgson *	a plug-in module.
18441c3cb6d20f0252308e9796fa4f3dacb4960de91Stuart Hodgson * @get_module_eeprom: Get the eeprom information from the plug-in module
18580f12eccce775dc6bb93dba9b52529740f929237Yuval Mintz * @get_eee: Get Energy-Efficient (EEE) supported and status.
18680f12eccce775dc6bb93dba9b52529740f929237Yuval Mintz * @set_eee: Set EEE status (enable/disable) as well as LPI timers.
1878717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *
1888717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * All operations are optional (i.e. the function pointer may be set
1898717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * to %NULL) and callers must take this into account.  Callers must
190b4f79e5cb2182f27d151da6e223186f287a615d6Ben Hutchings * hold the RTNL lock.
1918717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *
1928717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * See the structures used by these operations for further documentation.
1936e201c857b68ea994c9ac85718eb3d50dcf40d92Ben Hutchings * Note that for all operations using a structure ending with a zero-
1946e201c857b68ea994c9ac85718eb3d50dcf40d92Ben Hutchings * length array, the array is allocated separately in the kernel and
1956e201c857b68ea994c9ac85718eb3d50dcf40d92Ben Hutchings * is passed to the driver as an additional parameter.
1968717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings *
1978717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * See &struct net_device and &struct net_device_ops for documentation
1988717d07b1143e0f150921f5bd7cfe7af579a995aBen Hutchings * of the generic netdev features interface.
1991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
2001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct ethtool_ops {
2011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*get_settings)(struct net_device *, struct ethtool_cmd *);
2021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*set_settings)(struct net_device *, struct ethtool_cmd *);
2031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void	(*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
2041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*get_regs_len)(struct net_device *);
2051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void	(*get_regs)(struct net_device *, struct ethtool_regs *, void *);
2061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void	(*get_wol)(struct net_device *, struct ethtool_wolinfo *);
2071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*set_wol)(struct net_device *, struct ethtool_wolinfo *);
2081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u32	(*get_msglevel)(struct net_device *);
2091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void	(*set_msglevel)(struct net_device *, u32);
2101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*nway_reset)(struct net_device *);
2111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u32	(*get_link)(struct net_device *);
2121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*get_eeprom_len)(struct net_device *);
21397f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	int	(*get_eeprom)(struct net_device *,
21497f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey			      struct ethtool_eeprom *, u8 *);
21597f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	int	(*set_eeprom)(struct net_device *,
21697f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey			      struct ethtool_eeprom *, u8 *);
2171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
2181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
21997f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	void	(*get_ringparam)(struct net_device *,
22097f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey				 struct ethtool_ringparam *);
22197f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	int	(*set_ringparam)(struct net_device *,
22297f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey				 struct ethtool_ringparam *);
22397f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	void	(*get_pauseparam)(struct net_device *,
22497f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey				  struct ethtool_pauseparam*);
22597f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	int	(*set_pauseparam)(struct net_device *,
22697f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey				  struct ethtool_pauseparam*);
2271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void	(*self_test)(struct net_device *, struct ethtool_test *, u64 *);
2281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void	(*get_strings)(struct net_device *, u32 stringset, u8 *);
22968f512f21a64c9b264df6c61a9333e7890faf74bBen Hutchings	int	(*set_phys_id)(struct net_device *, enum ethtool_phys_id_state);
23097f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	void	(*get_ethtool_stats)(struct net_device *,
23197f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey				     struct ethtool_stats *, u64 *);
2321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int	(*begin)(struct net_device *);
2331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void	(*complete)(struct net_device *);
23497f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	u32	(*get_priv_flags)(struct net_device *);
23597f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	int	(*set_priv_flags)(struct net_device *, u32);
236ff03d49f0ca1959246068b315d26e009da692ff2Jeff Garzik	int	(*get_sset_count)(struct net_device *, int);
23797f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	int	(*get_rxnfc)(struct net_device *,
238815c7db5c809ea3d5735de3131ecdf758b0e14ffBen Hutchings			     struct ethtool_rxnfc *, u32 *rule_locs);
23959089d8d162ddcb5c434672e915331964d38a754Santwona Behera	int	(*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
24097f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6chavey	int	(*flash_device)(struct net_device *, struct ethtool_flash *);
241d73d3a8cb4723e161589864741d8528d70b350ebBen Hutchings	int	(*reset)(struct net_device *, u32 *);
2423de0b592394d17b2c41a261a6a493a521213f299Venkata Duvvuru	u32	(*get_rxfh_key_size)(struct net_device *);
2437850f63f1620512631445b901ae11cd149e7375cBen Hutchings	u32	(*get_rxfh_indir_size)(struct net_device *);
244678e30df2e5664619e06fcfea5490a476826d8feBen Hutchings	int	(*get_rxfh)(struct net_device *, u32 *indir, u8 *key);
24533cb0fa7888510b5bd2096352b200cfe29db10feBen Hutchings	int	(*set_rxfh)(struct net_device *, const u32 *indir,
24633cb0fa7888510b5bd2096352b200cfe29db10feBen Hutchings			    const u8 *key);
2478b5933c380fc66a6311739f9b36a812383f82141amit salecha	void	(*get_channels)(struct net_device *, struct ethtool_channels *);
2488b5933c380fc66a6311739f9b36a812383f82141amit salecha	int	(*set_channels)(struct net_device *, struct ethtool_channels *);
24929dd54b72ba8c5ad0dd6dd33584449b5953f700bAnirban Chakraborty	int	(*get_dump_flag)(struct net_device *, struct ethtool_dump *);
25029dd54b72ba8c5ad0dd6dd33584449b5953f700bAnirban Chakraborty	int	(*get_dump_data)(struct net_device *,
25129dd54b72ba8c5ad0dd6dd33584449b5953f700bAnirban Chakraborty				 struct ethtool_dump *, void *);
25229dd54b72ba8c5ad0dd6dd33584449b5953f700bAnirban Chakraborty	int	(*set_dump)(struct net_device *, struct ethtool_dump *);
253c8f3a8c31069137fe0100e6920558f1a7487ef3cRichard Cochran	int	(*get_ts_info)(struct net_device *, struct ethtool_ts_info *);
25441c3cb6d20f0252308e9796fa4f3dacb4960de91Stuart Hodgson	int     (*get_module_info)(struct net_device *,
25541c3cb6d20f0252308e9796fa4f3dacb4960de91Stuart Hodgson				   struct ethtool_modinfo *);
25641c3cb6d20f0252308e9796fa4f3dacb4960de91Stuart Hodgson	int     (*get_module_eeprom)(struct net_device *,
25741c3cb6d20f0252308e9796fa4f3dacb4960de91Stuart Hodgson				     struct ethtool_eeprom *, u8 *);
25880f12eccce775dc6bb93dba9b52529740f929237Yuval Mintz	int	(*get_eee)(struct net_device *, struct ethtool_eee *);
25980f12eccce775dc6bb93dba9b52529740f929237Yuval Mintz	int	(*set_eee)(struct net_device *, struct ethtool_eee *);
260f0db9b073415848709dd59a6394969882f517da9Govindarajulu Varadarajan	int	(*get_tunable)(struct net_device *,
261f0db9b073415848709dd59a6394969882f517da9Govindarajulu Varadarajan			       const struct ethtool_tunable *, void *);
262f0db9b073415848709dd59a6394969882f517da9Govindarajulu Varadarajan	int	(*set_tunable)(struct net_device *,
263f0db9b073415848709dd59a6394969882f517da9Govindarajulu Varadarajan			       const struct ethtool_tunable *, const void *);
26441c3cb6d20f0252308e9796fa4f3dacb4960de91Stuart Hodgson
2658b5933c380fc66a6311739f9b36a812383f82141amit salecha
2661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* _LINUX_ETHTOOL_H */
268