rpms/kernel/devel kernel.spec, 1.760, 1.761 linux-2.6-net-8139-pio-modparam.patch, 1.1, 1.2
Dave Jones (davej)
fedora-extras-commits at redhat.com
Mon Jul 14 17:25:31 UTC 2008
Author: davej
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32050
Modified Files:
kernel.spec linux-2.6-net-8139-pio-modparam.patch
Log Message:
Improve 8139too PIO patch with jgarziks comments.
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.760
retrieving revision 1.761
diff -u -r1.760 -r1.761
--- kernel.spec 14 Jul 2008 07:51:15 -0000 1.760
+++ kernel.spec 14 Jul 2008 17:24:20 -0000 1.761
@@ -1788,6 +1788,9 @@
%kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
%changelog
+* Mon Jul 14 2008 Dave Jones <davej at redhat.com>
+- Improve 8139too PIO patch with jgarziks comments.
+
* Mon Jul 14 2008 Roland McGrath <roland at redhat.com>
- utrace update
linux-2.6-net-8139-pio-modparam.patch:
Index: linux-2.6-net-8139-pio-modparam.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-net-8139-pio-modparam.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-net-8139-pio-modparam.patch 28 May 2008 17:48:25 -0000 1.1
+++ linux-2.6-net-8139-pio-modparam.patch 14 Jul 2008 17:24:20 -0000 1.2
@@ -6,10 +6,18 @@
Signed-off-by: Dave Jones <davej at redhat.com>
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
-index 53bd903..09ace39 100644
+index 53bd903..b620317 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
-@@ -120,11 +120,6 @@
+@@ -98,7 +98,6 @@
+ #include <linux/compiler.h>
+ #include <linux/pci.h>
+ #include <linux/init.h>
+-#include <linux/ioport.h>
+ #include <linux/netdevice.h>
+ #include <linux/etherdevice.h>
+ #include <linux/rtnetlink.h>
+@@ -120,11 +119,6 @@
NETIF_MSG_LINK)
@@ -21,25 +29,25 @@
/* define to 1, 2 or 3 to enable copious debugging info */
#define RTL8139_DEBUG 0
-@@ -156,6 +151,9 @@
+@@ -156,6 +150,9 @@
static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
+/* Whether to use MMIO or PIO. Default to MMIO. */
-+static int use_pio;
++static int use_io;
+
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
The RTL chips use a 64 element hash table based on the Ethernet CRC. */
static int multicast_filter_limit = 32;
-@@ -615,6 +613,7 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
+@@ -615,6 +612,7 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);
-+module_param(use_pio, int, 0);
++module_param(use_io, int, 0);
module_param(multicast_filter_limit, int, 0);
module_param_array(media, int, NULL, 0);
module_param_array(full_duplex, int, NULL, 0);
-@@ -710,14 +709,13 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
+@@ -710,13 +708,8 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
assert (tp->pci_dev != NULL);
pdev = tp->pci_dev;
@@ -47,21 +55,13 @@
- if (tp->mmio_addr)
- ioport_unmap (tp->mmio_addr);
-#else
-- if (tp->mmio_addr)
-- pci_iounmap (pdev, tp->mmio_addr);
+ if (tp->mmio_addr)
+ pci_iounmap (pdev, tp->mmio_addr);
-#endif /* USE_IO_OPS */
--
-+ if (use_pio) {
-+ if (tp->mmio_addr)
-+ ioport_unmap (tp->mmio_addr);
-+ } else {
-+ if (tp->mmio_addr)
-+ pci_iounmap (pdev, tp->mmio_addr);
-+ }
+
/* it's ok to call this even if we have no regions to free */
pci_release_regions (pdev);
-
-@@ -791,32 +789,32 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
+@@ -791,32 +784,32 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
DPRINTK("PIO region size == 0x%02X\n", pio_len);
DPRINTK("MMIO region size == 0x%02lX\n", mmio_len);
@@ -89,7 +89,7 @@
- dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
- rc = -ENODEV;
- goto err_out;
-+ if (use_pio) {
++ if (use_io) {
+ /* make sure PCI base addr 0 is PIO */
+ if (!(pio_flags & IORESOURCE_IO)) {
+ dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
@@ -119,7 +119,7 @@
rc = pci_request_regions (pdev, DRV_NAME);
if (rc)
-@@ -826,28 +824,28 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
+@@ -826,28 +819,27 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
/* enable PCI bus-mastering */
pci_set_master (pdev);
@@ -140,15 +140,14 @@
- dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
- rc = -EIO;
- goto err_out;
-+ if (use_pio) {
-+ ioaddr = ioport_map(pio_start, pio_len);
++ if (use_io) {
++ ioaddr = pci_iomap(pdev, 0, 0);
+ if (!ioaddr) {
+ dev_err(&pdev->dev, "cannot map PIO, aborting\n");
+ rc = -EIO;
+ goto err_out;
+ }
+ dev->base_addr = pio_start;
-+ tp->mmio_addr = ioaddr;
+ tp->regs_len = pio_len;
+ } else {
+ /* ioremap MMIO region */
@@ -159,17 +158,16 @@
+ goto err_out;
+ }
+ dev->base_addr = (long) ioaddr;
-+ tp->mmio_addr = ioaddr;
+ tp->regs_len = mmio_len;
}
- dev->base_addr = (long) ioaddr;
-- tp->mmio_addr = ioaddr;
+ tp->mmio_addr = ioaddr;
- tp->regs_len = mmio_len;
-#endif /* USE_IO_OPS */
/* Bring old chips out of low-power mode. */
RTL_W8 (HltClk, 'R');
-@@ -2383,20 +2381,24 @@ static void rtl8139_set_msglevel(struct net_device *dev, u32 datum)
+@@ -2383,20 +2375,24 @@ static void rtl8139_set_msglevel(struct net_device *dev, u32 datum)
np->msg_enable = datum;
}
@@ -183,7 +181,7 @@
- struct rtl8139_private *np = netdev_priv(dev);
+ struct rtl8139_private *np;
+ /* TODO: we are too slack to do reg dumping for pio, for now */
-+ if (use_pio)
++ if (use_io)
+ return 0;
+ np = netdev_priv(dev);
return np->regs_len;
@@ -195,13 +193,13 @@
+ struct rtl8139_private *np;
+
+ /* TODO: we are too slack to do reg dumping for pio, for now */
-+ if (use_pio)
++ if (use_io)
+ return;
+ np = netdev_priv(dev);
regs->version = RTL_REGS_VER;
-@@ -2404,7 +2406,6 @@ static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+@@ -2404,7 +2400,6 @@ static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs,
memcpy_fromio(regbuf, np->mmio_addr, regs->len);
spin_unlock_irq(&np->lock);
}
@@ -209,13 +207,13 @@
static int rtl8139_get_sset_count(struct net_device *dev, int sset)
{
-@@ -2610,6 +2611,11 @@ static int __init rtl8139_init_module (void)
+@@ -2610,6 +2605,11 @@ static int __init rtl8139_init_module (void)
printk (KERN_INFO RTL8139_DRIVER_NAME "\n");
#endif
+ /* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */
+#ifdef CONFIG_8139TOO_PIO
-+ use_pio = 1;
++ use_io = 1;
+#endif
+
return pci_register_driver(&rtl8139_pci_driver);
More information about the fedora-extras-commits
mailing list