summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Patterson <andrew.patterson@hp.com>2008-01-22 17:18:12 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 15:04:29 -0800
commitc2778357234f84668eab5558b54ad28478439d0b (patch)
tree9820e6cfa1bfe6989854425b0d63840c949fa3f2
parent02d90fc343411d6dff26bbd64f0895a243e6f608 (diff)
downloadlinux-3.10-c2778357234f84668eab5558b54ad28478439d0b.tar.gz
linux-3.10-c2778357234f84668eab5558b54ad28478439d0b.tar.bz2
linux-3.10-c2778357234f84668eab5558b54ad28478439d0b.zip
PCI ACPI: Added a function to register _OSC with only PCIe devices.
The function pci_osc_support_set() traverses every root bridge when checking for _OSC support for a capability. It quits as soon as it finds a device/bridge that doesn't support the requested capability. This won't work for systems that have mixed PCI and PCIe bridges when checking for PCIe features. I split this function into two -- pci_osc_support_set() and pcie_osc_support_set(). The latter is used when only PCIe devices should be traversed. Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/pci/pci-acpi.c6
-rw-r--r--include/linux/pci-acpi.h11
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 02e4876b3b2..e569645d59e 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -156,13 +156,13 @@ run_osc_out:
}
/**
- * pci_osc_support_set - register OS support to Firmware
+ * __pci_osc_support_set - register OS support to Firmware
* @flags: OS support bits
*
* Update OS support fields and doing a _OSC Query to obtain an update
* from Firmware on supported control bits.
**/
-acpi_status pci_osc_support_set(u32 flags)
+acpi_status __pci_osc_support_set(u32 flags, const char *hid)
{
u32 temp;
acpi_status retval;
@@ -176,7 +176,7 @@ acpi_status pci_osc_support_set(u32 flags)
temp = ctrlset_buf[OSC_CONTROL_TYPE];
ctrlset_buf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE;
ctrlset_buf[OSC_CONTROL_TYPE] = OSC_CONTROL_MASKS;
- acpi_get_devices ( PCI_ROOT_HID_STRING,
+ acpi_get_devices(hid,
acpi_query_osc,
ctrlset_buf,
(void **) &retval );
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 936ef82ed76..3ba25065fa9 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -48,7 +48,15 @@
#ifdef CONFIG_ACPI
extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
-extern acpi_status pci_osc_support_set(u32 flags);
+extern acpi_status __pci_osc_support_set(u32 flags, const char *hid);
+static inline acpi_status pci_osc_support_set(u32 flags)
+{
+ return __pci_osc_support_set(flags, PCI_ROOT_HID_STRING);
+}
+static inline acpi_status pcie_osc_support_set(u32 flags)
+{
+ return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING);
+}
#else
#if !defined(AE_ERROR)
typedef u32 acpi_status;
@@ -57,6 +65,7 @@ typedef u32 acpi_status;
static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
{return AE_ERROR;}
static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;}
+static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;}
#endif
#endif /* _PCI_ACPI_H_ */