Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bus.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/slab.h>
#include "pci.h"

Go to the source code of this file.


void pci_add_resource_offset (struct list_head *resources, struct resource *res, resource_size_t offset)
 EXPORT_SYMBOL (pci_add_resource_offset)
void pci_add_resource (struct list_head *resources, struct resource *res)
 EXPORT_SYMBOL (pci_add_resource)
void pci_free_resource_list (struct list_head *resources)
 EXPORT_SYMBOL (pci_free_resource_list)
void pci_bus_add_resource (struct pci_bus *bus, struct resource *res, unsigned int flags)
struct resourcepci_bus_resource_n (const struct pci_bus *bus, int n)
 EXPORT_SYMBOL_GPL (pci_bus_resource_n)
void pci_bus_remove_resources (struct pci_bus *bus)
int pci_bus_alloc_resource (struct pci_bus *bus, struct resource *res, resource_size_t size, resource_size_t align, resource_size_t min, unsigned int type_mask, resource_size_t(*alignf)(void *, const struct resource *, resource_size_t, resource_size_t), void *alignf_data)
int pci_bus_add_device (struct pci_dev *dev)
int pci_bus_add_child (struct pci_bus *bus)
void pci_bus_add_devices (const struct pci_bus *bus)
void pci_enable_bridges (struct pci_bus *bus)
void pci_walk_bus (struct pci_bus *top, int(*cb)(struct pci_dev *, void *), void *userdata)
 EXPORT_SYMBOL_GPL (pci_walk_bus)
 EXPORT_SYMBOL (pci_bus_alloc_resource)
 EXPORT_SYMBOL_GPL (pci_bus_add_device)
 EXPORT_SYMBOL (pci_bus_add_devices)
 EXPORT_SYMBOL (pci_enable_bridges)

Function Documentation

EXPORT_SYMBOL ( pci_add_resource_offset  )
EXPORT_SYMBOL ( pci_add_resource  )
EXPORT_SYMBOL ( pci_free_resource_list  )
EXPORT_SYMBOL ( pci_bus_alloc_resource  )
EXPORT_SYMBOL ( pci_bus_add_devices  )
EXPORT_SYMBOL ( pci_enable_bridges  )
EXPORT_SYMBOL_GPL ( pci_bus_resource_n  )
EXPORT_SYMBOL_GPL ( pci_walk_bus  )
EXPORT_SYMBOL_GPL ( pci_bus_add_device  )
void pci_add_resource ( struct list_head resources,
struct resource res 

Definition at line 38 of file bus.c.

void pci_add_resource_offset ( struct list_head resources,
struct resource res,
resource_size_t  offset 

Definition at line 21 of file bus.c.

int pci_bus_add_child ( struct pci_bus bus)

pci_bus_add_child - add a child bus : bus to add

This adds sysfs entries for a single bus

Definition at line 189 of file bus.c.

int pci_bus_add_device ( struct pci_dev dev)

pci_bus_add_device - add a single device : device to add

This adds a single pci device to the global device list and adds sysfs and procfs entries

Definition at line 168 of file bus.c.

void pci_bus_add_devices ( const struct pci_bus bus)

pci_bus_add_devices - insert newly discovered PCI devices : bus to check for new devices

Add newly discovered PCI devices (which are on the bus->devices list) to the global PCI device list, add the sysfs and procfs entries. Where a bridge is found, add the discovered bus to the parents list of child buses, and recurse (breadth-first to be compatible with 2.4)

Call hotplug for each new devices.

Definition at line 220 of file bus.c.

void pci_bus_add_resource ( struct pci_bus bus,
struct resource res,
unsigned int  flags 

Definition at line 55 of file bus.c.

int pci_bus_alloc_resource ( struct pci_bus bus,
struct resource res,
resource_size_t  size,
resource_size_t  align,
resource_size_t  min,
unsigned int  type_mask,
resource_size_t(*)(void *, const struct resource *, resource_size_t, resource_size_t alignf,
void alignf_data 

pci_bus_alloc_resource - allocate a resource from a parent bus : PCI bus : resource to allocate : size of resource to allocate : alignment of resource to allocate : minimum /proc/iomem address to allocate : IORESOURCE_* type flags : resource alignment function : data argument for resource alignment function

Given the PCI bus a device resides on, the size, minimum address, alignment and type, try to find an acceptable resource allocation for a specific device resource.

Definition at line 117 of file bus.c.

void pci_bus_remove_resources ( struct pci_bus bus)

Definition at line 87 of file bus.c.

struct resource* pci_bus_resource_n ( const struct pci_bus bus,
int  n 

Definition at line 71 of file bus.c.

void pci_enable_bridges ( struct pci_bus bus)

Definition at line 264 of file bus.c.

void pci_free_resource_list ( struct list_head resources)

Definition at line 44 of file bus.c.

void pci_walk_bus ( struct pci_bus top,
int(*)(struct pci_dev *, void *)  cb,
void userdata 

pci_walk_bus - walk devices on/under bus, calling callback. bus whose devices should be walked callback to be called for each device found arbitrary pointer to be passed to callback.

Walk the given bus, including any bridged devices on buses under this bus. Call the provided callback on each device found.

We check the return of each time. If it returns anything other than 0, we break out.

Definition at line 295 of file bus.c.