2 * Linux network driver for Brocade Converged Network Adapter.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License (GPL) Version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
14 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
21 #include <linux/netdevice.h>
22 #include <linux/skbuff.h>
23 #include <linux/ethtool.h>
24 #include <linux/rtnetlink.h>
30 #define BNAD_NUM_TXF_COUNTERS 12
31 #define BNAD_NUM_RXF_COUNTERS 10
32 #define BNAD_NUM_CQ_COUNTERS 3
33 #define BNAD_NUM_RXQ_COUNTERS 6
34 #define BNAD_NUM_TXQ_COUNTERS 5
36 #define BNAD_ETHTOOL_STATS_NUM \
37 (sizeof(struct rtnl_link_stats64) / sizeof(u64) + \
38 sizeof(struct bnad_drv_stats) / sizeof(u64) + \
39 offsetof(struct bfi_ll_stats, rxf_stats[0]) / sizeof(u64))
41 static char *bnad_net_stats_strings
[BNAD_ETHTOOL_STATS_NUM
] = {
63 "tx_heartbeat_errors",
71 "netif_queue_stopped",
87 "rxp_info_alloc_failed",
90 "tx_unmap_q_alloc_failed",
91 "rx_unmap_q_alloc_failed",
99 "mac_frame_1024_1518",
100 "mac_frame_1518_1522",
106 "mac_rx_control_frames",
108 "mac_rx_unknown_opcode",
109 "mac_rx_alignment_error",
110 "mac_rx_frame_length_error",
112 "mac_rx_carrier_sense_error",
125 "mac_tx_excessive_deferral",
126 "mac_tx_single_collision",
127 "mac_tx_muliple_collision",
128 "mac_tx_late_collision",
129 "mac_tx_excessive_collision",
130 "mac_tx_total_collision",
131 "mac_tx_pause_honored",
135 "mac_tx_control_frame",
148 "bpc_tx_zero_pause_0",
149 "bpc_tx_zero_pause_1",
150 "bpc_tx_zero_pause_2",
151 "bpc_tx_zero_pause_3",
152 "bpc_tx_zero_pause_4",
153 "bpc_tx_zero_pause_5",
154 "bpc_tx_zero_pause_6",
155 "bpc_tx_zero_pause_7",
156 "bpc_tx_first_pause_0",
157 "bpc_tx_first_pause_1",
158 "bpc_tx_first_pause_2",
159 "bpc_tx_first_pause_3",
160 "bpc_tx_first_pause_4",
161 "bpc_tx_first_pause_5",
162 "bpc_tx_first_pause_6",
163 "bpc_tx_first_pause_7",
173 "bpc_rx_zero_pause_0",
174 "bpc_rx_zero_pause_1",
175 "bpc_rx_zero_pause_2",
176 "bpc_rx_zero_pause_3",
177 "bpc_rx_zero_pause_4",
178 "bpc_rx_zero_pause_5",
179 "bpc_rx_zero_pause_6",
180 "bpc_rx_zero_pause_7",
181 "bpc_rx_first_pause_0",
182 "bpc_rx_first_pause_1",
183 "bpc_rx_first_pause_2",
184 "bpc_rx_first_pause_3",
185 "bpc_rx_first_pause_4",
186 "bpc_rx_first_pause_5",
187 "bpc_rx_first_pause_6",
188 "bpc_rx_first_pause_7",
192 "rad_rx_vlan_frames",
194 "rad_rx_ucast_octets",
197 "rad_rx_mcast_octets",
200 "rad_rx_bcast_octets",
204 "fc_rx_ucast_octets",
207 "fc_rx_mcast_octets",
210 "fc_rx_bcast_octets",
214 "fc_tx_ucast_octets",
217 "fc_tx_mcast_octets",
220 "fc_tx_bcast_octets",
223 "fc_tx_parity_errors",
225 "fc_tx_fid_parity_errors",
229 bnad_get_settings(struct net_device
*netdev
, struct ethtool_cmd
*cmd
)
231 cmd
->supported
= SUPPORTED_10000baseT_Full
;
232 cmd
->advertising
= ADVERTISED_10000baseT_Full
;
233 cmd
->autoneg
= AUTONEG_DISABLE
;
234 cmd
->supported
|= SUPPORTED_FIBRE
;
235 cmd
->advertising
|= ADVERTISED_FIBRE
;
236 cmd
->port
= PORT_FIBRE
;
237 cmd
->phy_address
= 0;
239 if (netif_carrier_ok(netdev
)) {
240 ethtool_cmd_speed_set(cmd
, SPEED_10000
);
241 cmd
->duplex
= DUPLEX_FULL
;
243 ethtool_cmd_speed_set(cmd
, -1);
246 cmd
->transceiver
= XCVR_EXTERNAL
;
254 bnad_set_settings(struct net_device
*netdev
, struct ethtool_cmd
*cmd
)
256 /* 10G full duplex setting supported only */
257 if (cmd
->autoneg
== AUTONEG_ENABLE
)
258 return -EOPNOTSUPP
; else {
259 if ((ethtool_cmd_speed(cmd
) == SPEED_10000
)
260 && (cmd
->duplex
== DUPLEX_FULL
))
268 bnad_get_drvinfo(struct net_device
*netdev
, struct ethtool_drvinfo
*drvinfo
)
270 struct bnad
*bnad
= netdev_priv(netdev
);
271 struct bfa_ioc_attr
*ioc_attr
;
274 strcpy(drvinfo
->driver
, BNAD_NAME
);
275 strcpy(drvinfo
->version
, BNAD_VERSION
);
277 ioc_attr
= kzalloc(sizeof(*ioc_attr
), GFP_KERNEL
);
279 spin_lock_irqsave(&bnad
->bna_lock
, flags
);
280 bfa_nw_ioc_get_attr(&bnad
->bna
.device
.ioc
, ioc_attr
);
281 spin_unlock_irqrestore(&bnad
->bna_lock
, flags
);
283 strncpy(drvinfo
->fw_version
, ioc_attr
->adapter_attr
.fw_ver
,
284 sizeof(drvinfo
->fw_version
) - 1);
288 strncpy(drvinfo
->bus_info
, pci_name(bnad
->pcidev
), ETHTOOL_BUSINFO_LEN
);
292 get_regs(struct bnad
*bnad
, u32
* regs
)
298 #define BNAD_GET_REG(addr) \
301 regs[num++] = readl(bnad->bar0 + (addr)); \
306 spin_lock_irqsave(&bnad
->bna_lock
, flags
);
308 /* DMA Block Internal Registers */
309 BNAD_GET_REG(DMA_CTRL_REG0
);
310 BNAD_GET_REG(DMA_CTRL_REG1
);
311 BNAD_GET_REG(DMA_ERR_INT_STATUS
);
312 BNAD_GET_REG(DMA_ERR_INT_ENABLE
);
313 BNAD_GET_REG(DMA_ERR_INT_STATUS_SET
);
315 /* APP Block Register Address Offset from BAR0 */
316 BNAD_GET_REG(HOSTFN0_INT_STATUS
);
317 BNAD_GET_REG(HOSTFN0_INT_MASK
);
318 BNAD_GET_REG(HOST_PAGE_NUM_FN0
);
319 BNAD_GET_REG(HOST_MSIX_ERR_INDEX_FN0
);
320 BNAD_GET_REG(FN0_PCIE_ERR_REG
);
321 BNAD_GET_REG(FN0_ERR_TYPE_STATUS_REG
);
322 BNAD_GET_REG(FN0_ERR_TYPE_MSK_STATUS_REG
);
324 BNAD_GET_REG(HOSTFN1_INT_STATUS
);
325 BNAD_GET_REG(HOSTFN1_INT_MASK
);
326 BNAD_GET_REG(HOST_PAGE_NUM_FN1
);
327 BNAD_GET_REG(HOST_MSIX_ERR_INDEX_FN1
);
328 BNAD_GET_REG(FN1_PCIE_ERR_REG
);
329 BNAD_GET_REG(FN1_ERR_TYPE_STATUS_REG
);
330 BNAD_GET_REG(FN1_ERR_TYPE_MSK_STATUS_REG
);
332 BNAD_GET_REG(PCIE_MISC_REG
);
334 BNAD_GET_REG(HOST_SEM0_INFO_REG
);
335 BNAD_GET_REG(HOST_SEM1_INFO_REG
);
336 BNAD_GET_REG(HOST_SEM2_INFO_REG
);
337 BNAD_GET_REG(HOST_SEM3_INFO_REG
);
339 BNAD_GET_REG(TEMPSENSE_CNTL_REG
);
340 BNAD_GET_REG(TEMPSENSE_STAT_REG
);
342 BNAD_GET_REG(APP_LOCAL_ERR_STAT
);
343 BNAD_GET_REG(APP_LOCAL_ERR_MSK
);
345 BNAD_GET_REG(PCIE_LNK_ERR_STAT
);
346 BNAD_GET_REG(PCIE_LNK_ERR_MSK
);
348 BNAD_GET_REG(FCOE_FIP_ETH_TYPE
);
349 BNAD_GET_REG(RESV_ETH_TYPE
);
351 BNAD_GET_REG(HOSTFN2_INT_STATUS
);
352 BNAD_GET_REG(HOSTFN2_INT_MASK
);
353 BNAD_GET_REG(HOST_PAGE_NUM_FN2
);
354 BNAD_GET_REG(HOST_MSIX_ERR_INDEX_FN2
);
355 BNAD_GET_REG(FN2_PCIE_ERR_REG
);
356 BNAD_GET_REG(FN2_ERR_TYPE_STATUS_REG
);
357 BNAD_GET_REG(FN2_ERR_TYPE_MSK_STATUS_REG
);
359 BNAD_GET_REG(HOSTFN3_INT_STATUS
);
360 BNAD_GET_REG(HOSTFN3_INT_MASK
);
361 BNAD_GET_REG(HOST_PAGE_NUM_FN3
);
362 BNAD_GET_REG(HOST_MSIX_ERR_INDEX_FN3
);
363 BNAD_GET_REG(FN3_PCIE_ERR_REG
);
364 BNAD_GET_REG(FN3_ERR_TYPE_STATUS_REG
);
365 BNAD_GET_REG(FN3_ERR_TYPE_MSK_STATUS_REG
);
367 /* Host Command Status Registers */
368 reg_addr
= HOST_CMDSTS0_CLR_REG
;
369 for (i
= 0; i
< 16; i
++) {
370 BNAD_GET_REG(reg_addr
);
371 BNAD_GET_REG(reg_addr
+ 4);
372 BNAD_GET_REG(reg_addr
+ 8);
376 /* Function ID register */
377 BNAD_GET_REG(FNC_ID_REG
);
379 /* Function personality register */
380 BNAD_GET_REG(FNC_PERS_REG
);
382 /* Operation mode register */
383 BNAD_GET_REG(OP_MODE
);
386 BNAD_GET_REG(LPU0_MBOX_CTL_REG
);
387 BNAD_GET_REG(LPU0_MBOX_CMD_REG
);
388 BNAD_GET_REG(LPU0_MBOX_LINK_0REG
);
389 BNAD_GET_REG(LPU1_MBOX_LINK_0REG
);
390 BNAD_GET_REG(LPU0_MBOX_STATUS_0REG
);
391 BNAD_GET_REG(LPU1_MBOX_STATUS_0REG
);
392 BNAD_GET_REG(LPU0_ERR_STATUS_REG
);
393 BNAD_GET_REG(LPU0_ERR_SET_REG
);
396 BNAD_GET_REG(LPU1_MBOX_CTL_REG
);
397 BNAD_GET_REG(LPU1_MBOX_CMD_REG
);
398 BNAD_GET_REG(LPU0_MBOX_LINK_1REG
);
399 BNAD_GET_REG(LPU1_MBOX_LINK_1REG
);
400 BNAD_GET_REG(LPU0_MBOX_STATUS_1REG
);
401 BNAD_GET_REG(LPU1_MBOX_STATUS_1REG
);
402 BNAD_GET_REG(LPU1_ERR_STATUS_REG
);
403 BNAD_GET_REG(LPU1_ERR_SET_REG
);
406 BNAD_GET_REG(PSS_CTL_REG
);
407 BNAD_GET_REG(PSS_ERR_STATUS_REG
);
408 BNAD_GET_REG(ERR_STATUS_SET
);
409 BNAD_GET_REG(PSS_RAM_ERR_STATUS_REG
);
411 /* Catapult CPQ Registers */
412 BNAD_GET_REG(HOSTFN0_LPU0_MBOX0_CMD_STAT
);
413 BNAD_GET_REG(HOSTFN0_LPU1_MBOX0_CMD_STAT
);
414 BNAD_GET_REG(LPU0_HOSTFN0_MBOX0_CMD_STAT
);
415 BNAD_GET_REG(LPU1_HOSTFN0_MBOX0_CMD_STAT
);
417 BNAD_GET_REG(HOSTFN0_LPU0_MBOX1_CMD_STAT
);
418 BNAD_GET_REG(HOSTFN0_LPU1_MBOX1_CMD_STAT
);
419 BNAD_GET_REG(LPU0_HOSTFN0_MBOX1_CMD_STAT
);
420 BNAD_GET_REG(LPU1_HOSTFN0_MBOX1_CMD_STAT
);
422 BNAD_GET_REG(HOSTFN1_LPU0_MBOX0_CMD_STAT
);
423 BNAD_GET_REG(HOSTFN1_LPU1_MBOX0_CMD_STAT
);
424 BNAD_GET_REG(LPU0_HOSTFN1_MBOX0_CMD_STAT
);
425 BNAD_GET_REG(LPU1_HOSTFN1_MBOX0_CMD_STAT
);
427 BNAD_GET_REG(HOSTFN1_LPU0_MBOX1_CMD_STAT
);
428 BNAD_GET_REG(HOSTFN1_LPU1_MBOX1_CMD_STAT
);
429 BNAD_GET_REG(LPU0_HOSTFN1_MBOX1_CMD_STAT
);
430 BNAD_GET_REG(LPU1_HOSTFN1_MBOX1_CMD_STAT
);
432 BNAD_GET_REG(HOSTFN2_LPU0_MBOX0_CMD_STAT
);
433 BNAD_GET_REG(HOSTFN2_LPU1_MBOX0_CMD_STAT
);
434 BNAD_GET_REG(LPU0_HOSTFN2_MBOX0_CMD_STAT
);
435 BNAD_GET_REG(LPU1_HOSTFN2_MBOX0_CMD_STAT
);
437 BNAD_GET_REG(HOSTFN2_LPU0_MBOX1_CMD_STAT
);
438 BNAD_GET_REG(HOSTFN2_LPU1_MBOX1_CMD_STAT
);
439 BNAD_GET_REG(LPU0_HOSTFN2_MBOX1_CMD_STAT
);
440 BNAD_GET_REG(LPU1_HOSTFN2_MBOX1_CMD_STAT
);
442 BNAD_GET_REG(HOSTFN3_LPU0_MBOX0_CMD_STAT
);
443 BNAD_GET_REG(HOSTFN3_LPU1_MBOX0_CMD_STAT
);
444 BNAD_GET_REG(LPU0_HOSTFN3_MBOX0_CMD_STAT
);
445 BNAD_GET_REG(LPU1_HOSTFN3_MBOX0_CMD_STAT
);
447 BNAD_GET_REG(HOSTFN3_LPU0_MBOX1_CMD_STAT
);
448 BNAD_GET_REG(HOSTFN3_LPU1_MBOX1_CMD_STAT
);
449 BNAD_GET_REG(LPU0_HOSTFN3_MBOX1_CMD_STAT
);
450 BNAD_GET_REG(LPU1_HOSTFN3_MBOX1_CMD_STAT
);
452 /* Host Function Force Parity Error Registers */
453 BNAD_GET_REG(HOSTFN0_LPU_FORCE_PERR
);
454 BNAD_GET_REG(HOSTFN1_LPU_FORCE_PERR
);
455 BNAD_GET_REG(HOSTFN2_LPU_FORCE_PERR
);
456 BNAD_GET_REG(HOSTFN3_LPU_FORCE_PERR
);
458 /* LL Port[0|1] Halt Mask Registers */
459 BNAD_GET_REG(LL_HALT_MSK_P0
);
460 BNAD_GET_REG(LL_HALT_MSK_P1
);
462 /* LL Port[0|1] Error Mask Registers */
463 BNAD_GET_REG(LL_ERR_MSK_P0
);
464 BNAD_GET_REG(LL_ERR_MSK_P1
);
466 /* EMC FLI Registers */
467 BNAD_GET_REG(FLI_CMD_REG
);
468 BNAD_GET_REG(FLI_ADDR_REG
);
469 BNAD_GET_REG(FLI_CTL_REG
);
470 BNAD_GET_REG(FLI_WRDATA_REG
);
471 BNAD_GET_REG(FLI_RDDATA_REG
);
472 BNAD_GET_REG(FLI_DEV_STATUS_REG
);
473 BNAD_GET_REG(FLI_SIG_WD_REG
);
475 BNAD_GET_REG(FLI_DEV_VENDOR_REG
);
476 BNAD_GET_REG(FLI_ERR_STATUS_REG
);
478 /* RxAdm 0 Registers */
479 BNAD_GET_REG(RAD0_CTL_REG
);
480 BNAD_GET_REG(RAD0_PE_PARM_REG
);
481 BNAD_GET_REG(RAD0_BCN_REG
);
482 BNAD_GET_REG(RAD0_DEFAULT_REG
);
483 BNAD_GET_REG(RAD0_PROMISC_REG
);
484 BNAD_GET_REG(RAD0_BCNQ_REG
);
485 BNAD_GET_REG(RAD0_DEFAULTQ_REG
);
487 BNAD_GET_REG(RAD0_ERR_STS
);
488 BNAD_GET_REG(RAD0_SET_ERR_STS
);
489 BNAD_GET_REG(RAD0_ERR_INT_EN
);
490 BNAD_GET_REG(RAD0_FIRST_ERR
);
491 BNAD_GET_REG(RAD0_FORCE_ERR
);
493 BNAD_GET_REG(RAD0_MAC_MAN_1H
);
494 BNAD_GET_REG(RAD0_MAC_MAN_1L
);
495 BNAD_GET_REG(RAD0_MAC_MAN_2H
);
496 BNAD_GET_REG(RAD0_MAC_MAN_2L
);
497 BNAD_GET_REG(RAD0_MAC_MAN_3H
);
498 BNAD_GET_REG(RAD0_MAC_MAN_3L
);
499 BNAD_GET_REG(RAD0_MAC_MAN_4H
);
500 BNAD_GET_REG(RAD0_MAC_MAN_4L
);
502 BNAD_GET_REG(RAD0_LAST4_IP
);
504 /* RxAdm 1 Registers */
505 BNAD_GET_REG(RAD1_CTL_REG
);
506 BNAD_GET_REG(RAD1_PE_PARM_REG
);
507 BNAD_GET_REG(RAD1_BCN_REG
);
508 BNAD_GET_REG(RAD1_DEFAULT_REG
);
509 BNAD_GET_REG(RAD1_PROMISC_REG
);
510 BNAD_GET_REG(RAD1_BCNQ_REG
);
511 BNAD_GET_REG(RAD1_DEFAULTQ_REG
);
513 BNAD_GET_REG(RAD1_ERR_STS
);
514 BNAD_GET_REG(RAD1_SET_ERR_STS
);
515 BNAD_GET_REG(RAD1_ERR_INT_EN
);
518 BNAD_GET_REG(TXA0_CTRL_REG
);
519 /* TxA0 TSO Sequence # Registers (RO) */
520 for (i
= 0; i
< 8; i
++) {
521 BNAD_GET_REG(TXA0_TSO_TCP_SEQ_REG(i
));
522 BNAD_GET_REG(TXA0_TSO_IP_INFO_REG(i
));
526 BNAD_GET_REG(TXA1_CTRL_REG
);
527 /* TxA1 TSO Sequence # Registers (RO) */
528 for (i
= 0; i
< 8; i
++) {
529 BNAD_GET_REG(TXA1_TSO_TCP_SEQ_REG(i
));
530 BNAD_GET_REG(TXA1_TSO_IP_INFO_REG(i
));
534 BNAD_GET_REG(RXA0_CTL_REG
);
535 BNAD_GET_REG(RXA1_CTL_REG
);
538 BNAD_GET_REG(PLB0_ECM_TIMER_REG
);
539 BNAD_GET_REG(PLB0_RL_CTL
);
540 for (i
= 0; i
< 8; i
++)
541 BNAD_GET_REG(PLB0_RL_MAX_BC(i
));
542 BNAD_GET_REG(PLB0_RL_TU_PRIO
);
543 for (i
= 0; i
< 8; i
++)
544 BNAD_GET_REG(PLB0_RL_BYTE_CNT(i
));
545 BNAD_GET_REG(PLB0_RL_MIN_REG
);
546 BNAD_GET_REG(PLB0_RL_MAX_REG
);
547 BNAD_GET_REG(PLB0_EMS_ADD_REG
);
550 BNAD_GET_REG(PLB1_ECM_TIMER_REG
);
551 BNAD_GET_REG(PLB1_RL_CTL
);
552 for (i
= 0; i
< 8; i
++)
553 BNAD_GET_REG(PLB1_RL_MAX_BC(i
));
554 BNAD_GET_REG(PLB1_RL_TU_PRIO
);
555 for (i
= 0; i
< 8; i
++)
556 BNAD_GET_REG(PLB1_RL_BYTE_CNT(i
));
557 BNAD_GET_REG(PLB1_RL_MIN_REG
);
558 BNAD_GET_REG(PLB1_RL_MAX_REG
);
559 BNAD_GET_REG(PLB1_EMS_ADD_REG
);
561 /* HQM Control Register */
562 BNAD_GET_REG(HQM0_CTL_REG
);
563 BNAD_GET_REG(HQM0_RXQ_STOP_SEM
);
564 BNAD_GET_REG(HQM0_TXQ_STOP_SEM
);
565 BNAD_GET_REG(HQM1_CTL_REG
);
566 BNAD_GET_REG(HQM1_RXQ_STOP_SEM
);
567 BNAD_GET_REG(HQM1_TXQ_STOP_SEM
);
570 BNAD_GET_REG(LUT0_ERR_STS
);
571 BNAD_GET_REG(LUT0_SET_ERR_STS
);
572 BNAD_GET_REG(LUT1_ERR_STS
);
573 BNAD_GET_REG(LUT1_SET_ERR_STS
);
576 BNAD_GET_REG(TRC_CTL_REG
);
577 BNAD_GET_REG(TRC_MODS_REG
);
578 BNAD_GET_REG(TRC_TRGC_REG
);
579 BNAD_GET_REG(TRC_CNT1_REG
);
580 BNAD_GET_REG(TRC_CNT2_REG
);
581 BNAD_GET_REG(TRC_NXTS_REG
);
582 BNAD_GET_REG(TRC_DIRR_REG
);
583 for (i
= 0; i
< 10; i
++)
584 BNAD_GET_REG(TRC_TRGM_REG(i
));
585 for (i
= 0; i
< 10; i
++)
586 BNAD_GET_REG(TRC_NXTM_REG(i
));
587 for (i
= 0; i
< 10; i
++)
588 BNAD_GET_REG(TRC_STRM_REG(i
));
590 spin_unlock_irqrestore(&bnad
->bna_lock
, flags
);
595 bnad_get_regs_len(struct net_device
*netdev
)
597 int ret
= get_regs(netdev_priv(netdev
), NULL
) * sizeof(u32
);
602 bnad_get_regs(struct net_device
*netdev
, struct ethtool_regs
*regs
, void *buf
)
604 memset(buf
, 0, bnad_get_regs_len(netdev
));
605 get_regs(netdev_priv(netdev
), buf
);
609 bnad_get_wol(struct net_device
*netdev
, struct ethtool_wolinfo
*wolinfo
)
611 wolinfo
->supported
= 0;
612 wolinfo
->wolopts
= 0;
616 bnad_get_coalesce(struct net_device
*netdev
, struct ethtool_coalesce
*coalesce
)
618 struct bnad
*bnad
= netdev_priv(netdev
);
621 /* Lock rqd. to access bnad->bna_lock */
622 spin_lock_irqsave(&bnad
->bna_lock
, flags
);
623 coalesce
->use_adaptive_rx_coalesce
=
624 (bnad
->cfg_flags
& BNAD_CF_DIM_ENABLED
) ? true : false;
625 spin_unlock_irqrestore(&bnad
->bna_lock
, flags
);
627 coalesce
->rx_coalesce_usecs
= bnad
->rx_coalescing_timeo
*
628 BFI_COALESCING_TIMER_UNIT
;
629 coalesce
->tx_coalesce_usecs
= bnad
->tx_coalescing_timeo
*
630 BFI_COALESCING_TIMER_UNIT
;
631 coalesce
->tx_max_coalesced_frames
= BFI_TX_INTERPKT_COUNT
;
637 bnad_set_coalesce(struct net_device
*netdev
, struct ethtool_coalesce
*coalesce
)
639 struct bnad
*bnad
= netdev_priv(netdev
);
641 int dim_timer_del
= 0;
643 if (coalesce
->rx_coalesce_usecs
== 0 ||
644 coalesce
->rx_coalesce_usecs
>
645 BFI_MAX_COALESCING_TIMEO
* BFI_COALESCING_TIMER_UNIT
)
648 if (coalesce
->tx_coalesce_usecs
== 0 ||
649 coalesce
->tx_coalesce_usecs
>
650 BFI_MAX_COALESCING_TIMEO
* BFI_COALESCING_TIMER_UNIT
)
653 mutex_lock(&bnad
->conf_mutex
);
655 * Do not need to store rx_coalesce_usecs here
656 * Every time DIM is disabled, we can get it from the
659 spin_lock_irqsave(&bnad
->bna_lock
, flags
);
660 if (coalesce
->use_adaptive_rx_coalesce
) {
661 if (!(bnad
->cfg_flags
& BNAD_CF_DIM_ENABLED
)) {
662 bnad
->cfg_flags
|= BNAD_CF_DIM_ENABLED
;
663 bnad_dim_timer_start(bnad
);
666 if (bnad
->cfg_flags
& BNAD_CF_DIM_ENABLED
) {
667 bnad
->cfg_flags
&= ~BNAD_CF_DIM_ENABLED
;
668 dim_timer_del
= bnad_dim_timer_running(bnad
);
670 clear_bit(BNAD_RF_DIM_TIMER_RUNNING
,
672 spin_unlock_irqrestore(&bnad
->bna_lock
, flags
);
673 del_timer_sync(&bnad
->dim_timer
);
674 spin_lock_irqsave(&bnad
->bna_lock
, flags
);
676 bnad_rx_coalescing_timeo_set(bnad
);
679 if (bnad
->tx_coalescing_timeo
!= coalesce
->tx_coalesce_usecs
/
680 BFI_COALESCING_TIMER_UNIT
) {
681 bnad
->tx_coalescing_timeo
= coalesce
->tx_coalesce_usecs
/
682 BFI_COALESCING_TIMER_UNIT
;
683 bnad_tx_coalescing_timeo_set(bnad
);
686 if (bnad
->rx_coalescing_timeo
!= coalesce
->rx_coalesce_usecs
/
687 BFI_COALESCING_TIMER_UNIT
) {
688 bnad
->rx_coalescing_timeo
= coalesce
->rx_coalesce_usecs
/
689 BFI_COALESCING_TIMER_UNIT
;
691 if (!(bnad
->cfg_flags
& BNAD_CF_DIM_ENABLED
))
692 bnad_rx_coalescing_timeo_set(bnad
);
696 /* Add Tx Inter-pkt DMA count? */
698 spin_unlock_irqrestore(&bnad
->bna_lock
, flags
);
700 mutex_unlock(&bnad
->conf_mutex
);
705 bnad_get_ringparam(struct net_device
*netdev
,
706 struct ethtool_ringparam
*ringparam
)
708 struct bnad
*bnad
= netdev_priv(netdev
);
710 ringparam
->rx_max_pending
= BNAD_MAX_Q_DEPTH
/ bnad_rxqs_per_cq
;
711 ringparam
->rx_mini_max_pending
= 0;
712 ringparam
->rx_jumbo_max_pending
= 0;
713 ringparam
->tx_max_pending
= BNAD_MAX_Q_DEPTH
;
715 ringparam
->rx_pending
= bnad
->rxq_depth
;
716 ringparam
->rx_mini_max_pending
= 0;
717 ringparam
->rx_jumbo_max_pending
= 0;
718 ringparam
->tx_pending
= bnad
->txq_depth
;
722 bnad_set_ringparam(struct net_device
*netdev
,
723 struct ethtool_ringparam
*ringparam
)
725 int i
, current_err
, err
= 0;
726 struct bnad
*bnad
= netdev_priv(netdev
);
728 mutex_lock(&bnad
->conf_mutex
);
729 if (ringparam
->rx_pending
== bnad
->rxq_depth
&&
730 ringparam
->tx_pending
== bnad
->txq_depth
) {
731 mutex_unlock(&bnad
->conf_mutex
);
735 if (ringparam
->rx_pending
< BNAD_MIN_Q_DEPTH
||
736 ringparam
->rx_pending
> BNAD_MAX_Q_DEPTH
/ bnad_rxqs_per_cq
||
737 !BNA_POWER_OF_2(ringparam
->rx_pending
)) {
738 mutex_unlock(&bnad
->conf_mutex
);
741 if (ringparam
->tx_pending
< BNAD_MIN_Q_DEPTH
||
742 ringparam
->tx_pending
> BNAD_MAX_Q_DEPTH
||
743 !BNA_POWER_OF_2(ringparam
->tx_pending
)) {
744 mutex_unlock(&bnad
->conf_mutex
);
748 if (ringparam
->rx_pending
!= bnad
->rxq_depth
) {
749 bnad
->rxq_depth
= ringparam
->rx_pending
;
750 for (i
= 0; i
< bnad
->num_rx
; i
++) {
751 if (!bnad
->rx_info
[i
].rx
)
753 bnad_cleanup_rx(bnad
, i
);
754 current_err
= bnad_setup_rx(bnad
, i
);
755 if (current_err
&& !err
)
759 if (ringparam
->tx_pending
!= bnad
->txq_depth
) {
760 bnad
->txq_depth
= ringparam
->tx_pending
;
761 for (i
= 0; i
< bnad
->num_tx
; i
++) {
762 if (!bnad
->tx_info
[i
].tx
)
764 bnad_cleanup_tx(bnad
, i
);
765 current_err
= bnad_setup_tx(bnad
, i
);
766 if (current_err
&& !err
)
771 mutex_unlock(&bnad
->conf_mutex
);
776 bnad_get_pauseparam(struct net_device
*netdev
,
777 struct ethtool_pauseparam
*pauseparam
)
779 struct bnad
*bnad
= netdev_priv(netdev
);
781 pauseparam
->autoneg
= 0;
782 pauseparam
->rx_pause
= bnad
->bna
.port
.pause_config
.rx_pause
;
783 pauseparam
->tx_pause
= bnad
->bna
.port
.pause_config
.tx_pause
;
787 bnad_set_pauseparam(struct net_device
*netdev
,
788 struct ethtool_pauseparam
*pauseparam
)
790 struct bnad
*bnad
= netdev_priv(netdev
);
791 struct bna_pause_config pause_config
;
794 if (pauseparam
->autoneg
== AUTONEG_ENABLE
)
797 mutex_lock(&bnad
->conf_mutex
);
798 if (pauseparam
->rx_pause
!= bnad
->bna
.port
.pause_config
.rx_pause
||
799 pauseparam
->tx_pause
!= bnad
->bna
.port
.pause_config
.tx_pause
) {
800 pause_config
.rx_pause
= pauseparam
->rx_pause
;
801 pause_config
.tx_pause
= pauseparam
->tx_pause
;
802 spin_lock_irqsave(&bnad
->bna_lock
, flags
);
803 bna_port_pause_config(&bnad
->bna
.port
, &pause_config
, NULL
);
804 spin_unlock_irqrestore(&bnad
->bna_lock
, flags
);
806 mutex_unlock(&bnad
->conf_mutex
);
811 bnad_get_strings(struct net_device
*netdev
, u32 stringset
, u8
* string
)
813 struct bnad
*bnad
= netdev_priv(netdev
);
817 mutex_lock(&bnad
->conf_mutex
);
821 for (i
= 0; i
< BNAD_ETHTOOL_STATS_NUM
; i
++) {
822 BUG_ON(!(strlen(bnad_net_stats_strings
[i
]) <
824 memcpy(string
, bnad_net_stats_strings
[i
],
826 string
+= ETH_GSTRING_LEN
;
828 bmap
= (u64
)bnad
->bna
.tx_mod
.txf_bmap
[0] |
829 ((u64
)bnad
->bna
.tx_mod
.txf_bmap
[1] << 32);
830 for (i
= 0; bmap
&& (i
< BFI_LL_TXF_ID_MAX
); i
++) {
832 sprintf(string
, "txf%d_ucast_octets", i
);
833 string
+= ETH_GSTRING_LEN
;
834 sprintf(string
, "txf%d_ucast", i
);
835 string
+= ETH_GSTRING_LEN
;
836 sprintf(string
, "txf%d_ucast_vlan", i
);
837 string
+= ETH_GSTRING_LEN
;
838 sprintf(string
, "txf%d_mcast_octets", i
);
839 string
+= ETH_GSTRING_LEN
;
840 sprintf(string
, "txf%d_mcast", i
);
841 string
+= ETH_GSTRING_LEN
;
842 sprintf(string
, "txf%d_mcast_vlan", i
);
843 string
+= ETH_GSTRING_LEN
;
844 sprintf(string
, "txf%d_bcast_octets", i
);
845 string
+= ETH_GSTRING_LEN
;
846 sprintf(string
, "txf%d_bcast", i
);
847 string
+= ETH_GSTRING_LEN
;
848 sprintf(string
, "txf%d_bcast_vlan", i
);
849 string
+= ETH_GSTRING_LEN
;
850 sprintf(string
, "txf%d_errors", i
);
851 string
+= ETH_GSTRING_LEN
;
852 sprintf(string
, "txf%d_filter_vlan", i
);
853 string
+= ETH_GSTRING_LEN
;
854 sprintf(string
, "txf%d_filter_mac_sa", i
);
855 string
+= ETH_GSTRING_LEN
;
860 bmap
= (u64
)bnad
->bna
.rx_mod
.rxf_bmap
[0] |
861 ((u64
)bnad
->bna
.rx_mod
.rxf_bmap
[1] << 32);
862 for (i
= 0; bmap
&& (i
< BFI_LL_RXF_ID_MAX
); i
++) {
864 sprintf(string
, "rxf%d_ucast_octets", i
);
865 string
+= ETH_GSTRING_LEN
;
866 sprintf(string
, "rxf%d_ucast", i
);
867 string
+= ETH_GSTRING_LEN
;
868 sprintf(string
, "rxf%d_ucast_vlan", i
);
869 string
+= ETH_GSTRING_LEN
;
870 sprintf(string
, "rxf%d_mcast_octets", i
);
871 string
+= ETH_GSTRING_LEN
;
872 sprintf(string
, "rxf%d_mcast", i
);
873 string
+= ETH_GSTRING_LEN
;
874 sprintf(string
, "rxf%d_mcast_vlan", i
);
875 string
+= ETH_GSTRING_LEN
;
876 sprintf(string
, "rxf%d_bcast_octets", i
);
877 string
+= ETH_GSTRING_LEN
;
878 sprintf(string
, "rxf%d_bcast", i
);
879 string
+= ETH_GSTRING_LEN
;
880 sprintf(string
, "rxf%d_bcast_vlan", i
);
881 string
+= ETH_GSTRING_LEN
;
882 sprintf(string
, "rxf%d_frame_drops", i
);
883 string
+= ETH_GSTRING_LEN
;
889 for (i
= 0; i
< bnad
->num_rx
; i
++) {
890 if (!bnad
->rx_info
[i
].rx
)
892 for (j
= 0; j
< bnad
->num_rxp_per_rx
; j
++) {
893 sprintf(string
, "cq%d_producer_index", q_num
);
894 string
+= ETH_GSTRING_LEN
;
895 sprintf(string
, "cq%d_consumer_index", q_num
);
896 string
+= ETH_GSTRING_LEN
;
897 sprintf(string
, "cq%d_hw_producer_index",
899 string
+= ETH_GSTRING_LEN
;
905 for (i
= 0; i
< bnad
->num_rx
; i
++) {
906 if (!bnad
->rx_info
[i
].rx
)
908 for (j
= 0; j
< bnad
->num_rxp_per_rx
; j
++) {
909 sprintf(string
, "rxq%d_packets", q_num
);
910 string
+= ETH_GSTRING_LEN
;
911 sprintf(string
, "rxq%d_bytes", q_num
);
912 string
+= ETH_GSTRING_LEN
;
913 sprintf(string
, "rxq%d_packets_with_error",
915 string
+= ETH_GSTRING_LEN
;
916 sprintf(string
, "rxq%d_allocbuf_failed", q_num
);
917 string
+= ETH_GSTRING_LEN
;
918 sprintf(string
, "rxq%d_producer_index", q_num
);
919 string
+= ETH_GSTRING_LEN
;
920 sprintf(string
, "rxq%d_consumer_index", q_num
);
921 string
+= ETH_GSTRING_LEN
;
923 if (bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
&&
924 bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->
926 bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->
928 sprintf(string
, "rxq%d_packets", q_num
);
929 string
+= ETH_GSTRING_LEN
;
930 sprintf(string
, "rxq%d_bytes", q_num
);
931 string
+= ETH_GSTRING_LEN
;
933 "rxq%d_packets_with_error", q_num
);
934 string
+= ETH_GSTRING_LEN
;
935 sprintf(string
, "rxq%d_allocbuf_failed",
937 string
+= ETH_GSTRING_LEN
;
938 sprintf(string
, "rxq%d_producer_index",
940 string
+= ETH_GSTRING_LEN
;
941 sprintf(string
, "rxq%d_consumer_index",
943 string
+= ETH_GSTRING_LEN
;
950 for (i
= 0; i
< bnad
->num_tx
; i
++) {
951 if (!bnad
->tx_info
[i
].tx
)
953 for (j
= 0; j
< bnad
->num_txq_per_tx
; j
++) {
954 sprintf(string
, "txq%d_packets", q_num
);
955 string
+= ETH_GSTRING_LEN
;
956 sprintf(string
, "txq%d_bytes", q_num
);
957 string
+= ETH_GSTRING_LEN
;
958 sprintf(string
, "txq%d_producer_index", q_num
);
959 string
+= ETH_GSTRING_LEN
;
960 sprintf(string
, "txq%d_consumer_index", q_num
);
961 string
+= ETH_GSTRING_LEN
;
962 sprintf(string
, "txq%d_hw_consumer_index",
964 string
+= ETH_GSTRING_LEN
;
975 mutex_unlock(&bnad
->conf_mutex
);
979 bnad_get_stats_count_locked(struct net_device
*netdev
)
981 struct bnad
*bnad
= netdev_priv(netdev
);
982 int i
, j
, count
, rxf_active_num
= 0, txf_active_num
= 0;
985 bmap
= (u64
)bnad
->bna
.tx_mod
.txf_bmap
[0] |
986 ((u64
)bnad
->bna
.tx_mod
.txf_bmap
[1] << 32);
987 for (i
= 0; bmap
&& (i
< BFI_LL_TXF_ID_MAX
); i
++) {
992 bmap
= (u64
)bnad
->bna
.rx_mod
.rxf_bmap
[0] |
993 ((u64
)bnad
->bna
.rx_mod
.rxf_bmap
[1] << 32);
994 for (i
= 0; bmap
&& (i
< BFI_LL_RXF_ID_MAX
); i
++) {
999 count
= BNAD_ETHTOOL_STATS_NUM
+
1000 txf_active_num
* BNAD_NUM_TXF_COUNTERS
+
1001 rxf_active_num
* BNAD_NUM_RXF_COUNTERS
;
1003 for (i
= 0; i
< bnad
->num_rx
; i
++) {
1004 if (!bnad
->rx_info
[i
].rx
)
1006 count
+= bnad
->num_rxp_per_rx
* BNAD_NUM_CQ_COUNTERS
;
1007 count
+= bnad
->num_rxp_per_rx
* BNAD_NUM_RXQ_COUNTERS
;
1008 for (j
= 0; j
< bnad
->num_rxp_per_rx
; j
++)
1009 if (bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
&&
1010 bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->rcb
[1] &&
1011 bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->rcb
[1]->rxq
)
1012 count
+= BNAD_NUM_RXQ_COUNTERS
;
1015 for (i
= 0; i
< bnad
->num_tx
; i
++) {
1016 if (!bnad
->tx_info
[i
].tx
)
1018 count
+= bnad
->num_txq_per_tx
* BNAD_NUM_TXQ_COUNTERS
;
1024 bnad_per_q_stats_fill(struct bnad
*bnad
, u64
*buf
, int bi
)
1027 struct bna_rcb
*rcb
= NULL
;
1028 struct bna_tcb
*tcb
= NULL
;
1030 for (i
= 0; i
< bnad
->num_rx
; i
++) {
1031 if (!bnad
->rx_info
[i
].rx
)
1033 for (j
= 0; j
< bnad
->num_rxp_per_rx
; j
++)
1034 if (bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
&&
1035 bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->rcb
[0] &&
1036 bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->rcb
[0]->rxq
) {
1037 buf
[bi
++] = bnad
->rx_info
[i
].rx_ctrl
[j
].
1038 ccb
->producer_index
;
1039 buf
[bi
++] = 0; /* ccb->consumer_index */
1040 buf
[bi
++] = *(bnad
->rx_info
[i
].rx_ctrl
[j
].
1041 ccb
->hw_producer_index
);
1044 for (i
= 0; i
< bnad
->num_rx
; i
++) {
1045 if (!bnad
->rx_info
[i
].rx
)
1047 for (j
= 0; j
< bnad
->num_rxp_per_rx
; j
++)
1048 if (bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
) {
1049 if (bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->rcb
[0] &&
1050 bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->
1052 rcb
= bnad
->rx_info
[i
].rx_ctrl
[j
].
1054 buf
[bi
++] = rcb
->rxq
->rx_packets
;
1055 buf
[bi
++] = rcb
->rxq
->rx_bytes
;
1056 buf
[bi
++] = rcb
->rxq
->
1057 rx_packets_with_error
;
1058 buf
[bi
++] = rcb
->rxq
->
1060 buf
[bi
++] = rcb
->producer_index
;
1061 buf
[bi
++] = rcb
->consumer_index
;
1063 if (bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->rcb
[1] &&
1064 bnad
->rx_info
[i
].rx_ctrl
[j
].ccb
->
1066 rcb
= bnad
->rx_info
[i
].rx_ctrl
[j
].
1068 buf
[bi
++] = rcb
->rxq
->rx_packets
;
1069 buf
[bi
++] = rcb
->rxq
->rx_bytes
;
1070 buf
[bi
++] = rcb
->rxq
->
1071 rx_packets_with_error
;
1072 buf
[bi
++] = rcb
->rxq
->
1074 buf
[bi
++] = rcb
->producer_index
;
1075 buf
[bi
++] = rcb
->consumer_index
;
1080 for (i
= 0; i
< bnad
->num_tx
; i
++) {
1081 if (!bnad
->tx_info
[i
].tx
)
1083 for (j
= 0; j
< bnad
->num_txq_per_tx
; j
++)
1084 if (bnad
->tx_info
[i
].tcb
[j
] &&
1085 bnad
->tx_info
[i
].tcb
[j
]->txq
) {
1086 tcb
= bnad
->tx_info
[i
].tcb
[j
];
1087 buf
[bi
++] = tcb
->txq
->tx_packets
;
1088 buf
[bi
++] = tcb
->txq
->tx_bytes
;
1089 buf
[bi
++] = tcb
->producer_index
;
1090 buf
[bi
++] = tcb
->consumer_index
;
1091 buf
[bi
++] = *(tcb
->hw_consumer_index
);
1099 bnad_get_ethtool_stats(struct net_device
*netdev
, struct ethtool_stats
*stats
,
1102 struct bnad
*bnad
= netdev_priv(netdev
);
1104 unsigned long flags
;
1105 struct rtnl_link_stats64
*net_stats64
;
1109 mutex_lock(&bnad
->conf_mutex
);
1110 if (bnad_get_stats_count_locked(netdev
) != stats
->n_stats
) {
1111 mutex_unlock(&bnad
->conf_mutex
);
1116 * Used bna_lock to sync reads from bna_stats, which is written
1117 * under the same lock
1119 spin_lock_irqsave(&bnad
->bna_lock
, flags
);
1121 memset(buf
, 0, stats
->n_stats
* sizeof(u64
));
1123 net_stats64
= (struct rtnl_link_stats64
*)buf
;
1124 bnad_netdev_qstats_fill(bnad
, net_stats64
);
1125 bnad_netdev_hwstats_fill(bnad
, net_stats64
);
1127 bi
= sizeof(*net_stats64
) / sizeof(u64
);
1129 /* Get netif_queue_stopped from stack */
1130 bnad
->stats
.drv_stats
.netif_queue_stopped
= netif_queue_stopped(netdev
);
1132 /* Fill driver stats into ethtool buffers */
1133 stats64
= (u64
*)&bnad
->stats
.drv_stats
;
1134 for (i
= 0; i
< sizeof(struct bnad_drv_stats
) / sizeof(u64
); i
++)
1135 buf
[bi
++] = stats64
[i
];
1137 /* Fill hardware stats excluding the rxf/txf into ethtool bufs */
1138 stats64
= (u64
*) bnad
->stats
.bna_stats
->hw_stats
;
1140 i
< offsetof(struct bfi_ll_stats
, rxf_stats
[0]) / sizeof(u64
);
1142 buf
[bi
++] = stats64
[i
];
1144 /* Fill txf stats into ethtool buffers */
1145 bmap
= (u64
)bnad
->bna
.tx_mod
.txf_bmap
[0] |
1146 ((u64
)bnad
->bna
.tx_mod
.txf_bmap
[1] << 32);
1147 for (i
= 0; bmap
&& (i
< BFI_LL_TXF_ID_MAX
); i
++) {
1149 stats64
= (u64
*)&bnad
->stats
.bna_stats
->
1150 hw_stats
->txf_stats
[i
];
1151 for (j
= 0; j
< sizeof(struct bfi_ll_stats_txf
) /
1153 buf
[bi
++] = stats64
[j
];
1158 /* Fill rxf stats into ethtool buffers */
1159 bmap
= (u64
)bnad
->bna
.rx_mod
.rxf_bmap
[0] |
1160 ((u64
)bnad
->bna
.rx_mod
.rxf_bmap
[1] << 32);
1161 for (i
= 0; bmap
&& (i
< BFI_LL_RXF_ID_MAX
); i
++) {
1163 stats64
= (u64
*)&bnad
->stats
.bna_stats
->
1164 hw_stats
->rxf_stats
[i
];
1165 for (j
= 0; j
< sizeof(struct bfi_ll_stats_rxf
) /
1167 buf
[bi
++] = stats64
[j
];
1172 /* Fill per Q stats into ethtool buffers */
1173 bi
= bnad_per_q_stats_fill(bnad
, buf
, bi
);
1175 spin_unlock_irqrestore(&bnad
->bna_lock
, flags
);
1177 mutex_unlock(&bnad
->conf_mutex
);
1181 bnad_get_sset_count(struct net_device
*netdev
, int sset
)
1185 return bnad_get_stats_count_locked(netdev
);
1191 static struct ethtool_ops bnad_ethtool_ops
= {
1192 .get_settings
= bnad_get_settings
,
1193 .set_settings
= bnad_set_settings
,
1194 .get_drvinfo
= bnad_get_drvinfo
,
1195 .get_regs_len
= bnad_get_regs_len
,
1196 .get_regs
= bnad_get_regs
,
1197 .get_wol
= bnad_get_wol
,
1198 .get_link
= ethtool_op_get_link
,
1199 .get_coalesce
= bnad_get_coalesce
,
1200 .set_coalesce
= bnad_set_coalesce
,
1201 .get_ringparam
= bnad_get_ringparam
,
1202 .set_ringparam
= bnad_set_ringparam
,
1203 .get_pauseparam
= bnad_get_pauseparam
,
1204 .set_pauseparam
= bnad_set_pauseparam
,
1205 .get_strings
= bnad_get_strings
,
1206 .get_ethtool_stats
= bnad_get_ethtool_stats
,
1207 .get_sset_count
= bnad_get_sset_count
1211 bnad_set_ethtool_ops(struct net_device
*netdev
)
1213 SET_ETHTOOL_OPS(netdev
, &bnad_ethtool_ops
);