forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
....@@ -129,13 +129,13 @@
129129
130130 #define XGMAC_MMC_STAT(_string, _var) \
131131 { _string, \
132
- FIELD_SIZEOF(struct xgbe_mmc_stats, _var), \
132
+ sizeof_field(struct xgbe_mmc_stats, _var), \
133133 offsetof(struct xgbe_prv_data, mmc_stats._var), \
134134 }
135135
136136 #define XGMAC_EXT_STAT(_string, _var) \
137137 { _string, \
138
- FIELD_SIZEOF(struct xgbe_ext_stats, _var), \
138
+ sizeof_field(struct xgbe_ext_stats, _var), \
139139 offsetof(struct xgbe_prv_data, ext_stats._var), \
140140 }
141141
....@@ -405,7 +405,6 @@
405405 struct xgbe_hw_features *hw_feat = &pdata->hw_feat;
406406
407407 strlcpy(drvinfo->driver, XGBE_DRV_NAME, sizeof(drvinfo->driver));
408
- strlcpy(drvinfo->version, XGBE_DRV_VERSION, sizeof(drvinfo->version));
409408 strlcpy(drvinfo->bus_info, dev_name(pdata->dev),
410409 sizeof(drvinfo->bus_info));
411410 snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d.%d.%d",
....@@ -450,30 +449,6 @@
450449 struct xgbe_hw_if *hw_if = &pdata->hw_if;
451450 unsigned int rx_frames, rx_riwt, rx_usecs;
452451 unsigned int tx_frames;
453
-
454
- /* Check for not supported parameters */
455
- if ((ec->rx_coalesce_usecs_irq) ||
456
- (ec->rx_max_coalesced_frames_irq) ||
457
- (ec->tx_coalesce_usecs) ||
458
- (ec->tx_coalesce_usecs_irq) ||
459
- (ec->tx_max_coalesced_frames_irq) ||
460
- (ec->stats_block_coalesce_usecs) ||
461
- (ec->use_adaptive_rx_coalesce) ||
462
- (ec->use_adaptive_tx_coalesce) ||
463
- (ec->pkt_rate_low) ||
464
- (ec->rx_coalesce_usecs_low) ||
465
- (ec->rx_max_coalesced_frames_low) ||
466
- (ec->tx_coalesce_usecs_low) ||
467
- (ec->tx_max_coalesced_frames_low) ||
468
- (ec->pkt_rate_high) ||
469
- (ec->rx_coalesce_usecs_high) ||
470
- (ec->rx_max_coalesced_frames_high) ||
471
- (ec->tx_coalesce_usecs_high) ||
472
- (ec->tx_max_coalesced_frames_high) ||
473
- (ec->rate_sample_interval)) {
474
- netdev_err(netdev, "unsupported coalescing parameter\n");
475
- return -EOPNOTSUPP;
476
- }
477452
478453 rx_riwt = hw_if->usec_to_riwt(pdata, ec->rx_coalesce_usecs);
479454 rx_usecs = ec->rx_coalesce_usecs;
....@@ -838,6 +813,8 @@
838813 }
839814
840815 static const struct ethtool_ops xgbe_ethtool_ops = {
816
+ .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
817
+ ETHTOOL_COALESCE_MAX_FRAMES,
841818 .get_drvinfo = xgbe_get_drvinfo,
842819 .get_msglevel = xgbe_get_msglevel,
843820 .set_msglevel = xgbe_set_msglevel,