netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, akpm@osdl.org, jgarzik@pobox.com
Subject: [patch 2.6.13 2/2] 3c59x: add option for using memory-mapped PCI I/O resources
Date: Tue, 6 Sep 2005 16:44:00 -0400	[thread overview]
Message-ID: <20050906204400.GD20145@tuxdriver.com> (raw)
In-Reply-To: <20050906204147.GC20145@tuxdriver.com>

Add module option to enable 3c59x driver to use memory-mapped PCI I/O
resources.  This may improve performance for those devices so equipped.

Add "use_mmio=1" to the 3c59x module options in order to enable this
functionality.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Ideally this option will eventually go away.  First we need a good list
of which devices "work" and which ones do not.

 drivers/net/3c59x.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -918,6 +918,9 @@ static int global_enable_wol = -1;
 static int compaq_ioaddr, compaq_irq, compaq_device_id = 0x5900;
 static struct net_device *compaq_net_device;
 
+/* Flag to enable use of memory-mapped PCI I/O resource */
+static int use_mmio;
+
 static int vortex_cards_found;
 
 module_param(debug, int, 0);
@@ -935,6 +938,7 @@ module_param(compaq_ioaddr, int, 0);
 module_param(compaq_irq, int, 0);
 module_param(compaq_device_id, int, 0);
 module_param(watchdog, int, 0);
+module_param(use_mmio, int, 0);
 MODULE_PARM_DESC(debug, "3c59x debug level (0-6)");
 MODULE_PARM_DESC(options, "3c59x: Bits 0-3: media type, bit 4: bus mastering, bit 9: full duplex");
 MODULE_PARM_DESC(global_options, "3c59x: same as options, but applies to all NICs if options is unset");
@@ -950,6 +954,7 @@ MODULE_PARM_DESC(compaq_ioaddr, "3c59x P
 MODULE_PARM_DESC(compaq_irq, "3c59x PCI IRQ number (Compaq BIOS problem workaround)");
 MODULE_PARM_DESC(compaq_device_id, "3c59x PCI device ID (Compaq BIOS problem workaround)");
 MODULE_PARM_DESC(watchdog, "3c59x transmit timeout in milliseconds");
+MODULE_PARM_DESC(use_mmio, "3c59x: use memory-mapped PCI I/O resource");
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void poll_vortex(struct net_device *dev)
@@ -1093,14 +1098,16 @@ static int __init vortex_eisa_init (void
 static int __devinit vortex_init_one (struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
-	int rc;
+	int rc, pci_bar;
 
 	/* wake up and enable device */		
 	rc = pci_enable_device (pdev);
 	if (rc < 0)
 		goto out;
 
-	rc = vortex_probe1 (&pdev->dev, pci_iomap(pdev, 0, 0),
+	pci_bar = use_mmio ? 1 : 0;
+
+	rc = vortex_probe1 (&pdev->dev, pci_iomap(pdev, pci_bar, 0),
 			    pdev->irq, ent->driver_data, vortex_cards_found);
 	if (rc < 0) {
 		pci_disable_device (pdev);
-- 
John W. Linville
linville@tuxdriver.com

  reply	other threads:[~2005-09-06 20:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-06 20:41 [patch 2.6.13 1/2] 3c59x: convert to use of pci_iomap API John W. Linville
2005-09-06 20:44 ` John W. Linville [this message]
2005-09-06 20:54   ` [patch 2.6.13 2/2] 3c59x: add option for using memory-mapped PCI I/O resources Christoph Hellwig
2005-09-06 21:04     ` Andrew Morton
     [not found]       ` <20050906220922.GA26003@tuxdriver.com>
2005-09-06 22:15         ` Andrew Morton
2005-09-06 22:57           ` John W. Linville
2005-09-06 23:13             ` Andrew Morton
2005-09-12 14:48               ` [patch 2.6.13] 3c59x: enable use of memory-mapped PCI I/O John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050906204400.GD20145@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=akpm@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).