Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
portdrv_acpi.c
Go to the documentation of this file.
1 /*
2  * PCIe Port Native Services Support, ACPI-Related Part
3  *
4  * Copyright (C) 2010 Rafael J. Wysocki <[email protected]>, Novell Inc.
5  *
6  * This file is subject to the terms and conditions of the GNU General Public
7  * License V2. See the file "COPYING" in the main directory of this archive
8  * for more details.
9  */
10 
11 #include <linux/pci.h>
12 #include <linux/kernel.h>
13 #include <linux/errno.h>
14 #include <linux/acpi.h>
15 #include <linux/pci-acpi.h>
16 #include <linux/pcieport_if.h>
17 
18 #include "aer/aerdrv.h"
19 #include "../pci.h"
20 
34 int pcie_port_acpi_setup(struct pci_dev *port, int *srv_mask)
35 {
36  struct acpi_pci_root *root;
38  u32 flags;
39 
41  return 0;
42 
43  handle = acpi_find_root_bridge_handle(port);
44  if (!handle)
45  return -EINVAL;
46 
47  root = acpi_pci_find_root(handle);
48  if (!root)
49  return -ENODEV;
50 
51  flags = root->osc_control_set;
52 
53  *srv_mask = PCIE_PORT_SERVICE_VC;
54  if (flags & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL)
55  *srv_mask |= PCIE_PORT_SERVICE_HP;
56  if (flags & OSC_PCI_EXPRESS_PME_CONTROL)
57  *srv_mask |= PCIE_PORT_SERVICE_PME;
58  if (flags & OSC_PCI_EXPRESS_AER_CONTROL)
59  *srv_mask |= PCIE_PORT_SERVICE_AER;
60 
61  return 0;
62 }