From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-pci@atrey.karlin.mff.cuni.cz, Andrew Morton <akpm@osdl.org>,
Greg KH <greg@kroah.com>
Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Subject: [RFC][PATCH 3/4] PCI legacy I/O port free driver - Make Intel e1000 driver legacy I/O port free
Date: Tue, 14 Feb 2006 15:09:01 +0900 [thread overview]
Message-ID: <43F173FD.4070401@jp.fujitsu.com> (raw)
In-Reply-To: <43F172BA.1020405@jp.fujitsu.com>
This patch makes e1000 driver pci legacy free.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
drivers/net/e1000/e1000_main.c | 34 ++++++++++++++++++++++++++++------
1 files changed, 28 insertions(+), 6 deletions(-)
Index: linux-2.6.16-rc3/drivers/net/e1000/e1000_main.c
===================================================================
--- linux-2.6.16-rc3.orig/drivers/net/e1000/e1000_main.c 2006-02-14 12:25:08.000000000 +0900
+++ linux-2.6.16-rc3/drivers/net/e1000/e1000_main.c 2006-02-14 12:28:06.000000000 +0900
@@ -642,6 +642,18 @@
}
}
+static inline int need_io_port(struct pci_dev *pdev)
+{
+ switch (pdev->device) {
+ case 0x1008: case 0x1009: case 0x100c: case 0x100d: case 0x100e:
+ case 0x1015: case 0x1016: case 0x1017: case 0x101e: case 0x100f:
+ case 0x1011: case 0x1010: case 0x1012: case 0x101d: case 0x1013:
+ case 0x1018: case 0x1078: case 0x1076: case 0x107c: case 0x1077:
+ return 1;
+ }
+ return 0;
+}
+
/**
* e1000_probe - Device Initialization Routine
* @pdev: PCI device information struct
@@ -666,6 +678,11 @@
int i, err, pci_using_dac;
uint16_t eeprom_data;
uint16_t eeprom_apme_mask = E1000_EEPROM_APME;
+ int need_io = need_io_port(pdev);
+
+ if (!need_io)
+ pci_set_bar_mask_by_resource(pdev, IORESOURCE_MEM);
+
if ((err = pci_enable_device(pdev)))
return err;
@@ -709,12 +726,15 @@
goto err_ioremap;
}
- for (i = BAR_1; i <= BAR_5; i++) {
- if (pci_resource_len(pdev, i) == 0)
- continue;
- if (pci_resource_flags(pdev, i) & IORESOURCE_IO) {
- adapter->hw.io_base = pci_resource_start(pdev, i);
- break;
+ if (need_io) {
+ for (i = BAR_1; i <= BAR_5; i++) {
+ if (pci_resource_len(pdev, i) == 0)
+ continue;
+ if (pci_resource_flags(pdev, i) & IORESOURCE_IO) {
+ adapter->hw.io_base =
+ pci_resource_start(pdev, i);
+ break;
+ }
}
}
@@ -4683,6 +4703,8 @@
if (retval)
DPRINTK(PROBE, ERR, "Error in setting power state\n");
e1000_pci_restore_state(adapter);
+ if (!need_io_port(pdev))
+ pci_set_bar_mask_by_resource(pdev, IORESOURCE_MEM);
ret_val = pci_enable_device(pdev);
pci_set_master(pdev);
next prev parent reply other threads:[~2006-02-14 6:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 6:03 [RFC][PATCH 0/4] PCI legacy I/O port free driver Kenji Kaneshige
2006-02-14 6:06 ` [RFC][PATCH 1/4] PCI legacy I/O port free driver - Introduce pci_set_bar_mask*() Kenji Kaneshige
2006-02-15 5:07 ` Andrew Morton
2006-02-15 6:03 ` Kenji Kaneshige
2006-02-15 9:07 ` Russell King
2006-02-15 12:33 ` Kenji Kaneshige
2006-02-14 6:07 ` [RFC][PATCH 2/4] PCI legacy I/O port free driver - Update Documantion/pci.txt Kenji Kaneshige
2006-02-14 6:09 ` Kenji Kaneshige [this message]
2006-02-14 6:10 ` [RFC][PATCH 4/4] PCI legacy I/O port free driver - Make Emulex lpfc driver legacy I/O port free Kenji Kaneshige
2006-02-14 9:32 ` [RFC][PATCH 0/4] PCI legacy I/O port free driver Andi Kleen
2006-02-15 3:16 ` Kenji Kaneshige
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=43F173FD.4070401@jp.fujitsu.com \
--to=kaneshige.kenji@jp.fujitsu.com \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.