Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161414AbWBUGev (ORCPT ); Tue, 21 Feb 2006 01:34:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161415AbWBUGeu (ORCPT ); Tue, 21 Feb 2006 01:34:50 -0500 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:57021 "EHLO fgwmail7.fujitsu.co.jp") by vger.kernel.org with ESMTP id S1161414AbWBUGet (ORCPT ); Tue, 21 Feb 2006 01:34:49 -0500 Message-ID: <43FAB3FA.1040802@jp.fujitsu.com> Date: Tue, 21 Feb 2006 15:32:26 +0900 From: Kenji Kaneshige User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: ja, en-us, en MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz, akpm@osdl.org, greg@kroah.com CC: Kenji Kaneshige , ak@suse.de, rmk+lkml@arm.linux.org.uk Subject: [PATCH 5/6] PCI legacy I/O port free driver (take2) - Make Intel e1000 driver legacy I/O port free References: <43FAB283.8090206@jp.fujitsu.com> In-Reply-To: <43FAB283.8090206@jp.fujitsu.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6458 Lines: 153 This patch makes e1000 driver legacy I/O port free. Signed-off-by: Kenji Kaneshige drivers/net/e1000/e1000.h | 4 - drivers/net/e1000/e1000_main.c | 105 +++++++++++++++++++++-------------------- 2 files changed, 56 insertions(+), 53 deletions(-) Index: linux-2.6.16-rc4/drivers/net/e1000/e1000.h =================================================================== --- linux-2.6.16-rc4.orig/drivers/net/e1000/e1000.h 2006-02-21 14:40:46.000000000 +0900 +++ linux-2.6.16-rc4/drivers/net/e1000/e1000.h 2006-02-21 14:40:57.000000000 +0900 @@ -77,8 +77,8 @@ #define BAR_1 1 #define BAR_5 5 -#define INTEL_E1000_ETHERNET_DEVICE(device_id) {\ - PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)} +#define INTEL_E1000_ETHERNET_DEVICE(device_id, flags) {\ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id), .device_flags = flags} struct e1000_adapter; Index: linux-2.6.16-rc4/drivers/net/e1000/e1000_main.c =================================================================== --- linux-2.6.16-rc4.orig/drivers/net/e1000/e1000_main.c 2006-02-21 14:40:46.000000000 +0900 +++ linux-2.6.16-rc4/drivers/net/e1000/e1000_main.c 2006-02-21 14:40:57.000000000 +0900 @@ -115,51 +115,51 @@ * {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)} */ static struct pci_device_id e1000_pci_tbl[] = { - INTEL_E1000_ETHERNET_DEVICE(0x1000), - INTEL_E1000_ETHERNET_DEVICE(0x1001), - INTEL_E1000_ETHERNET_DEVICE(0x1004), - INTEL_E1000_ETHERNET_DEVICE(0x1008), - INTEL_E1000_ETHERNET_DEVICE(0x1009), - INTEL_E1000_ETHERNET_DEVICE(0x100C), - INTEL_E1000_ETHERNET_DEVICE(0x100D), - INTEL_E1000_ETHERNET_DEVICE(0x100E), - INTEL_E1000_ETHERNET_DEVICE(0x100F), - INTEL_E1000_ETHERNET_DEVICE(0x1010), - INTEL_E1000_ETHERNET_DEVICE(0x1011), - INTEL_E1000_ETHERNET_DEVICE(0x1012), - INTEL_E1000_ETHERNET_DEVICE(0x1013), - INTEL_E1000_ETHERNET_DEVICE(0x1014), - INTEL_E1000_ETHERNET_DEVICE(0x1015), - INTEL_E1000_ETHERNET_DEVICE(0x1016), - INTEL_E1000_ETHERNET_DEVICE(0x1017), - INTEL_E1000_ETHERNET_DEVICE(0x1018), - INTEL_E1000_ETHERNET_DEVICE(0x1019), - INTEL_E1000_ETHERNET_DEVICE(0x101A), - INTEL_E1000_ETHERNET_DEVICE(0x101D), - INTEL_E1000_ETHERNET_DEVICE(0x101E), - INTEL_E1000_ETHERNET_DEVICE(0x1026), - INTEL_E1000_ETHERNET_DEVICE(0x1027), - INTEL_E1000_ETHERNET_DEVICE(0x1028), - INTEL_E1000_ETHERNET_DEVICE(0x105E), - INTEL_E1000_ETHERNET_DEVICE(0x105F), - INTEL_E1000_ETHERNET_DEVICE(0x1060), - INTEL_E1000_ETHERNET_DEVICE(0x1075), - INTEL_E1000_ETHERNET_DEVICE(0x1076), - INTEL_E1000_ETHERNET_DEVICE(0x1077), - INTEL_E1000_ETHERNET_DEVICE(0x1078), - INTEL_E1000_ETHERNET_DEVICE(0x1079), - INTEL_E1000_ETHERNET_DEVICE(0x107A), - INTEL_E1000_ETHERNET_DEVICE(0x107B), - INTEL_E1000_ETHERNET_DEVICE(0x107C), - INTEL_E1000_ETHERNET_DEVICE(0x107D), - INTEL_E1000_ETHERNET_DEVICE(0x107E), - INTEL_E1000_ETHERNET_DEVICE(0x107F), - INTEL_E1000_ETHERNET_DEVICE(0x108A), - INTEL_E1000_ETHERNET_DEVICE(0x108B), - INTEL_E1000_ETHERNET_DEVICE(0x108C), - INTEL_E1000_ETHERNET_DEVICE(0x1099), - INTEL_E1000_ETHERNET_DEVICE(0x109A), - INTEL_E1000_ETHERNET_DEVICE(0x10B5), + INTEL_E1000_ETHERNET_DEVICE(0x1000, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1001, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1004, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1008, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1009, 0), + INTEL_E1000_ETHERNET_DEVICE(0x100C, 0), + INTEL_E1000_ETHERNET_DEVICE(0x100D, 0), + INTEL_E1000_ETHERNET_DEVICE(0x100E, 0), + INTEL_E1000_ETHERNET_DEVICE(0x100F, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1010, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1011, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1012, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1013, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1014, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1015, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1016, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1017, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1018, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1019, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x101A, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x101D, 0), + INTEL_E1000_ETHERNET_DEVICE(0x101E, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1026, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1027, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1028, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x105E, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x105F, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1060, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1075, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1076, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1077, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1078, 0), + INTEL_E1000_ETHERNET_DEVICE(0x1079, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x107A, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x107B, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x107C, 0), + INTEL_E1000_ETHERNET_DEVICE(0x107D, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x107E, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x107F, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x108A, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x108B, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x108C, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x1099, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x109A, PCI_DEVICE_ID_FLAG_NOIOPORT), + INTEL_E1000_ETHERNET_DEVICE(0x10B5, PCI_DEVICE_ID_FLAG_NOIOPORT), /* required last entry */ {0,} }; @@ -709,12 +709,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 (!(ent->device_flags & PCI_DEVICE_ID_FLAG_NOIOPORT)) { + 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; + } } } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/