hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
....@@ -1,8 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * QLogic qlcnic NIC Driver
34 * Copyright (c) 2009-2013 QLogic Corporation
4
- *
5
- * See LICENSE.qlcnic for copyright and licensing details.
65 */
76
87 #include <linux/types.h>
....@@ -20,7 +19,7 @@
2019 int stat_offset;
2120 };
2221
23
-#define QLC_SIZEOF(m) FIELD_SIZEOF(struct qlcnic_adapter, m)
22
+#define QLC_SIZEOF(m) sizeof_field(struct qlcnic_adapter, m)
2423 #define QLC_OFF(m) offsetof(struct qlcnic_adapter, m)
2524 static const u32 qlcnic_fw_dump_level[] = {
2625 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff
....@@ -353,7 +352,7 @@
353352 case QLCNIC_BRDTYPE_P3P_4_GB_MM:
354353 supported |= SUPPORTED_Autoneg;
355354 advertising |= ADVERTISED_Autoneg;
356
- /* fall through */
355
+ fallthrough;
357356 case QLCNIC_BRDTYPE_P3P_10G_CX4:
358357 case QLCNIC_BRDTYPE_P3P_10G_CX4_LP:
359358 case QLCNIC_BRDTYPE_P3P_10000_BASE_T:
....@@ -377,7 +376,7 @@
377376 supported |= SUPPORTED_TP;
378377 check_sfp_module = netif_running(adapter->netdev) &&
379378 ahw->has_link_events;
380
- /* fall through */
379
+ fallthrough;
381380 case QLCNIC_BRDTYPE_P3P_10G_XFP:
382381 supported |= SUPPORTED_FIBRE;
383382 advertising |= ADVERTISED_FIBRE;
....@@ -1543,24 +1542,7 @@
15431542 if (ethcoal->rx_coalesce_usecs > 0xffff ||
15441543 ethcoal->rx_max_coalesced_frames > 0xffff ||
15451544 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)
15641546 return -EINVAL;
15651547
15661548 err = qlcnic_config_intr_coalesce(adapter, ethcoal);
....@@ -1835,6 +1817,8 @@
18351817 }
18361818
18371819 const struct ethtool_ops qlcnic_ethtool_ops = {
1820
+ .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
1821
+ ETHTOOL_COALESCE_MAX_FRAMES,
18381822 .get_drvinfo = qlcnic_get_drvinfo,
18391823 .get_regs_len = qlcnic_get_regs_len,
18401824 .get_regs = qlcnic_get_regs,
....@@ -1866,6 +1850,8 @@
18661850 };
18671851
18681852 const struct ethtool_ops qlcnic_sriov_vf_ethtool_ops = {
1853
+ .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
1854
+ ETHTOOL_COALESCE_MAX_FRAMES,
18691855 .get_drvinfo = qlcnic_get_drvinfo,
18701856 .get_regs_len = qlcnic_get_regs_len,
18711857 .get_regs = qlcnic_get_regs,