View | Details | Raw Unified | Return to bug 141318
Collapse All | Expand All

(-)linux-2.6.15/include/linux/ethtool.h (-114 / +114 lines)
Lines 15-38 Link Here
15
15
16
/* This should work for both 32 and 64 bit userland. */
16
/* This should work for both 32 and 64 bit userland. */
17
struct ethtool_cmd {
17
struct ethtool_cmd {
18
	u32	cmd;
18
	__u32	cmd;
19
	u32	supported;	/* Features this interface supports */
19
	__u32	supported;	/* Features this interface supports */
20
	u32	advertising;	/* Features this interface advertises */
20
	__u32	advertising;	/* Features this interface advertises */
21
	u16	speed;		/* The forced speed, 10Mb, 100Mb, gigabit */
21
	__u16	speed;		/* The forced speed, 10Mb, 100Mb, gigabit */
22
	u8	duplex;		/* Duplex, half or full */
22
	__u8	duplex;		/* Duplex, half or full */
23
	u8	port;		/* Which connector port */
23
	__u8	port;		/* Which connector port */
24
	u8	phy_address;
24
	__u8	phy_address;
25
	u8	transceiver;	/* Which transceiver to use */
25
	__u8	transceiver;	/* Which transceiver to use */
26
	u8	autoneg;	/* Enable or disable autonegotiation */
26
	__u8	autoneg;	/* Enable or disable autonegotiation */
27
	u32	maxtxpkt;	/* Tx pkts before generating tx int */
27
	__u32	maxtxpkt;	/* Tx pkts before generating tx int */
28
	u32	maxrxpkt;	/* Rx pkts before generating rx int */
28
	__u32	maxrxpkt;	/* Rx pkts before generating rx int */
29
	u32	reserved[4];
29
	__u32	reserved[4];
30
};
30
};
31
31
32
#define ETHTOOL_BUSINFO_LEN	32
32
#define ETHTOOL_BUSINFO_LEN	32
33
/* these strings are set to whatever the driver author decides... */
33
/* these strings are set to whatever the driver author decides... */
34
struct ethtool_drvinfo {
34
struct ethtool_drvinfo {
35
	u32	cmd;
35
	__u32	cmd;
36
	char	driver[32];	/* driver short name, "tulip", "eepro100" */
36
	char	driver[32];	/* driver short name, "tulip", "eepro100" */
37
	char	version[32];	/* driver version string */
37
	char	version[32];	/* driver version string */
38
	char	fw_version[32];	/* firmware version string, if applicable */
38
	char	fw_version[32];	/* firmware version string, if applicable */
Lines 40-92 Link Here
40
				/* For PCI devices, use pci_name(pci_dev). */
40
				/* For PCI devices, use pci_name(pci_dev). */
41
	char	reserved1[32];
41
	char	reserved1[32];
42
	char	reserved2[16];
42
	char	reserved2[16];
43
	u32	n_stats;	/* number of u64's from ETHTOOL_GSTATS */
43
	__u32	n_stats;	/* number of __u64's from ETHTOOL_GSTATS */
44
	u32	testinfo_len;
44
	__u32	testinfo_len;
45
	u32	eedump_len;	/* Size of data from ETHTOOL_GEEPROM (bytes) */
45
	__u32	eedump_len;	/* Size of data from ETHTOOL_GEEPROM (bytes) */
46
	u32	regdump_len;	/* Size of data from ETHTOOL_GREGS (bytes) */
46
	__u32	regdump_len;	/* Size of data from ETHTOOL_GREGS (bytes) */
47
};
47
};
48
48
49
#define SOPASS_MAX	6
49
#define SOPASS_MAX	6
50
/* wake-on-lan settings */
50
/* wake-on-lan settings */
51
struct ethtool_wolinfo {
51
struct ethtool_wolinfo {
52
	u32	cmd;
52
	__u32	cmd;
53
	u32	supported;
53
	__u32	supported;
54
	u32	wolopts;
54
	__u32	wolopts;
55
	u8	sopass[SOPASS_MAX]; /* SecureOn(tm) password */
55
	__u8	sopass[SOPASS_MAX]; /* SecureOn(tm) password */
56
};
56
};
57
57
58
/* for passing single values */
58
/* for passing single values */
59
struct ethtool_value {
59
struct ethtool_value {
60
	u32	cmd;
60
	__u32	cmd;
61
	u32	data;
61
	__u32	data;
62
};
62
};
63
63
64
/* for passing big chunks of data */
64
/* for passing big chunks of data */
65
struct ethtool_regs {
65
struct ethtool_regs {
66
	u32	cmd;
66
	__u32	cmd;
67
	u32	version; /* driver-specific, indicates different chips/revs */
67
	__u32	version; /* driver-specific, indicates different chips/revs */
68
	u32	len; /* bytes */
68
	__u32	len; /* bytes */
69
	u8	data[0];
69
	__u8	data[0];
70
};
70
};
71
71
72
/* for passing EEPROM chunks */
72
/* for passing EEPROM chunks */
73
struct ethtool_eeprom {
73
struct ethtool_eeprom {
74
	u32	cmd;
74
	__u32	cmd;
75
	u32	magic;
75
	__u32	magic;
76
	u32	offset; /* in bytes */
76
	__u32	offset; /* in bytes */
77
	u32	len; /* in bytes */
77
	__u32	len; /* in bytes */
78
	u8	data[0];
78
	__u8	data[0];
79
};
79
};
80
80
81
/* for configuring coalescing parameters of chip */
81
/* for configuring coalescing parameters of chip */
82
struct ethtool_coalesce {
82
struct ethtool_coalesce {
83
	u32	cmd;	/* ETHTOOL_{G,S}COALESCE */
83
	__u32	cmd;	/* ETHTOOL_{G,S}COALESCE */
84
84
85
	/* How many usecs to delay an RX interrupt after
85
	/* How many usecs to delay an RX interrupt after
86
	 * a packet arrives.  If 0, only rx_max_coalesced_frames
86
	 * a packet arrives.  If 0, only rx_max_coalesced_frames
87
	 * is used.
87
	 * is used.
88
	 */
88
	 */
89
	u32	rx_coalesce_usecs;
89
	__u32	rx_coalesce_usecs;
90
90
91
	/* How many packets to delay an RX interrupt after
91
	/* How many packets to delay an RX interrupt after
92
	 * a packet arrives.  If 0, only rx_coalesce_usecs is
92
	 * a packet arrives.  If 0, only rx_coalesce_usecs is
Lines 94-114 Link Here
94
	 * to zero as this would cause RX interrupts to never be
94
	 * to zero as this would cause RX interrupts to never be
95
	 * generated.
95
	 * generated.
96
	 */
96
	 */
97
	u32	rx_max_coalesced_frames;
97
	__u32	rx_max_coalesced_frames;
98
98
99
	/* Same as above two parameters, except that these values
99
	/* Same as above two parameters, except that these values
100
	 * apply while an IRQ is being serviced by the host.  Not
100
	 * apply while an IRQ is being serviced by the host.  Not
101
	 * all cards support this feature and the values are ignored
101
	 * all cards support this feature and the values are ignored
102
	 * in that case.
102
	 * in that case.
103
	 */
103
	 */
104
	u32	rx_coalesce_usecs_irq;
104
	__u32	rx_coalesce_usecs_irq;
105
	u32	rx_max_coalesced_frames_irq;
105
	__u32	rx_max_coalesced_frames_irq;
106
106
107
	/* How many usecs to delay a TX interrupt after
107
	/* How many usecs to delay a TX interrupt after
108
	 * a packet is sent.  If 0, only tx_max_coalesced_frames
108
	 * a packet is sent.  If 0, only tx_max_coalesced_frames
109
	 * is used.
109
	 * is used.
110
	 */
110
	 */
111
	u32	tx_coalesce_usecs;
111
	__u32	tx_coalesce_usecs;
112
112
113
	/* How many packets to delay a TX interrupt after
113
	/* How many packets to delay a TX interrupt after
114
	 * a packet is sent.  If 0, only tx_coalesce_usecs is
114
	 * a packet is sent.  If 0, only tx_coalesce_usecs is
Lines 116-137 Link Here
116
	 * to zero as this would cause TX interrupts to never be
116
	 * to zero as this would cause TX interrupts to never be
117
	 * generated.
117
	 * generated.
118
	 */
118
	 */
119
	u32	tx_max_coalesced_frames;
119
	__u32	tx_max_coalesced_frames;
120
120
121
	/* Same as above two parameters, except that these values
121
	/* Same as above two parameters, except that these values
122
	 * apply while an IRQ is being serviced by the host.  Not
122
	 * apply while an IRQ is being serviced by the host.  Not
123
	 * all cards support this feature and the values are ignored
123
	 * all cards support this feature and the values are ignored
124
	 * in that case.
124
	 * in that case.
125
	 */
125
	 */
126
	u32	tx_coalesce_usecs_irq;
126
	__u32	tx_coalesce_usecs_irq;
127
	u32	tx_max_coalesced_frames_irq;
127
	__u32	tx_max_coalesced_frames_irq;
128
128
129
	/* How many usecs to delay in-memory statistics
129
	/* How many usecs to delay in-memory statistics
130
	 * block updates.  Some drivers do not have an in-memory
130
	 * block updates.  Some drivers do not have an in-memory
131
	 * statistic block, and in such cases this value is ignored.
131
	 * statistic block, and in such cases this value is ignored.
132
	 * This value must not be zero.
132
	 * This value must not be zero.
133
	 */
133
	 */
134
	u32	stats_block_coalesce_usecs;
134
	__u32	stats_block_coalesce_usecs;
135
135
136
	/* Adaptive RX/TX coalescing is an algorithm implemented by
136
	/* Adaptive RX/TX coalescing is an algorithm implemented by
137
	 * some drivers to improve latency under low packet rates and
137
	 * some drivers to improve latency under low packet rates and
Lines 140-157 Link Here
140
	 * not implemented by the driver causes these values to be
140
	 * not implemented by the driver causes these values to be
141
	 * silently ignored.
141
	 * silently ignored.
142
	 */
142
	 */
143
	u32	use_adaptive_rx_coalesce;
143
	__u32	use_adaptive_rx_coalesce;
144
	u32	use_adaptive_tx_coalesce;
144
	__u32	use_adaptive_tx_coalesce;
145
145
146
	/* When the packet rate (measured in packets per second)
146
	/* When the packet rate (measured in packets per second)
147
	 * is below pkt_rate_low, the {rx,tx}_*_low parameters are
147
	 * is below pkt_rate_low, the {rx,tx}_*_low parameters are
148
	 * used.
148
	 * used.
149
	 */
149
	 */
150
	u32	pkt_rate_low;
150
	__u32	pkt_rate_low;
151
	u32	rx_coalesce_usecs_low;
151
	__u32	rx_coalesce_usecs_low;
152
	u32	rx_max_coalesced_frames_low;
152
	__u32	rx_max_coalesced_frames_low;
153
	u32	tx_coalesce_usecs_low;
153
	__u32	tx_coalesce_usecs_low;
154
	u32	tx_max_coalesced_frames_low;
154
	__u32	tx_max_coalesced_frames_low;
155
155
156
	/* When the packet rate is below pkt_rate_high but above
156
	/* When the packet rate is below pkt_rate_high but above
157
	 * pkt_rate_low (both measured in packets per second) the
157
	 * pkt_rate_low (both measured in packets per second) the
Lines 162-204 Link Here
162
	 * is above pkt_rate_high, the {rx,tx}_*_high parameters are
162
	 * is above pkt_rate_high, the {rx,tx}_*_high parameters are
163
	 * used.
163
	 * used.
164
	 */
164
	 */
165
	u32	pkt_rate_high;
165
	__u32	pkt_rate_high;
166
	u32	rx_coalesce_usecs_high;
166
	__u32	rx_coalesce_usecs_high;
167
	u32	rx_max_coalesced_frames_high;
167
	__u32	rx_max_coalesced_frames_high;
168
	u32	tx_coalesce_usecs_high;
168
	__u32	tx_coalesce_usecs_high;
169
	u32	tx_max_coalesced_frames_high;
169
	__u32	tx_max_coalesced_frames_high;
170
170
171
	/* How often to do adaptive coalescing packet rate sampling,
171
	/* How often to do adaptive coalescing packet rate sampling,
172
	 * measured in seconds.  Must not be zero.
172
	 * measured in seconds.  Must not be zero.
173
	 */
173
	 */
174
	u32	rate_sample_interval;
174
	__u32	rate_sample_interval;
175
};
175
};
176
176
177
/* for configuring RX/TX ring parameters */
177
/* for configuring RX/TX ring parameters */
178
struct ethtool_ringparam {
178
struct ethtool_ringparam {
179
	u32	cmd;	/* ETHTOOL_{G,S}RINGPARAM */
179
	__u32	cmd;	/* ETHTOOL_{G,S}RINGPARAM */
180
180
181
	/* Read only attributes.  These indicate the maximum number
181
	/* Read only attributes.  These indicate the maximum number
182
	 * of pending RX/TX ring entries the driver will allow the
182
	 * of pending RX/TX ring entries the driver will allow the
183
	 * user to set.
183
	 * user to set.
184
	 */
184
	 */
185
	u32	rx_max_pending;
185
	__u32	rx_max_pending;
186
	u32	rx_mini_max_pending;
186
	__u32	rx_mini_max_pending;
187
	u32	rx_jumbo_max_pending;
187
	__u32	rx_jumbo_max_pending;
188
	u32	tx_max_pending;
188
	__u32	tx_max_pending;
189
189
190
	/* Values changeable by the user.  The valid values are
190
	/* Values changeable by the user.  The valid values are
191
	 * in the range 1 to the "*_max_pending" counterpart above.
191
	 * in the range 1 to the "*_max_pending" counterpart above.
192
	 */
192
	 */
193
	u32	rx_pending;
193
	__u32	rx_pending;
194
	u32	rx_mini_pending;
194
	__u32	rx_mini_pending;
195
	u32	rx_jumbo_pending;
195
	__u32	rx_jumbo_pending;
196
	u32	tx_pending;
196
	__u32	tx_pending;
197
};
197
};
198
198
199
/* for configuring link flow control parameters */
199
/* for configuring link flow control parameters */
200
struct ethtool_pauseparam {
200
struct ethtool_pauseparam {
201
	u32	cmd;	/* ETHTOOL_{G,S}PAUSEPARAM */
201
	__u32	cmd;	/* ETHTOOL_{G,S}PAUSEPARAM */
202
202
203
	/* If the link is being auto-negotiated (via ethtool_cmd.autoneg
203
	/* If the link is being auto-negotiated (via ethtool_cmd.autoneg
204
	 * being true) the user may set 'autonet' here non-zero to have the
204
	 * being true) the user may set 'autonet' here non-zero to have the
Lines 210-218 Link Here
210
	 * then {rx,tx}_pause force the driver to use/not-use pause
210
	 * then {rx,tx}_pause force the driver to use/not-use pause
211
	 * flow control.
211
	 * flow control.
212
	 */
212
	 */
213
	u32	autoneg;
213
	__u32	autoneg;
214
	u32	rx_pause;
214
	__u32	rx_pause;
215
	u32	tx_pause;
215
	__u32	tx_pause;
216
};
216
};
217
217
218
#define ETH_GSTRING_LEN		32
218
#define ETH_GSTRING_LEN		32
Lines 223-232 Link Here
223
223
224
/* for passing string sets for data tagging */
224
/* for passing string sets for data tagging */
225
struct ethtool_gstrings {
225
struct ethtool_gstrings {
226
	u32	cmd;		/* ETHTOOL_GSTRINGS */
226
	__u32	cmd;		/* ETHTOOL_GSTRINGS */
227
	u32	string_set;	/* string set id e.c. ETH_SS_TEST, etc*/
227
	__u32	string_set;	/* string set id e.c. ETH_SS_TEST, etc*/
228
	u32	len;		/* number of strings in the string set */
228
	__u32	len;		/* number of strings in the string set */
229
	u8	data[0];
229
	__u8	data[0];
230
};
230
};
231
231
232
enum ethtool_test_flags {
232
enum ethtool_test_flags {
Lines 236-276 Link Here
236
236
237
/* for requesting NIC test and getting results*/
237
/* for requesting NIC test and getting results*/
238
struct ethtool_test {
238
struct ethtool_test {
239
	u32	cmd;		/* ETHTOOL_TEST */
239
	__u32	cmd;		/* ETHTOOL_TEST */
240
	u32	flags;		/* ETH_TEST_FL_xxx */
240
	__u32	flags;		/* ETH_TEST_FL_xxx */
241
	u32	reserved;
241
	__u32	reserved;
242
	u32	len;		/* result length, in number of u64 elements */
242
	__u32	len;		/* result length, in number of __u64 elements */
243
	u64	data[0];
243
	__u64	data[0];
244
};
244
};
245
245
246
/* for dumping NIC-specific statistics */
246
/* for dumping NIC-specific statistics */
247
struct ethtool_stats {
247
struct ethtool_stats {
248
	u32	cmd;		/* ETHTOOL_GSTATS */
248
	__u32	cmd;		/* ETHTOOL_GSTATS */
249
	u32	n_stats;	/* number of u64's being returned */
249
	__u32	n_stats;	/* number of __u64's being returned */
250
	u64	data[0];
250
	__u64	data[0];
251
};
251
};
252
252
253
struct ethtool_perm_addr {
253
struct ethtool_perm_addr {
254
	u32	cmd;		/* ETHTOOL_GPERMADDR */
254
	__u32	cmd;		/* ETHTOOL_GPERMADDR */
255
	u32	size;
255
	__u32	size;
256
	u8	data[0];
256
	__u8	data[0];
257
};
257
};
258
258
259
struct net_device;
259
struct net_device;
260
260
261
/* Some generic methods drivers may use in their ethtool_ops */
261
/* Some generic methods drivers may use in their ethtool_ops */
262
u32 ethtool_op_get_link(struct net_device *dev);
262
__u32 ethtool_op_get_link(struct net_device *dev);
263
u32 ethtool_op_get_tx_csum(struct net_device *dev);
263
__u32 ethtool_op_get_tx_csum(struct net_device *dev);
264
int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
264
int ethtool_op_set_tx_csum(struct net_device *dev, __u32 data);
265
int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
265
int ethtool_op_set_tx_hw_csum(struct net_device *dev, __u32 data);
266
u32 ethtool_op_get_sg(struct net_device *dev);
266
__u32 ethtool_op_get_sg(struct net_device *dev);
267
int ethtool_op_set_sg(struct net_device *dev, u32 data);
267
int ethtool_op_set_sg(struct net_device *dev, __u32 data);
268
u32 ethtool_op_get_tso(struct net_device *dev);
268
__u32 ethtool_op_get_tso(struct net_device *dev);
269
int ethtool_op_set_tso(struct net_device *dev, u32 data);
269
int ethtool_op_set_tso(struct net_device *dev, __u32 data);
270
int ethtool_op_get_perm_addr(struct net_device *dev, 
270
int ethtool_op_get_perm_addr(struct net_device *dev, 
271
			     struct ethtool_perm_addr *addr, u8 *data);
271
			     struct ethtool_perm_addr *addr, __u8 *data);
272
u32 ethtool_op_get_ufo(struct net_device *dev);
272
__u32 ethtool_op_get_ufo(struct net_device *dev);
273
int ethtool_op_set_ufo(struct net_device *dev, u32 data);
273
int ethtool_op_set_ufo(struct net_device *dev, __u32 data);
274
274
275
/**
275
/**
276
 * &ethtool_ops - Alter and report network device settings
276
 * &ethtool_ops - Alter and report network device settings
Lines 338-375 Link Here
338
	void	(*get_regs)(struct net_device *, struct ethtool_regs *, void *);
338
	void	(*get_regs)(struct net_device *, struct ethtool_regs *, void *);
339
	void	(*get_wol)(struct net_device *, struct ethtool_wolinfo *);
339
	void	(*get_wol)(struct net_device *, struct ethtool_wolinfo *);
340
	int	(*set_wol)(struct net_device *, struct ethtool_wolinfo *);
340
	int	(*set_wol)(struct net_device *, struct ethtool_wolinfo *);
341
	u32	(*get_msglevel)(struct net_device *);
341
	__u32	(*get_msglevel)(struct net_device *);
342
	void	(*set_msglevel)(struct net_device *, u32);
342
	void	(*set_msglevel)(struct net_device *, __u32);
343
	int	(*nway_reset)(struct net_device *);
343
	int	(*nway_reset)(struct net_device *);
344
	u32	(*get_link)(struct net_device *);
344
	__u32	(*get_link)(struct net_device *);
345
	int	(*get_eeprom_len)(struct net_device *);
345
	int	(*get_eeprom_len)(struct net_device *);
346
	int	(*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
346
	int	(*get_eeprom)(struct net_device *, struct ethtool_eeprom *, __u8 *);
347
	int	(*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
347
	int	(*set_eeprom)(struct net_device *, struct ethtool_eeprom *, __u8 *);
348
	int	(*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
348
	int	(*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
349
	int	(*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
349
	int	(*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
350
	void	(*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
350
	void	(*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
351
	int	(*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
351
	int	(*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
352
	void	(*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
352
	void	(*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
353
	int	(*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
353
	int	(*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
354
	u32	(*get_rx_csum)(struct net_device *);
354
	__u32	(*get_rx_csum)(struct net_device *);
355
	int	(*set_rx_csum)(struct net_device *, u32);
355
	int	(*set_rx_csum)(struct net_device *, __u32);
356
	u32	(*get_tx_csum)(struct net_device *);
356
	__u32	(*get_tx_csum)(struct net_device *);
357
	int	(*set_tx_csum)(struct net_device *, u32);
357
	int	(*set_tx_csum)(struct net_device *, __u32);
358
	u32	(*get_sg)(struct net_device *);
358
	__u32	(*get_sg)(struct net_device *);
359
	int	(*set_sg)(struct net_device *, u32);
359
	int	(*set_sg)(struct net_device *, __u32);
360
	u32	(*get_tso)(struct net_device *);
360
	__u32	(*get_tso)(struct net_device *);
361
	int	(*set_tso)(struct net_device *, u32);
361
	int	(*set_tso)(struct net_device *, __u32);
362
	int	(*self_test_count)(struct net_device *);
362
	int	(*self_test_count)(struct net_device *);
363
	void	(*self_test)(struct net_device *, struct ethtool_test *, u64 *);
363
	void	(*self_test)(struct net_device *, struct ethtool_test *, __u64 *);
364
	void	(*get_strings)(struct net_device *, u32 stringset, u8 *);
364
	void	(*get_strings)(struct net_device *, __u32 stringset, __u8 *);
365
	int	(*phys_id)(struct net_device *, u32);
365
	int	(*phys_id)(struct net_device *, __u32);
366
	int	(*get_stats_count)(struct net_device *);
366
	int	(*get_stats_count)(struct net_device *);
367
	void	(*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
367
	void	(*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, __u64 *);
368
	int	(*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *);
368
	int	(*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, __u8 *);
369
	int	(*begin)(struct net_device *);
369
	int	(*begin)(struct net_device *);
370
	void	(*complete)(struct net_device *);
370
	void	(*complete)(struct net_device *);
371
	u32     (*get_ufo)(struct net_device *);
371
	__u32     (*get_ufo)(struct net_device *);
372
	int     (*set_ufo)(struct net_device *, u32);
372
	int     (*set_ufo)(struct net_device *, __u32);
373
};
373
};
374
374
375
/* CMDs currently supported */
375
/* CMDs currently supported */

Return to bug 141318