probe.c File Reference

Go to the source code of this file.

Defines

#define CARDBUS_LATENCY_TIMER   176
#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)
static int find_anything (struct device *dev, void *data)
int no_pci_devices (void)
 EXPORT_SYMBOL (no_pci_devices)
static ssize_t pci_bus_show_cpuaffinity (struct device *dev, int type, struct device_attribute *attr, char *buf)
static ssize_t pci_bus_show_cpumaskaffinity (struct device *dev, struct device_attribute *attr, char *buf)
static ssize_t pci_bus_show_cpulistaffinity (struct device *dev, struct device_attribute *attr, char *buf)
 DEVICE_ATTR (cpuaffinity, S_IRUGO, pci_bus_show_cpumaskaffinity, NULL)
 DEVICE_ATTR (cpulistaffinity, S_IRUGO, pci_bus_show_cpulistaffinity, NULL)
static void release_pcibus_dev (struct device *dev)
static int __init pcibus_class_init (void)
 postcore_initcall (pcibus_class_init)
static unsigned int pci_calc_resource_flags (unsigned int flags)
static u64 pci_size (u64 base, u64 maxbase, u64 mask)
static enum pci_bar_type decode_bar (struct resource *res, u32 bar)
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
static void pci_read_bases (struct pci_dev *dev, unsigned int howmany, int rom)
void __devinit pci_read_bridge_bases (struct pci_bus *child)
static struct pci_buspci_alloc_bus (void)
static struct pci_buspci_alloc_child_bus (struct pci_bus *parent, struct pci_dev *bridge, int busnr)
struct pci_bus *__ref pci_add_new_bus (struct pci_bus *parent, struct pci_dev *dev, int busnr)
static void pci_fixup_parent_subordinate_busnr (struct pci_bus *child, int max)
int __devinit pci_scan_bridge (struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
static void pci_read_irq (struct pci_dev *dev)
static 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
static void pci_release_capabilities (struct pci_dev *dev)
static void pci_release_dev (struct device *dev)
 pci_release_dev - free a pci device structure when all users of it are finished.
static void set_pcie_port_type (struct pci_dev *pdev)
int pci_cfg_space_size_ext (struct pci_dev *dev)
 pci_cfg_space_size - get the configuration space size of the PCI device.
int pci_cfg_space_size (struct pci_dev *dev)
static void pci_release_bus_bridge_dev (struct device *dev)
struct pci_dev * alloc_pci_dev (void)
 EXPORT_SYMBOL (alloc_pci_dev)
static struct pci_dev * pci_scan_device (struct pci_bus *bus, int devfn)
static void pci_init_capabilities (struct pci_dev *dev)
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)
 pci_scan_slot - scan a PCI slot on a bus for devices.
unsigned int __devinit pci_scan_child_bus (struct pci_bus *bus)
void __attribute__ ((weak))
 pcibios_set_pcie_reset_state - set reset state for device dev : the PCI-E device reset : Reset state to enter into
struct pci_buspci_create_bus (struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
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)
static int __init pci_sort_bf_cmp (const struct device *d_a, const struct device *d_b)
void __init pci_sort_breadthfirst (void)

Variables

static struct class pcibus_class


Define Documentation

#define CARDBUS_LATENCY_TIMER   176

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 685 of file probe.c.


Function Documentation

void __attribute__ ( (weak)   )  [read]

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

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

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

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

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

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

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

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

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 1112 of file probe.c.

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 165 of file probe.c.

struct pci_dev* alloc_pci_dev ( void   )  [read]

Definition at line 881 of file probe.c.

static enum pci_bar_type decode_bar ( struct resource *  res,
u32  bar 
) [inline, static]

Definition at line 142 of file probe.c.

DEVICE_ATTR ( cpulistaffinity  ,
S_IRUGO  ,
pci_bus_show_cpulistaffinity  ,
NULL   
)

DEVICE_ATTR ( cpuaffinity  ,
S_IRUGO  ,
pci_bus_show_cpumaskaffinity  ,
NULL   
)

EXPORT_SYMBOL ( pci_scan_bus_parented   ) 

EXPORT_SYMBOL ( pci_scan_single_device   ) 

EXPORT_SYMBOL ( alloc_pci_dev   ) 

EXPORT_SYMBOL ( no_pci_devices   ) 

EXPORT_SYMBOL ( pci_root_buses   ) 

static int find_anything ( struct device *  dev,
void *  data 
) [static]

Definition at line 27 of file probe.c.

LIST_HEAD ( pci_root_buses   ) 

int no_pci_devices ( void   ) 

Definition at line 37 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 441 of file probe.c.

static struct pci_bus* pci_alloc_bus ( void   )  [static, read]

Definition at line 378 of file probe.c.

static struct pci_bus* pci_alloc_child_bus ( struct pci_bus parent,
struct pci_dev *  bridge,
int  busnr 
) [static, read]

Definition at line 392 of file probe.c.

static ssize_t pci_bus_show_cpuaffinity ( struct device *  dev,
int  type,
struct device_attribute *  attr,
char *  buf 
) [static]

Definition at line 52 of file probe.c.

static ssize_t pci_bus_show_cpulistaffinity ( struct device *  dev,
struct device_attribute *  attr,
char *  buf 
) [inline, static]

Definition at line 76 of file probe.c.

static ssize_t pci_bus_show_cpumaskaffinity ( struct device *  dev,
struct device_attribute *  attr,
char *  buf 
) [inline, static]

Definition at line 69 of file probe.c.

static unsigned int pci_calc_resource_flags ( unsigned int  flags  )  [inline, static]

Definition at line 113 of file probe.c.

int pci_cfg_space_size ( struct pci_dev *  dev  ) 

Definition at line 854 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 838 of file probe.c.

struct pci_bus* pci_create_bus ( struct device *  parent,
int  bus,
struct pci_ops *  ops,
void *  sysdata 
) [read]

Definition at line 1116 of file probe.c.

void pci_device_add ( struct pci_dev *  dev,
struct pci_bus bus 
)

Definition at line 985 of file probe.c.

static void pci_fixup_parent_subordinate_busnr ( struct pci_bus child,
int  max 
) [static]

Definition at line 454 of file probe.c.

static void pci_init_capabilities ( struct pci_dev *  dev  )  [static]

Definition at line 966 of file probe.c.

static void pci_read_bases ( struct pci_dev *  dev,
unsigned int  howmany,
int  rom 
) [static]

Definition at line 265 of file probe.c.

void __devinit pci_read_bridge_bases ( struct pci_bus child  ) 

Definition at line 285 of file probe.c.

static void pci_read_irq ( struct pci_dev *  dev  )  [static]

Definition at line 674 of file probe.c.

static void pci_release_bus_bridge_dev ( struct device *  dev  )  [static]

Definition at line 876 of file probe.c.

static void pci_release_capabilities ( struct pci_dev *  dev  )  [static]

Definition at line 793 of file probe.c.

static void pci_release_dev ( struct device *  dev  )  [static]

pci_release_dev - free a pci device structure when all users of it are finished.

: device that's been disconnected

Will be called only by the device core when all users of this pci device are done.

Definition at line 805 of file probe.c.

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

Definition at line 482 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 1193 of file probe.c.

unsigned int __devinit pci_scan_child_bus ( struct pci_bus bus  ) 

Definition at line 1074 of file probe.c.

static struct pci_dev* pci_scan_device ( struct pci_bus bus,
int  devfn 
) [static, read]

Definition at line 899 of file probe.c.

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

Definition at line 1013 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.

Definition at line 1036 of file probe.c.

static int pci_setup_device ( struct pci_dev *  dev  )  [static]

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 -1 if unknown type of device (not normal, bridge or CardBus).

Definition at line 697 of file probe.c.

static u64 pci_size ( u64  base,
u64  maxbase,
u64  mask 
) [static]

Definition at line 124 of file probe.c.

static int __init pci_sort_bf_cmp ( const struct device *  d_a,
const struct device *  d_b 
) [static]

Definition at line 1212 of file probe.c.

void __init pci_sort_breadthfirst ( void   ) 

Definition at line 1229 of file probe.c.

static int __init pcibus_class_init ( void   )  [static]

Definition at line 103 of file probe.c.

postcore_initcall ( pcibus_class_init   ) 

static void release_pcibus_dev ( struct device *  dev  )  [static]

Definition at line 89 of file probe.c.

static void set_pcie_port_type ( struct pci_dev *  pdev  )  [static]

Definition at line 814 of file probe.c.


Variable Documentation

struct class pcibus_class [static]

Initial value:

 {
        .name           = "pci_bus",
        .dev_release    = &release_pcibus_dev,
}

Definition at line 98 of file probe.c.


Generated on Wed Apr 11 06:39:16 2012 for DDE - The L4 Device Driver Environment by  doxygen 1.5.6