aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/Makefile7
-rw-r--r--drivers/pci/hotplug.c44
-rw-r--r--drivers/pci/pci-driver.c6
-rw-r--r--drivers/pci/pci.h4
-rw-r--r--drivers/pci/quirks.c30
5 files changed, 60 insertions, 31 deletions
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 716df015f8d0..6707df968934 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -6,6 +6,9 @@ obj-y += access.o bus.o probe.o remove.o pci.o quirks.o \
6 pci-driver.o search.o pci-sysfs.o rom.o setup-res.o 6 pci-driver.o search.o pci-sysfs.o rom.o setup-res.o
7obj-$(CONFIG_PROC_FS) += proc.o 7obj-$(CONFIG_PROC_FS) += proc.o
8 8
9# Build PCI Express stuff if needed
10obj-$(CONFIG_PCIEPORTBUS) += pcie/
11
9obj-$(CONFIG_HOTPLUG) += hotplug.o 12obj-$(CONFIG_HOTPLUG) += hotplug.o
10 13
11# Build the PCI Hotplug drivers if we were asked to 14# Build the PCI Hotplug drivers if we were asked to
@@ -40,7 +43,3 @@ endif
40ifeq ($(CONFIG_PCI_DEBUG),y) 43ifeq ($(CONFIG_PCI_DEBUG),y)
41EXTRA_CFLAGS += -DDEBUG 44EXTRA_CFLAGS += -DDEBUG
42endif 45endif
43
44# Build PCI Express stuff if needed
45obj-$(CONFIG_PCIEPORTBUS) += pcie/
46
diff --git a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c
index e1743be31909..1c97e7dd130b 100644
--- a/drivers/pci/hotplug.c
+++ b/drivers/pci/hotplug.c
@@ -3,8 +3,8 @@
3#include <linux/module.h> 3#include <linux/module.h>
4#include "pci.h" 4#include "pci.h"
5 5
6int pci_hotplug (struct device *dev, char **envp, int num_envp, 6int pci_uevent(struct device *dev, char **envp, int num_envp,
7 char *buffer, int buffer_size) 7 char *buffer, int buffer_size)
8{ 8{
9 struct pci_dev *pdev; 9 struct pci_dev *pdev;
10 int i = 0; 10 int i = 0;
@@ -17,34 +17,34 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
17 if (!pdev) 17 if (!pdev)
18 return -ENODEV; 18 return -ENODEV;
19 19
20 if (add_hotplug_env_var(envp, num_envp, &i, 20 if (add_uevent_var(envp, num_envp, &i,
21 buffer, buffer_size, &length, 21 buffer, buffer_size, &length,
22 "PCI_CLASS=%04X", pdev->class)) 22 "PCI_CLASS=%04X", pdev->class))
23 return -ENOMEM; 23 return -ENOMEM;
24 24
25 if (add_hotplug_env_var(envp, num_envp, &i, 25 if (add_uevent_var(envp, num_envp, &i,
26 buffer, buffer_size, &length, 26 buffer, buffer_size, &length,
27 "PCI_ID=%04X:%04X", pdev->vendor, pdev->device)) 27 "PCI_ID=%04X:%04X", pdev->vendor, pdev->device))
28 return -ENOMEM; 28 return -ENOMEM;
29 29
30 if (add_hotplug_env_var(envp, num_envp, &i, 30 if (add_uevent_var(envp, num_envp, &i,
31 buffer, buffer_size, &length, 31 buffer, buffer_size, &length,
32 "PCI_SUBSYS_ID=%04X:%04X", pdev->subsystem_vendor, 32 "PCI_SUBSYS_ID=%04X:%04X", pdev->subsystem_vendor,
33 pdev->subsystem_device)) 33 pdev->subsystem_device))
34 return -ENOMEM; 34 return -ENOMEM;
35 35
36 if (add_hotplug_env_var(envp, num_envp, &i, 36 if (add_uevent_var(envp, num_envp, &i,
37 buffer, buffer_size, &length, 37 buffer, buffer_size, &length,
38 "PCI_SLOT_NAME=%s", pci_name(pdev))) 38 "PCI_SLOT_NAME=%s", pci_name(pdev)))
39 return -ENOMEM; 39 return -ENOMEM;
40 40
41 if (add_hotplug_env_var(envp, num_envp, &i, 41 if (add_uevent_var(envp, num_envp, &i,
42 buffer, buffer_size, &length, 42 buffer, buffer_size, &length,
43 "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x", 43 "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x",
44 pdev->vendor, pdev->device, 44 pdev->vendor, pdev->device,
45 pdev->subsystem_vendor, pdev->subsystem_device, 45 pdev->subsystem_vendor, pdev->subsystem_device,
46 (u8)(pdev->class >> 16), (u8)(pdev->class >> 8), 46 (u8)(pdev->class >> 16), (u8)(pdev->class >> 8),
47 (u8)(pdev->class))) 47 (u8)(pdev->class)))
48 return -ENOMEM; 48 return -ENOMEM;
49 49
50 envp[i] = NULL; 50 envp[i] = NULL;
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index a9046d4b8af3..7146b69b812c 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -502,8 +502,8 @@ void pci_dev_put(struct pci_dev *dev)
502} 502}
503 503
504#ifndef CONFIG_HOTPLUG 504#ifndef CONFIG_HOTPLUG
505int pci_hotplug (struct device *dev, char **envp, int num_envp, 505int pci_uevent(struct device *dev, char **envp, int num_envp,
506 char *buffer, int buffer_size) 506 char *buffer, int buffer_size)
507{ 507{
508 return -ENODEV; 508 return -ENODEV;
509} 509}
@@ -512,7 +512,7 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
512struct bus_type pci_bus_type = { 512struct bus_type pci_bus_type = {
513 .name = "pci", 513 .name = "pci",
514 .match = pci_bus_match, 514 .match = pci_bus_match,
515 .hotplug = pci_hotplug, 515 .uevent = pci_uevent,
516 .suspend = pci_device_suspend, 516 .suspend = pci_device_suspend,
517 .resume = pci_device_resume, 517 .resume = pci_device_resume,
518 .dev_attrs = pci_dev_attrs, 518 .dev_attrs = pci_dev_attrs,
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 6527b36c9a61..294849d24590 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -1,7 +1,7 @@
1/* Functions internal to the PCI core code */ 1/* Functions internal to the PCI core code */
2 2
3extern int pci_hotplug (struct device *dev, char **envp, int num_envp, 3extern int pci_uevent(struct device *dev, char **envp, int num_envp,
4 char *buffer, int buffer_size); 4 char *buffer, int buffer_size);
5extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); 5extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
6extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); 6extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
7extern void pci_cleanup_rom(struct pci_dev *dev); 7extern void pci_cleanup_rom(struct pci_dev *dev);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 3a4f49f4effb..f28ebdd3958a 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1098,6 +1098,23 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev)
1098DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic ); 1098DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic );
1099#endif 1099#endif
1100 1100
1101enum ide_combined_type { COMBINED = 0, IDE = 1, LIBATA = 2 };
1102/* Defaults to combined */
1103static enum ide_combined_type combined_mode;
1104
1105static int __init combined_setup(char *str)
1106{
1107 if (!strncmp(str, "ide", 3))
1108 combined_mode = IDE;
1109 else if (!strncmp(str, "libata", 6))
1110 combined_mode = LIBATA;
1111 else /* "combined" or anything else defaults to old behavior */
1112 combined_mode = COMBINED;
1113
1114 return 1;
1115}
1116__setup("combined_mode=", combined_setup);
1117
1101#ifdef CONFIG_SCSI_SATA_INTEL_COMBINED 1118#ifdef CONFIG_SCSI_SATA_INTEL_COMBINED
1102static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev) 1119static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev)
1103{ 1120{
@@ -1164,6 +1181,19 @@ static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev)
1164 if (prog & comb) 1181 if (prog & comb)
1165 return; 1182 return;
1166 1183
1184 /* Don't reserve any so the IDE driver can get them (but only if
1185 * combined_mode=ide).
1186 */
1187 if (combined_mode == IDE)
1188 return;
1189
1190 /* Grab them both for libata if combined_mode=libata. */
1191 if (combined_mode == LIBATA) {
1192 request_region(0x1f0, 8, "libata"); /* port 0 */
1193 request_region(0x170, 8, "libata"); /* port 1 */
1194 return;
1195 }
1196
1167 /* SATA port is in legacy mode. Reserve port so that 1197 /* SATA port is in legacy mode. Reserve port so that
1168 * IDE driver does not attempt to use it. If request_region 1198 * IDE driver does not attempt to use it. If request_region
1169 * fails, it will be obvious at boot time, so we don't bother 1199 * fails, it will be obvious at boot time, so we don't bother