| .. | .. |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | Written 1998-2001 by Donald Becker. |
|---|
| 4 | 4 | |
|---|
| 5 | | - Current Maintainer: Roger Luethi <rl@hellgate.ch> |
|---|
| 5 | + Current Maintainer: Kevin Brace <kevinbrace@bracecomputerlab.com> |
|---|
| 6 | 6 | |
|---|
| 7 | 7 | This software may be used and distributed according to the terms of |
|---|
| 8 | 8 | the GNU General Public License (GPL), incorporated herein by reference. |
|---|
| .. | .. |
|---|
| 32 | 32 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| 33 | 33 | |
|---|
| 34 | 34 | #define DRV_NAME "via-rhine" |
|---|
| 35 | | -#define DRV_VERSION "1.5.1" |
|---|
| 36 | | -#define DRV_RELDATE "2010-10-09" |
|---|
| 37 | 35 | |
|---|
| 38 | 36 | #include <linux/types.h> |
|---|
| 39 | 37 | |
|---|
| .. | .. |
|---|
| 116 | 114 | #include <asm/irq.h> |
|---|
| 117 | 115 | #include <linux/uaccess.h> |
|---|
| 118 | 116 | #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"; |
|---|
| 123 | 117 | |
|---|
| 124 | 118 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
|---|
| 125 | 119 | MODULE_DESCRIPTION("VIA Rhine PCI Fast Ethernet driver"); |
|---|
| .. | .. |
|---|
| 243 | 237 | VT8233 = 0x60, /* Integrated MAC */ |
|---|
| 244 | 238 | VT8235 = 0x74, /* Integrated MAC */ |
|---|
| 245 | 239 | VT8237 = 0x78, /* Integrated MAC */ |
|---|
| 246 | | - VTunknown1 = 0x7C, |
|---|
| 240 | + VT8251 = 0x7C, /* Integrated MAC */ |
|---|
| 247 | 241 | VT6105 = 0x80, |
|---|
| 248 | 242 | VT6105_B0 = 0x83, |
|---|
| 249 | 243 | VT6105L = 0x8A, |
|---|
| .. | .. |
|---|
| 506 | 500 | static int rhine_open(struct net_device *dev); |
|---|
| 507 | 501 | static void rhine_reset_task(struct work_struct *work); |
|---|
| 508 | 502 | 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); |
|---|
| 510 | 504 | static netdev_tx_t rhine_start_tx(struct sk_buff *skb, |
|---|
| 511 | 505 | struct net_device *dev); |
|---|
| 512 | 506 | static irqreturn_t rhine_interrupt(int irq, void *dev_instance); |
|---|
| .. | .. |
|---|
| 571 | 565 | if (rp->quirks & rqStatusWBRace) |
|---|
| 572 | 566 | iowrite8(mask >> 16, ioaddr + IntrStatus2); |
|---|
| 573 | 567 | iowrite16(mask, ioaddr + IntrStatus); |
|---|
| 574 | | - mmiowb(); |
|---|
| 575 | 568 | } |
|---|
| 576 | 569 | |
|---|
| 577 | 570 | /* |
|---|
| .. | .. |
|---|
| 863 | 856 | if (work_done < budget) { |
|---|
| 864 | 857 | napi_complete_done(napi, work_done); |
|---|
| 865 | 858 | iowrite16(enable_mask, ioaddr + IntrEnable); |
|---|
| 866 | | - mmiowb(); |
|---|
| 867 | 859 | } |
|---|
| 868 | 860 | return work_done; |
|---|
| 869 | 861 | } |
|---|
| .. | .. |
|---|
| 1053 | 1045 | u32 quirks = 0; |
|---|
| 1054 | 1046 | #endif |
|---|
| 1055 | 1047 | |
|---|
| 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 | | - |
|---|
| 1061 | 1048 | rc = pci_enable_device(pdev); |
|---|
| 1062 | 1049 | if (rc) |
|---|
| 1063 | 1050 | goto err_out; |
|---|
| .. | .. |
|---|
| 1129 | 1116 | const struct of_device_id *match; |
|---|
| 1130 | 1117 | const u32 *quirks; |
|---|
| 1131 | 1118 | int irq; |
|---|
| 1132 | | - struct resource *res; |
|---|
| 1133 | 1119 | void __iomem *ioaddr; |
|---|
| 1134 | 1120 | |
|---|
| 1135 | 1121 | match = of_match_device(rhine_of_tbl, &pdev->dev); |
|---|
| 1136 | 1122 | if (!match) |
|---|
| 1137 | 1123 | return -EINVAL; |
|---|
| 1138 | 1124 | |
|---|
| 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); |
|---|
| 1141 | 1126 | if (IS_ERR(ioaddr)) |
|---|
| 1142 | 1127 | return PTR_ERR(ioaddr); |
|---|
| 1143 | 1128 | |
|---|
| .. | .. |
|---|
| 1519 | 1504 | |
|---|
| 1520 | 1505 | /** |
|---|
| 1521 | 1506 | * rhine_update_vcam - update VLAN CAM filters |
|---|
| 1522 | | - * @rp: rhine_private data of this Rhine |
|---|
| 1507 | + * @dev: rhine_private data of this Rhine |
|---|
| 1523 | 1508 | * |
|---|
| 1524 | 1509 | * Update VLAN CAM filters to match configuration change. |
|---|
| 1525 | 1510 | */ |
|---|
| .. | .. |
|---|
| 1710 | 1695 | goto out_free_ring; |
|---|
| 1711 | 1696 | |
|---|
| 1712 | 1697 | alloc_tbufs(dev); |
|---|
| 1698 | + enable_mmio(rp->pioaddr, rp->quirks); |
|---|
| 1699 | + rhine_power_init(dev); |
|---|
| 1713 | 1700 | rhine_chip_reset(dev); |
|---|
| 1714 | 1701 | rhine_task_enable(rp); |
|---|
| 1715 | 1702 | init_registers(dev); |
|---|
| .. | .. |
|---|
| 1765 | 1752 | mutex_unlock(&rp->task_lock); |
|---|
| 1766 | 1753 | } |
|---|
| 1767 | 1754 | |
|---|
| 1768 | | -static void rhine_tx_timeout(struct net_device *dev) |
|---|
| 1755 | +static void rhine_tx_timeout(struct net_device *dev, unsigned int txqueue) |
|---|
| 1769 | 1756 | { |
|---|
| 1770 | 1757 | struct rhine_private *rp = netdev_priv(dev); |
|---|
| 1771 | 1758 | void __iomem *ioaddr = rp->base; |
|---|
| .. | .. |
|---|
| 1893 | 1880 | static void rhine_irq_disable(struct rhine_private *rp) |
|---|
| 1894 | 1881 | { |
|---|
| 1895 | 1882 | iowrite16(0x0000, rp->base + IntrEnable); |
|---|
| 1896 | | - mmiowb(); |
|---|
| 1897 | 1883 | } |
|---|
| 1898 | 1884 | |
|---|
| 1899 | 1885 | /* The interrupt handler does all of the Rx thread work and cleans up |
|---|
| .. | .. |
|---|
| 2299 | 2285 | struct device *hwdev = dev->dev.parent; |
|---|
| 2300 | 2286 | |
|---|
| 2301 | 2287 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
|---|
| 2302 | | - strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
|---|
| 2303 | 2288 | strlcpy(info->bus_info, dev_name(hwdev), sizeof(info->bus_info)); |
|---|
| 2304 | 2289 | } |
|---|
| 2305 | 2290 | |
|---|
| .. | .. |
|---|
| 2621 | 2606 | int ret_pci, ret_platform; |
|---|
| 2622 | 2607 | |
|---|
| 2623 | 2608 | /* 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 |
|---|
| 2627 | 2609 | if (dmi_check_system(rhine_dmi_table)) { |
|---|
| 2628 | 2610 | /* these BIOSes fail at PXE boot if chip is in D3 */ |
|---|
| 2629 | 2611 | avoid_D3 = true; |
|---|