2 * Copyright (C) 2005 - 2011 Emulex
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation. The full GNU General
8 * Public License is included in this distribution in the file called COPYING.
10 * Contact Information:
11 * linux-drivers@emulex.com
15 * Costa Mesa, CA 92626
20 #include <linux/ethtool.h>
22 struct be_ethtool_stat
{
23 char desc
[ETH_GSTRING_LEN
];
29 enum {NETSTAT
, DRVSTAT_TX
, DRVSTAT_RX
, ERXSTAT
,
31 #define FIELDINFO(_struct, field) FIELD_SIZEOF(_struct, field), \
32 offsetof(_struct, field)
33 #define NETSTAT_INFO(field) #field, NETSTAT,\
34 FIELDINFO(struct net_device_stats,\
36 #define DRVSTAT_TX_INFO(field) #field, DRVSTAT_TX,\
37 FIELDINFO(struct be_tx_stats, field)
38 #define DRVSTAT_RX_INFO(field) #field, DRVSTAT_RX,\
39 FIELDINFO(struct be_rx_stats, field)
40 #define ERXSTAT_INFO(field) #field, ERXSTAT,\
41 FIELDINFO(struct be_erx_stats_v1, field)
42 #define DRVSTAT_INFO(field) #field, DRVSTAT,\
43 FIELDINFO(struct be_drv_stats, \
46 static const struct be_ethtool_stat et_stats
[] = {
47 {NETSTAT_INFO(rx_packets
)},
48 {NETSTAT_INFO(tx_packets
)},
49 {NETSTAT_INFO(rx_bytes
)},
50 {NETSTAT_INFO(tx_bytes
)},
51 {NETSTAT_INFO(rx_errors
)},
52 {NETSTAT_INFO(tx_errors
)},
53 {NETSTAT_INFO(rx_dropped
)},
54 {NETSTAT_INFO(tx_dropped
)},
55 {DRVSTAT_TX_INFO(be_tx_rate
)},
56 {DRVSTAT_TX_INFO(be_tx_reqs
)},
57 {DRVSTAT_TX_INFO(be_tx_wrbs
)},
58 {DRVSTAT_TX_INFO(be_tx_stops
)},
59 {DRVSTAT_TX_INFO(be_tx_events
)},
60 {DRVSTAT_TX_INFO(be_tx_compl
)},
61 {DRVSTAT_INFO(rx_crc_errors
)},
62 {DRVSTAT_INFO(rx_alignment_symbol_errors
)},
63 {DRVSTAT_INFO(rx_pause_frames
)},
64 {DRVSTAT_INFO(rx_control_frames
)},
65 {DRVSTAT_INFO(rx_in_range_errors
)},
66 {DRVSTAT_INFO(rx_out_range_errors
)},
67 {DRVSTAT_INFO(rx_frame_too_long
)},
68 {DRVSTAT_INFO(rx_address_match_errors
)},
69 {DRVSTAT_INFO(rx_dropped_too_small
)},
70 {DRVSTAT_INFO(rx_dropped_too_short
)},
71 {DRVSTAT_INFO(rx_dropped_header_too_small
)},
72 {DRVSTAT_INFO(rx_dropped_tcp_length
)},
73 {DRVSTAT_INFO(rx_dropped_runt
)},
74 {DRVSTAT_INFO(rxpp_fifo_overflow_drop
)},
75 {DRVSTAT_INFO(rx_input_fifo_overflow_drop
)},
76 {DRVSTAT_INFO(rx_ip_checksum_errs
)},
77 {DRVSTAT_INFO(rx_tcp_checksum_errs
)},
78 {DRVSTAT_INFO(rx_udp_checksum_errs
)},
79 {DRVSTAT_INFO(rx_switched_unicast_packets
)},
80 {DRVSTAT_INFO(rx_switched_multicast_packets
)},
81 {DRVSTAT_INFO(rx_switched_broadcast_packets
)},
82 {DRVSTAT_INFO(tx_pauseframes
)},
83 {DRVSTAT_INFO(tx_controlframes
)},
84 {DRVSTAT_INFO(rx_priority_pause_frames
)},
85 {DRVSTAT_INFO(pmem_fifo_overflow_drop
)},
86 {DRVSTAT_INFO(jabber_events
)},
87 {DRVSTAT_INFO(rx_drops_no_pbuf
)},
88 {DRVSTAT_INFO(rx_drops_no_txpb
)},
89 {DRVSTAT_INFO(rx_drops_no_erx_descr
)},
90 {DRVSTAT_INFO(rx_drops_no_tpre_descr
)},
91 {DRVSTAT_INFO(rx_drops_too_many_frags
)},
92 {DRVSTAT_INFO(rx_drops_invalid_ring
)},
93 {DRVSTAT_INFO(forwarded_packets
)},
94 {DRVSTAT_INFO(rx_drops_mtu
)},
95 {DRVSTAT_INFO(eth_red_drops
)},
96 {DRVSTAT_INFO(be_on_die_temperature
)}
98 #define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats)
100 /* Stats related to multi RX queues */
101 static const struct be_ethtool_stat et_rx_stats
[] = {
102 {DRVSTAT_RX_INFO(rx_bytes
)},
103 {DRVSTAT_RX_INFO(rx_pkts
)},
104 {DRVSTAT_RX_INFO(rx_rate
)},
105 {DRVSTAT_RX_INFO(rx_polls
)},
106 {DRVSTAT_RX_INFO(rx_events
)},
107 {DRVSTAT_RX_INFO(rx_compl
)},
108 {DRVSTAT_RX_INFO(rx_mcast_pkts
)},
109 {DRVSTAT_RX_INFO(rx_post_fail
)},
110 {ERXSTAT_INFO(rx_drops_no_fragments
)}
112 #define ETHTOOL_RXSTATS_NUM (ARRAY_SIZE(et_rx_stats))
114 static const char et_self_tests
[][ETH_GSTRING_LEN
] = {
117 "External Loopback test",
122 #define ETHTOOL_TESTS_NUM ARRAY_SIZE(et_self_tests)
123 #define BE_MAC_LOOPBACK 0x0
124 #define BE_PHY_LOOPBACK 0x1
125 #define BE_ONE_PORT_EXT_LOOPBACK 0x2
126 #define BE_NO_LOOPBACK 0xff
129 be_get_drvinfo(struct net_device
*netdev
, struct ethtool_drvinfo
*drvinfo
)
131 struct be_adapter
*adapter
= netdev_priv(netdev
);
133 strcpy(drvinfo
->driver
, DRV_NAME
);
134 strcpy(drvinfo
->version
, DRV_VER
);
135 strncpy(drvinfo
->fw_version
, adapter
->fw_ver
, FW_VER_LEN
);
136 strcpy(drvinfo
->bus_info
, pci_name(adapter
->pdev
));
137 drvinfo
->testinfo_len
= 0;
138 drvinfo
->regdump_len
= 0;
139 drvinfo
->eedump_len
= 0;
143 be_get_reg_len(struct net_device
*netdev
)
145 struct be_adapter
*adapter
= netdev_priv(netdev
);
148 if (be_physfn(adapter
))
149 be_cmd_get_reg_len(adapter
, &log_size
);
155 be_get_regs(struct net_device
*netdev
, struct ethtool_regs
*regs
, void *buf
)
157 struct be_adapter
*adapter
= netdev_priv(netdev
);
159 if (be_physfn(adapter
)) {
160 memset(buf
, 0, regs
->len
);
161 be_cmd_get_regs(adapter
, regs
->len
, buf
);
166 be_get_coalesce(struct net_device
*netdev
, struct ethtool_coalesce
*coalesce
)
168 struct be_adapter
*adapter
= netdev_priv(netdev
);
169 struct be_eq_obj
*rx_eq
= &adapter
->rx_obj
[0].rx_eq
;
170 struct be_eq_obj
*tx_eq
= &adapter
->tx_eq
;
172 coalesce
->rx_coalesce_usecs
= rx_eq
->cur_eqd
;
173 coalesce
->rx_coalesce_usecs_high
= rx_eq
->max_eqd
;
174 coalesce
->rx_coalesce_usecs_low
= rx_eq
->min_eqd
;
176 coalesce
->tx_coalesce_usecs
= tx_eq
->cur_eqd
;
177 coalesce
->tx_coalesce_usecs_high
= tx_eq
->max_eqd
;
178 coalesce
->tx_coalesce_usecs_low
= tx_eq
->min_eqd
;
180 coalesce
->use_adaptive_rx_coalesce
= rx_eq
->enable_aic
;
181 coalesce
->use_adaptive_tx_coalesce
= tx_eq
->enable_aic
;
187 * This routine is used to set interrup coalescing delay
190 be_set_coalesce(struct net_device
*netdev
, struct ethtool_coalesce
*coalesce
)
192 struct be_adapter
*adapter
= netdev_priv(netdev
);
193 struct be_rx_obj
*rxo
;
194 struct be_eq_obj
*rx_eq
;
195 struct be_eq_obj
*tx_eq
= &adapter
->tx_eq
;
196 u32 rx_max
, rx_min
, rx_cur
;
200 if (coalesce
->use_adaptive_tx_coalesce
== 1)
203 for_all_rx_queues(adapter
, rxo
, i
) {
206 if (!rx_eq
->enable_aic
&& coalesce
->use_adaptive_rx_coalesce
)
208 rx_eq
->enable_aic
= coalesce
->use_adaptive_rx_coalesce
;
210 rx_max
= coalesce
->rx_coalesce_usecs_high
;
211 rx_min
= coalesce
->rx_coalesce_usecs_low
;
212 rx_cur
= coalesce
->rx_coalesce_usecs
;
214 if (rx_eq
->enable_aic
) {
215 if (rx_max
> BE_MAX_EQD
)
219 rx_eq
->max_eqd
= rx_max
;
220 rx_eq
->min_eqd
= rx_min
;
221 if (rx_eq
->cur_eqd
> rx_max
)
222 rx_eq
->cur_eqd
= rx_max
;
223 if (rx_eq
->cur_eqd
< rx_min
)
224 rx_eq
->cur_eqd
= rx_min
;
226 if (rx_cur
> BE_MAX_EQD
)
228 if (rx_eq
->cur_eqd
!= rx_cur
) {
229 status
= be_cmd_modify_eqd(adapter
, rx_eq
->q
.id
,
232 rx_eq
->cur_eqd
= rx_cur
;
237 tx_cur
= coalesce
->tx_coalesce_usecs
;
239 if (tx_cur
> BE_MAX_EQD
)
241 if (tx_eq
->cur_eqd
!= tx_cur
) {
242 status
= be_cmd_modify_eqd(adapter
, tx_eq
->q
.id
, tx_cur
);
244 tx_eq
->cur_eqd
= tx_cur
;
251 be_get_ethtool_stats(struct net_device
*netdev
,
252 struct ethtool_stats
*stats
, uint64_t *data
)
254 struct be_adapter
*adapter
= netdev_priv(netdev
);
255 struct be_rx_obj
*rxo
;
259 for (i
= 0; i
< ETHTOOL_STATS_NUM
; i
++) {
260 switch (et_stats
[i
].type
) {
265 p
= &adapter
->tx_stats
;
268 p
= &adapter
->drv_stats
;
272 p
= (u8
*)p
+ et_stats
[i
].offset
;
273 data
[i
] = (et_stats
[i
].size
== sizeof(u64
)) ?
274 *(u64
*)p
: *(u32
*)p
;
277 for_all_rx_queues(adapter
, rxo
, j
) {
278 for (i
= 0; i
< ETHTOOL_RXSTATS_NUM
; i
++) {
279 switch (et_rx_stats
[i
].type
) {
281 p
= (u8
*)&rxo
->stats
+ et_rx_stats
[i
].offset
;
284 p
= (u32
*)be_erx_stats_from_cmd(adapter
) +
288 data
[ETHTOOL_STATS_NUM
+ j
* ETHTOOL_RXSTATS_NUM
+ i
] =
289 (et_rx_stats
[i
].size
== sizeof(u64
)) ?
290 *(u64
*)p
: *(u32
*)p
;
296 be_get_stat_strings(struct net_device
*netdev
, uint32_t stringset
,
299 struct be_adapter
*adapter
= netdev_priv(netdev
);
304 for (i
= 0; i
< ETHTOOL_STATS_NUM
; i
++) {
305 memcpy(data
, et_stats
[i
].desc
, ETH_GSTRING_LEN
);
306 data
+= ETH_GSTRING_LEN
;
308 for (i
= 0; i
< adapter
->num_rx_qs
; i
++) {
309 for (j
= 0; j
< ETHTOOL_RXSTATS_NUM
; j
++) {
310 sprintf(data
, "rxq%d: %s", i
,
311 et_rx_stats
[j
].desc
);
312 data
+= ETH_GSTRING_LEN
;
317 for (i
= 0; i
< ETHTOOL_TESTS_NUM
; i
++) {
318 memcpy(data
, et_self_tests
[i
], ETH_GSTRING_LEN
);
319 data
+= ETH_GSTRING_LEN
;
325 static int be_get_sset_count(struct net_device
*netdev
, int stringset
)
327 struct be_adapter
*adapter
= netdev_priv(netdev
);
331 return ETHTOOL_TESTS_NUM
;
333 return ETHTOOL_STATS_NUM
+
334 adapter
->num_rx_qs
* ETHTOOL_RXSTATS_NUM
;
340 static int be_get_settings(struct net_device
*netdev
, struct ethtool_cmd
*ecmd
)
342 struct be_adapter
*adapter
= netdev_priv(netdev
);
343 struct be_dma_mem phy_cmd
;
344 struct be_cmd_resp_get_phy_info
*resp
;
347 bool link_up
= false;
351 if ((adapter
->link_speed
< 0) || (!(netdev
->flags
& IFF_UP
))) {
352 status
= be_cmd_link_status_query(adapter
, &link_up
,
353 &mac_speed
, &link_speed
, 0);
355 be_link_status_update(adapter
, link_up
);
356 /* link_speed is in units of 10 Mbps */
358 ethtool_cmd_speed_set(ecmd
, link_speed
*10);
361 case PHY_LINK_SPEED_10MBPS
:
362 ethtool_cmd_speed_set(ecmd
, SPEED_10
);
364 case PHY_LINK_SPEED_100MBPS
:
365 ethtool_cmd_speed_set(ecmd
, SPEED_100
);
367 case PHY_LINK_SPEED_1GBPS
:
368 ethtool_cmd_speed_set(ecmd
, SPEED_1000
);
370 case PHY_LINK_SPEED_10GBPS
:
371 ethtool_cmd_speed_set(ecmd
, SPEED_10000
);
373 case PHY_LINK_SPEED_ZERO
:
374 ethtool_cmd_speed_set(ecmd
, 0);
379 phy_cmd
.size
= sizeof(struct be_cmd_req_get_phy_info
);
380 phy_cmd
.va
= dma_alloc_coherent(&adapter
->pdev
->dev
,
381 phy_cmd
.size
, &phy_cmd
.dma
,
384 dev_err(&adapter
->pdev
->dev
, "Memory alloc failure\n");
387 status
= be_cmd_get_phy_info(adapter
, &phy_cmd
);
389 resp
= (struct be_cmd_resp_get_phy_info
*) phy_cmd
.va
;
390 intf_type
= le16_to_cpu(resp
->interface_type
);
393 case PHY_TYPE_XFP_10GB
:
394 case PHY_TYPE_SFP_1GB
:
395 case PHY_TYPE_SFP_PLUS_10GB
:
396 ecmd
->port
= PORT_FIBRE
;
399 ecmd
->port
= PORT_TP
;
404 case PHY_TYPE_KR_10GB
:
405 case PHY_TYPE_KX4_10GB
:
406 ecmd
->autoneg
= AUTONEG_ENABLE
;
407 ecmd
->transceiver
= XCVR_INTERNAL
;
410 ecmd
->autoneg
= AUTONEG_DISABLE
;
411 ecmd
->transceiver
= XCVR_EXTERNAL
;
416 /* Save for future use */
417 adapter
->link_speed
= ethtool_cmd_speed(ecmd
);
418 adapter
->port_type
= ecmd
->port
;
419 adapter
->transceiver
= ecmd
->transceiver
;
420 adapter
->autoneg
= ecmd
->autoneg
;
421 dma_free_coherent(&adapter
->pdev
->dev
, phy_cmd
.size
, phy_cmd
.va
,
424 ethtool_cmd_speed_set(ecmd
, adapter
->link_speed
);
425 ecmd
->port
= adapter
->port_type
;
426 ecmd
->transceiver
= adapter
->transceiver
;
427 ecmd
->autoneg
= adapter
->autoneg
;
430 ecmd
->duplex
= DUPLEX_FULL
;
431 ecmd
->phy_address
= adapter
->port_num
;
432 switch (ecmd
->port
) {
434 ecmd
->supported
= (SUPPORTED_10000baseT_Full
| SUPPORTED_FIBRE
);
437 ecmd
->supported
= (SUPPORTED_10000baseT_Full
| SUPPORTED_TP
);
440 ecmd
->supported
= (SUPPORTED_10000baseT_Full
| SUPPORTED_AUI
);
445 ecmd
->supported
|= SUPPORTED_1000baseT_Full
;
446 ecmd
->supported
|= SUPPORTED_Autoneg
;
447 ecmd
->advertising
|= (ADVERTISED_10000baseT_Full
|
448 ADVERTISED_1000baseT_Full
);
455 be_get_ringparam(struct net_device
*netdev
, struct ethtool_ringparam
*ring
)
457 struct be_adapter
*adapter
= netdev_priv(netdev
);
459 ring
->rx_max_pending
= adapter
->rx_obj
[0].q
.len
;
460 ring
->tx_max_pending
= adapter
->tx_obj
.q
.len
;
462 ring
->rx_pending
= atomic_read(&adapter
->rx_obj
[0].q
.used
);
463 ring
->tx_pending
= atomic_read(&adapter
->tx_obj
.q
.used
);
467 be_get_pauseparam(struct net_device
*netdev
, struct ethtool_pauseparam
*ecmd
)
469 struct be_adapter
*adapter
= netdev_priv(netdev
);
471 be_cmd_get_flow_control(adapter
, &ecmd
->tx_pause
, &ecmd
->rx_pause
);
476 be_set_pauseparam(struct net_device
*netdev
, struct ethtool_pauseparam
*ecmd
)
478 struct be_adapter
*adapter
= netdev_priv(netdev
);
481 if (ecmd
->autoneg
!= 0)
483 adapter
->tx_fc
= ecmd
->tx_pause
;
484 adapter
->rx_fc
= ecmd
->rx_pause
;
486 status
= be_cmd_set_flow_control(adapter
,
487 adapter
->tx_fc
, adapter
->rx_fc
);
489 dev_warn(&adapter
->pdev
->dev
, "Pause param set failed.\n");
495 be_set_phys_id(struct net_device
*netdev
,
496 enum ethtool_phys_id_state state
)
498 struct be_adapter
*adapter
= netdev_priv(netdev
);
501 case ETHTOOL_ID_ACTIVE
:
502 be_cmd_get_beacon_state(adapter
, adapter
->hba_port_num
,
503 &adapter
->beacon_state
);
504 return 1; /* cycle on/off once per second */
507 be_cmd_set_beacon_state(adapter
, adapter
->hba_port_num
, 0, 0,
508 BEACON_STATE_ENABLED
);
512 be_cmd_set_beacon_state(adapter
, adapter
->hba_port_num
, 0, 0,
513 BEACON_STATE_DISABLED
);
516 case ETHTOOL_ID_INACTIVE
:
517 be_cmd_set_beacon_state(adapter
, adapter
->hba_port_num
, 0, 0,
518 adapter
->beacon_state
);
525 be_is_wol_supported(struct be_adapter
*adapter
)
527 if (!be_physfn(adapter
))
534 be_get_wol(struct net_device
*netdev
, struct ethtool_wolinfo
*wol
)
536 struct be_adapter
*adapter
= netdev_priv(netdev
);
538 if (be_is_wol_supported(adapter
))
539 wol
->supported
= WAKE_MAGIC
;
542 wol
->wolopts
= WAKE_MAGIC
;
545 memset(&wol
->sopass
, 0, sizeof(wol
->sopass
));
549 be_set_wol(struct net_device
*netdev
, struct ethtool_wolinfo
*wol
)
551 struct be_adapter
*adapter
= netdev_priv(netdev
);
553 if (wol
->wolopts
& ~WAKE_MAGIC
)
556 if ((wol
->wolopts
& WAKE_MAGIC
) && be_is_wol_supported(adapter
))
559 adapter
->wol
= false;
565 be_test_ddr_dma(struct be_adapter
*adapter
)
568 struct be_dma_mem ddrdma_cmd
;
569 static const u64 pattern
[2] = {
570 0x5a5a5a5a5a5a5a5aULL
, 0xa5a5a5a5a5a5a5a5ULL
573 ddrdma_cmd
.size
= sizeof(struct be_cmd_req_ddrdma_test
);
574 ddrdma_cmd
.va
= dma_alloc_coherent(&adapter
->pdev
->dev
, ddrdma_cmd
.size
,
575 &ddrdma_cmd
.dma
, GFP_KERNEL
);
576 if (!ddrdma_cmd
.va
) {
577 dev_err(&adapter
->pdev
->dev
, "Memory allocation failure\n");
581 for (i
= 0; i
< 2; i
++) {
582 ret
= be_cmd_ddr_dma_test(adapter
, pattern
[i
],
589 dma_free_coherent(&adapter
->pdev
->dev
, ddrdma_cmd
.size
, ddrdma_cmd
.va
,
594 static u64
be_loopback_test(struct be_adapter
*adapter
, u8 loopback_type
,
597 be_cmd_set_loopback(adapter
, adapter
->hba_port_num
,
599 *status
= be_cmd_loopback_test(adapter
, adapter
->hba_port_num
,
602 be_cmd_set_loopback(adapter
, adapter
->hba_port_num
,
608 be_self_test(struct net_device
*netdev
, struct ethtool_test
*test
, u64
*data
)
610 struct be_adapter
*adapter
= netdev_priv(netdev
);
613 u16 qos_link_speed
= 0;
615 memset(data
, 0, sizeof(u64
) * ETHTOOL_TESTS_NUM
);
617 if (test
->flags
& ETH_TEST_FL_OFFLINE
) {
618 if (be_loopback_test(adapter
, BE_MAC_LOOPBACK
,
620 test
->flags
|= ETH_TEST_FL_FAILED
;
622 if (be_loopback_test(adapter
, BE_PHY_LOOPBACK
,
624 test
->flags
|= ETH_TEST_FL_FAILED
;
626 if (be_loopback_test(adapter
, BE_ONE_PORT_EXT_LOOPBACK
,
628 test
->flags
|= ETH_TEST_FL_FAILED
;
632 if (be_test_ddr_dma(adapter
) != 0) {
634 test
->flags
|= ETH_TEST_FL_FAILED
;
637 if (be_cmd_link_status_query(adapter
, &link_up
, &mac_speed
,
638 &qos_link_speed
, 0) != 0) {
639 test
->flags
|= ETH_TEST_FL_FAILED
;
641 } else if (!mac_speed
) {
642 test
->flags
|= ETH_TEST_FL_FAILED
;
648 be_do_flash(struct net_device
*netdev
, struct ethtool_flash
*efl
)
650 struct be_adapter
*adapter
= netdev_priv(netdev
);
651 char file_name
[ETHTOOL_FLASH_MAX_FILENAME
];
653 file_name
[ETHTOOL_FLASH_MAX_FILENAME
- 1] = 0;
654 strcpy(file_name
, efl
->data
);
656 return be_load_fw(adapter
, file_name
);
660 be_get_eeprom_len(struct net_device
*netdev
)
662 return BE_READ_SEEPROM_LEN
;
666 be_read_eeprom(struct net_device
*netdev
, struct ethtool_eeprom
*eeprom
,
669 struct be_adapter
*adapter
= netdev_priv(netdev
);
670 struct be_dma_mem eeprom_cmd
;
671 struct be_cmd_resp_seeprom_read
*resp
;
677 eeprom
->magic
= BE_VENDOR_ID
| (adapter
->pdev
->device
<<16);
679 memset(&eeprom_cmd
, 0, sizeof(struct be_dma_mem
));
680 eeprom_cmd
.size
= sizeof(struct be_cmd_req_seeprom_read
);
681 eeprom_cmd
.va
= dma_alloc_coherent(&adapter
->pdev
->dev
, eeprom_cmd
.size
,
682 &eeprom_cmd
.dma
, GFP_KERNEL
);
684 if (!eeprom_cmd
.va
) {
685 dev_err(&adapter
->pdev
->dev
,
686 "Memory allocation failure. Could not read eeprom\n");
690 status
= be_cmd_get_seeprom_data(adapter
, &eeprom_cmd
);
693 resp
= (struct be_cmd_resp_seeprom_read
*) eeprom_cmd
.va
;
694 memcpy(data
, resp
->seeprom_data
+ eeprom
->offset
, eeprom
->len
);
696 dma_free_coherent(&adapter
->pdev
->dev
, eeprom_cmd
.size
, eeprom_cmd
.va
,
702 const struct ethtool_ops be_ethtool_ops
= {
703 .get_settings
= be_get_settings
,
704 .get_drvinfo
= be_get_drvinfo
,
705 .get_wol
= be_get_wol
,
706 .set_wol
= be_set_wol
,
707 .get_link
= ethtool_op_get_link
,
708 .get_eeprom_len
= be_get_eeprom_len
,
709 .get_eeprom
= be_read_eeprom
,
710 .get_coalesce
= be_get_coalesce
,
711 .set_coalesce
= be_set_coalesce
,
712 .get_ringparam
= be_get_ringparam
,
713 .get_pauseparam
= be_get_pauseparam
,
714 .set_pauseparam
= be_set_pauseparam
,
715 .get_strings
= be_get_stat_strings
,
716 .set_phys_id
= be_set_phys_id
,
717 .get_sset_count
= be_get_sset_count
,
718 .get_ethtool_stats
= be_get_ethtool_stats
,
719 .get_regs_len
= be_get_reg_len
,
720 .get_regs
= be_get_regs
,
721 .flash_device
= be_do_flash
,
722 .self_test
= be_self_test
,