aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2015-03-25 02:31:41 -0400
committerBjorn Helgaas <bhelgaas@google.com>2015-04-08 15:39:30 -0400
commit18e94a3384368340d438cf67fcaebd72084f34f8 (patch)
treea23e29fde7ad6f0429562adbb7bdb6f07d37c630 /drivers/pci
parentc89ac4433030fa95a453b14857358cc6ec2e30db (diff)
PCI: Make a shareable UUID for PCI firmware ACPI _DSM
The PCI Firmware Specification, r3.0, sec 4.6.4.1.3, defines a single UUID for an ACPI _DSM method to provide device-specific control functions. This _DSM method support several functions, including PCI Express Slot Information, PCI Express Slot Number, PCI Bus Capabilities, etc. Move the UUID definition from pci/pci-label.c, where it could be used only for one function, to pci/pci-acpi.c where it can be shared for all these functions. [bhelgaas: changelog] Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci-acpi.c9
-rw-r--r--drivers/pci/pci-label.c11
2 files changed, 11 insertions, 9 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 489063987325..bea6be4992c3 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -18,6 +18,15 @@
18#include <linux/pm_qos.h> 18#include <linux/pm_qos.h>
19#include "pci.h" 19#include "pci.h"
20 20
21/*
22 * The UUID is defined in the PCI Firmware Specification available here:
23 * https://www.pcisig.com/members/downloads/pcifw_r3_1_13Dec10.pdf
24 */
25const u8 pci_acpi_dsm_uuid[] = {
26 0xd0, 0x37, 0xc9, 0xe5, 0x53, 0x35, 0x7a, 0x4d,
27 0x91, 0x17, 0xea, 0x4d, 0x19, 0xc3, 0x43, 0x4d
28};
29
21phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle) 30phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle)
22{ 31{
23 acpi_status status = AE_NOT_EXIST; 32 acpi_status status = AE_NOT_EXIST;
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
index 2ab1b47c7651..024b5c179348 100644
--- a/drivers/pci/pci-label.c
+++ b/drivers/pci/pci-label.c
@@ -31,8 +31,6 @@
31#include <linux/pci-acpi.h> 31#include <linux/pci-acpi.h>
32#include "pci.h" 32#include "pci.h"
33 33
34#define DEVICE_LABEL_DSM 0x07
35
36#ifdef CONFIG_DMI 34#ifdef CONFIG_DMI
37enum smbios_attr_enum { 35enum smbios_attr_enum {
38 SMBIOS_ATTR_NONE = 0, 36 SMBIOS_ATTR_NONE = 0,
@@ -148,11 +146,6 @@ static inline void pci_remove_smbiosname_file(struct pci_dev *pdev)
148#endif 146#endif
149 147
150#ifdef CONFIG_ACPI 148#ifdef CONFIG_ACPI
151static const char device_label_dsm_uuid[] = {
152 0xD0, 0x37, 0xC9, 0xE5, 0x53, 0x35, 0x7A, 0x4D,
153 0x91, 0x17, 0xEA, 0x4D, 0x19, 0xC3, 0x43, 0x4D
154};
155
156enum acpi_attr_enum { 149enum acpi_attr_enum {
157 ACPI_ATTR_LABEL_SHOW, 150 ACPI_ATTR_LABEL_SHOW,
158 ACPI_ATTR_INDEX_SHOW, 151 ACPI_ATTR_INDEX_SHOW,
@@ -179,7 +172,7 @@ static int dsm_get_label(struct device *dev, char *buf,
179 if (!handle) 172 if (!handle)
180 return -1; 173 return -1;
181 174
182 obj = acpi_evaluate_dsm(handle, device_label_dsm_uuid, 0x2, 175 obj = acpi_evaluate_dsm(handle, pci_acpi_dsm_uuid, 0x2,
183 DEVICE_LABEL_DSM, NULL); 176 DEVICE_LABEL_DSM, NULL);
184 if (!obj) 177 if (!obj)
185 return -1; 178 return -1;
@@ -219,7 +212,7 @@ static bool device_has_dsm(struct device *dev)
219 if (!handle) 212 if (!handle)
220 return false; 213 return false;
221 214
222 return !!acpi_check_dsm(handle, device_label_dsm_uuid, 0x2, 215 return !!acpi_check_dsm(handle, pci_acpi_dsm_uuid, 0x2,
223 1 << DEVICE_LABEL_DSM); 216 1 << DEVICE_LABEL_DSM);
224} 217}
225 218