#include <assert.h>
#include <stdio.h>
#include <errno.h>
#include <bool.h>
#include <fibril_synch.h>
#include <str.h>
#include <ctype.h>
#include <macros.h>
#include <str_error.h>
#include <ddf/driver.h>
#include <ddf/log.h>
#include <devman.h>
#include <ipc/devman.h>
#include <ipc/dev_iface.h>
#include <ipc/irc.h>
#include <ipc/ns.h>
#include <ipc/services.h>
#include <sysinfo.h>
#include <ops/hw_res.h>
#include <device/hw_res.h>
#include <ddi.h>
#include <libarch/ddi.h>
#include <pci_dev_iface.h>
#include "pci.h"
Go to the source code of this file.
Defines | |
#define | CONF_ADDR(bus, dev, fn, reg) ((1 << 31) | (bus << 16) | (dev << 11) | (fn << 8) | (reg & ~3)) |
#define | NAME "pciintel" |
#define | PCI_BUS(dnode) ((pci_bus_t *) (dnode)->driver_data) |
Obtain PCI bus soft-state from DDF device node. | |
#define | PCI_BUS_FROM_FUN(fun) ((fun)->busptr) |
Obtain PCI bus soft-state from function soft-state. | |
#define | PCI_FUN(fnode) ((pci_fun_t *) (fnode)->driver_data) |
Obtain PCI function soft-state from DDF function node. | |
Functions | |
int | main (int argc, char *argv[]) |
Main entry point. | |
static int | pci_add_device (ddf_dev_t *) |
void | pci_add_interrupt (pci_fun_t *fun, int irq) |
void | pci_add_range (pci_fun_t *fun, uint64_t range_addr, size_t range_size, bool io) |
bool | pci_alloc_resource_list (pci_fun_t *fun) |
size_t | pci_bar_mask_to_size (uint32_t mask) |
static void | pci_bus_delete (pci_bus_t *bus) |
static pci_bus_t * | pci_bus_new (void) |
void | pci_bus_scan (pci_bus_t *bus, int bus_num) |
Enumerate (recursively) and register the devices connected to a pci bus. | |
void | pci_clean_resource_list (pci_fun_t *fun) |
static void | pci_conf_read (pci_fun_t *fun, int reg, uint8_t *buf, size_t len) |
uint16_t | pci_conf_read_16 (pci_fun_t *fun, int reg) |
uint32_t | pci_conf_read_32 (pci_fun_t *fun, int reg) |
uint8_t | pci_conf_read_8 (pci_fun_t *fun, int reg) |
static void | pci_conf_write (pci_fun_t *fun, int reg, uint8_t *buf, size_t len) |
void | pci_conf_write_16 (pci_fun_t *fun, int reg, uint16_t val) |
void | pci_conf_write_32 (pci_fun_t *fun, int reg, uint32_t val) |
void | pci_conf_write_8 (pci_fun_t *fun, int reg, uint8_t val) |
static int | pci_config_space_read_16 (ddf_fun_t *fun, uint32_t address, uint16_t *data) |
static int | pci_config_space_read_32 (ddf_fun_t *fun, uint32_t address, uint32_t *data) |
static int | pci_config_space_read_8 (ddf_fun_t *fun, uint32_t address, uint8_t *data) |
static int | pci_config_space_write_16 (ddf_fun_t *fun, uint32_t address, uint16_t data) |
static int | pci_config_space_write_32 (ddf_fun_t *fun, uint32_t address, uint32_t data) |
static int | pci_config_space_write_8 (ddf_fun_t *fun, uint32_t address, uint8_t data) |
void | pci_fun_create_match_ids (pci_fun_t *fun) |
char * | pci_fun_create_name (pci_fun_t *fun) |
void | pci_fun_delete (pci_fun_t *fun) |
void | pci_fun_init (pci_fun_t *fun, int bus, int dev, int fn) |
pci_fun_t * | pci_fun_new (pci_bus_t *bus) |
int | pci_read_bar (pci_fun_t *fun, int addr) |
Read the base address register (BAR) of the device and if it contains valid address add it to the devices hw resource list. | |
void | pci_read_bars (pci_fun_t *fun) |
Read the base address registers (BARs) of the function and add the addresses to its HW resource list. | |
void | pci_read_interrupt (pci_fun_t *fun) |
static bool | pciintel_enable_interrupt (ddf_fun_t *fnode) |
static hw_resource_list_t * | pciintel_get_resources (ddf_fun_t *fnode) |
static void | pciintel_init (void) |
Variables | |
static pci_dev_iface_t | pci_dev_ops |
static driver_t | pci_driver |
PCI bus driver structure. | |
static ddf_dev_ops_t | pci_fun_ops |
static driver_ops_t | pci_ops |
PCI bus driver standard operations. | |
static hw_res_ops_t | pciintel_hw_res_ops |
Definition in file pci.c.