| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * QLogic qlcnic NIC Driver |
|---|
| 3 | 4 | * Copyright (c) 2009-2013 QLogic Corporation |
|---|
| 4 | | - * |
|---|
| 5 | | - * See LICENSE.qlcnic for copyright and licensing details. |
|---|
| 6 | 5 | */ |
|---|
| 7 | 6 | |
|---|
| 8 | 7 | #include <linux/types.h> |
|---|
| .. | .. |
|---|
| 20 | 19 | int stat_offset; |
|---|
| 21 | 20 | }; |
|---|
| 22 | 21 | |
|---|
| 23 | | -#define QLC_SIZEOF(m) FIELD_SIZEOF(struct qlcnic_adapter, m) |
|---|
| 22 | +#define QLC_SIZEOF(m) sizeof_field(struct qlcnic_adapter, m) |
|---|
| 24 | 23 | #define QLC_OFF(m) offsetof(struct qlcnic_adapter, m) |
|---|
| 25 | 24 | static const u32 qlcnic_fw_dump_level[] = { |
|---|
| 26 | 25 | 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff |
|---|
| .. | .. |
|---|
| 353 | 352 | case QLCNIC_BRDTYPE_P3P_4_GB_MM: |
|---|
| 354 | 353 | supported |= SUPPORTED_Autoneg; |
|---|
| 355 | 354 | advertising |= ADVERTISED_Autoneg; |
|---|
| 356 | | - /* fall through */ |
|---|
| 355 | + fallthrough; |
|---|
| 357 | 356 | case QLCNIC_BRDTYPE_P3P_10G_CX4: |
|---|
| 358 | 357 | case QLCNIC_BRDTYPE_P3P_10G_CX4_LP: |
|---|
| 359 | 358 | case QLCNIC_BRDTYPE_P3P_10000_BASE_T: |
|---|
| .. | .. |
|---|
| 377 | 376 | supported |= SUPPORTED_TP; |
|---|
| 378 | 377 | check_sfp_module = netif_running(adapter->netdev) && |
|---|
| 379 | 378 | ahw->has_link_events; |
|---|
| 380 | | - /* fall through */ |
|---|
| 379 | + fallthrough; |
|---|
| 381 | 380 | case QLCNIC_BRDTYPE_P3P_10G_XFP: |
|---|
| 382 | 381 | supported |= SUPPORTED_FIBRE; |
|---|
| 383 | 382 | advertising |= ADVERTISED_FIBRE; |
|---|
| .. | .. |
|---|
| 1543 | 1542 | if (ethcoal->rx_coalesce_usecs > 0xffff || |
|---|
| 1544 | 1543 | ethcoal->rx_max_coalesced_frames > 0xffff || |
|---|
| 1545 | 1544 | ethcoal->tx_coalesce_usecs > 0xffff || |
|---|
| 1546 | | - ethcoal->tx_max_coalesced_frames > 0xffff || |
|---|
| 1547 | | - ethcoal->rx_coalesce_usecs_irq || |
|---|
| 1548 | | - ethcoal->rx_max_coalesced_frames_irq || |
|---|
| 1549 | | - ethcoal->tx_coalesce_usecs_irq || |
|---|
| 1550 | | - ethcoal->tx_max_coalesced_frames_irq || |
|---|
| 1551 | | - ethcoal->stats_block_coalesce_usecs || |
|---|
| 1552 | | - ethcoal->use_adaptive_rx_coalesce || |
|---|
| 1553 | | - ethcoal->use_adaptive_tx_coalesce || |
|---|
| 1554 | | - ethcoal->pkt_rate_low || |
|---|
| 1555 | | - ethcoal->rx_coalesce_usecs_low || |
|---|
| 1556 | | - ethcoal->rx_max_coalesced_frames_low || |
|---|
| 1557 | | - ethcoal->tx_coalesce_usecs_low || |
|---|
| 1558 | | - ethcoal->tx_max_coalesced_frames_low || |
|---|
| 1559 | | - ethcoal->pkt_rate_high || |
|---|
| 1560 | | - ethcoal->rx_coalesce_usecs_high || |
|---|
| 1561 | | - ethcoal->rx_max_coalesced_frames_high || |
|---|
| 1562 | | - ethcoal->tx_coalesce_usecs_high || |
|---|
| 1563 | | - ethcoal->tx_max_coalesced_frames_high) |
|---|
| 1545 | + ethcoal->tx_max_coalesced_frames > 0xffff) |
|---|
| 1564 | 1546 | return -EINVAL; |
|---|
| 1565 | 1547 | |
|---|
| 1566 | 1548 | err = qlcnic_config_intr_coalesce(adapter, ethcoal); |
|---|
| .. | .. |
|---|
| 1835 | 1817 | } |
|---|
| 1836 | 1818 | |
|---|
| 1837 | 1819 | const struct ethtool_ops qlcnic_ethtool_ops = { |
|---|
| 1820 | + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | |
|---|
| 1821 | + ETHTOOL_COALESCE_MAX_FRAMES, |
|---|
| 1838 | 1822 | .get_drvinfo = qlcnic_get_drvinfo, |
|---|
| 1839 | 1823 | .get_regs_len = qlcnic_get_regs_len, |
|---|
| 1840 | 1824 | .get_regs = qlcnic_get_regs, |
|---|
| .. | .. |
|---|
| 1866 | 1850 | }; |
|---|
| 1867 | 1851 | |
|---|
| 1868 | 1852 | const struct ethtool_ops qlcnic_sriov_vf_ethtool_ops = { |
|---|
| 1853 | + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | |
|---|
| 1854 | + ETHTOOL_COALESCE_MAX_FRAMES, |
|---|
| 1869 | 1855 | .get_drvinfo = qlcnic_get_drvinfo, |
|---|
| 1870 | 1856 | .get_regs_len = qlcnic_get_regs_len, |
|---|
| 1871 | 1857 | .get_regs = qlcnic_get_regs, |
|---|