Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
probe.c File Reference
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/cpumask.h>
#include <linux/pci-aspm.h>
#include <asm-generic/pci-bridge.h>
#include "pci.h"

Go to the source code of this file.

Data Structures

struct  pci_domain_busn_res
 

Macros

#define CARDBUS_LATENCY_TIMER   176 /* secondary latency timer */
 
#define CARDBUS_RESERVE_BUSNR   3
 
#define LEGACY_IO_RESOURCE   (IORESOURCE_IO | IORESOURCE_PCI_FIXED)
 

Functions

 LIST_HEAD (pci_root_buses)
 
 EXPORT_SYMBOL (pci_root_buses)
 
int no_pci_devices (void)
 
 EXPORT_SYMBOL (no_pci_devices)
 
 postcore_initcall (pcibus_class_init)
 
int __pci_read_base (struct pci_dev *dev, enum pci_bar_type type, struct resource *res, unsigned int pos)
 
void __devinit pci_read_bridge_bases (struct pci_bus *child)
 
void pcie_update_link_speed (struct pci_bus *bus, u16 linksta)
 
 EXPORT_SYMBOL_GPL (pcie_update_link_speed)
 
struct pci_bus *__ref pci_add_new_bus (struct pci_bus *parent, struct pci_dev *dev, int busnr)
 
int __devinit pci_scan_bridge (struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
 
void set_pcie_port_type (struct pci_dev *pdev)
 
void set_pcie_hotplug_bridge (struct pci_dev *pdev)
 
int pci_setup_device (struct pci_dev *dev)
 
int pci_cfg_space_size_ext (struct pci_dev *dev)
 
int pci_cfg_space_size (struct pci_dev *dev)
 
struct pci_devalloc_pci_dev (void)
 
 EXPORT_SYMBOL (alloc_pci_dev)
 
bool pci_bus_read_dev_vendor_id (struct pci_bus *bus, int devfn, u32 *l, int crs_timeout)
 
 EXPORT_SYMBOL (pci_bus_read_dev_vendor_id)
 
void pci_device_add (struct pci_dev *dev, struct pci_bus *bus)
 
struct pci_dev *__ref pci_scan_single_device (struct pci_bus *bus, int devfn)
 
 EXPORT_SYMBOL (pci_scan_single_device)
 
int pci_scan_slot (struct pci_bus *bus, int devfn)
 
void pcie_bus_configure_settings (struct pci_bus *bus, u8 mpss)
 
 EXPORT_SYMBOL_GPL (pcie_bus_configure_settings)
 
unsigned int __devinit pci_scan_child_bus (struct pci_bus *bus)
 
struct pci_buspci_create_root_bus (struct device *parent, int bus, struct pci_ops *ops, void *sysdata, struct list_head *resources)
 
int pci_bus_insert_busn_res (struct pci_bus *b, int bus, int bus_max)
 
int pci_bus_update_busn_res_end (struct pci_bus *b, int bus_max)
 
void pci_bus_release_busn_res (struct pci_bus *b)
 
struct pci_bus *__devinit pci_scan_root_bus (struct device *parent, int bus, struct pci_ops *ops, void *sysdata, struct list_head *resources)
 
 EXPORT_SYMBOL (pci_scan_root_bus)
 
struct pci_bus *__devinit pci_scan_bus_parented (struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
 
 EXPORT_SYMBOL (pci_scan_bus_parented)
 
struct pci_bus *__devinit pci_scan_bus (int bus, struct pci_ops *ops, void *sysdata)
 
 EXPORT_SYMBOL (pci_scan_bus)
 
void __init pci_sort_breadthfirst (void)
 

Variables

struct resource busn_resource
 

Macro Definition Documentation

#define CARDBUS_LATENCY_TIMER   176 /* secondary latency timer */

Definition at line 16 of file probe.c.

#define CARDBUS_RESERVE_BUSNR   3

Definition at line 17 of file probe.c.

#define LEGACY_IO_RESOURCE   (IORESOURCE_IO | IORESOURCE_PCI_FIXED)

Definition at line 951 of file probe.c.

Function Documentation

int __pci_read_base ( struct pci_dev dev,
enum pci_bar_type  type,
struct resource res,
unsigned int  pos 
)

pci_read_base - read a PCI BAR : the PCI device : type of the BAR : resource buffer to be filled in : BAR position in the config space

Returns 1 if the BAR is 64-bit, or 0 if 32-bit.

Definition at line 168 of file probe.c.

struct pci_dev* alloc_pci_dev ( void  )
read

Definition at line 1188 of file probe.c.

EXPORT_SYMBOL ( pci_root_buses  )
EXPORT_SYMBOL ( no_pci_devices  )
EXPORT_SYMBOL ( alloc_pci_dev  )
EXPORT_SYMBOL ( pci_bus_read_dev_vendor_id  )
EXPORT_SYMBOL ( pci_scan_single_device  )
EXPORT_SYMBOL ( pci_scan_root_bus  )
EXPORT_SYMBOL ( pci_scan_bus_parented  )
EXPORT_SYMBOL ( pci_scan_bus  )
EXPORT_SYMBOL_GPL ( pcie_update_link_speed  )
EXPORT_SYMBOL_GPL ( pcie_bus_configure_settings  )
LIST_HEAD ( pci_root_buses  )
int no_pci_devices ( void  )

Definition at line 70 of file probe.c.

struct pci_bus* __ref pci_add_new_bus ( struct pci_bus parent,
struct pci_dev dev,
int  busnr 
)
read

Definition at line 669 of file probe.c.

int pci_bus_insert_busn_res ( struct pci_bus b,
int  bus,
int  bus_max 
)

Definition at line 1730 of file probe.c.

bool pci_bus_read_dev_vendor_id ( struct pci_bus bus,
int  devfn,
u32 l,
int  crs_timeout 
)

Definition at line 1202 of file probe.c.

void pci_bus_release_busn_res ( struct pci_bus b)

Definition at line 1779 of file probe.c.

int pci_bus_update_busn_res_end ( struct pci_bus b,
int  bus_max 
)

Definition at line 1757 of file probe.c.

int pci_cfg_space_size ( struct pci_dev dev)

Definition at line 1150 of file probe.c.

int pci_cfg_space_size_ext ( struct pci_dev dev)

pci_cfg_space_size - get the configuration space size of the PCI device. : PCI device

Regular PCI devices have 256 bytes, but PCI-X 2 and PCI Express devices have 4096 bytes. Even if the device is capable, that doesn't mean we can access it. Maybe we don't have a way to generate extended config space accesses, or the device is behind a reverse Express bridge. So we try reading the dword at 0x100 which must either be 0 or a valid extended capability header.

Definition at line 1134 of file probe.c.

struct pci_bus* pci_create_root_bus ( struct device parent,
int  bus,
struct pci_ops ops,
void sysdata,
struct list_head resources 
)
read

Definition at line 1632 of file probe.c.

void pci_device_add ( struct pci_dev dev,
struct pci_bus bus 
)

Definition at line 1294 of file probe.c.

void __devinit pci_read_bridge_bases ( struct pci_bus child)

Definition at line 420 of file probe.c.

int __devinit pci_scan_bridge ( struct pci_bus bus,
struct pci_dev dev,
int  max,
int  pass 
)

Definition at line 708 of file probe.c.

struct pci_bus* __devinit pci_scan_bus ( int  bus,
struct pci_ops ops,
void sysdata 
)
read

Definition at line 1847 of file probe.c.

struct pci_bus* __devinit pci_scan_bus_parented ( struct device parent,
int  bus,
struct pci_ops ops,
void sysdata 
)
read

Definition at line 1829 of file probe.c.

unsigned int __devinit pci_scan_child_bus ( struct pci_bus bus)

Definition at line 1589 of file probe.c.

struct pci_bus* __devinit pci_scan_root_bus ( struct device parent,
int  bus,
struct pci_ops ops,
void sysdata,
struct list_head resources 
)
read

Definition at line 1793 of file probe.c.

struct pci_dev* __ref pci_scan_single_device ( struct pci_bus bus,
int  devfn 
)
read

Definition at line 1328 of file probe.c.

int pci_scan_slot ( struct pci_bus bus,
int  devfn 
)

pci_scan_slot - scan a PCI slot on a bus for devices. : PCI bus to scan : slot number to scan (must have zero function.)

Scan a PCI slot on the specified PCI bus for devices, adding discovered devices to the ->devices list. New devices will not have is_added set.

Returns the number of new devices found.

Definition at line 1401 of file probe.c.

int pci_setup_device ( struct pci_dev dev)

pci_setup_device - fill in class and map information of a device : the device structure to fill

Initialize the device structure with information about the device's vendor,class,memory and IO-space addresses,IRQ lines etc. Called at initialisation of the PCI subsystem and by CardBus services. Returns 0 on success and negative if unknown type of device (not normal, bridge or CardBus).

Definition at line 963 of file probe.c.

void __init pci_sort_breadthfirst ( void  )

Definition at line 1916 of file probe.c.

void pcie_bus_configure_settings ( struct pci_bus bus,
u8  mpss 
)

Definition at line 1560 of file probe.c.

void pcie_update_link_speed ( struct pci_bus bus,
u16  linksta 
)

Definition at line 522 of file probe.c.

postcore_initcall ( pcibus_class_init  )
void set_pcie_hotplug_bridge ( struct pci_dev pdev)

Definition at line 942 of file probe.c.

void set_pcie_port_type ( struct pci_dev pdev)

Definition at line 926 of file probe.c.

Variable Documentation

struct resource busn_resource
Initial value:
= {
.name = "PCI busn",
.start = 0,
.end = 255,
.flags = IORESOURCE_BUS,
}

Definition at line 19 of file probe.c.