forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/net/ethernet/via/via-rhine.c
....@@ -2,7 +2,7 @@
22 /*
33 Written 1998-2001 by Donald Becker.
44
5
- Current Maintainer: Roger Luethi <rl@hellgate.ch>
5
+ Current Maintainer: Kevin Brace <kevinbrace@bracecomputerlab.com>
66
77 This software may be used and distributed according to the terms of
88 the GNU General Public License (GPL), incorporated herein by reference.
....@@ -32,8 +32,6 @@
3232 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
3333
3434 #define DRV_NAME "via-rhine"
35
-#define DRV_VERSION "1.5.1"
36
-#define DRV_RELDATE "2010-10-09"
3735
3836 #include <linux/types.h>
3937
....@@ -116,10 +114,6 @@
116114 #include <asm/irq.h>
117115 #include <linux/uaccess.h>
118116 #include <linux/dmi.h>
119
-
120
-/* These identify the driver base version and may not be removed. */
121
-static const char version[] =
122
- "v1.10-LK" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker";
123117
124118 MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
125119 MODULE_DESCRIPTION("VIA Rhine PCI Fast Ethernet driver");
....@@ -243,7 +237,7 @@
243237 VT8233 = 0x60, /* Integrated MAC */
244238 VT8235 = 0x74, /* Integrated MAC */
245239 VT8237 = 0x78, /* Integrated MAC */
246
- VTunknown1 = 0x7C,
240
+ VT8251 = 0x7C, /* Integrated MAC */
247241 VT6105 = 0x80,
248242 VT6105_B0 = 0x83,
249243 VT6105L = 0x8A,
....@@ -506,7 +500,7 @@
506500 static int rhine_open(struct net_device *dev);
507501 static void rhine_reset_task(struct work_struct *work);
508502 static void rhine_slow_event_task(struct work_struct *work);
509
-static void rhine_tx_timeout(struct net_device *dev);
503
+static void rhine_tx_timeout(struct net_device *dev, unsigned int txqueue);
510504 static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
511505 struct net_device *dev);
512506 static irqreturn_t rhine_interrupt(int irq, void *dev_instance);
....@@ -571,7 +565,6 @@
571565 if (rp->quirks & rqStatusWBRace)
572566 iowrite8(mask >> 16, ioaddr + IntrStatus2);
573567 iowrite16(mask, ioaddr + IntrStatus);
574
- mmiowb();
575568 }
576569
577570 /*
....@@ -863,7 +856,6 @@
863856 if (work_done < budget) {
864857 napi_complete_done(napi, work_done);
865858 iowrite16(enable_mask, ioaddr + IntrEnable);
866
- mmiowb();
867859 }
868860 return work_done;
869861 }
....@@ -1053,11 +1045,6 @@
10531045 u32 quirks = 0;
10541046 #endif
10551047
1056
-/* when built into the kernel, we only print version if device is found */
1057
-#ifndef MODULE
1058
- pr_info_once("%s\n", version);
1059
-#endif
1060
-
10611048 rc = pci_enable_device(pdev);
10621049 if (rc)
10631050 goto err_out;
....@@ -1129,15 +1116,13 @@
11291116 const struct of_device_id *match;
11301117 const u32 *quirks;
11311118 int irq;
1132
- struct resource *res;
11331119 void __iomem *ioaddr;
11341120
11351121 match = of_match_device(rhine_of_tbl, &pdev->dev);
11361122 if (!match)
11371123 return -EINVAL;
11381124
1139
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1140
- ioaddr = devm_ioremap_resource(&pdev->dev, res);
1125
+ ioaddr = devm_platform_ioremap_resource(pdev, 0);
11411126 if (IS_ERR(ioaddr))
11421127 return PTR_ERR(ioaddr);
11431128
....@@ -1519,7 +1504,7 @@
15191504
15201505 /**
15211506 * rhine_update_vcam - update VLAN CAM filters
1522
- * @rp: rhine_private data of this Rhine
1507
+ * @dev: rhine_private data of this Rhine
15231508 *
15241509 * Update VLAN CAM filters to match configuration change.
15251510 */
....@@ -1710,6 +1695,8 @@
17101695 goto out_free_ring;
17111696
17121697 alloc_tbufs(dev);
1698
+ enable_mmio(rp->pioaddr, rp->quirks);
1699
+ rhine_power_init(dev);
17131700 rhine_chip_reset(dev);
17141701 rhine_task_enable(rp);
17151702 init_registers(dev);
....@@ -1765,7 +1752,7 @@
17651752 mutex_unlock(&rp->task_lock);
17661753 }
17671754
1768
-static void rhine_tx_timeout(struct net_device *dev)
1755
+static void rhine_tx_timeout(struct net_device *dev, unsigned int txqueue)
17691756 {
17701757 struct rhine_private *rp = netdev_priv(dev);
17711758 void __iomem *ioaddr = rp->base;
....@@ -1893,7 +1880,6 @@
18931880 static void rhine_irq_disable(struct rhine_private *rp)
18941881 {
18951882 iowrite16(0x0000, rp->base + IntrEnable);
1896
- mmiowb();
18971883 }
18981884
18991885 /* The interrupt handler does all of the Rx thread work and cleans up
....@@ -2299,7 +2285,6 @@
22992285 struct device *hwdev = dev->dev.parent;
23002286
23012287 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
2302
- strlcpy(info->version, DRV_VERSION, sizeof(info->version));
23032288 strlcpy(info->bus_info, dev_name(hwdev), sizeof(info->bus_info));
23042289 }
23052290
....@@ -2621,9 +2606,6 @@
26212606 int ret_pci, ret_platform;
26222607
26232608 /* when a module, this is printed whether or not devices are found in probe */
2624
-#ifdef MODULE
2625
- pr_info("%s\n", version);
2626
-#endif
26272609 if (dmi_check_system(rhine_dmi_table)) {
26282610 /* these BIOSes fail at PXE boot if chip is in D3 */
26292611 avoid_D3 = true;