Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 /*
  2  * Access ACPI _OSC method
  3  *
  4  * Copyright (C) 2006 Intel Corp.
  5  *      Tom Long Nguyen (tom.l.nguyen@intel.com)
  6  *      Zhang Yanmin (yanmin.zhang@intel.com)
  7  *
  8  */
  9 
 10 #include <linux/module.h>
 11 #include <linux/pci.h>
 12 #include <linux/kernel.h>
 13 #include <linux/errno.h>
 14 #include <linux/pm.h>
 15 #include <linux/suspend.h>
 16 #include <linux/acpi.h>
 17 #include <linux/pci-acpi.h>
 18 #include <linux/delay.h>
 19 #include "aerdrv.h"
 20 
 21 /**
 22  * aer_osc_setup - run ACPI _OSC method
 23  * @pciedev: pcie_device which AER is being enabled on
 24  *
 25  * @return: Zero on success. Nonzero otherwise.
 26  *
 27  * Invoked when PCIE bus loads AER service driver. To avoid conflict with
 28  * BIOS AER support requires BIOS to yield AER control to OS native driver.
 29  **/
 30 int aer_osc_setup(struct pcie_device *pciedev)
 31 {
 32         acpi_status status = AE_NOT_FOUND;
 33         struct pci_dev *pdev = pciedev->port;
 34         acpi_handle handle = 0;
 35 
 36         /* Find root host bridge */
 37         while (pdev->bus && pdev->bus->self)
 38                 pdev = pdev->bus->self;
 39         handle = acpi_get_pci_rootbridge_handle(
 40                 pci_domain_nr(pdev->bus), pdev->bus->number);
 41 
 42         if (handle) {
 43                 pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);
 44                 status = pci_osc_control_set(handle,
 45                                         OSC_PCI_EXPRESS_AER_CONTROL |
 46                                         OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
 47         }
 48 
 49         if (ACPI_FAILURE(status)) {
 50                 printk(KERN_DEBUG "AER service couldn't init device %s - %s\n",
 51                     pciedev->device.bus_id,
 52                     (status == AE_SUPPORT || status == AE_NOT_FOUND) ?
 53                     "no _OSC support" : "Run ACPI _OSC fails");
 54                 return -1;
 55         }
 56 
 57         return 0;
 58 }
 59 
  This page was automatically generated by the LXR engine.