#include <l4/env/errno.h>
#include <l4/generic_io/libio.h>
#include <l4/sigma0/kip.h>
#include <l4/dde_linux/dde.h>
#include <linux/pci.h>
#include <linux/list.h>
#include "internal.h"
#include "__config.h"
Go to the source code of this file.
Classes | |
struct | pcidevs |
PCI device structure array. More... | |
struct | pci_pool |
the pool More... | |
struct | pci_page |
cacheable header for 'allocation' bytes More... | |
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. | |
#define | POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000) |
#define | POOL_POISON_BYTE 0xa7 |
struct 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. | |
static struct pci_page * | pool_alloc_page (struct pci_pool *pool, int mem_flags) |
static int | is_page_busy (int blocks, unsigned long *bitmap) |
static void | pool_free_page (struct pci_pool *pool, struct pci_page *page) |
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. | |
static struct pci_page * | pool_find_page (struct pci_pool *pool, dma_addr_t dma) |
void | pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma) |
Put block back into pci pool. | |
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. | |
int | pci_set_dma_mask (struct pci_dev *dev, u64 mask) |
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 . | |
Module variables | |
static struct pci_bus | pcibus |
virtual PCI bus | |
static int | _initialized = 0 |
initialization flag | |
LIST_HEAD (pci_devices) | |
list of all PCI devices (must be global) | |
Functions | |
static l4io_pdev_t | __pci_get_handle (struct pci_dev *linus) |
Get L4IO device handle for given device. | |
static void | __pci_io_to_linux (l4io_pci_dev_t *l4io, struct pci_dev *linus) |
Convert IO's pci_dev to Linux' pci_dev struct. | |
int | l4dde_pci_init (void) |
Initalize PCI module. | |
Exploration of bus/attached devices and drivers | |
struct pci_device_id * | pci_match_device (const struct pci_device_id *ids, const struct pci_dev *dev) |
Check device against ID table. | |
static int | pci_announce_device (struct pci_driver *drv, struct pci_dev *dev) |
Check device - driver compatibility. | |
struct 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. | |
struct pci_dev * | pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from) |
Find PCI Device on vendor and device IDs. | |
struct 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. | |
struct pci_dev * | pci_find_slot (unsigned int bus, unsigned int devfn) |
Find PCI Device on Slot. | |
struct pci_dev * | pci_find_class (unsigned int class, const struct pci_dev *from) |
Find PCI Device on Class. | |
int | pci_find_capability (struct pci_dev *dev, int cap) |
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. | |
int | pci_set_mwi (struct pci_dev *dev) |
FIXME Dummy (could also go into L4IO. | |
void | pci_clear_mwi (struct pci_dev *dev) |
FIXME Dummy (should also go into L4IO. | |
Power Management related functions | |
int | pci_set_power_state (struct pci_dev *dev, int state) |
Set PM State for PCI Device. | |
int | pci_enable_wake (struct pci_dev *dev, u32 state, int enable) |
FIXME Dummy (could also go into L4IO. | |
int | pci_save_state (struct pci_dev *dev, u32 *buffer) |
FIXME Dummy (could also go into L4IO. | |
int | pci_restore_state (struct pci_dev *dev, u32 *buffer) |
FIXME Dummy (could also go into L4IO. | |
PCI device related resources | |
void | pci_release_region (struct pci_dev *pdev, int bar) |
Release a PCI bar : PCI device whose resources were previously reserved by pci_request_region : BAR to release. | |
int | pci_request_region (struct pci_dev *pdev, int bar, char *res_name) |
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. | |
void | pci_release_regions (struct pci_dev *pdev) |
Release reserved PCI I/O and memory resources : PCI device whose resources were previously reserved by pci_request_regions. | |
int | pci_request_regions (struct pci_dev *pdev, char *res_name) |
Reserve PCI I/O and memory resources : PCI device whose resources are to be reserved : Name to be associated with resource. | |
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. |
Definition in file pci.c.
static l4io_pdev_t __pci_get_handle | ( | struct pci_dev * | linus | ) | [inline, static] |
static void __pci_io_to_linux | ( | l4io_pci_dev_t * | l4io, | |
struct pci_dev * | linus | |||
) | [inline, static] |
static int pci_announce_device | ( | struct pci_driver * | drv, | |
struct pci_dev * | dev | |||
) | [static] |
struct pci_device_id* pci_match_device | ( | const struct pci_device_id * | ids, | |
const struct pci_dev * | dev | |||
) | [read] |
void pci_pool_free | ( | struct pci_pool * | pool, | |
void * | vaddr, | |||
dma_addr_t | dma | |||
) |
void pci_release_region | ( | struct pci_dev * | pdev, | |
int | bar | |||
) |
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.
void pci_release_regions | ( | struct pci_dev * | pdev | ) |
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.
int pci_request_region | ( | struct pci_dev * | pdev, | |
int | bar, | |||
char * | res_name | |||
) |
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 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.
int pci_request_regions | ( | struct pci_dev * | pdev, | |
char * | res_name | |||
) |
Reserve 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.
struct pci_bus pcibus [static] |