Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
pci.c File Reference
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/log2.h>
#include <linux/pci-aspm.h>
#include <linux/pm_wakeup.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/pm_runtime.h>
#include <asm-generic/pci-bridge.h>
#include <asm/setup.h>
#include "pci.h"

Go to the source code of this file.

Data Structures

struct  pci_pme_device
 
struct  pci_saved_state
 
struct  pci_devres
 

Macros

#define PME_TIMEOUT   1000 /* How long between PME checks */
 
#define DEFAULT_CARDBUS_IO_SIZE   (256)
 
#define DEFAULT_CARDBUS_MEM_SIZE   (64*1024*1024)
 
#define DEFAULT_HOTPLUG_IO_SIZE   (256)
 
#define DEFAULT_HOTPLUG_MEM_SIZE   (2*1024*1024)
 
#define PCI_FIND_CAP_TTL   48
 
#define PCI_EXP_SAVE_REGS   7
 
#define RESOURCE_ALIGNMENT_PARAM_SIZE   COMMAND_LINE_SIZE
 

Functions

 EXPORT_SYMBOL_GPL (pci_power_names)
 
 EXPORT_SYMBOL (isa_dma_bridge_buggy)
 
 EXPORT_SYMBOL (pci_pci_problems)
 
unsigned char pci_bus_max_busnr (struct pci_bus *bus)
 
 EXPORT_SYMBOL_GPL (pci_bus_max_busnr)
 
int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap)
 
 EXPORT_SYMBOL_GPL (pci_find_next_capability)
 
int pci_find_capability (struct pci_dev *dev, int cap)
 
int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap)
 
int pci_find_next_ext_capability (struct pci_dev *dev, int start, int cap)
 
 EXPORT_SYMBOL_GPL (pci_find_next_ext_capability)
 
int pci_find_ext_capability (struct pci_dev *dev, int cap)
 
 EXPORT_SYMBOL_GPL (pci_find_ext_capability)
 
int pci_find_next_ht_capability (struct pci_dev *dev, int pos, int ht_cap)
 
 EXPORT_SYMBOL_GPL (pci_find_next_ht_capability)
 
int pci_find_ht_capability (struct pci_dev *dev, int ht_cap)
 
 EXPORT_SYMBOL_GPL (pci_find_ht_capability)
 
struct resourcepci_find_parent_resource (const struct pci_dev *dev, struct resource *res)
 
int pci_set_platform_pm (struct pci_platform_pm_ops *ops)
 
void pci_update_current_state (struct pci_dev *dev, pci_power_t state)
 
void pci_power_up (struct pci_dev *dev)
 
int __pci_complete_power_transition (struct pci_dev *dev, pci_power_t state)
 
 EXPORT_SYMBOL_GPL (__pci_complete_power_transition)
 
int pci_set_power_state (struct pci_dev *dev, pci_power_t state)
 
pci_power_t pci_choose_state (struct pci_dev *dev, pm_message_t state)
 
 EXPORT_SYMBOL (pci_choose_state)
 
int pci_save_state (struct pci_dev *dev)
 
void pci_restore_state (struct pci_dev *dev)
 
struct pci_saved_statepci_store_saved_state (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_store_saved_state)
 
int pci_load_saved_state (struct pci_dev *dev, struct pci_saved_state *state)
 
 EXPORT_SYMBOL_GPL (pci_load_saved_state)
 
int pci_load_and_free_saved_state (struct pci_dev *dev, struct pci_saved_state **state)
 
 EXPORT_SYMBOL_GPL (pci_load_and_free_saved_state)
 
int pci_reenable_device (struct pci_dev *dev)
 
int pci_enable_device_io (struct pci_dev *dev)
 
int pci_enable_device_mem (struct pci_dev *dev)
 
int pci_enable_device (struct pci_dev *dev)
 
int pcim_enable_device (struct pci_dev *pdev)
 
void pcim_pin_device (struct pci_dev *pdev)
 
void __weak pcibios_disable_device (struct pci_dev *dev)
 
void pci_disable_enabled_device (struct pci_dev *dev)
 
void pci_disable_device (struct pci_dev *dev)
 
int __weak pcibios_set_pcie_reset_state (struct pci_dev *dev, enum pcie_reset_state state)
 
int pci_set_pcie_reset_state (struct pci_dev *dev, enum pcie_reset_state state)
 
bool pci_check_pme_status (struct pci_dev *dev)
 
void pci_pme_wakeup_bus (struct pci_bus *bus)
 
void pci_wakeup_bus (struct pci_bus *bus)
 
bool pci_pme_capable (struct pci_dev *dev, pci_power_t state)
 
void pci_pme_active (struct pci_dev *dev, bool enable)
 
int __pci_enable_wake (struct pci_dev *dev, pci_power_t state, bool runtime, bool enable)
 
 EXPORT_SYMBOL (__pci_enable_wake)
 
int pci_wake_from_d3 (struct pci_dev *dev, bool enable)
 
pci_power_t pci_target_state (struct pci_dev *dev)
 
int pci_prepare_to_sleep (struct pci_dev *dev)
 
int pci_back_from_sleep (struct pci_dev *dev)
 
int pci_finish_runtime_suspend (struct pci_dev *dev)
 
bool pci_dev_run_wake (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_dev_run_wake)
 
void pci_config_pm_runtime_get (struct pci_dev *pdev)
 
void pci_config_pm_runtime_put (struct pci_dev *pdev)
 
void pci_pm_init (struct pci_dev *dev)
 
void platform_pci_wakeup_init (struct pci_dev *dev)
 
void pci_allocate_cap_save_buffers (struct pci_dev *dev)
 
void pci_free_cap_save_buffers (struct pci_dev *dev)
 
void pci_enable_ari (struct pci_dev *dev)
 
void pci_enable_ido (struct pci_dev *dev, unsigned long type)
 
 EXPORT_SYMBOL (pci_enable_ido)
 
void pci_disable_ido (struct pci_dev *dev, unsigned long type)
 
 EXPORT_SYMBOL (pci_disable_ido)
 
int pci_enable_obff (struct pci_dev *dev, enum pci_obff_signal_type type)
 
 EXPORT_SYMBOL (pci_enable_obff)
 
void pci_disable_obff (struct pci_dev *dev)
 
 EXPORT_SYMBOL (pci_disable_obff)
 
int pci_enable_ltr (struct pci_dev *dev)
 
 EXPORT_SYMBOL (pci_enable_ltr)
 
void pci_disable_ltr (struct pci_dev *dev)
 
 EXPORT_SYMBOL (pci_disable_ltr)
 
int pci_set_ltr (struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns)
 
 EXPORT_SYMBOL (pci_set_ltr)
 
void pci_request_acs (void)
 
void pci_enable_acs (struct pci_dev *dev)
 
bool pci_acs_enabled (struct pci_dev *pdev, u16 acs_flags)
 
bool pci_acs_path_enabled (struct pci_dev *start, struct pci_dev *end, u16 acs_flags)
 
u8 pci_swizzle_interrupt_pin (const struct pci_dev *dev, u8 pin)
 
int pci_get_interrupt_pin (struct pci_dev *dev, struct pci_dev **bridge)
 
u8 pci_common_swizzle (struct pci_dev *dev, u8 *pinp)
 
void pci_release_region (struct pci_dev *pdev, int bar)
 
int pci_request_region (struct pci_dev *pdev, int bar, const char *res_name)
 
int pci_request_region_exclusive (struct pci_dev *pdev, int bar, const char *res_name)
 
void pci_release_selected_regions (struct pci_dev *pdev, int bars)
 
int __pci_request_selected_regions (struct pci_dev *pdev, int bars, const char *res_name, int excl)
 
int pci_request_selected_regions (struct pci_dev *pdev, int bars, const char *res_name)
 
int pci_request_selected_regions_exclusive (struct pci_dev *pdev, int bars, const char *res_name)
 
void pci_release_regions (struct pci_dev *pdev)
 
int pci_request_regions (struct pci_dev *pdev, const char *res_name)
 
int pci_request_regions_exclusive (struct pci_dev *pdev, const char *res_name)
 
char *__weak __init pcibios_setup (char *str)
 
void __weak pcibios_set_master (struct pci_dev *dev)
 
void pci_set_master (struct pci_dev *dev)
 
void pci_clear_master (struct pci_dev *dev)
 
int pci_set_cacheline_size (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_set_cacheline_size)
 
int pci_set_mwi (struct pci_dev *dev)
 
int pci_try_set_mwi (struct pci_dev *dev)
 
void pci_clear_mwi (struct pci_dev *dev)
 
void pci_intx (struct pci_dev *pdev, int enable)
 
bool pci_intx_mask_supported (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_intx_mask_supported)
 
bool pci_check_and_mask_intx (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_check_and_mask_intx)
 
bool pci_check_and_unmask_intx (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_check_and_unmask_intx)
 
void pci_msi_off (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_msi_off)
 
int pci_set_dma_max_seg_size (struct pci_dev *dev, unsigned int size)
 
 EXPORT_SYMBOL (pci_set_dma_max_seg_size)
 
int pci_set_dma_seg_boundary (struct pci_dev *dev, unsigned long mask)
 
 EXPORT_SYMBOL (pci_set_dma_seg_boundary)
 
int __pci_reset_function (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (__pci_reset_function)
 
int __pci_reset_function_locked (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (__pci_reset_function_locked)
 
int pci_probe_reset_function (struct pci_dev *dev)
 
int pci_reset_function (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_reset_function)
 
int pcix_get_max_mmrbc (struct pci_dev *dev)
 
 EXPORT_SYMBOL (pcix_get_max_mmrbc)
 
int pcix_get_mmrbc (struct pci_dev *dev)
 
 EXPORT_SYMBOL (pcix_get_mmrbc)
 
int pcix_set_mmrbc (struct pci_dev *dev, int mmrbc)
 
 EXPORT_SYMBOL (pcix_set_mmrbc)
 
int pcie_get_readrq (struct pci_dev *dev)
 
 EXPORT_SYMBOL (pcie_get_readrq)
 
int pcie_set_readrq (struct pci_dev *dev, int rq)
 
 EXPORT_SYMBOL (pcie_set_readrq)
 
int pcie_get_mps (struct pci_dev *dev)
 
int pcie_set_mps (struct pci_dev *dev, int mps)
 
int pci_select_bars (struct pci_dev *dev, unsigned long flags)
 
int pci_resource_bar (struct pci_dev *dev, int resno, enum pci_bar_type *type)
 
void __init pci_register_set_vga_state (arch_set_vga_state_t func)
 
int pci_set_vga_state (struct pci_dev *dev, bool decode, unsigned int command_bits, u32 flags)
 
resource_size_t pci_specified_resource_alignment (struct pci_dev *dev)
 
int pci_is_reassigndev (struct pci_dev *dev)
 
void pci_reassigndev_resource_alignment (struct pci_dev *dev)
 
ssize_t pci_set_resource_alignment_param (const char *buf, size_t count)
 
ssize_t pci_get_resource_alignment_param (char *buf, size_t size)
 
 BUS_ATTR (resource_alignment, 0644, pci_resource_alignment_show, pci_resource_alignment_store)
 
 late_initcall (pci_resource_alignment_sysfs_init)
 
int __weak pci_ext_cfg_avail (struct pci_dev *dev)
 
void __weak pci_fixup_cardbus (struct pci_bus *bus)
 
 EXPORT_SYMBOL (pci_fixup_cardbus)
 
 early_param ("pci", pci_setup)
 
 EXPORT_SYMBOL (pci_reenable_device)
 
 EXPORT_SYMBOL (pci_enable_device_io)
 
 EXPORT_SYMBOL (pci_enable_device_mem)
 
 EXPORT_SYMBOL (pci_enable_device)
 
 EXPORT_SYMBOL (pcim_enable_device)
 
 EXPORT_SYMBOL (pcim_pin_device)
 
 EXPORT_SYMBOL (pci_disable_device)
 
 EXPORT_SYMBOL (pci_find_capability)
 
 EXPORT_SYMBOL (pci_bus_find_capability)
 
 EXPORT_SYMBOL (pci_release_regions)
 
 EXPORT_SYMBOL (pci_request_regions)
 
 EXPORT_SYMBOL (pci_request_regions_exclusive)
 
 EXPORT_SYMBOL (pci_release_region)
 
 EXPORT_SYMBOL (pci_request_region)
 
 EXPORT_SYMBOL (pci_request_region_exclusive)
 
 EXPORT_SYMBOL (pci_release_selected_regions)
 
 EXPORT_SYMBOL (pci_request_selected_regions)
 
 EXPORT_SYMBOL (pci_request_selected_regions_exclusive)
 
 EXPORT_SYMBOL (pci_set_master)
 
 EXPORT_SYMBOL (pci_clear_master)
 
 EXPORT_SYMBOL (pci_set_mwi)
 
 EXPORT_SYMBOL (pci_try_set_mwi)
 
 EXPORT_SYMBOL (pci_clear_mwi)
 
 EXPORT_SYMBOL_GPL (pci_intx)
 
 EXPORT_SYMBOL (pci_assign_resource)
 
 EXPORT_SYMBOL (pci_find_parent_resource)
 
 EXPORT_SYMBOL (pci_select_bars)
 
 EXPORT_SYMBOL (pci_set_power_state)
 
 EXPORT_SYMBOL (pci_save_state)
 
 EXPORT_SYMBOL (pci_restore_state)
 
 EXPORT_SYMBOL (pci_pme_capable)
 
 EXPORT_SYMBOL (pci_pme_active)
 
 EXPORT_SYMBOL (pci_wake_from_d3)
 
 EXPORT_SYMBOL (pci_target_state)
 
 EXPORT_SYMBOL (pci_prepare_to_sleep)
 
 EXPORT_SYMBOL (pci_back_from_sleep)
 
 EXPORT_SYMBOL_GPL (pci_set_pcie_reset_state)
 

Variables

const charpci_power_names []
 
int isa_dma_bridge_buggy
 
int pci_pci_problems
 
unsigned int pci_pm_d3_delay
 
unsigned long pci_cardbus_io_size = DEFAULT_CARDBUS_IO_SIZE
 
unsigned long pci_cardbus_mem_size = DEFAULT_CARDBUS_MEM_SIZE
 
unsigned long pci_hotplug_io_size = DEFAULT_HOTPLUG_IO_SIZE
 
unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE
 
enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF
 
u8 pci_dfl_cache_line_size __devinitdata = L1_CACHE_BYTES >> 2
 
u8 pci_cache_line_size
 
unsigned int pcibios_max_latency = 255
 

Macro Definition Documentation

#define DEFAULT_CARDBUS_IO_SIZE   (256)

Definition at line 69 of file pci.c.

#define DEFAULT_CARDBUS_MEM_SIZE   (64*1024*1024)

Definition at line 70 of file pci.c.

#define DEFAULT_HOTPLUG_IO_SIZE   (256)

Definition at line 75 of file pci.c.

#define DEFAULT_HOTPLUG_MEM_SIZE   (2*1024*1024)

Definition at line 76 of file pci.c.

#define PCI_EXP_SAVE_REGS   7

Definition at line 843 of file pci.c.

#define PCI_FIND_CAP_TTL   48

Definition at line 139 of file pci.c.

#define PME_TIMEOUT   1000 /* How long between PME checks */

Definition at line 53 of file pci.c.

#define RESOURCE_ALIGNMENT_PARAM_SIZE   COMMAND_LINE_SIZE

Definition at line 3683 of file pci.c.

Function Documentation

int __pci_complete_power_transition ( struct pci_dev dev,
pci_power_t  state 
)

__pci_complete_power_transition - Complete power transition of a PCI device : PCI device to handle. : State to put the device into.

This function should not be called directly by device drivers.

Definition at line 727 of file pci.c.

int __pci_enable_wake ( struct pci_dev dev,
pci_power_t  state,
bool  runtime,
bool  enable 
)

__pci_enable_wake - enable PCI device as wakeup event source : PCI device affected : PCI state from which device will issue wakeup events : True if the events are to be generated at run time : True to enable event generation; false to disable

This enables the device as a wakeup event source, or disables it. When such events involves platform-specific hooks, those hooks are called automatically by this routine.

Devices with legacy power management (no standard PCI PM capabilities) always require such platform hooks.

RETURN VALUE: 0 is returned on success -EINVAL is returned if device is not supposed to wake up the system Error code depending on the platform is returned if both the platform and the native mechanism fail to enable the generation of wake-up events

Definition at line 1642 of file pci.c.

int __pci_request_selected_regions ( struct pci_dev pdev,
int  bars,
const char res_name,
int  excl 
)

Definition at line 2614 of file pci.c.

int __pci_reset_function ( struct pci_dev dev)

__pci_reset_function - reset a PCI device function : PCI device to reset

Some devices allow an individual function to be reset without affecting other functions in the same device. The PCI device must be responsive to PCI config space in order to use this function.

The device function is presumed to be unused when this function is called. Resetting the device will make the contents of PCI configuration space random, so any caller of this must be prepared to reinitialise the device including MSI, bus mastering, BARs, decoding IO and memory spaces, etc.

Returns 0 if the device function was successfully reset or negative if the device doesn't support resetting a single function.

Definition at line 3294 of file pci.c.

int __pci_reset_function_locked ( struct pci_dev dev)

__pci_reset_function_locked - reset a PCI device function while holding the mutex lock. : PCI device to reset

Some devices allow an individual function to be reset without affecting other functions in the same device. The PCI device must be responsive to PCI config space in order to use this function.

The device function is presumed to be unused and the caller is holding the device mutex lock when this function is called. Resetting the device will make the contents of PCI configuration space random, so any caller of this must be prepared to reinitialise the device including MSI, bus mastering, BARs, decoding IO and memory spaces, etc.

Returns 0 if the device function was successfully reset or negative if the device doesn't support resetting a single function.

Definition at line 3319 of file pci.c.

BUS_ATTR ( resource_alignment  ,
0644  ,
pci_resource_alignment_show  ,
pci_resource_alignment_store   
)
early_param ( "pci"  ,
pci_setup   
)
EXPORT_SYMBOL ( isa_dma_bridge_buggy  )
EXPORT_SYMBOL ( pci_pci_problems  )
EXPORT_SYMBOL ( pci_choose_state  )
EXPORT_SYMBOL ( __pci_enable_wake  )
EXPORT_SYMBOL ( pci_enable_ido  )
EXPORT_SYMBOL ( pci_disable_ido  )
EXPORT_SYMBOL ( pci_enable_obff  )
EXPORT_SYMBOL ( pci_disable_obff  )
EXPORT_SYMBOL ( pci_enable_ltr  )
EXPORT_SYMBOL ( pci_disable_ltr  )
EXPORT_SYMBOL ( pci_set_ltr  )
EXPORT_SYMBOL ( pci_set_dma_max_seg_size  )
EXPORT_SYMBOL ( pci_set_dma_seg_boundary  )
EXPORT_SYMBOL ( pcix_get_max_mmrbc  )
EXPORT_SYMBOL ( pcix_get_mmrbc  )
EXPORT_SYMBOL ( pcix_set_mmrbc  )
EXPORT_SYMBOL ( pcie_get_readrq  )
EXPORT_SYMBOL ( pcie_set_readrq  )
EXPORT_SYMBOL ( pci_fixup_cardbus  )
EXPORT_SYMBOL ( pci_reenable_device  )
EXPORT_SYMBOL ( pci_enable_device_io  )
EXPORT_SYMBOL ( pci_enable_device_mem  )
EXPORT_SYMBOL ( pci_enable_device  )
EXPORT_SYMBOL ( pcim_enable_device  )
EXPORT_SYMBOL ( pcim_pin_device  )
EXPORT_SYMBOL ( pci_disable_device  )
EXPORT_SYMBOL ( pci_find_capability  )
EXPORT_SYMBOL ( pci_bus_find_capability  )
EXPORT_SYMBOL ( pci_release_regions  )
EXPORT_SYMBOL ( pci_request_regions  )
EXPORT_SYMBOL ( pci_request_regions_exclusive  )
EXPORT_SYMBOL ( pci_release_region  )
EXPORT_SYMBOL ( pci_request_region  )
EXPORT_SYMBOL ( pci_request_region_exclusive  )
EXPORT_SYMBOL ( pci_release_selected_regions  )
EXPORT_SYMBOL ( pci_request_selected_regions  )
EXPORT_SYMBOL ( pci_set_master  )
EXPORT_SYMBOL ( pci_clear_master  )
EXPORT_SYMBOL ( pci_set_mwi  )
EXPORT_SYMBOL ( pci_try_set_mwi  )
EXPORT_SYMBOL ( pci_clear_mwi  )
EXPORT_SYMBOL ( pci_assign_resource  )
EXPORT_SYMBOL ( pci_find_parent_resource  )
EXPORT_SYMBOL ( pci_select_bars  )
EXPORT_SYMBOL ( pci_set_power_state  )
EXPORT_SYMBOL ( pci_save_state  )
EXPORT_SYMBOL ( pci_restore_state  )
EXPORT_SYMBOL ( pci_pme_capable  )
EXPORT_SYMBOL ( pci_pme_active  )
EXPORT_SYMBOL ( pci_wake_from_d3  )
EXPORT_SYMBOL ( pci_target_state  )
EXPORT_SYMBOL ( pci_prepare_to_sleep  )
EXPORT_SYMBOL ( pci_back_from_sleep  )
EXPORT_SYMBOL_GPL ( pci_power_names  )
EXPORT_SYMBOL_GPL ( pci_bus_max_busnr  )
EXPORT_SYMBOL_GPL ( pci_find_next_capability  )
EXPORT_SYMBOL_GPL ( pci_find_next_ext_capability  )
EXPORT_SYMBOL_GPL ( pci_find_ext_capability  )
EXPORT_SYMBOL_GPL ( pci_find_next_ht_capability  )
EXPORT_SYMBOL_GPL ( pci_find_ht_capability  )
EXPORT_SYMBOL_GPL ( __pci_complete_power_transition  )
EXPORT_SYMBOL_GPL ( pci_store_saved_state  )
EXPORT_SYMBOL_GPL ( pci_load_saved_state  )
EXPORT_SYMBOL_GPL ( pci_load_and_free_saved_state  )
EXPORT_SYMBOL_GPL ( pci_dev_run_wake  )
EXPORT_SYMBOL_GPL ( pci_set_cacheline_size  )
EXPORT_SYMBOL_GPL ( pci_intx_mask_supported  )
EXPORT_SYMBOL_GPL ( pci_check_and_mask_intx  )
EXPORT_SYMBOL_GPL ( pci_check_and_unmask_intx  )
EXPORT_SYMBOL_GPL ( pci_msi_off  )
EXPORT_SYMBOL_GPL ( __pci_reset_function  )
EXPORT_SYMBOL_GPL ( __pci_reset_function_locked  )
EXPORT_SYMBOL_GPL ( pci_reset_function  )
EXPORT_SYMBOL_GPL ( pci_intx  )
EXPORT_SYMBOL_GPL ( pci_set_pcie_reset_state  )
late_initcall ( pci_resource_alignment_sysfs_init  )
bool pci_acs_enabled ( struct pci_dev pdev,
u16  acs_flags 
)

pci_acs_enabled - test ACS against required flags for a given device : device to test : required PCI ACS flags

Return true if the device supports the provided flags. Automatically filters out flags that are not implemented on multifunction devices.

Definition at line 2357 of file pci.c.

bool pci_acs_path_enabled ( struct pci_dev start,
struct pci_dev end,
u16  acs_flags 
)

pci_acs_path_enable - test ACS flags from start to end in a hierarchy : starting downstream device : ending upstream device or NULL to search to the root bus : required flags

Walk up a device tree from start to end testing PCI ACS support. If any step along the way does not support the required flags, return false.

Definition at line 2398 of file pci.c.

void pci_allocate_cap_save_buffers ( struct pci_dev dev)

pci_allocate_cap_save_buffers - allocate buffers for saving capabilities : the PCI device

Definition at line 2019 of file pci.c.

int pci_back_from_sleep ( struct pci_dev dev)

pci_back_from_sleep - turn PCI device on during system-wide transition into working state : Device to handle.

Disable device's system wake-up capability and put it into D0.

Definition at line 1791 of file pci.c.

int pci_bus_find_capability ( struct pci_bus bus,
unsigned int  devfn,
int  cap 
)

pci_bus_find_capability - query for devices' capabilities : the PCI bus to query : PCI device to query : capability code

Like pci_find_capability() but works for pci devices that do not have a pci_dev structure set up yet.

Returns the address of the requested capability structure within the device's PCI configuration space or 0 in case the device does not support it.

Definition at line 242 of file pci.c.

unsigned char pci_bus_max_busnr ( struct pci_bus bus)

pci_bus_max_busnr - returns maximum PCI bus number of given bus' children : pointer to PCI bus structure to search

Given a PCI bus, returns the highest PCI bus number present in the set including the given PCI bus and its list of child PCI buses.

Definition at line 108 of file pci.c.

bool pci_check_and_mask_intx ( struct pci_dev dev)

pci_check_and_mask_intx - mask INTx on pending interrupt : the PCI device to operate on

Check if the device dev has its INTx line asserted, mask it and return true in that case. False is returned if not interrupt was pending.

Definition at line 3028 of file pci.c.

bool pci_check_and_unmask_intx ( struct pci_dev dev)

pci_check_and_mask_intx - unmask INTx of no interrupt is pending : the PCI device to operate on

Check if the device dev has its INTx line asserted, unmask it if not and return true. False is returned and the mask remains active if there was still an interrupt pending.

Definition at line 3042 of file pci.c.

bool pci_check_pme_status ( struct pci_dev dev)

pci_check_pme_status - Check if given device has generated PME. : Device to check.

Check the PME status of the device and if set, clear it and clear PME enable (if set). Return 'true' if PME status and PME enable were both set or 'false' otherwise.

Definition at line 1435 of file pci.c.

pci_power_t pci_choose_state ( struct pci_dev dev,
pm_message_t  state 
)

pci_choose_state - Choose the power state of a PCI device : PCI device to be suspended : target sleep state for the whole system. This is the value that is passed to suspend() function.

Returns PCI power state suitable for given device and given system message.

Definition at line 813 of file pci.c.

void pci_clear_master ( struct pci_dev dev)

pci_clear_master - disables bus-mastering for device dev : the PCI device to disable

Definition at line 2780 of file pci.c.

void pci_clear_mwi ( struct pci_dev dev)

pci_clear_mwi - disables Memory-Write-Invalidate for device dev : the PCI device to disable

Disables PCI Memory-Write-Invalidate transaction on the device

Definition at line 2890 of file pci.c.

u8 pci_common_swizzle ( struct pci_dev dev,
u8 pinp 
)

pci_common_swizzle - swizzle INTx all the way to root bridge : the PCI device : pointer to the INTx pin value (1=INTA, 2=INTB, 3=INTD, 4=INTD)

Perform INTx swizzling for a device. This traverses through all PCI-to-PCI bridges all the way up to a PCI root bus.

Definition at line 2466 of file pci.c.

void pci_config_pm_runtime_get ( struct pci_dev pdev)

Definition at line 1861 of file pci.c.

void pci_config_pm_runtime_put ( struct pci_dev pdev)

Definition at line 1883 of file pci.c.

bool pci_dev_run_wake ( struct pci_dev dev)

pci_dev_run_wake - Check if device can generate run-time wake-up events. : Device to check.

Return true if the device itself is cabable of generating wake-up events (through the platform or using the native PCIe PME) or if the device supports PME and one of its upstream bridges can generate wake-up events.

Definition at line 1834 of file pci.c.

void pci_disable_device ( struct pci_dev dev)

pci_disable_device - Disable PCI device after use : PCI device to be disabled

Signal to the system that the PCI device is not in use by the system anymore. This only involves disabling PCI bus-mastering, if active.

Note we don't actually disable the device until all callers of pci_enable_device() have called pci_disable_device().

Definition at line 1383 of file pci.c.

void pci_disable_enabled_device ( struct pci_dev dev)

pci_disable_enabled_device - Disable device without updating enable_cnt : PCI device to disable

NOTE: This function is a backend of PCI power management routines and is not supposed to be called drivers.

Definition at line 1366 of file pci.c.

void pci_disable_ido ( struct pci_dev dev,
unsigned long  type 
)

pci_disable_ido - disable ID-based ordering on a device : the PCI device : which types of IDO to disable

Definition at line 2098 of file pci.c.

void pci_disable_ltr ( struct pci_dev dev)

pci_disable_ltr - disable latency tolerance reporting : PCI device

Definition at line 2235 of file pci.c.

void pci_disable_obff ( struct pci_dev dev)

pci_disable_obff - disable optimized buffer flush/fill : PCI device

Disable OBFF on .

Definition at line 2177 of file pci.c.

void pci_enable_acs ( struct pci_dev dev)

pci_enable_acs - enable ACS if hardware support it : the PCI device

Definition at line 2318 of file pci.c.

void pci_enable_ari ( struct pci_dev dev)

pci_enable_ari - enable ARI forwarding if hardware support it : the PCI device

Definition at line 2048 of file pci.c.

int pci_enable_device ( struct pci_dev dev)

pci_enable_device - Initialize device before it's used by a driver. : PCI device to be initialized

Initialize device before it's used by a driver. Ask low-level code to enable I/O and memory. Wake up the device if it was suspended. Beware, this function can fail.

Note we don't actually enable the device many times if we call this function repeatedly (we just increment the count).

Definition at line 1231 of file pci.c.

int pci_enable_device_io ( struct pci_dev dev)

pci_enable_device_io - Initialize a device for use with IO space : PCI device to be initialized

Initialize device before it's used by a driver. Ask low-level code to enable I/O resources. Wake up the device if it was suspended. Beware, this function can fail.

Definition at line 1202 of file pci.c.

int pci_enable_device_mem ( struct pci_dev dev)

pci_enable_device_mem - Initialize a device for use with Memory space : PCI device to be initialized

Initialize device before it's used by a driver. Ask low-level code to enable Memory resources. Wake up the device if it was suspended. Beware, this function can fail.

Definition at line 1215 of file pci.c.

void pci_enable_ido ( struct pci_dev dev,
unsigned long  type 
)

pci_enable_ido - enable ID-based Ordering on a device : the PCI device : which types of IDO to enable

Enable ID-based ordering on . can contain the bits PCI_EXP_IDO_REQUEST and/or PCI_EXP_IDO_COMPLETION to indicate which types of transactions are allowed to be re-ordered.

Definition at line 2080 of file pci.c.

int pci_enable_ltr ( struct pci_dev dev)

pci_enable_ltr - enable latency tolerance reporting : PCI device

Enable LTR on if possible, which means enabling it first on upstream ports.

RETURNS: Zero on success, errno on failure.

Definition at line 2209 of file pci.c.

int pci_enable_obff ( struct pci_dev dev,
enum pci_obff_signal_type  type 
)

pci_enable_obff - enable optimized buffer flush/fill : PCI device : type of signaling to use

Try to enable OBFF signaling on . It will try using WAKE# signaling if possible, falling back to message signaling only if WAKE# isn't supported. should indicate whether the PCIe link be brought out of L0s or L1 to send the message. It should be either PCI_EXP_OBFF_SIGNAL_ALWAYS or PCI_OBFF_SIGNAL_L0.

If your device can benefit from receiving all messages, even at the power cost of bringing the link back up from a low power state, use PCI_EXP_OBFF_SIGNAL_ALWAYS. Otherwise, use PCI_OBFF_SIGNAL_L0 (the preferred type).

RETURNS: Zero on success, appropriate error number on failure.

Definition at line 2130 of file pci.c.

int __weak pci_ext_cfg_avail ( struct pci_dev dev)

pci_ext_cfg_enabled - can we access extended PCI config space? : The PCI device of the root bridge.

Returns 1 if we can access PCI extended config space (offsets greater than 0xff). This is the default implementation. Architecture implementations can override this.

Definition at line 3875 of file pci.c.

int pci_find_capability ( struct pci_dev dev,
int  cap 
)

pci_find_capability - query for devices' capabilities : PCI device to query : capability code

Tell if a device supports a given PCI capability. Returns the address of the requested capability structure within the device's PCI configuration space or 0 in case the device does not support it. Possible values for :

PCI_CAP_ID_PM Power Management PCI_CAP_ID_AGP Accelerated Graphics Port PCI_CAP_ID_VPD Vital Product Data PCI_CAP_ID_SLOTID Slot Identification PCI_CAP_ID_MSI Message Signalled Interrupts PCI_CAP_ID_CHSWP CompactPCI HotSwap PCI_CAP_ID_PCIX PCI-X PCI_CAP_ID_EXP PCI Express

Definition at line 218 of file pci.c.

int pci_find_ext_capability ( struct pci_dev dev,
int  cap 
)

pci_find_ext_capability - Find an extended capability : PCI device to query : capability code

Returns the address of the requested extended capability structure within the device's PCI configuration space or 0 if the device does not support it. Possible values for :

PCI_EXT_CAP_ID_ERR Advanced Error Reporting PCI_EXT_CAP_ID_VC Virtual Channel PCI_EXT_CAP_ID_DSN Device Serial Number PCI_EXT_CAP_ID_PWR Power Budgeting

Definition at line 322 of file pci.c.

int pci_find_ht_capability ( struct pci_dev dev,
int  ht_cap 
)

pci_find_ht_capability - query a device's Hypertransport capabilities : PCI device to query : Hypertransport capability code

Tell if a device supports a given Hypertransport capability. Returns an address within the device's PCI configuration space or 0 in case the device does not support the request capability. The address points to the PCI capability, of type PCI_CAP_ID_HT, which has a Hypertransport capability matching .

Definition at line 385 of file pci.c.

int pci_find_next_capability ( struct pci_dev dev,
u8  pos,
int  cap 
)

Definition at line 170 of file pci.c.

int pci_find_next_ext_capability ( struct pci_dev dev,
int  start,
int  cap 
)

pci_find_next_ext_capability - Find an extended capability : PCI device to query : address at which to start looking (0 to start at beginning of list) : capability code

Returns the address of the next matching extended capability structure within the device's PCI configuration space or 0 if the device does not support it. Some capabilities can occur several times, e.g., the vendor-specific capability, and this provides a way to find them all.

Definition at line 267 of file pci.c.

int pci_find_next_ht_capability ( struct pci_dev dev,
int  pos,
int  ht_cap 
)

pci_find_next_ht_capability - query a device's Hypertransport capabilities : PCI device to query : Position from which to continue searching : Hypertransport capability code

To be used in conjunction with pci_find_ht_capability() to search for all capabilities matching . should always be a value returned from pci_find_ht_capability().

NB. To be 100% safe against broken PCI devices, the caller should take steps to avoid an infinite loop.

Definition at line 368 of file pci.c.

struct resource* pci_find_parent_resource ( const struct pci_dev dev,
struct resource res 
)
read

pci_find_parent_resource - return resource region of parent bus of given region : PCI device structure contains resources to be searched : child resource record for which parent is sought

For given resource region of given device, return the resource region of parent bus the given region is contained in or where it should be allocated from.

Definition at line 407 of file pci.c.

int pci_finish_runtime_suspend ( struct pci_dev dev)

pci_finish_runtime_suspend - Carry out PCI-specific part of runtime suspend. : PCI device being suspended.

Prepare to generate wake-up events at run time and put it into a low power state.

Definition at line 1804 of file pci.c.

void __weak pci_fixup_cardbus ( struct pci_bus bus)

Definition at line 3880 of file pci.c.

void pci_free_cap_save_buffers ( struct pci_dev dev)

Definition at line 2035 of file pci.c.

int pci_get_interrupt_pin ( struct pci_dev dev,
struct pci_dev **  bridge 
)

Definition at line 2442 of file pci.c.

ssize_t pci_get_resource_alignment_param ( char buf,
size_t  size 
)

Definition at line 3829 of file pci.c.

void pci_intx ( struct pci_dev pdev,
int  enable 
)

pci_intx - enables/disables PCI INTx for device dev : the PCI device to operate on : boolean: whether to enable or disable PCI INTx

Enables/disables PCI INTx for device dev

Definition at line 2910 of file pci.c.

bool pci_intx_mask_supported ( struct pci_dev dev)

pci_intx_mask_supported - probe for INTx masking support : the PCI device to operate on

Check if the device dev support INTx masking via the config space command word.

Definition at line 2942 of file pci.c.

int pci_is_reassigndev ( struct pci_dev dev)

pci_is_reassigndev - check if specified PCI is target device to reassign : the PCI device to check

RETURNS: non-zero for PCI device is a target device to reassign, or zero is not.

Definition at line 3751 of file pci.c.

int pci_load_and_free_saved_state ( struct pci_dev dev,
struct pci_saved_state **  state 
)

pci_load_and_free_saved_state - Reload the save state pointed to by state, and free the memory allocated for it. : PCI device that we're dealing with : Pointer to saved state returned from pci_store_saved_state()

Definition at line 1120 of file pci.c.

int pci_load_saved_state ( struct pci_dev dev,
struct pci_saved_state state 
)

pci_load_saved_state - Reload the provided save state into struct pci_dev. : PCI device that we're dealing with : Saved state returned from pci_store_saved_state()

Definition at line 1084 of file pci.c.

void pci_msi_off ( struct pci_dev dev)

pci_msi_off - disables any msi or msix capabilities : the PCI device to operate on

If you want to use msi see pci_enable_msi and friends. This is a lower level primitive that allows us to disable msi operation at the device level.

Definition at line 3056 of file pci.c.

void pci_pm_init ( struct pci_dev dev)

pci_pm_init - Initialize PM functions of given PCI device : PCI device to handle.

Definition at line 1897 of file pci.c.

void pci_pme_active ( struct pci_dev dev,
bool  enable 
)

pci_pme_active - enable or disable PCI device's PME# function : PCI device to handle. : 'true' to enable PME# generation; 'false' to disable it.

The caller must verify that the device is capable of generating PME# before calling this function with equal to 'true'.

Definition at line 1566 of file pci.c.

bool pci_pme_capable ( struct pci_dev dev,
pci_power_t  state 
)

pci_pme_capable - check the capability of PCI device to generate PME# : PCI device to handle. : PCI state from which device will issue PME#.

Definition at line 1519 of file pci.c.

void pci_pme_wakeup_bus ( struct pci_bus bus)

pci_pme_wakeup_bus - Walk given bus and wake up devices on it, if necessary. : Top bus of the subtree to walk.

Definition at line 1486 of file pci.c.

void pci_power_up ( struct pci_dev dev)

pci_power_up - Put the given device into D0 forcibly : PCI device to power up

Definition at line 632 of file pci.c.

int pci_prepare_to_sleep ( struct pci_dev dev)

pci_prepare_to_sleep - prepare PCI device for system-wide transition into a sleep state : Device to handle.

Choose the power state appropriate for the device depending on whether it can wake up the system and/or is power manageable by the platform (PCI_D3hot is the default) and put the device into that state.

Definition at line 1763 of file pci.c.

int pci_probe_reset_function ( struct pci_dev dev)

pci_probe_reset_function - check whether the device can be safely reset : PCI device to reset

Some devices allow an individual function to be reset without affecting other functions in the same device. The PCI device must be responsive to PCI config space in order to use this function.

Returns 0 if the device function can be reset or negative if the device doesn't support resetting a single function.

Definition at line 3336 of file pci.c.

void pci_reassigndev_resource_alignment ( struct pci_dev dev)

Definition at line 3763 of file pci.c.

int pci_reenable_device ( struct pci_dev dev)

pci_reenable_device - Resume abandoned device : PCI device to be resumed

Note this function is a backend of pci_default_resume and is not supposed to be called by normal code, write proper resume handler and use it instead.

Definition at line 1152 of file pci.c.

void __init pci_register_set_vga_state ( arch_set_vga_state_t  func)

Definition at line 3616 of file pci.c.

void pci_release_region ( struct pci_dev pdev,
int  bar 
)

pci_release_region - Release a PCI bar : PCI device whose resources were previously reserved by pci_request_region : BAR to release

Releases the PCI I/O and memory resources previously reserved by a successful call to pci_request_region. Call this function only after all use of the PCI regions has ceased.

Definition at line 2487 of file pci.c.

void pci_release_regions ( struct pci_dev pdev)

pci_release_regions - Release reserved PCI I/O and memory resources : PCI device whose resources were previously reserved by pci_request_regions

Releases all PCI I/O and memory resources previously reserved by a successful call to pci_request_regions. Call this function only after all use of the PCI regions has ceased.

Definition at line 2662 of file pci.c.

void pci_release_selected_regions ( struct pci_dev pdev,
int  bars 
)

pci_release_selected_regions - Release selected PCI I/O and memory resources : PCI device whose resources were previously reserved : Bitmask of BARs to be released

Release selected PCI I/O and memory resources previously reserved. Call this function only after all use of the PCI regions has ceased.

Definition at line 2605 of file pci.c.

void pci_request_acs ( void  )

pci_request_acs - ask for ACS to be enabled if supported

Definition at line 2309 of file pci.c.

int pci_request_region ( struct pci_dev pdev,
int  bar,
const char res_name 
)

pci_request_region - Reserve PCI I/O and memory resource : PCI device whose resources are to be reserved : BAR to be reserved : Name to be associated with resource

Mark the PCI region associated with PCI device BAR as being reserved by owner . Do not access any address inside the PCI regions unless this call returns successfully.

Returns 0 on success, or EBUSY on error. A warning message is also printed on failure.

Definition at line 2570 of file pci.c.

int pci_request_region_exclusive ( struct pci_dev pdev,
int  bar,
const char res_name 
)

pci_request_region_exclusive - Reserved PCI I/O and memory resource : PCI device whose resources are to be reserved : BAR to be reserved : Name to be associated with resource.

Mark the PCI region associated with PCI device BR as being reserved by owner . Do not access any address inside the PCI regions unless this call returns successfully.

Returns 0 on success, or EBUSY on error. A warning message is also printed on failure.

The key difference that _exclusive makes it that userspace is explicitly not allowed to map the resource via /dev/mem or sysfs.

Definition at line 2593 of file pci.c.

int pci_request_regions ( struct pci_dev pdev,
const char res_name 
)

pci_request_regions - Reserved PCI I/O and memory resources : PCI device whose resources are to be reserved : Name to be associated with resource.

Mark all PCI regions associated with PCI device as being reserved by owner . Do not access any address inside the PCI regions unless this call returns successfully.

Returns 0 on success, or EBUSY on error. A warning message is also printed on failure.

Definition at line 2680 of file pci.c.

int pci_request_regions_exclusive ( struct pci_dev pdev,
const char res_name 
)

pci_request_regions_exclusive - Reserved PCI I/O and memory resources : PCI device whose resources are to be reserved : Name to be associated with resource.

Mark all PCI regions associated with PCI device as being reserved by owner . Do not access any address inside the PCI regions unless this call returns successfully.

pci_request_regions_exclusive() will mark the region so that /dev/mem and the sysfs MMIO access will not be allowed.

Returns 0 on success, or EBUSY on error. A warning message is also printed on failure.

Definition at line 2701 of file pci.c.

int pci_request_selected_regions ( struct pci_dev pdev,
int  bars,
const char res_name 
)

pci_request_selected_regions - Reserve selected PCI I/O and memory resources : PCI device whose resources are to be reserved : Bitmask of BARs to be requested : Name to be associated with resource

Definition at line 2640 of file pci.c.

int pci_request_selected_regions_exclusive ( struct pci_dev pdev,
int  bars,
const char res_name 
)

Definition at line 2646 of file pci.c.

int pci_reset_function ( struct pci_dev dev)

pci_reset_function - quiesce and reset a PCI device function : PCI device to reset

Some devices allow an individual function to be reset without affecting other functions in the same device. The PCI device must be responsive to PCI config space in order to use this function.

This function does not just reset the PCI portion of a device, but clears all the state associated with the device. This function differs from __pci_reset_function in that it saves and restores device state over the reset.

Returns 0 if the device function was successfully reset or negative if the device doesn't support resetting a single function.

Definition at line 3357 of file pci.c.

int pci_resource_bar ( struct pci_dev dev,
int  resno,
enum pci_bar_type type 
)

pci_resource_bar - get position of the BAR associated with a resource : the PCI device : the resource number : the BAR type to be filled in

Returns BAR position in config space, or 0 if the BAR is invalid.

Definition at line 3592 of file pci.c.

void pci_restore_state ( struct pci_dev dev)

pci_restore_state - Restore the saved state of a PCI device : - PCI device that we're dealing with

Definition at line 1014 of file pci.c.

int pci_save_state ( struct pci_dev dev)

pci_save_state - save the PCI configuration space of a device before suspending : - PCI device that we're dealing with

Definition at line 949 of file pci.c.

int pci_select_bars ( struct pci_dev dev,
unsigned long  flags 
)

pci_select_bars - Make BAR mask from the type of resource : the PCI device for which BAR mask is made : resource type mask to be selected

This helper routine makes bar mask from the type of resource.

Definition at line 3575 of file pci.c.

int pci_set_cacheline_size ( struct pci_dev dev)

pci_set_cacheline_size - ensure the CACHE_LINE_SIZE register is programmed : the PCI device for which MWI is to be enabled

Helper function for pci_set_mwi. Originally copied from drivers/net/acenic.c. Copyright 1998-2001 by Jes Sorensen, jes@t.nosp@m.rain.nosp@m.ed-mo.nosp@m.nkey.nosp@m..org.

RETURNS: An appropriate -ERRNO error value on error, or zero for success.

Definition at line 2795 of file pci.c.

int pci_set_dma_max_seg_size ( struct pci_dev dev,
unsigned int  size 
)

Definition at line 3076 of file pci.c.

int pci_set_dma_seg_boundary ( struct pci_dev dev,
unsigned long  mask 
)

Definition at line 3082 of file pci.c.

int pci_set_ltr ( struct pci_dev dev,
int  snoop_lat_ns,
int  nosnoop_lat_ns 
)

pci_set_ltr - set LTR latency values : PCI device : snoop latency in nanoseconds : nosnoop latency in nanoseconds

Figure out the scale and set the LTR values accordingly.

Definition at line 2267 of file pci.c.

void pci_set_master ( struct pci_dev dev)

pci_set_master - enables bus-mastering for device dev : the PCI device to enable

Enables bus-mastering on the device and calls pcibios_set_master() to do the needed arch specific settings.

Definition at line 2770 of file pci.c.

int pci_set_mwi ( struct pci_dev dev)

pci_set_mwi - enables memory-write-invalidate PCI transaction : the PCI device for which MWI is enabled

Enables the Memory-Write-Invalidate transaction in PCI_COMMAND.

RETURNS: An appropriate -ERRNO error value on error, or zero for success.

Definition at line 2849 of file pci.c.

int pci_set_pcie_reset_state ( struct pci_dev dev,
enum pcie_reset_state  state 
)

pci_set_pcie_reset_state - set reset state for device dev : the PCIe device reset : Reset state to enter into

Sets the PCI reset state for the device.

Definition at line 1422 of file pci.c.

int pci_set_platform_pm ( struct pci_platform_pm_ops ops)

Definition at line 450 of file pci.c.

int pci_set_power_state ( struct pci_dev dev,
pci_power_t  state 
)

pci_set_power_state - Set the power state of a PCI device : PCI device to handle. : PCI power state (D0, D1, D2, D3hot) to put the device into.

Transition a device to a new power state, using the platform firmware and/or the device's PCI PM registers.

RETURN VALUE: -EINVAL if the requested state is invalid. -EIO if device does not support PCI PM or its PM capabilities register has a wrong version, or device doesn't support the requested state. 0 if device already is in the requested state. 0 if device's power state has been successfully changed.

Definition at line 756 of file pci.c.

ssize_t pci_set_resource_alignment_param ( const char buf,
size_t  count 
)

Definition at line 3818 of file pci.c.

int pci_set_vga_state ( struct pci_dev dev,
bool  decode,
unsigned int  command_bits,
u32  flags 
)

pci_set_vga_state - set VGA decode state on device and parents if requested : the PCI device : true = enable decoding, false = disable decoding : PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY : traverse ancestors and change bridges CHANGE_BRIDGE_ONLY / CHANGE_BRIDGE

Definition at line 3638 of file pci.c.

resource_size_t pci_specified_resource_alignment ( struct pci_dev dev)

pci_specified_resource_alignment - get resource alignment specified by user. : the PCI device to get

RETURNS: Resource alignment if it is specified. Zero if it is not specified.

Definition at line 3694 of file pci.c.

struct pci_saved_state* pci_store_saved_state ( struct pci_dev dev)
read

pci_store_saved_state - Allocate and return an opaque struct containing the device saved state. : PCI device that we're dealing with

Rerturn NULL if no state or error.

Definition at line 1044 of file pci.c.

u8 pci_swizzle_interrupt_pin ( const struct pci_dev dev,
u8  pin 
)

pci_swizzle_interrupt_pin - swizzle INTx for device behind bridge : the PCI device : the INTx pin (1=INTA, 2=INTB, 3=INTD, 4=INTD)

Perform INTx swizzling for a device behind one level of bridge. This is required by section 9.1 of the PCI-to-PCI bridge specification for devices behind bridges on add-in cards. For devices with ARI enabled, the slot number is always 0 (see the Implementation Note in section 2.2.8.1 of the PCI Express Base Specification, Revision 2.1)

Definition at line 2429 of file pci.c.

pci_power_t pci_target_state ( struct pci_dev dev)

pci_target_state - find an appropriate low power state for a given PCI dev : PCI device

Use underlying platform code to find a supported low power state for . If the platform can't manage , return the deepest state from which it can generate wake events, based on any available PME info.

Definition at line 1715 of file pci.c.

int pci_try_set_mwi ( struct pci_dev dev)

pci_try_set_mwi - enables memory-write-invalidate PCI transaction : the PCI device for which MWI is enabled

Enables the Memory-Write-Invalidate transaction in PCI_COMMAND. Callers are not required to check the return value.

RETURNS: An appropriate -ERRNO error value on error, or zero for success.

Definition at line 2877 of file pci.c.

void pci_update_current_state ( struct pci_dev dev,
pci_power_t  state 
)

pci_update_current_state - Read PCI power state of given device from its PCI PM registers and cache it : PCI device to handle. : State to cache in case the device doesn't have the PM capability

Definition at line 606 of file pci.c.

int pci_wake_from_d3 ( struct pci_dev dev,
bool  enable 
)

pci_wake_from_d3 - enable/disable device to wake up from D3_hot or D3_cold : PCI device to prepare : True to enable wake-up event generation; false to disable

Many drivers want the device to wake up the system from D3_hot or D3_cold and this function allows them to set that up cleanly - pci_enable_wake() should not be called twice in a row to enable wake-up due to PCI PM vs ACPI ordering constraints.

This function only returns error code if the device is not capable of generating PME# from both D3_hot and D3_cold, and the platform is unable to enable wake-up power for it.

Definition at line 1700 of file pci.c.

void pci_wakeup_bus ( struct pci_bus bus)

pci_wakeup_bus - Walk given bus and wake up devices on it : Top bus of the subtree to walk.

Definition at line 1508 of file pci.c.

void __weak pcibios_disable_device ( struct pci_dev dev)

pcibios_disable_device - disable arch specific PCI resources for device dev : the PCI device to disable

Disables architecture specific PCI resources for the device. This is the default implementation. Architecture implementations can override this.

Definition at line 1344 of file pci.c.

void __weak pcibios_set_master ( struct pci_dev dev)

pcibios_set_master - enable PCI bus-mastering for device dev : the PCI device to enable

Enables PCI bus-mastering for the device. This is the default implementation. Architecture specific implementations can override this if necessary.

Definition at line 2744 of file pci.c.

int __weak pcibios_set_pcie_reset_state ( struct pci_dev dev,
enum pcie_reset_state  state 
)

pcibios_set_pcie_reset_state - set reset state for device dev : the PCIe device reset : Reset state to enter into

Sets the PCIe reset state for the device. This is the default implementation. Architecture implementations can override this.

Definition at line 1408 of file pci.c.

char* __weak __init pcibios_setup ( char str)

pcibios_setup - process "pci=" kernel boot arguments : string used to pass in "pci=" kernel boot arguments

Process kernel boot arguments. This is the default implementation. Architecture specific implementations can override this as necessary.

Definition at line 2731 of file pci.c.

int pcie_get_mps ( struct pci_dev dev)

pcie_get_mps - get PCI Express maximum payload size : PCI device to query

Returns maximum payload size in bytes or appropriate error value.

Definition at line 3535 of file pci.c.

int pcie_get_readrq ( struct pci_dev dev)

pcie_get_readrq - get PCI Express read request size : PCI device to query

Returns maximum memory read request in bytes or appropriate error value.

Definition at line 3481 of file pci.c.

int pcie_set_mps ( struct pci_dev dev,
int  mps 
)

pcie_set_mps - set PCI Express maximum payload size : PCI device to query : maximum payload size in bytes valid values are 128, 256, 512, 1024, 2048, 4096

If possible sets maximum payload size

Definition at line 3552 of file pci.c.

int pcie_set_readrq ( struct pci_dev dev,
int  rq 
)

pcie_set_readrq - set PCI Express maximum memory read request : PCI device to query : maximum memory read count in bytes valid values are 128, 256, 512, 1024, 2048, 4096

If possible sets maximum memory read request in bytes

Definition at line 3499 of file pci.c.

int pcim_enable_device ( struct pci_dev pdev)

pcim_enable_device - Managed pci_enable_device() : PCI device to be initialized

Managed pci_enable_device().

Definition at line 1299 of file pci.c.

void pcim_pin_device ( struct pci_dev pdev)

pcim_pin_device - Pin managed PCI device : PCI device to pin

Pin managed PCI device . Pinned device won't be disabled on driver detach. must have been enabled with pcim_enable_device().

Definition at line 1326 of file pci.c.

int pcix_get_max_mmrbc ( struct pci_dev dev)

pcix_get_max_mmrbc - get PCI-X maximum designed memory read byte count : PCI device to query

Returns mmrbc: maximum designed memory read count in bytes or appropriate error value.

Definition at line 3388 of file pci.c.

int pcix_get_mmrbc ( struct pci_dev dev)

pcix_get_mmrbc - get PCI-X maximum memory read byte count : PCI device to query

Returns mmrbc: maximum memory read count in bytes or appropriate error value.

Definition at line 3411 of file pci.c.

int pcix_set_mmrbc ( struct pci_dev dev,
int  mmrbc 
)

pcix_set_mmrbc - set PCI-X maximum memory read byte count : PCI device to query : maximum memory read count in bytes valid values are 512, 1024, 2048, 4096

If possible sets maximum memory read byte count, some bridges have erratas that prevent this.

Definition at line 3436 of file pci.c.

void platform_pci_wakeup_init ( struct pci_dev dev)

platform_pci_wakeup_init - init platform wakeup if present : PCI device

Some devices don't have PCI PM caps but can still generate wakeup events through platform methods (like ACPI events). If supports platform wakeup events, set the device flag to indicate as much. This may be redundant if the device also supports PCI PM caps, but double initialization should be safe in that case.

Definition at line 1973 of file pci.c.

Variable Documentation

Definition at line 89 of file pci.c.

int isa_dma_bridge_buggy

Definition at line 34 of file pci.c.

u8 pci_cache_line_size

Definition at line 90 of file pci.c.

unsigned long pci_cardbus_io_size = DEFAULT_CARDBUS_IO_SIZE

Definition at line 72 of file pci.c.

unsigned long pci_cardbus_mem_size = DEFAULT_CARDBUS_MEM_SIZE

Definition at line 73 of file pci.c.

unsigned long pci_hotplug_io_size = DEFAULT_HOTPLUG_IO_SIZE

Definition at line 78 of file pci.c.

unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE

Definition at line 79 of file pci.c.

int pci_pci_problems

Definition at line 37 of file pci.c.

unsigned int pci_pm_d3_delay

Definition at line 40 of file pci.c.

const char* pci_power_names[]
Initial value:
= {
"error", "D0", "D1", "D2", "D3hot", "D3cold", "unknown",
}

Definition at line 29 of file pci.c.

unsigned int pcibios_max_latency = 255

Definition at line 96 of file pci.c.

enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF

Definition at line 81 of file pci.c.