forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
....@@ -33,7 +33,6 @@
3333 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
3434
3535 #include <linux/module.h>
36
-#include <linux/moduleparam.h>
3736 #include <linux/init.h>
3837 #include <linux/pci.h>
3938 #include <linux/dma-mapping.h>
....@@ -106,7 +105,6 @@
106105 MODULE_DESCRIPTION(DRV_DESC);
107106 MODULE_AUTHOR("Chelsio Communications");
108107 MODULE_LICENSE("Dual BSD/GPL");
109
-MODULE_VERSION(DRV_VERSION);
110108 MODULE_DEVICE_TABLE(pci, cxgb3_pci_tbl);
111109
112110 static int dflt_msg_enable = DFLT_MSG_ENABLE;
....@@ -150,7 +148,7 @@
150148
151149 /**
152150 * link_report - show link status and link speed/duplex
153
- * @p: the port whose settings are to be reported
151
+ * @dev: the port whose settings are to be reported
154152 *
155153 * Shows the link status, speed, and duplex of a port.
156154 */
....@@ -306,8 +304,8 @@
306304
307305 /**
308306 * t3_os_phymod_changed - handle PHY module changes
309
- * @phy: the PHY reporting the module change
310
- * @mod_type: new module type
307
+ * @adap: the adapter associated with the link change
308
+ * @port_id: the port index whose limk status has changed
311309 *
312310 * This is the OS-dependent handler for PHY module changes. It is
313311 * invoked when a PHY module is removed or inserted for any OS-specific
....@@ -1202,7 +1200,7 @@
12021200
12031201 /**
12041202 * cxgb_up - enable the adapter
1205
- * @adapter: adapter being enabled
1203
+ * @adap: adapter being enabled
12061204 *
12071205 * Called when the first port is enabled, this function performs the
12081206 * actions necessary to make an adapter operational, such as completing
....@@ -1304,6 +1302,7 @@
13041302 if (ret < 0) {
13051303 CH_ERR(adap, "failed to bind qsets, err %d\n", ret);
13061304 t3_intr_disable(adap);
1305
+ quiesce_rx(adap);
13071306 free_irq_resources(adap);
13081307 err = ret;
13091308 goto out;
....@@ -1630,7 +1629,6 @@
16301629 spin_unlock(&adapter->stats_lock);
16311630
16321631 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
1633
- strlcpy(info->version, DRV_VERSION, sizeof(info->version));
16341632 strlcpy(info->bus_info, pci_name(adapter->pdev),
16351633 sizeof(info->bus_info));
16361634 if (fw_vers)
....@@ -2107,6 +2105,7 @@
21072105 }
21082106
21092107 static const struct ethtool_ops cxgb_ethtool_ops = {
2108
+ .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS,
21102109 .get_drvinfo = get_drvinfo,
21112110 .get_msglevel = get_msglevel,
21122111 .set_msglevel = set_msglevel,
....@@ -2545,7 +2544,7 @@
25452544 !(data->phy_id & 0xe0e0))
25462545 data->phy_id = mdio_phy_id_c45(data->phy_id >> 8,
25472546 data->phy_id & 0x1f);
2548
- /* FALLTHRU */
2547
+ fallthrough;
25492548 case SIOCGMIIPHY:
25502549 return mdio_mii_ioctl(&pi->phy.mdio, data, cmd);
25512550 case SIOCCHIOCTL:
....@@ -2998,7 +2997,7 @@
29982997 unsigned int fw_status[4];
29992998
30002999 if (adapter->flags & FULL_INIT_DONE) {
3001
- t3_sge_stop(adapter);
3000
+ t3_sge_stop_dma(adapter);
30023001 t3_write_reg(adapter, A_XGM_TX_CTRL, 0);
30033002 t3_write_reg(adapter, A_XGM_RX_CTRL, 0);
30043003 t3_write_reg(adapter, XGM_REG(A_XGM_TX_CTRL, 1), 0);
....@@ -3211,8 +3210,6 @@
32113210 struct adapter *adapter = NULL;
32123211 struct port_info *pi;
32133212
3214
- pr_info_once("%s - version %s\n", DRV_DESC, DRV_VERSION);
3215
-
32163213 if (!cxgb3_wq) {
32173214 cxgb3_wq = create_singlethread_workqueue(DRV_NAME);
32183215 if (!cxgb3_wq) {
....@@ -3268,7 +3265,7 @@
32683265 goto out_free_adapter;
32693266 }
32703267
3271
- adapter->regs = ioremap_nocache(mmio_start, mmio_len);
3268
+ adapter->regs = ioremap(mmio_start, mmio_len);
32723269 if (!adapter->regs) {
32733270 dev_err(&pdev->dev, "cannot map device registers\n");
32743271 err = -ENOMEM;
....@@ -3445,8 +3442,7 @@
34453442 free_netdev(adapter->port[i]);
34463443
34473444 iounmap(adapter->regs);
3448
- if (adapter->nofail_skb)
3449
- kfree_skb(adapter->nofail_skb);
3445
+ kfree_skb(adapter->nofail_skb);
34503446 kfree(adapter);
34513447 pci_release_regions(pdev);
34523448 pci_disable_device(pdev);