Functions for Linux backward compatibility | |
This is from drivers/pci/compat.c | |
#define | PCI_OP(rw, size, type) |
Configuration space access function creation (old interface). | |
int | pcibios_find_device (unsigned short vendor, unsigned short device, unsigned short index, unsigned char *bus, unsigned char *devfn) |
Find ... | |
Exploration of bus/attached devices and drivers | |
pci_driver * | pci_dev_driver (const struct pci_dev *dev) |
Get PCI driver of given device. | |
int | pci_register_driver (struct pci_driver *drv) |
Register PCI driver. | |
void | pci_unregister_driver (struct pci_driver *drv) |
Unregister PCI driver. | |
pci_dev * | pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from) |
Find PCI Device on vendor and device IDs. | |
pci_dev * | pci_find_subsys (unsigned int vendor, unsigned int device, unsigned int ss_vendor, unsigned int ss_device, const struct pci_dev *from) |
Find PCI Device on vendor, subvendor, device and subdevice IDs. | |
pci_dev * | pci_find_slot (unsigned int bus, unsigned int devfn) |
Find PCI Device on Slot. | |
pci_dev * | pci_find_class (unsigned int class, const struct pci_dev *from) |
Find PCI Device on Class. | |
Device setup (bus mastering, enable/disable) | |
int | pci_enable_device (struct pci_dev *dev) |
Enable PCI Device. | |
void | pci_disable_device (struct pci_dev *dev) |
Disable PCI Device. | |
void | pci_set_master (struct pci_dev *dev) |
Set Busmastering for PCI Device. | |
Power Management related functions | |
int | pci_set_power_state (struct pci_dev *dev, int state) |
Set PM State for PCI Device. | |
PCI memory pools (consistent DMA mappings...) | |
Pool allocator ...
wraps the pci_alloc_consistent page allocator, so small blocks are easily used by drivers for bus mastering controllers. This should probably be sharing the guts of the slab allocator. | |
pci_pool * | pci_pool_create (const char *name, struct pci_dev *pdev, size_t size, size_t align, size_t allocation, int flags) |
Create a pool of pci consistent memory blocks, for dma. | |
void | pci_pool_destroy (struct pci_pool *pool) |
Destroy a pool of pci memory blocks. | |
void * | pci_pool_alloc (struct pci_pool *pool, int mem_flags, dma_addr_t *handle) |
Get a block of consistent memory. | |
void * | pci_alloc_consistent (struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) |
Allocation of PCI consistent DMA Memory. | |
void | pci_free_consistent (struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) |
Deallocation of PCI consistent DMA Memory. | |
Configuration space access | |
int | pci_read_config_byte (struct pci_dev *dev, int pos, l4_uint8_t *val) |
PCI Configuration Space access - read byte. | |
int | pci_read_config_word (struct pci_dev *dev, int pos, l4_uint16_t *val) |
PCI Configuration Space access - read word. | |
int | pci_read_config_dword (struct pci_dev *dev, int pos, l4_uint32_t *val) |
PCI Configuration Space access - read double word. | |
int | pci_write_config_byte (struct pci_dev *dev, int pos, l4_uint8_t val) |
PCI Configuration Space access - write byte. | |
int | pci_write_config_word (struct pci_dev *dev, int pos, l4_uint16_t val) |
PCI Configuration Space access - write word. | |
int | pci_write_config_dword (struct pci_dev *dev, int pos, l4_uint32_t val) |
PCI Configuration Space access - write double word. | |
Functions | |
int | l4dde_pci_init () |
Initalize PCI module. |
Most of the services of this module are wrappers to libio functions. The remainder is simple glue code. The PCI module supports up to PCI_DEVICES
devices at one virtual PCI bus.
Services are:
Requirements: (additionally to Global Requirements)
Configuration:
|
Value: int pcibios_##rw##_config_##size (unsigned char bus, unsigned char dev_fn, \ unsigned char where, unsigned type val) \ { \ struct pci_dev *dev = pci_find_slot(bus, dev_fn); \ if (!dev) return PCIBIOS_DEVICE_NOT_FOUND; \ return pci_##rw##_config_##size(dev, where, val); \ }
|
|
Initalize PCI module.
Definition at line 1286 of file pci.c. References __pci_get_handle(), __pci_io_to_linux(), _initialized, PCI_DEVICES, and pcibus. |
|
Allocation of PCI consistent DMA Memory.
Definition at line 974 of file pci.c. References DEBUG_PALLOC. |
|
Get PCI driver of given device.
Definition at line 209 of file pci.c. Referenced by pci_register_driver(). |
|
Disable PCI Device.
Definition at line 410 of file pci.c. References __pci_get_handle(), and DEBUG_ERRORS. |
|
Enable PCI Device.
Definition at line 382 of file pci.c. References __pci_get_handle(), and DEBUG_ERRORS. |
|
Find PCI Device on Class.
|
|
Find PCI Device on vendor and device IDs.
Definition at line 273 of file pci.c. Referenced by pcibios_find_device(). |
|
Find PCI Device on Slot.
|
|
Find PCI Device on vendor, subvendor, device and subdevice IDs.
|
|
Deallocation of PCI consistent DMA Memory.
Definition at line 1000 of file pci.c. References DEBUG_PALLOC. |
|
Get a block of consistent memory.
Definition at line 823 of file pci.c. References pci_pool::blocks_per_page, pci_pool::lock, pci_pool::page_list, pci_pool::size, and pci_pool::waitq. |
|
Create a pool of pci consistent memory blocks, for dma.
If allocation is nonzero, objects returned from pci_pool_alloc() won't cross that size boundary. This is useful for devices which have addressing restrictions on individual DMA transfers, such as not crossing boundaries of 4KBytes. Definition at line 660 of file pci.c. References kmalloc(). |
|
Destroy a pool of pci memory blocks.
Definition at line 780 of file pci.c. References pci_pool::blocks_per_page, pci_pool::dev, kfree(), pci_pool::lock, pci_pool::name, and pci_pool::page_list. |
|
PCI Configuration Space access - read byte.
Definition at line 1029 of file pci.c. References __pci_get_handle(). |
|
PCI Configuration Space access - read double word.
Definition at line 1093 of file pci.c. References __pci_get_handle(). |
|
PCI Configuration Space access - read word.
Definition at line 1061 of file pci.c. References __pci_get_handle(). |
|
Register PCI driver.
pci_register/unregister_driver() are helpers for these and have to be implemented. Definition at line 229 of file pci.c. References pci_announce_device(), and pci_dev_driver(). |
|
Set Busmastering for PCI Device.
Definition at line 438 of file pci.c. References __pci_get_handle(). |
|
Set PM State for PCI Device.
Definition at line 465 of file pci.c. References __pci_get_handle(), and DEBUG_ERRORS. |
|
Unregister PCI driver.
|
|
PCI Configuration Space access - write byte.
Definition at line 1125 of file pci.c. References __pci_get_handle(). |
|
PCI Configuration Space access - write double word.
Definition at line 1189 of file pci.c. References __pci_get_handle(). |
|
PCI Configuration Space access - write word.
Definition at line 1157 of file pci.c. References __pci_get_handle(). |
|
Find ... (old interface) Definition at line 1240 of file pci.c. References pci_find_device(). |