be_ethtool.c 29.5 KB
Newer Older
Sathya Perla's avatar
Sathya Perla committed
1
/*
2
 * Copyright (C) 2005 - 2013 Emulex
Sathya Perla's avatar
Sathya Perla committed
3
4
5
6
7
8
9
10
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.  The full GNU General
 * Public License is included in this distribution in the file called COPYING.
 *
 * Contact Information:
11
 * linux-drivers@emulex.com
Sathya Perla's avatar
Sathya Perla committed
12
 *
13
14
15
 * Emulex
 * 3333 Susan Street
 * Costa Mesa, CA 92626
Sathya Perla's avatar
Sathya Perla committed
16
17
18
 */

#include "be.h"
19
#include "be_cmds.h"
Sathya Perla's avatar
Sathya Perla committed
20
21
22
23
24
25
26
27
28
#include <linux/ethtool.h>

struct be_ethtool_stat {
	char desc[ETH_GSTRING_LEN];
	int type;
	int size;
	int offset;
};

29
enum {DRVSTAT_TX, DRVSTAT_RX, DRVSTAT};
Sathya Perla's avatar
Sathya Perla committed
30
31
#define FIELDINFO(_struct, field) FIELD_SIZEOF(_struct, field), \
					offsetof(_struct, field)
32
33
34
35
#define DRVSTAT_TX_INFO(field)	#field, DRVSTAT_TX,\
					FIELDINFO(struct be_tx_stats, field)
#define DRVSTAT_RX_INFO(field)	#field, DRVSTAT_RX,\
					FIELDINFO(struct be_rx_stats, field)
36
#define	DRVSTAT_INFO(field)	#field, DRVSTAT,\
37
					FIELDINFO(struct be_drv_stats, field)
Sathya Perla's avatar
Sathya Perla committed
38
39

static const struct be_ethtool_stat et_stats[] = {
40
41
42
43
	{DRVSTAT_INFO(rx_crc_errors)},
	{DRVSTAT_INFO(rx_alignment_symbol_errors)},
	{DRVSTAT_INFO(rx_pause_frames)},
	{DRVSTAT_INFO(rx_control_frames)},
44
45
46
	/* Received packets dropped when the Ethernet length field
	 * is not equal to the actual Ethernet data length.
	 */
47
	{DRVSTAT_INFO(rx_in_range_errors)},
48
49
50
	/* Received packets dropped when their length field is >= 1501 bytes
	 * and <= 1535 bytes.
	 */
51
	{DRVSTAT_INFO(rx_out_range_errors)},
52
	/* Received packets dropped when they are longer than 9216 bytes */
53
	{DRVSTAT_INFO(rx_frame_too_long)},
54
55
56
	/* Received packets dropped when they don't pass the unicast or
	 * multicast address filtering.
	 */
57
	{DRVSTAT_INFO(rx_address_filtered)},
58
59
60
	/* Received packets dropped when IP packet length field is less than
	 * the IP header length field.
	 */
61
	{DRVSTAT_INFO(rx_dropped_too_small)},
62
63
64
	/* Received packets dropped when IP length field is greater than
	 * the actual packet length.
	 */
65
	{DRVSTAT_INFO(rx_dropped_too_short)},
66
67
68
	/* Received packets dropped when the IP header length field is less
	 * than 5.
	 */
69
	{DRVSTAT_INFO(rx_dropped_header_too_small)},
70
71
72
73
	/* Received packets dropped when the TCP header length field is less
	 * than 5 or the TCP header length + IP header length is more
	 * than IP packet length.
	 */
74
75
	{DRVSTAT_INFO(rx_dropped_tcp_length)},
	{DRVSTAT_INFO(rx_dropped_runt)},
76
77
78
79
	/* Number of received packets dropped when a fifo for descriptors going
	 * into the packet demux block overflows. In normal operation, this
	 * fifo must never overflow.
	 */
80
81
82
83
84
85
86
87
	{DRVSTAT_INFO(rxpp_fifo_overflow_drop)},
	{DRVSTAT_INFO(rx_input_fifo_overflow_drop)},
	{DRVSTAT_INFO(rx_ip_checksum_errs)},
	{DRVSTAT_INFO(rx_tcp_checksum_errs)},
	{DRVSTAT_INFO(rx_udp_checksum_errs)},
	{DRVSTAT_INFO(tx_pauseframes)},
	{DRVSTAT_INFO(tx_controlframes)},
	{DRVSTAT_INFO(rx_priority_pause_frames)},
88
	{DRVSTAT_INFO(tx_priority_pauseframes)},
89
90
91
	/* Received packets dropped when an internal fifo going into
	 * main packet buffer tank (PMEM) overflows.
	 */
92
93
	{DRVSTAT_INFO(pmem_fifo_overflow_drop)},
	{DRVSTAT_INFO(jabber_events)},
94
95
96
	/* Received packets dropped due to lack of available HW packet buffers
	 * used to temporarily hold the received packets.
	 */
97
	{DRVSTAT_INFO(rx_drops_no_pbuf)},
98
99
100
	/* Received packets dropped due to input receive buffer
	 * descriptor fifo overflowing.
	 */
101
	{DRVSTAT_INFO(rx_drops_no_erx_descr)},
102
103
104
105
	/* Packets dropped because the internal FIFO to the offloaded TCP
	 * receive processing block is full. This could happen only for
	 * offloaded iSCSI or FCoE trarffic.
	 */
106
	{DRVSTAT_INFO(rx_drops_no_tpre_descr)},
107
108
109
110
	/* Received packets dropped when they need more than 8
	 * receive buffers. This cannot happen as the driver configures
	 * 2048 byte receive buffers.
	 */
111
112
	{DRVSTAT_INFO(rx_drops_too_many_frags)},
	{DRVSTAT_INFO(forwarded_packets)},
113
114
115
	/* Received packets dropped when the frame length
	 * is more than 9018 bytes
	 */
116
	{DRVSTAT_INFO(rx_drops_mtu)},
117
	/* Number of packets dropped due to random early drop function */
118
	{DRVSTAT_INFO(eth_red_drops)},
119
	{DRVSTAT_INFO(be_on_die_temperature)}
Sathya Perla's avatar
Sathya Perla committed
120
121
122
};
#define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats)

123
124
125
/* Stats related to multi RX queues: get_stats routine assumes bytes, pkts
 * are first and second members respectively.
 */
126
static const struct be_ethtool_stat et_rx_stats[] = {
127
128
	{DRVSTAT_RX_INFO(rx_bytes)},/* If moving this member see above note */
	{DRVSTAT_RX_INFO(rx_pkts)}, /* If moving this member see above note */
129
130
	{DRVSTAT_RX_INFO(rx_compl)},
	{DRVSTAT_RX_INFO(rx_mcast_pkts)},
131
132
133
	/* Number of page allocation failures while posting receive buffers
	 * to HW.
	 */
134
	{DRVSTAT_RX_INFO(rx_post_fail)},
135
	/* Recevied packets dropped due to skb allocation failure */
136
	{DRVSTAT_RX_INFO(rx_drops_no_skbs)},
137
138
139
	/* Received packets dropped due to lack of available fetched buffers
	 * posted by the driver.
	 */
140
	{DRVSTAT_RX_INFO(rx_drops_no_frags)}
141
142
143
};
#define ETHTOOL_RXSTATS_NUM (ARRAY_SIZE(et_rx_stats))

144
145
146
/* Stats related to multi TX queues: get_stats routine assumes compl is the
 * first member
 */
147
static const struct be_ethtool_stat et_tx_stats[] = {
148
	{DRVSTAT_TX_INFO(tx_compl)}, /* If moving this member see above note */
149
150
	{DRVSTAT_TX_INFO(tx_bytes)},
	{DRVSTAT_TX_INFO(tx_pkts)},
151
	/* Number of skbs queued for trasmission by the driver */
152
	{DRVSTAT_TX_INFO(tx_reqs)},
153
	/* Number of TX work request blocks DMAed to HW */
154
	{DRVSTAT_TX_INFO(tx_wrbs)},
155
156
157
	/* Number of times the TX queue was stopped due to lack
	 * of spaces in the TXQ.
	 */
158
	{DRVSTAT_TX_INFO(tx_stops)}
159
160
161
};
#define ETHTOOL_TXSTATS_NUM (ARRAY_SIZE(et_tx_stats))

162
163
164
165
static const char et_self_tests[][ETH_GSTRING_LEN] = {
	"MAC Loopback test",
	"PHY Loopback test",
	"External Loopback test",
166
	"DDR DMA test",
167
	"Link test"
168
169
170
171
172
173
};

#define ETHTOOL_TESTS_NUM ARRAY_SIZE(et_self_tests)
#define BE_MAC_LOOPBACK 0x0
#define BE_PHY_LOOPBACK 0x1
#define BE_ONE_PORT_EXT_LOOPBACK 0x2
174
#define BE_NO_LOOPBACK 0xff
175

176
177
static void be_get_drvinfo(struct net_device *netdev,
				struct ethtool_drvinfo *drvinfo)
Sathya Perla's avatar
Sathya Perla committed
178
179
{
	struct be_adapter *adapter = netdev_priv(netdev);
180
181
182
183
	char fw_on_flash[FW_VER_LEN];

	memset(fw_on_flash, 0 , sizeof(fw_on_flash));
	be_cmd_get_fw_ver(adapter, adapter->fw_ver, fw_on_flash);
Sathya Perla's avatar
Sathya Perla committed
184

185
186
	strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
	strlcpy(drvinfo->version, DRV_VER, sizeof(drvinfo->version));
187
188
189
190
191
192
	if (!memcmp(adapter->fw_ver, fw_on_flash, FW_VER_LEN))
		strlcpy(drvinfo->fw_version, adapter->fw_ver,
			sizeof(drvinfo->fw_version));
	else
		snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
			 "%s [%s]", adapter->fw_ver, fw_on_flash);
193

194
195
	strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
		sizeof(drvinfo->bus_info));
Sathya Perla's avatar
Sathya Perla committed
196
197
198
199
200
	drvinfo->testinfo_len = 0;
	drvinfo->regdump_len = 0;
	drvinfo->eedump_len = 0;
}

201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
static u32
lancer_cmd_get_file_len(struct be_adapter *adapter, u8 *file_name)
{
	u32 data_read = 0, eof;
	u8 addn_status;
	struct be_dma_mem data_len_cmd;
	int status;

	memset(&data_len_cmd, 0, sizeof(data_len_cmd));
	/* data_offset and data_size should be 0 to get reg len */
	status = lancer_cmd_read_object(adapter, &data_len_cmd, 0, 0,
				file_name, &data_read, &eof, &addn_status);

	return data_read;
}

static int
lancer_cmd_read_file(struct be_adapter *adapter, u8 *file_name,
		u32 buf_len, void *buf)
{
	struct be_dma_mem read_cmd;
	u32 read_len = 0, total_read_len = 0, chunk_size;
	u32 eof = 0;
	u8 addn_status;
	int status = 0;

	read_cmd.size = LANCER_READ_FILE_CHUNK;
	read_cmd.va = pci_alloc_consistent(adapter->pdev, read_cmd.size,
			&read_cmd.dma);

	if (!read_cmd.va) {
		dev_err(&adapter->pdev->dev,
				"Memory allocation failure while reading dump\n");
		return -ENOMEM;
	}

	while ((total_read_len < buf_len) && !eof) {
		chunk_size = min_t(u32, (buf_len - total_read_len),
				LANCER_READ_FILE_CHUNK);
		chunk_size = ALIGN(chunk_size, 4);
		status = lancer_cmd_read_object(adapter, &read_cmd, chunk_size,
				total_read_len, file_name, &read_len,
				&eof, &addn_status);
		if (!status) {
			memcpy(buf + total_read_len, read_cmd.va, read_len);
			total_read_len += read_len;
			eof &= LANCER_READ_FILE_EOF_MASK;
		} else {
			status = -EIO;
			break;
		}
	}
	pci_free_consistent(adapter->pdev, read_cmd.size, read_cmd.va,
			read_cmd.dma);

	return status;
}

259
260
261
262
263
264
static int
be_get_reg_len(struct net_device *netdev)
{
	struct be_adapter *adapter = netdev_priv(netdev);
	u32 log_size = 0;

265
266
267
	if (!check_privilege(adapter, MAX_PRIVILEGES))
		return 0;

268
269
270
271
272
273
274
	if (be_physfn(adapter)) {
		if (lancer_chip(adapter))
			log_size = lancer_cmd_get_file_len(adapter,
					LANCER_FW_DUMP_FILE);
		else
			be_cmd_get_reg_len(adapter, &log_size);
	}
275
276
277
278
279
280
281
282
	return log_size;
}

static void
be_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *buf)
{
	struct be_adapter *adapter = netdev_priv(netdev);

283
284
	if (be_physfn(adapter)) {
		memset(buf, 0, regs->len);
285
286
287
288
289
		if (lancer_chip(adapter))
			lancer_cmd_read_file(adapter, LANCER_FW_DUMP_FILE,
					regs->len, buf);
		else
			be_cmd_get_regs(adapter, regs->len, buf);
290
	}
291
292
}

Sathya Perla's avatar
Sathya Perla committed
293
294
static int be_get_coalesce(struct net_device *netdev,
			   struct ethtool_coalesce *et)
Sathya Perla's avatar
Sathya Perla committed
295
296
{
	struct be_adapter *adapter = netdev_priv(netdev);
Sathya Perla's avatar
Sathya Perla committed
297
298
	struct be_eq_obj *eqo = &adapter->eq_obj[0];

Sathya Perla's avatar
Sathya Perla committed
299

Sathya Perla's avatar
Sathya Perla committed
300
301
302
	et->rx_coalesce_usecs = eqo->cur_eqd;
	et->rx_coalesce_usecs_high = eqo->max_eqd;
	et->rx_coalesce_usecs_low = eqo->min_eqd;
Sathya Perla's avatar
Sathya Perla committed
303

Sathya Perla's avatar
Sathya Perla committed
304
305
306
	et->tx_coalesce_usecs = eqo->cur_eqd;
	et->tx_coalesce_usecs_high = eqo->max_eqd;
	et->tx_coalesce_usecs_low = eqo->min_eqd;
Sathya Perla's avatar
Sathya Perla committed
307

Sathya Perla's avatar
Sathya Perla committed
308
309
	et->use_adaptive_rx_coalesce = eqo->enable_aic;
	et->use_adaptive_tx_coalesce = eqo->enable_aic;
Sathya Perla's avatar
Sathya Perla committed
310
311
312
313

	return 0;
}

Sathya Perla's avatar
Sathya Perla committed
314
315
/* TX attributes are ignored. Only RX attributes are considered
 * eqd cmd is issued in the worker thread.
Sathya Perla's avatar
Sathya Perla committed
316
 */
Sathya Perla's avatar
Sathya Perla committed
317
318
static int be_set_coalesce(struct net_device *netdev,
			   struct ethtool_coalesce *et)
Sathya Perla's avatar
Sathya Perla committed
319
320
{
	struct be_adapter *adapter = netdev_priv(netdev);
Sathya Perla's avatar
Sathya Perla committed
321
322
323
324
325
326
327
328
	struct be_eq_obj *eqo;
	int i;

	for_all_evt_queues(adapter, eqo, i) {
		eqo->enable_aic = et->use_adaptive_rx_coalesce;
		eqo->max_eqd = min(et->rx_coalesce_usecs_high, BE_MAX_EQD);
		eqo->min_eqd = min(et->rx_coalesce_usecs_low, eqo->max_eqd);
		eqo->eqd = et->rx_coalesce_usecs;
Sathya Perla's avatar
Sathya Perla committed
329
330
331
332
333
334
335
336
337
338
	}

	return 0;
}

static void
be_get_ethtool_stats(struct net_device *netdev,
		struct ethtool_stats *stats, uint64_t *data)
{
	struct be_adapter *adapter = netdev_priv(netdev);
339
	struct be_rx_obj *rxo;
340
	struct be_tx_obj *txo;
341
	void *p;
342
	unsigned int i, j, base = 0, start;
Sathya Perla's avatar
Sathya Perla committed
343
344

	for (i = 0; i < ETHTOOL_STATS_NUM; i++) {
345
		p = (u8 *)&adapter->drv_stats + et_stats[i].offset;
346
		data[i] = *(u32 *)p;
Sathya Perla's avatar
Sathya Perla committed
347
	}
348
	base += ETHTOOL_STATS_NUM;
349
350

	for_all_rx_queues(adapter, rxo, j) {
351
352
353
354
355
356
357
358
359
360
361
		struct be_rx_stats *stats = rx_stats(rxo);

		do {
			start = u64_stats_fetch_begin_bh(&stats->sync);
			data[base] = stats->rx_bytes;
			data[base + 1] = stats->rx_pkts;
		} while (u64_stats_fetch_retry_bh(&stats->sync, start));

		for (i = 2; i < ETHTOOL_RXSTATS_NUM; i++) {
			p = (u8 *)stats + et_rx_stats[i].offset;
			data[base + i] = *(u32 *)p;
362
		}
363
		base += ETHTOOL_RXSTATS_NUM;
364
	}
365
366

	for_all_tx_queues(adapter, txo, j) {
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
		struct be_tx_stats *stats = tx_stats(txo);

		do {
			start = u64_stats_fetch_begin_bh(&stats->sync_compl);
			data[base] = stats->tx_compl;
		} while (u64_stats_fetch_retry_bh(&stats->sync_compl, start));

		do {
			start = u64_stats_fetch_begin_bh(&stats->sync);
			for (i = 1; i < ETHTOOL_TXSTATS_NUM; i++) {
				p = (u8 *)stats + et_tx_stats[i].offset;
				data[base + i] =
					(et_tx_stats[i].size == sizeof(u64)) ?
						*(u64 *)p : *(u32 *)p;
			}
		} while (u64_stats_fetch_retry_bh(&stats->sync, start));
		base += ETHTOOL_TXSTATS_NUM;
384
	}
Sathya Perla's avatar
Sathya Perla committed
385
386
387
388
389
390
}

static void
be_get_stat_strings(struct net_device *netdev, uint32_t stringset,
		uint8_t *data)
{
391
392
393
	struct be_adapter *adapter = netdev_priv(netdev);
	int i, j;

Sathya Perla's avatar
Sathya Perla committed
394
395
396
397
398
399
	switch (stringset) {
	case ETH_SS_STATS:
		for (i = 0; i < ETHTOOL_STATS_NUM; i++) {
			memcpy(data, et_stats[i].desc, ETH_GSTRING_LEN);
			data += ETH_GSTRING_LEN;
		}
400
401
402
403
404
405
406
		for (i = 0; i < adapter->num_rx_qs; i++) {
			for (j = 0; j < ETHTOOL_RXSTATS_NUM; j++) {
				sprintf(data, "rxq%d: %s", i,
					et_rx_stats[j].desc);
				data += ETH_GSTRING_LEN;
			}
		}
407
408
409
410
411
412
413
		for (i = 0; i < adapter->num_tx_qs; i++) {
			for (j = 0; j < ETHTOOL_TXSTATS_NUM; j++) {
				sprintf(data, "txq%d: %s", i,
					et_tx_stats[j].desc);
				data += ETH_GSTRING_LEN;
			}
		}
Sathya Perla's avatar
Sathya Perla committed
414
		break;
415
416
417
418
419
420
	case ETH_SS_TEST:
		for (i = 0; i < ETHTOOL_TESTS_NUM; i++) {
			memcpy(data, et_self_tests[i], ETH_GSTRING_LEN);
			data += ETH_GSTRING_LEN;
		}
		break;
Sathya Perla's avatar
Sathya Perla committed
421
422
423
	}
}

424
static int be_get_sset_count(struct net_device *netdev, int stringset)
Sathya Perla's avatar
Sathya Perla committed
425
{
426
427
	struct be_adapter *adapter = netdev_priv(netdev);

428
	switch (stringset) {
429
430
	case ETH_SS_TEST:
		return ETHTOOL_TESTS_NUM;
431
	case ETH_SS_STATS:
432
		return ETHTOOL_STATS_NUM +
433
434
			adapter->num_rx_qs * ETHTOOL_RXSTATS_NUM +
			adapter->num_tx_qs * ETHTOOL_TXSTATS_NUM;
435
436
437
	default:
		return -EINVAL;
	}
Sathya Perla's avatar
Sathya Perla committed
438
439
}

440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
static u32 be_get_port_type(u32 phy_type, u32 dac_cable_len)
{
	u32 port;

	switch (phy_type) {
	case PHY_TYPE_BASET_1GB:
	case PHY_TYPE_BASEX_1GB:
	case PHY_TYPE_SGMII:
		port = PORT_TP;
		break;
	case PHY_TYPE_SFP_PLUS_10GB:
		port = dac_cable_len ? PORT_DA : PORT_FIBRE;
		break;
	case PHY_TYPE_XFP_10GB:
	case PHY_TYPE_SFP_1GB:
		port = PORT_FIBRE;
		break;
	case PHY_TYPE_BASET_10GB:
		port = PORT_TP;
		break;
	default:
		port = PORT_OTHER;
	}

	return port;
}

static u32 convert_to_et_setting(u32 if_type, u32 if_speeds)
{
	u32 val = 0;

	switch (if_type) {
	case PHY_TYPE_BASET_1GB:
	case PHY_TYPE_BASEX_1GB:
	case PHY_TYPE_SGMII:
		val |= SUPPORTED_TP;
		if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
			val |= SUPPORTED_1000baseT_Full;
		if (if_speeds & BE_SUPPORTED_SPEED_100MBPS)
			val |= SUPPORTED_100baseT_Full;
		if (if_speeds & BE_SUPPORTED_SPEED_10MBPS)
			val |= SUPPORTED_10baseT_Full;
		break;
	case PHY_TYPE_KX4_10GB:
		val |= SUPPORTED_Backplane;
		if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
			val |= SUPPORTED_1000baseKX_Full;
		if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
			val |= SUPPORTED_10000baseKX4_Full;
		break;
	case PHY_TYPE_KR_10GB:
		val |= SUPPORTED_Backplane |
				SUPPORTED_10000baseKR_Full;
		break;
	case PHY_TYPE_SFP_PLUS_10GB:
	case PHY_TYPE_XFP_10GB:
	case PHY_TYPE_SFP_1GB:
		val |= SUPPORTED_FIBRE;
		if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
			val |= SUPPORTED_10000baseT_Full;
		if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
			val |= SUPPORTED_1000baseT_Full;
		break;
	case PHY_TYPE_BASET_10GB:
		val |= SUPPORTED_TP;
		if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
			val |= SUPPORTED_10000baseT_Full;
		if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
			val |= SUPPORTED_1000baseT_Full;
		if (if_speeds & BE_SUPPORTED_SPEED_100MBPS)
			val |= SUPPORTED_100baseT_Full;
		break;
	default:
		val |= SUPPORTED_TP;
	}

	return val;
}

bool be_pause_supported(struct be_adapter *adapter)
{
	return (adapter->phy.interface_type == PHY_TYPE_SFP_PLUS_10GB ||
		adapter->phy.interface_type == PHY_TYPE_XFP_10GB) ?
		false : true;
}

Sathya Perla's avatar
Sathya Perla committed
526
527
static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{
528
	struct be_adapter *adapter = netdev_priv(netdev);
529
	u8 link_status;
530
	u16 link_speed = 0;
531
	int status;
532
533
534
535
	u32 auto_speeds;
	u32 fixed_speeds;
	u32 dac_cable_len;
	u16 interface_type;
536

537
538
539
540
541
542
	if (adapter->phy.link_speed < 0) {
		status = be_cmd_link_status_query(adapter, &link_speed,
						  &link_status, 0);
		if (!status)
			be_link_status_update(adapter, link_status);
		ethtool_cmd_speed_set(ecmd, link_speed);
543
544

		status = be_cmd_get_phy_info(adapter);
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
		if (!status) {
			interface_type = adapter->phy.interface_type;
			auto_speeds = adapter->phy.auto_speeds_supported;
			fixed_speeds = adapter->phy.fixed_speeds_supported;
			dac_cable_len = adapter->phy.dac_cable_len;

			ecmd->supported =
				convert_to_et_setting(interface_type,
						      auto_speeds |
						      fixed_speeds);
			ecmd->advertising =
				convert_to_et_setting(interface_type,
						      auto_speeds);

			ecmd->port = be_get_port_type(interface_type,
						      dac_cable_len);

			if (adapter->phy.auto_speeds_supported) {
				ecmd->supported |= SUPPORTED_Autoneg;
				ecmd->autoneg = AUTONEG_ENABLE;
				ecmd->advertising |= ADVERTISED_Autoneg;
			}
567
568

			ecmd->supported |= SUPPORTED_Pause;
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
			if (be_pause_supported(adapter))
				ecmd->advertising |= ADVERTISED_Pause;

			switch (adapter->phy.interface_type) {
			case PHY_TYPE_KR_10GB:
			case PHY_TYPE_KX4_10GB:
				ecmd->transceiver = XCVR_INTERNAL;
				break;
			default:
				ecmd->transceiver = XCVR_EXTERNAL;
				break;
			}
		} else {
			ecmd->port = PORT_OTHER;
			ecmd->autoneg = AUTONEG_DISABLE;
			ecmd->transceiver = XCVR_DUMMY1;
585
		}
586
587

		/* Save for future use */
588
589
590
591
592
593
		adapter->phy.link_speed = ethtool_cmd_speed(ecmd);
		adapter->phy.port_type = ecmd->port;
		adapter->phy.transceiver = ecmd->transceiver;
		adapter->phy.autoneg = ecmd->autoneg;
		adapter->phy.advertising = ecmd->advertising;
		adapter->phy.supported = ecmd->supported;
594
	} else {
595
596
597
598
599
600
		ethtool_cmd_speed_set(ecmd, adapter->phy.link_speed);
		ecmd->port = adapter->phy.port_type;
		ecmd->transceiver = adapter->phy.transceiver;
		ecmd->autoneg = adapter->phy.autoneg;
		ecmd->advertising = adapter->phy.advertising;
		ecmd->supported = adapter->phy.supported;
601
	}
602

603
	ecmd->duplex = netif_carrier_ok(netdev) ? DUPLEX_FULL : DUPLEX_UNKNOWN;
604
	ecmd->phy_address = adapter->port_num;
605

Sathya Perla's avatar
Sathya Perla committed
606
607
608
	return 0;
}

609
610
static void be_get_ringparam(struct net_device *netdev,
			     struct ethtool_ringparam *ring)
Sathya Perla's avatar
Sathya Perla committed
611
612
613
{
	struct be_adapter *adapter = netdev_priv(netdev);

614
615
	ring->rx_max_pending = ring->rx_pending = adapter->rx_obj[0].q.len;
	ring->tx_max_pending = ring->tx_pending = adapter->tx_obj[0].q.len;
Sathya Perla's avatar
Sathya Perla committed
616
617
618
619
620
621
622
}

static void
be_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
{
	struct be_adapter *adapter = netdev_priv(netdev);

623
	be_cmd_get_flow_control(adapter, &ecmd->tx_pause, &ecmd->rx_pause);
624
	ecmd->autoneg = adapter->phy.fc_autoneg;
Sathya Perla's avatar
Sathya Perla committed
625
626
627
628
629
630
631
632
}

static int
be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
{
	struct be_adapter *adapter = netdev_priv(netdev);
	int status;

633
	if (ecmd->autoneg != adapter->phy.fc_autoneg)
Sathya Perla's avatar
Sathya Perla committed
634
		return -EINVAL;
635
636
	adapter->tx_fc = ecmd->tx_pause;
	adapter->rx_fc = ecmd->rx_pause;
Sathya Perla's avatar
Sathya Perla committed
637

638
639
640
	status = be_cmd_set_flow_control(adapter,
					adapter->tx_fc, adapter->rx_fc);
	if (status)
Sathya Perla's avatar
Sathya Perla committed
641
642
643
644
645
		dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");

	return status;
}

646
static int
647
648
be_set_phys_id(struct net_device *netdev,
	       enum ethtool_phys_id_state state)
649
650
651
{
	struct be_adapter *adapter = netdev_priv(netdev);

652
653
654
655
	switch (state) {
	case ETHTOOL_ID_ACTIVE:
		be_cmd_get_beacon_state(adapter, adapter->hba_port_num,
					&adapter->beacon_state);
656
		return 1;	/* cycle on/off once per second */
657

658
659
660
661
	case ETHTOOL_ID_ON:
		be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
					BEACON_STATE_ENABLED);
		break;
662

663
664
665
666
	case ETHTOOL_ID_OFF:
		be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
					BEACON_STATE_DISABLED);
		break;
667

668
669
670
671
	case ETHTOOL_ID_INACTIVE:
		be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
					adapter->beacon_state);
	}
672

673
	return 0;
674
675
}

676

677
678
679
680
681
static void
be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{
	struct be_adapter *adapter = netdev_priv(netdev);

682
683
	if (be_is_wol_supported(adapter)) {
		wol->supported |= WAKE_MAGIC;
684
685
		if (adapter->wol)
			wol->wolopts |= WAKE_MAGIC;
686
	} else
687
688
689
690
691
692
693
694
695
696
		wol->wolopts = 0;
	memset(&wol->sopass, 0, sizeof(wol->sopass));
}

static int
be_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{
	struct be_adapter *adapter = netdev_priv(netdev);

	if (wol->wolopts & ~WAKE_MAGIC)
697
698
699
700
701
702
		return -EOPNOTSUPP;

	if (!be_is_wol_supported(adapter)) {
		dev_warn(&adapter->pdev->dev, "WOL not supported\n");
		return -EOPNOTSUPP;
	}
703

704
	if (wol->wolopts & WAKE_MAGIC)
705
706
707
708
709
710
711
		adapter->wol = true;
	else
		adapter->wol = false;

	return 0;
}

712
713
714
715
716
static int
be_test_ddr_dma(struct be_adapter *adapter)
{
	int ret, i;
	struct be_dma_mem ddrdma_cmd;
Joe Perches's avatar
Joe Perches committed
717
718
719
	static const u64 pattern[2] = {
		0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL
	};
720
721

	ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
Ivan Vecera's avatar
Ivan Vecera committed
722
723
	ddrdma_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, ddrdma_cmd.size,
					   &ddrdma_cmd.dma, GFP_KERNEL);
724
	if (!ddrdma_cmd.va)
725
726
727
728
729
730
731
732
733
734
		return -ENOMEM;

	for (i = 0; i < 2; i++) {
		ret = be_cmd_ddr_dma_test(adapter, pattern[i],
					4096, &ddrdma_cmd);
		if (ret != 0)
			goto err;
	}

err:
Ivan Vecera's avatar
Ivan Vecera committed
735
736
	dma_free_coherent(&adapter->pdev->dev, ddrdma_cmd.size, ddrdma_cmd.va,
			  ddrdma_cmd.dma);
737
738
739
	return ret;
}

740
741
742
static u64 be_loopback_test(struct be_adapter *adapter, u8 loopback_type,
				u64 *status)
{
743
	be_cmd_set_loopback(adapter, adapter->hba_port_num,
744
				loopback_type, 1);
745
	*status = be_cmd_loopback_test(adapter, adapter->hba_port_num,
746
747
				loopback_type, 1500,
				2, 0xabc);
748
	be_cmd_set_loopback(adapter, adapter->hba_port_num,
749
750
751
752
				BE_NO_LOOPBACK, 1);
	return *status;
}

753
754
755
756
static void
be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
{
	struct be_adapter *adapter = netdev_priv(netdev);
757
758
	int status;
	u8 link_status = 0;
759

760
761
762
763
764
765
	if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) {
		dev_err(&adapter->pdev->dev, "Self test not supported\n");
		test->flags |= ETH_TEST_FL_FAILED;
		return;
	}

766
767
768
	memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM);

	if (test->flags & ETH_TEST_FL_OFFLINE) {
769
770
		if (be_loopback_test(adapter, BE_MAC_LOOPBACK,
						&data[0]) != 0) {
771
			test->flags |= ETH_TEST_FL_FAILED;
772
773
774
		}
		if (be_loopback_test(adapter, BE_PHY_LOOPBACK,
						&data[1]) != 0) {
775
			test->flags |= ETH_TEST_FL_FAILED;
776
777
778
		}
		if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
						&data[2]) != 0) {
779
			test->flags |= ETH_TEST_FL_FAILED;
780
		}
781
	}
782

783
	if (!lancer_chip(adapter) && be_test_ddr_dma(adapter) != 0) {
784
785
		data[3] = 1;
		test->flags |= ETH_TEST_FL_FAILED;
786
787
	}

788
789
	status = be_cmd_link_status_query(adapter, NULL, &link_status, 0);
	if (status) {
790
791
		test->flags |= ETH_TEST_FL_FAILED;
		data[4] = -1;
792
	} else if (!link_status) {
793
		test->flags |= ETH_TEST_FL_FAILED;
794
795
		data[4] = 1;
	}
796
797
}

798
799
800
801
802
static int
be_do_flash(struct net_device *netdev, struct ethtool_flash *efl)
{
	struct be_adapter *adapter = netdev_priv(netdev);

803
	return be_load_fw(adapter, efl->data);
804
805
}

806
807
808
static int
be_get_eeprom_len(struct net_device *netdev)
{
809
	struct be_adapter *adapter = netdev_priv(netdev);
810
811
812
813

	if (!check_privilege(adapter, MAX_PRIVILEGES))
		return 0;

814
815
816
817
818
819
820
821
822
823
	if (lancer_chip(adapter)) {
		if (be_physfn(adapter))
			return lancer_cmd_get_file_len(adapter,
					LANCER_VPD_PF_FILE);
		else
			return lancer_cmd_get_file_len(adapter,
					LANCER_VPD_VF_FILE);
	} else {
		return BE_READ_SEEPROM_LEN;
	}
824
825
826
827
828
829
830
831
832
833
834
835
836
837
}

static int
be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
			uint8_t *data)
{
	struct be_adapter *adapter = netdev_priv(netdev);
	struct be_dma_mem eeprom_cmd;
	struct be_cmd_resp_seeprom_read *resp;
	int status;

	if (!eeprom->len)
		return -EINVAL;

838
839
840
841
842
843
844
845
846
	if (lancer_chip(adapter)) {
		if (be_physfn(adapter))
			return lancer_cmd_read_file(adapter, LANCER_VPD_PF_FILE,
					eeprom->len, data);
		else
			return lancer_cmd_read_file(adapter, LANCER_VPD_VF_FILE,
					eeprom->len, data);
	}

847
848
849
850
	eeprom->magic = BE_VENDOR_ID | (adapter->pdev->device<<16);

	memset(&eeprom_cmd, 0, sizeof(struct be_dma_mem));
	eeprom_cmd.size = sizeof(struct be_cmd_req_seeprom_read);
Ivan Vecera's avatar
Ivan Vecera committed
851
852
	eeprom_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, eeprom_cmd.size,
					   &eeprom_cmd.dma, GFP_KERNEL);
853

854
	if (!eeprom_cmd.va)
855
856
857
858
859
		return -ENOMEM;

	status = be_cmd_get_seeprom_data(adapter, &eeprom_cmd);

	if (!status) {
860
		resp = eeprom_cmd.va;
861
		memcpy(data, resp->seeprom_data + eeprom->offset, eeprom->len);
862
	}
Ivan Vecera's avatar
Ivan Vecera committed
863
864
	dma_free_coherent(&adapter->pdev->dev, eeprom_cmd.size, eeprom_cmd.va,
			  eeprom_cmd.dma);
865
866
867
868

	return status;
}

869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
static u32 be_get_msg_level(struct net_device *netdev)
{
	struct be_adapter *adapter = netdev_priv(netdev);

	if (lancer_chip(adapter)) {
		dev_err(&adapter->pdev->dev, "Operation not supported\n");
		return -EOPNOTSUPP;
	}

	return adapter->msg_enable;
}

static void be_set_fw_log_level(struct be_adapter *adapter, u32 level)
{
	struct be_dma_mem extfat_cmd;
	struct be_fat_conf_params *cfgs;
	int status;
	int i, j;

	memset(&extfat_cmd, 0, sizeof(struct be_dma_mem));
	extfat_cmd.size = sizeof(struct be_cmd_resp_get_ext_fat_caps);
	extfat_cmd.va = pci_alloc_consistent(adapter->pdev, extfat_cmd.size,
					     &extfat_cmd.dma);
	if (!extfat_cmd.va) {
		dev_err(&adapter->pdev->dev, "%s: Memory allocation failure\n",
			__func__);
		goto err;
	}
	status = be_cmd_get_ext_fat_capabilites(adapter, &extfat_cmd);
	if (!status) {
		cfgs = (struct be_fat_conf_params *)(extfat_cmd.va +
					sizeof(struct be_cmd_resp_hdr));
901
902
903
		for (i = 0; i < le32_to_cpu(cfgs->num_modules); i++) {
			u32 num_modes = le32_to_cpu(cfgs->module[i].num_modes);
			for (j = 0; j < num_modes; j++) {
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
				if (cfgs->module[i].trace_lvl[j].mode ==
								MODE_UART)
					cfgs->module[i].trace_lvl[j].dbg_lvl =
							cpu_to_le32(level);
			}
		}
		status = be_cmd_set_ext_fat_capabilites(adapter, &extfat_cmd,
							cfgs);
		if (status)
			dev_err(&adapter->pdev->dev,
				"Message level set failed\n");
	} else {
		dev_err(&adapter->pdev->dev, "Message level get failed\n");
	}

	pci_free_consistent(adapter->pdev, extfat_cmd.size, extfat_cmd.va,
			    extfat_cmd.dma);
err:
	return;
}

static void be_set_msg_level(struct net_device *netdev, u32 level)
{
	struct be_adapter *adapter = netdev_priv(netdev);

	if (lancer_chip(adapter)) {
		dev_err(&adapter->pdev->dev, "Operation not supported\n");
		return;
	}

	if (adapter->msg_enable == level)
		return;

	if ((level & NETIF_MSG_HW) != (adapter->msg_enable & NETIF_MSG_HW))
		be_set_fw_log_level(adapter, level & NETIF_MSG_HW ?
				    FW_LOG_LEVEL_DEFAULT : FW_LOG_LEVEL_FATAL);
	adapter->msg_enable = level;

	return;
}

945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
static u64 be_get_rss_hash_opts(struct be_adapter *adapter, u64 flow_type)
{
	u64 data = 0;

	switch (flow_type) {
	case TCP_V4_FLOW:
		if (adapter->rss_flags & RSS_ENABLE_IPV4)
			data |= RXH_IP_DST | RXH_IP_SRC;
		if (adapter->rss_flags & RSS_ENABLE_TCP_IPV4)
			data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
		break;
	case UDP_V4_FLOW:
		if (adapter->rss_flags & RSS_ENABLE_IPV4)
			data |= RXH_IP_DST | RXH_IP_SRC;
		if (adapter->rss_flags & RSS_ENABLE_UDP_IPV4)
			data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
		break;
	case TCP_V6_FLOW:
		if (adapter->rss_flags & RSS_ENABLE_IPV6)
			data |= RXH_IP_DST | RXH_IP_SRC;
		if (adapter->rss_flags & RSS_ENABLE_TCP_IPV6)
			data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
		break;
	case UDP_V6_FLOW:
		if (adapter->rss_flags & RSS_ENABLE_IPV6)
			data |= RXH_IP_DST | RXH_IP_SRC;
		if (adapter->rss_flags & RSS_ENABLE_UDP_IPV6)
			data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
		break;
	}

	return data;
}

static int be_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
		      u32 *rule_locs)
{
	struct be_adapter *adapter = netdev_priv(netdev);

	if (!be_multi_rxq(adapter)) {
		dev_info(&adapter->pdev->dev,
			 "ethtool::get_rxnfc: RX flow hashing is disabled\n");
		return -EINVAL;
	}

	switch (cmd->cmd) {
	case ETHTOOL_GRXFH:
		cmd->data = be_get_rss_hash_opts(adapter, cmd->flow_type);
		break;
	case ETHTOOL_GRXRINGS:
		cmd->data = adapter->num_rx_qs - 1;
		break;
	default:
		return -EINVAL;
	}

	return 0;
}

static int be_set_rss_hash_opts(struct be_adapter *adapter,
				struct ethtool_rxnfc *cmd)
{
	struct be_rx_obj *rxo;
	int status = 0, i, j;
	u8 rsstable[128];
	u32 rss_flags = adapter->rss_flags;

	if (cmd->data != L3_RSS_FLAGS &&
	    cmd->data != (L3_RSS_FLAGS | L4_RSS_FLAGS))
		return -EINVAL;

	switch (cmd->flow_type) {
	case TCP_V4_FLOW:
		if (cmd->data == L3_RSS_FLAGS)
			rss_flags &= ~RSS_ENABLE_TCP_IPV4;
		else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
			rss_flags |= RSS_ENABLE_IPV4 |
					RSS_ENABLE_TCP_IPV4;
		break;
	case TCP_V6_FLOW:
		if (cmd->data == L3_RSS_FLAGS)
			rss_flags &= ~RSS_ENABLE_TCP_IPV6;
		else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
			rss_flags |= RSS_ENABLE_IPV6 |
					RSS_ENABLE_TCP_IPV6;
		break;
	case UDP_V4_FLOW:
		if ((cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS)) &&
		    BEx_chip(adapter))
			return -EINVAL;

		if (cmd->data == L3_RSS_FLAGS)
			rss_flags &= ~RSS_ENABLE_UDP_IPV4;
		else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
			rss_flags |= RSS_ENABLE_IPV4 |
					RSS_ENABLE_UDP_IPV4;
		break;
	case UDP_V6_FLOW:
		if ((cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS)) &&
		    BEx_chip(adapter))
			return -EINVAL;

		if (cmd->data == L3_RSS_FLAGS)
			rss_flags &= ~RSS_ENABLE_UDP_IPV6;
		else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
			rss_flags |= RSS_ENABLE_IPV6 |
					RSS_ENABLE_UDP_IPV6;
		break;
	default:
		return -EINVAL;
	}

	if (rss_flags == adapter->rss_flags)
		return status;

	if (be_multi_rxq(adapter)) {
		for (j = 0; j < 128; j += adapter->num_rx_qs - 1) {
			for_all_rss_queues(adapter, rxo, i) {
				if ((j + i) >= 128)
					break;
				rsstable[j + i] = rxo->rss_id;
			}
		}
	}
	status = be_cmd_rss_config(adapter, rsstable, rss_flags, 128);
	if (!status)
		adapter->rss_flags = rss_flags;

	return status;
}

static int be_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
{
	struct be_adapter *adapter = netdev_priv(netdev);
	int status = 0;

	if (!be_multi_rxq(adapter)) {
		dev_err(&adapter->pdev->dev,
			"ethtool::set_rxnfc: RX flow hashing is disabled\n");
		return -EINVAL;
	}

	switch (cmd->cmd) {
	case ETHTOOL_SRXFH:
		status = be_set_rss_hash_opts(adapter, cmd);
		break;
	default:
		return -EINVAL;
	}

	return status;
}

1098
const struct ethtool_ops be_ethtool_ops = {
Sathya Perla's avatar
Sathya Perla committed
1099
1100
	.get_settings = be_get_settings,
	.get_drvinfo = be_get_drvinfo,
1101
1102
	.get_wol = be_get_wol,
	.set_wol = be_set_wol,
Sathya Perla's avatar
Sathya Perla committed
1103
	.get_link = ethtool_op_get_link,
1104
1105
	.get_eeprom_len = be_get_eeprom_len,
	.get_eeprom = be_read_eeprom,
Sathya Perla's avatar
Sathya Perla committed
1106
1107
1108
1109
1110
1111
	.get_coalesce = be_get_coalesce,
	.set_coalesce = be_set_coalesce,
	.get_ringparam = be_get_ringparam,
	.get_pauseparam = be_get_pauseparam,
	.set_pauseparam = be_set_pauseparam,
	.get_strings = be_get_stat_strings,
1112
	.set_phys_id = be_set_phys_id,
1113
1114
	.get_msglevel = be_get_msg_level,
	.set_msglevel = be_set_msg_level,
1115
	.get_sset_count = be_get_sset_count,
Sathya Perla's avatar
Sathya Perla committed
1116
	.get_ethtool_stats = be_get_ethtool_stats,
1117
1118
	.get_regs_len = be_get_reg_len,
	.get_regs = be_get_regs,
1119
	.flash_device = be_do_flash,
1120
	.self_test = be_self_test,
1121
1122
	.get_rxnfc = be_get_rxnfc,
	.set_rxnfc = be_set_rxnfc,
Sathya Perla's avatar
Sathya Perla committed
1123
};