FreeBSD kernel amd64 PCI device code
|
#include <sys/cdefs.h>
#include "opt_acpi.h"
#include "opt_iommu.h"
#include "opt_bus.h"
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/endian.h>
#include <sys/eventhandler.h>
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/linker.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/queue.h>
#include <sys/sbuf.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/taskqueue.h>
#include <sys/tree.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_extern.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>
#include <machine/stdarg.h>
#include <sys/pciio.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pci_private.h>
#include <dev/usb/controller/xhcireg.h>
#include <dev/usb/controller/ehcireg.h>
#include <dev/usb/controller/ohcireg.h>
#include <dev/usb/controller/uhcireg.h>
#include <dev/iommu/iommu.h>
#include "pcib_if.h"
#include "pci_if.h"
#include "opt_ddb.h"
Go to the source code of this file.
Data Structures | |
struct | pci_quirk |
struct | vpd_readstate |
Macros | |
#define | PCIR_IS_BIOS(cfg, reg) |
#define | PCI_QUIRK_MAP_REG 1 /* PCI map register in weird place */ |
#define | PCI_QUIRK_DISABLE_MSI 2 /* Neither MSI nor MSI-X work */ |
#define | PCI_QUIRK_ENABLE_MSI_VM 3 /* Older chipset in VM where MSI works */ |
#define | PCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */ |
#define | PCI_QUIRK_DISABLE_MSIX 5 /* MSI-X doesn't work */ |
#define | PCI_QUIRK_MSI_INTX_BUG 6 /* PCIM_CMD_INTxDIS disables MSI */ |
#define | PCI_QUIRK_REALLOC_BAR 7 /* Can't allocate memory at the default address */ |
#define | PCI_MAPMEM 0x01 /* memory map */ |
#define | PCI_MAPMEMP 0x02 /* prefetchable memory map */ |
#define | PCI_MAPPORT 0x04 /* port map */ |
#define | REG(n, w) PCIB_READ_CONFIG(pcib, b, s, f, n, w) |
#define | REG(n, w) PCIB_READ_CONFIG(pcib, b, s, f, n, w) |
#define | REG(n, w) |
#define | REG(n, w) PCIB_READ_CONFIG(pcib, cfg->bus, cfg->slot, cfg->func, n, w) |
#define | WREG(n, v, w) PCIB_WRITE_CONFIG(pcib, cfg->bus, cfg->slot, cfg->func, n, v, w) |
#define | PCI_VPD_TIMEOUT 1000000 |
#define | REG(n, w) PCIB_READ_CONFIG(pcib, busno, s, f, n, w) |
#define | REG(n, w) PCIB_READ_CONFIG(pcib, busno, s, f, n, w) |
#define | WREG(n, v) pci_write_config(dev, pos + (n), (v), 2) |
#define | RREG(n) pci_read_config(dev, pos + (n), 2) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | pci_has_quirk (uint32_t devid, int quirk) |
static pci_addr_t | pci_mapbase (uint64_t mapreg) |
static const char * | pci_maptype (uint64_t mapreg) |
static int | pci_maprange (uint64_t mapreg) |
static pci_addr_t | pci_rombase (uint64_t mapreg) |
static int | pci_romsize (uint64_t testval) |
static void | pci_fixancient (pcicfgregs *cfg) |
static int | pci_printf (pcicfgregs *cfg, const char *fmt,...) |
static int | pci_porten (device_t dev) |
static int | pci_memen (device_t dev) |
static void | pci_assign_interrupt (device_t bus, device_t dev, int force_route) |
static int | pci_add_map (device_t bus, device_t dev, int reg, struct resource_list *rl, int force, int prefetch) |
static int | pci_probe (device_t dev) |
static void | pci_load_vendor_data (void) |
static int | pci_describe_parse_line (char **ptr, int *vendor, int *device, char **desc) |
static char * | pci_describe_device (device_t dev) |
static int | pci_modevent (module_t mod, int what, void *arg) |
static void | pci_hdrtypedata (device_t pcib, int b, int s, int f, pcicfgregs *cfg) |
static void | pci_read_cap (device_t pcib, pcicfgregs *cfg) |
static int | pci_read_vpd_reg (device_t pcib, pcicfgregs *cfg, int reg, uint32_t *data) |
static void | pci_read_vpd (device_t pcib, pcicfgregs *cfg) |
static void | pci_mask_msix (device_t dev, u_int index) |
static void | pci_unmask_msix (device_t dev, u_int index) |
static int | pci_msi_blacklisted (void) |
static int | pci_msix_blacklisted (void) |
static void | pci_resume_msi (device_t dev) |
static void | pci_resume_msix (device_t dev) |
static int | pci_remap_intr_method (device_t bus, device_t dev, u_int irq) |
static void | pci_hint_device_unit (device_t acdev, device_t child, const char *name, int *unitp) |
static int | pci_reset_post (device_t dev, device_t child) |
static int | pci_reset_prepare (device_t dev, device_t child) |
static int | pci_reset_child (device_t dev, device_t child, int flags) |
static int | pci_get_id_method (device_t dev, device_t child, enum pci_id_type type, uintptr_t *rid) |
static struct pci_devinfo * | pci_fill_devinfo (device_t pcib, device_t bus, int d, int b, int s, int f, uint16_t vid, uint16_t did) |
DEFINE_CLASS_0 (pci, pci_driver, pci_methods, sizeof(struct pci_softc)) | |
EARLY_DRIVER_MODULE (pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL, BUS_PASS_BUS) | |
MODULE_VERSION (pci, 1) | |
SYSCTL_NODE (_hw, OID_AUTO, pci, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "PCI bus tuning parameters") | |
SYSCTL_INT (_hw_pci, OID_AUTO, enable_io_modes, CTLFLAG_RWTUN, &pci_enable_io_modes, 1, "Enable I/O and memory bits in the config register. Some BIOSes do not" " enable these bits correctly. We'd like to do this all the time, but" " there are some peripherals that this causes problems with.") | |
SYSCTL_INT (_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RWTUN, &pci_do_realloc_bars, 0, "Attempt to allocate a new range for any BARs whose original " "firmware-assigned ranges fail to allocate during the initial device scan.") | |
SYSCTL_INT (_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RWTUN, &pci_do_power_nodriver, 0, "Place a function into D3 state when no driver attaches to it. 0 means" " disable. 1 means conservatively place devices into D3 state. 2 means" " aggressively place devices into D3 state. 3 means put absolutely" " everything in D3 state.") | |
SYSCTL_INT (_hw_pci, OID_AUTO, do_power_resume, CTLFLAG_RWTUN, &pci_do_power_resume, 1, "Transition from D3 -> D0 on resume.") | |
SYSCTL_INT (_hw_pci, OID_AUTO, do_power_suspend, CTLFLAG_RWTUN, &pci_do_power_suspend, 1, "Transition from D0 -> D3 on suspend.") | |
SYSCTL_INT (_hw_pci, OID_AUTO, enable_msi, CTLFLAG_RWTUN, &pci_do_msi, 1, "Enable support for MSI interrupts") | |
SYSCTL_INT (_hw_pci, OID_AUTO, enable_msix, CTLFLAG_RWTUN, &pci_do_msix, 1, "Enable support for MSI-X interrupts") | |
SYSCTL_INT (_hw_pci, OID_AUTO, msix_rewrite_table, CTLFLAG_RWTUN, &pci_msix_rewrite_table, 0, "Rewrite entire MSI-X table when updating MSI-X entries") | |
SYSCTL_INT (_hw_pci, OID_AUTO, honor_msi_blacklist, CTLFLAG_RDTUN, &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI/MSI-X") | |
SYSCTL_INT (_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RDTUN, &pci_usb_takeover, 1, "Enable early takeover of USB controllers. Disable this if you depend on" " BIOS emulation of USB devices, that is you use USB devices (like" " keyboard or mouse) but do not load USB drivers") | |
SYSCTL_INT (_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, "Ignore firmware-assigned resources for BARs.") | |
SYSCTL_INT (_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, 0, "Enable support for PCIe Alternative RID Interpretation") | |
SYSCTL_INT (_hw_pci, OID_AUTO, enable_aspm, CTLFLAG_RDTUN, &pci_enable_aspm, 0, "Enable support for PCIe Active State Power Management") | |
SYSCTL_INT (_hw_pci, OID_AUTO, clear_aer_on_attach, CTLFLAG_RWTUN, &pci_clear_aer_on_attach, 0, "Clear port and device AER state on driver attach") | |
device_t | pci_find_bsf (uint8_t bus, uint8_t slot, uint8_t func) |
device_t | pci_find_dbsf (uint32_t domain, uint8_t bus, uint8_t slot, uint8_t func) |
device_t | pci_find_device (uint16_t vendor, uint16_t device) |
device_t | pci_find_class (uint8_t class, uint8_t subclass) |
device_t | pci_find_class_from (uint8_t class, uint8_t subclass, device_t from) |
int | pci_mapsize (uint64_t testval) |
struct pci_devinfo * | pci_read_device (device_t pcib, device_t bus, int d, int b, int s, int f) |
struct pci_devinfo * | pci_alloc_devinfo_method (device_t dev) |
static void | pci_ea_fill_info (device_t pcib, pcicfgregs *cfg) |
static int | vpd_nextbyte (struct vpd_readstate *vrs, uint8_t *data) |
int | pci_get_vpd_ident_method (device_t dev, device_t child, const char **identptr) |
int | pci_get_vpd_readonly_method (device_t dev, device_t child, const char *kw, const char **vptr) |
struct pcicfg_vpd * | pci_fetch_vpd_list (device_t dev) |
int | pci_find_htcap_method (device_t dev, device_t child, int capability, int *capreg) |
int | pci_find_next_htcap_method (device_t dev, device_t child, int capability, int start, int *capreg) |
int | pci_find_cap_method (device_t dev, device_t child, int capability, int *capreg) |
int | pci_find_next_cap_method (device_t dev, device_t child, int capability, int start, int *capreg) |
int | pci_find_extcap_method (device_t dev, device_t child, int capability, int *capreg) |
int | pci_find_next_extcap_method (device_t dev, device_t child, int capability, int start, int *capreg) |
static void | pci_write_msix_entry (device_t dev, u_int index, uint64_t address, uint32_t data) |
void | pci_enable_msix_method (device_t dev, device_t child, u_int index, uint64_t address, uint32_t data) |
int | pci_pending_msix (device_t dev, u_int index) |
int | pci_alloc_msix_method (device_t dev, device_t child, int *count) |
int | pci_remap_msix_method (device_t dev, device_t child, int count, const u_int *vectors) |
static int | pci_release_msix (device_t dev, device_t child) |
int | pci_msix_count_method (device_t dev, device_t child) |
int | pci_msix_pba_bar_method (device_t dev, device_t child) |
int | pci_msix_table_bar_method (device_t dev, device_t child) |
void | pci_ht_map_msi (device_t dev, uint64_t addr) |
int | pci_get_relaxed_ordering_enabled (device_t dev) |
int | pci_get_max_payload (device_t dev) |
int | pci_get_max_read_req (device_t dev) |
int | pci_set_max_read_req (device_t dev, int size) |
uint32_t | pcie_read_config (device_t dev, int reg, int width) |
void | pcie_write_config (device_t dev, int reg, uint32_t value, int width) |
uint32_t | pcie_adjust_config (device_t dev, int reg, uint32_t mask, uint32_t value, int width) |
void | pci_enable_msi_method (device_t dev, device_t child, uint64_t address, uint16_t data) |
void | pci_disable_msi_method (device_t dev, device_t child) |
int | pci_msi_device_blacklisted (device_t dev) |
int | pci_msix_device_blacklisted (device_t dev) |
int | pci_alloc_msi_method (device_t dev, device_t child, int *count) |
int | pci_release_msi_method (device_t dev, device_t child) |
int | pci_msi_count_method (device_t dev, device_t child) |
int | pci_freecfg (struct pci_devinfo *dinfo) |
int | pci_set_powerstate_method (device_t dev, device_t child, int state) |
int | pci_get_powerstate_method (device_t dev, device_t child) |
static __inline void | pci_set_command_bit (device_t dev, device_t child, uint16_t bit) |
static __inline void | pci_clear_command_bit (device_t dev, device_t child, uint16_t bit) |
int | pci_enable_busmaster_method (device_t dev, device_t child) |
int | pci_disable_busmaster_method (device_t dev, device_t child) |
int | pci_enable_io_method (device_t dev, device_t child, int space) |
int | pci_disable_io_method (device_t dev, device_t child, int space) |
void | pci_print_verbose (struct pci_devinfo *dinfo) |
void | pci_read_bar (device_t dev, int reg, pci_addr_t *mapp, pci_addr_t *testvalp, int *bar64) |
static void | pci_write_bar (device_t dev, struct pci_map *pm, pci_addr_t base) |
struct pci_map * | pci_find_bar (device_t dev, int reg) |
int | pci_bar_enabled (device_t dev, struct pci_map *pm) |
struct pci_map * | pci_add_bar (device_t dev, int reg, pci_addr_t value, pci_addr_t size) |
static void | pci_restore_bars (device_t dev) |
static void | pci_ata_maps (device_t bus, device_t dev, struct resource_list *rl, int force, uint32_t prefetchmask) |
static void | ohci_early_takeover (device_t self) |
static void | uhci_early_takeover (device_t self) |
static void | ehci_early_takeover (device_t self) |
static void | xhci_early_takeover (device_t self) |
static int | pci_ea_bei_to_rid (device_t dev, int bei) |
int | pci_ea_is_enabled (device_t dev, int rid) |
void | pci_add_resources_ea (device_t bus, device_t dev, int alloc_iov) |
void | pci_add_resources (device_t bus, device_t dev, int force, uint32_t prefetchmask) |
static struct pci_devinfo * | pci_identify_function (device_t pcib, device_t dev, int domain, int busno, int slot, int func) |
void | pci_add_children (device_t dev, int domain, int busno) |
int | pci_rescan_method (device_t dev) |
static void | pcie_setup_mps (device_t dev) |
static void | pci_add_child_clear_aer (device_t dev, struct pci_devinfo *dinfo) |
void | pci_add_child (device_t bus, struct pci_devinfo *dinfo) |
void | pci_child_added_method (device_t dev, device_t child) |
int | pci_attach_common (device_t dev) |
int | pci_attach (device_t dev) |
int | pci_detach (device_t dev) |
static void | pci_set_power_child (device_t dev, device_t child, int state) |
int | pci_suspend_child (device_t dev, device_t child) |
int | pci_resume_child (device_t dev, device_t child) |
int | pci_resume (device_t dev) |
void | pci_driver_added (device_t dev, driver_t *driver) |
int | pci_setup_intr (device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, void **cookiep) |
int | pci_teardown_intr (device_t dev, device_t child, struct resource *irq, void *cookie) |
int | pci_print_child (device_t dev, device_t child) |
void | pci_probe_nomatch (device_t dev, device_t child) |
void | pci_child_detached (device_t dev, device_t child) |
int | pci_read_ivar (device_t dev, device_t child, int which, uintptr_t *result) |
int | pci_write_ivar (device_t dev, device_t child, int which, uintptr_t value) |
struct resource * | pci_reserve_map (device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int num, u_int flags) |
struct resource * | pci_alloc_multi_resource (device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_long num, u_int flags) |
struct resource * | pci_alloc_resource (device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) |
int | pci_release_resource (device_t dev, device_t child, int type, int rid, struct resource *r) |
int | pci_activate_resource (device_t dev, device_t child, int type, int rid, struct resource *r) |
int | pci_deactivate_resource (device_t dev, device_t child, int type, int rid, struct resource *r) |
void | pci_child_deleted (device_t dev, device_t child) |
void | pci_delete_resource (device_t dev, device_t child, int type, int rid) |
struct resource_list * | pci_get_resource_list (device_t dev, device_t child) |
bus_dma_tag_t | pci_get_dma_tag (device_t bus, device_t dev) |
uint32_t | pci_read_config_method (device_t dev, device_t child, int reg, int width) |
void | pci_write_config_method (device_t dev, device_t child, int reg, uint32_t val, int width) |
int | pci_child_location_method (device_t dev, device_t child, struct sbuf *sb) |
int | pci_child_pnpinfo_method (device_t dev, device_t child, struct sbuf *sb) |
int | pci_get_device_path_method (device_t bus, device_t child, const char *locator, struct sbuf *sb) |
int | pci_assign_interrupt_method (device_t dev, device_t child) |
static void | pci_lookup (void *arg, const char *name, device_t *dev) |
static void | pci_cfg_restore_pcie (device_t dev, struct pci_devinfo *dinfo) |
static void | pci_cfg_restore_pcix (device_t dev, struct pci_devinfo *dinfo) |
void | pci_cfg_restore (device_t dev, struct pci_devinfo *dinfo) |
static void | pci_cfg_save_pcie (device_t dev, struct pci_devinfo *dinfo) |
static void | pci_cfg_save_pcix (device_t dev, struct pci_devinfo *dinfo) |
void | pci_cfg_save (device_t dev, struct pci_devinfo *dinfo, int setstate) |
void | pci_save_state (device_t dev) |
void | pci_restore_state (device_t dev) |
device_t | pci_find_pcie_root_port (device_t dev) |
bool | pcie_wait_for_pending_transactions (device_t dev, u_int max_delay) |
int | pcie_get_max_completion_timeout (device_t dev) |
void | pcie_apei_error (device_t dev, int sev, uint8_t *aerp) |
bool | pcie_flr (device_t dev, u_int max_delay, bool force) |
int | pci_power_reset (device_t dev) |
int | pcie_link_reset (device_t port, int pcie_location) |
const struct pci_device_table * | pci_match_device (device_t child, const struct pci_device_table *id, size_t nelt) |
static void | pci_print_faulted_dev_name (const struct pci_devinfo *dinfo) |
void | pci_print_faulted_dev (void) |
Variables | |
static device_method_t | pci_methods [] |
static devclass_t | pci_devclass |
static char * | pci_vendordata |
static size_t | pci_vendordata_size |
static const struct pci_quirk | pci_quirks [] |
struct devlist | pci_devq |
uint32_t | pci_generation |
uint32_t | pci_numdevs = 0 |
static int | pcie_chipset |
static int | pcix_chipset |
static int | pci_enable_io_modes = 1 |
static int | pci_do_realloc_bars = 1 |
static int | pci_do_power_nodriver = 0 |
int | pci_do_power_resume = 1 |
int | pci_do_power_suspend = 1 |
static int | pci_do_msi = 1 |
static int | pci_do_msix = 1 |
static int | pci_msix_rewrite_table = 0 |
static int | pci_honor_msi_blacklist = 1 |
static int | pci_usb_takeover = 0 |
static int | pci_clear_bars |
static int | pci_enable_ari = 1 |
int | pci_enable_aspm = 1 |
static int | pci_clear_aer_on_attach = 0 |
struct { | |
int class | |
int subclass | |
int report | |
const char * desc | |
} | pci_nomatch_tab [] |
#define PCI_QUIRK_DISABLE_MSI 2 /* Neither MSI nor MSI-X work */ |
#define PCI_QUIRK_ENABLE_MSI_VM 3 /* Older chipset in VM where MSI works */ |
#define PCI_QUIRK_MAP_REG 1 /* PCI map register in weird place */ |
#define PCI_QUIRK_MSI_INTX_BUG 6 /* PCIM_CMD_INTxDIS disables MSI */ |
#define PCI_QUIRK_REALLOC_BAR 7 /* Can't allocate memory at the default address */ |
#define PCIR_IS_BIOS | ( | cfg, | |
reg | |||
) |
#define REG | ( | n, | |
w | |||
) | PCIB_READ_CONFIG(pcib, b, s, f, n, w) |
#define REG | ( | n, | |
w | |||
) | PCIB_READ_CONFIG(pcib, b, s, f, n, w) |
#define REG | ( | n, | |
w | |||
) |
#define REG | ( | n, | |
w | |||
) | PCIB_READ_CONFIG(pcib, busno, s, f, n, w) |
#define REG | ( | n, | |
w | |||
) | PCIB_READ_CONFIG(pcib, busno, s, f, n, w) |
#define RREG | ( | n | ) | pci_read_config(dev, pos + (n), 2) |
#define WREG | ( | n, | |
v | |||
) | pci_write_config(dev, pos + (n), (v), 2) |
__FBSDID | ( | "$FreeBSD$" | ) |
DEFINE_CLASS_0 | ( | pci | , |
pci_driver | , | ||
pci_methods | , | ||
sizeof(struct pci_softc) | |||
) |
EARLY_DRIVER_MODULE | ( | pci | , |
pcib | , | ||
pci_driver | , | ||
pci_devclass | , | ||
pci_modevent | , | ||
NULL | , | ||
BUS_PASS_BUS | |||
) |
|
static |
Definition at line 3593 of file pci.c.
Referenced by pci_add_resources().
MODULE_VERSION | ( | pci | , |
1 | |||
) |
|
static |
Definition at line 3532 of file pci.c.
Referenced by pci_add_resources().
int pci_activate_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Definition at line 5694 of file pci.c.
References child, dev, pci_find_bar(), pci_write_bar(), PCIM_BIOS_ENABLE, PCIR_IS_BIOS, rid, and type.
struct pci_map * pci_add_bar | ( | device_t | dev, |
int | reg, | ||
pci_addr_t | value, | ||
pci_addr_t | size | ||
) |
Definition at line 3203 of file pci.c.
References dev, pci_map::pm_reg, pci_map::pm_size, pci_map::pm_value, reg, and value.
Referenced by pci_add_map(), pci_iov_add_bars(), and pci_reserve_map().
void pci_add_child | ( | device_t | bus, |
struct pci_devinfo * | dinfo | ||
) |
Definition at line 4431 of file pci.c.
References bus, dev, pci_add_child_clear_aer(), pci_add_resources(), pci_cfg_restore(), pci_cfg_save(), pci_clear_aer_on_attach, pci_print_verbose(), and pcie_setup_mps().
Referenced by pci_identify_function().
|
static |
Definition at line 4356 of file pci.c.
References dev, pci_printf(), PCIEM_CTL_COR_ENABLE, PCIEM_CTL_FER_ENABLE, PCIEM_CTL_NFER_ENABLE, PCIEM_CTL_URR_ENABLE, PCIEM_ROOT_CTL_SERR_CORR, PCIEM_ROOT_CTL_SERR_FATAL, PCIEM_ROOT_CTL_SERR_NONFATAL, PCIEM_TYPE_ROOT_PORT, PCIER_DEVICE_CTL, PCIER_ROOT_CTL, PCIM_AER_COR_ADVISORY_NF_ERROR, PCIM_AER_COR_BAD_DLLP, PCIM_AER_COR_BAD_TLP, PCIM_AER_COR_HEADER_LOG_OVFLOW, PCIM_AER_COR_INTERNAL_ERROR, PCIM_AER_COR_RECEIVER_ERROR, PCIM_AER_COR_REPLAY_ROLLOVER, PCIM_AER_COR_REPLAY_TIMEOUT, PCIM_AER_UC_ACS_VIOLATION, PCIM_AER_UC_ATOMIC_EGRESS_BLK, PCIM_AER_UC_COMPLETER_ABORT, PCIM_AER_UC_COMPLETION_TIMEOUT, PCIM_AER_UC_DL_PROTOCOL_ERROR, PCIM_AER_UC_ECRC_ERROR, PCIM_AER_UC_FC_PROTOCOL_ERROR, PCIM_AER_UC_INTERNAL_ERROR, PCIM_AER_UC_MALFORMED_TLP, PCIM_AER_UC_MC_BLOCKED_TLP, PCIM_AER_UC_POISONED_TLP, PCIM_AER_UC_RECEIVER_OVERFLOW, PCIM_AER_UC_SURPRISE_LINK_DOWN, PCIM_AER_UC_TLP_PREFIX_BLOCKED, PCIM_AER_UC_TRAINING_ERROR, PCIM_AER_UC_UNEXPECTED_COMPLETION, PCIM_AER_UC_UNSUPPORTED_REQUEST, PCIR_AER_COR_MASK, PCIR_AER_COR_STATUS, PCIR_AER_UC_MASK, PCIR_AER_UC_STATUS, and PCIZ_AER.
Referenced by pci_add_child().
void pci_add_children | ( | device_t | dev, |
int | domain, | ||
int | busno | ||
) |
Definition at line 4144 of file pci.c.
References dev, maxslots, pci_enable_ari, pci_identify_function(), PCI_MAXHDRTYPE, pcib, PCIM_HDRTYPE, PCIM_MFDEV, PCIR_HDRTYPE, PCIR_VENDOR, PCIV_INVALID, and REG.
Referenced by pci_attach().
|
static |
Definition at line 3252 of file pci.c.
References bus, count, dev, pci_add_bar(), PCI_BAR_IO, PCI_BAR_MEM, pci_clear_bars, pci_do_realloc_bars, pci_enable_io_modes, pci_find_bar(), pci_has_quirk(), pci_mapbase(), pci_maprange(), pci_mapsize(), pci_maptype(), pci_memen(), pci_porten(), PCI_QUIRK_REALLOC_BAR, pci_read_bar(), pci_write_bar(), PCIM_BAR_IO_RESERVED, PCIM_BAR_MEM_PREFETCH, PCIM_CMD_MEMEN, PCIM_CMD_PORTEN, PCIR_COMMAND, pci_map::pm_value, reg, start, and type.
Referenced by pci_add_resources(), and pci_ata_maps().
void pci_add_resources | ( | device_t | bus, |
device_t | dev, | ||
int | force, | ||
uint32_t | prefetchmask | ||
) |
Definition at line 4038 of file pci.c.
References pci_quirk::arg1, bus, dev, pcicfg::device, pci_quirk::devid, ehci_early_takeover(), pcicfg::intline, pcicfg::intpin, pcicfg::nummaps, ohci_early_takeover(), pci_add_map(), pci_add_resources_ea(), pci_assign_interrupt(), pci_ata_maps(), pci_ea_is_enabled(), PCI_QUIRK_MAP_REG, PCI_QUIRK_UNMAP_REG, pci_quirks, pci_usb_takeover, PCIC_SERIALBUS, PCIC_STORAGE, PCIP_SERIALBUS_USB_EHCI, PCIP_SERIALBUS_USB_OHCI, PCIP_SERIALBUS_USB_UHCI, PCIP_SERIALBUS_USB_XHCI, PCIP_STORAGE_IDE_MASTERDEV, PCIR_BAR, PCIS_SERIALBUS_USB, PCIS_STORAGE_IDE, pci_quirk::type, uhci_early_takeover(), pcicfg::vendor, and xhci_early_takeover().
Referenced by pci_add_child().
void pci_add_resources_ea | ( | device_t | bus, |
device_t | dev, | ||
int | alloc_iov | ||
) |
Definition at line 3920 of file pci.c.
References bus, count, dev, pci_ea_entry::eae_base, pci_ea_entry::eae_bei, pci_ea_entry::eae_cfg_offset, pci_ea_entry::eae_flags, pci_ea_entry::eae_max_offset, pcicfg_iov::iov_num_vfs, pci_ea_bei_to_rid(), PCIM_EA_BEI_BAR_0, PCIM_EA_BEI_BAR_5, PCIM_EA_BEI_ROM, PCIM_EA_BEI_VF_BAR_0, PCIM_EA_BEI_VF_BAR_5, PCIM_EA_ENABLE, PCIM_EA_P_IO, PCIM_EA_P_MEM, PCIM_EA_P_MEM_PREFETCH, PCIM_EA_P_VF_MEM, PCIM_EA_P_VF_MEM_PREFETCH, PCIM_EA_PP, PCIM_EA_PP_OFFSET, rid, start, and type.
Referenced by pci_add_resources(), and pci_iov_setup_bars().
int pci_alloc_msi_method | ( | device_t | dev, |
device_t | child, | ||
int * | count | ||
) |
Definition at line 2587 of file pci.c.
References child, count, dev, irqs, pcicfg::msi, pcicfg_msi::msi_alloc, pcicfg_msi::msi_ctrl, pcicfg_msi::msi_handlers, pcicfg_msi::msi_location, pcicfg_msi::msi_msgnum, pcicfg::msix, pcicfg_msix::msix_alloc, pci_do_msi, pci_msi_blacklisted(), and PCIR_MSI_CTRL.
int pci_alloc_msix_method | ( | device_t | dev, |
device_t | child, | ||
int * | count | ||
) |
Definition at line 1808 of file pci.c.
References child, count, dev, irq, pcicfg::msi, pcicfg_msi::msi_alloc, pcicfg::msix, pcicfg_msix::msix_alloc, pcicfg_msix::msix_ctrl, pcicfg_msix::msix_location, pcicfg_msix::msix_msgnum, pcicfg_msix::msix_pba_bar, pcicfg_msix::msix_pba_res, pcicfg_msix::msix_table, pcicfg_msix::msix_table_bar, pcicfg_msix::msix_table_len, pcicfg_msix::msix_table_res, pcicfg_msix::msix_vectors, msix_table_entry::mte_vector, msix_vector::mv_irq, pci_do_msix, pci_mask_msix(), pci_msix_blacklisted(), PCIM_MSIXCTRL_MSIX_ENABLE, and PCIR_MSIX_CTRL.
struct resource * pci_alloc_multi_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int * | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count, | ||
u_long | num, | ||
u_int | flags | ||
) |
Definition at line 5535 of file pci.c.
References child, count, dev, pcicfg::hdrtype, pcicfg::intline, pcicfg::intpin, pcicfg::msi, pcicfg_msi::msi_alloc, pcicfg::msix, pcicfg_msix::msix_alloc, pci_assign_interrupt(), pci_reserve_map(), PCIM_HDRTYPE_BRIDGE, PCIR_IOBASEL_1, PCIR_MEMBASE_1, PCIR_PMBASEL_1, rid, start, and type.
Referenced by pci_alloc_resource(), and pci_iov_alloc_bar().
struct resource * pci_alloc_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int * | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count, | ||
u_int | flags | ||
) |
|
static |
Definition at line 3483 of file pci.c.
References bus, pcicfg::bus, dev, pcicfg::domain, pcicfg::intline, pcicfg::intpin, irq, PCIR_INTLINE, and pcicfg::slot.
Referenced by pci_add_resources(), and pci_alloc_multi_resource().
int pci_assign_interrupt_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 5946 of file pci.c.
References child, dev, and pcicfg::intpin.
|
static |
Definition at line 3429 of file pci.c.
References bus, dev, pci_add_map(), pci_mapbase(), PCIP_STORAGE_IDE_MODEPRIM, PCIP_STORAGE_IDE_MODESEC, PCIR_BAR, PCIR_PROGIF, rid, and type.
Referenced by pci_add_resources().
int pci_attach | ( | device_t | dev | ) |
Definition at line 4496 of file pci.c.
References dev, pci_add_children(), and pci_attach_common().
int pci_attach_common | ( | device_t | dev | ) |
Definition at line 4468 of file pci.c.
References dev, rid, and pci_softc::sc_dma_tag.
Referenced by pci_attach().
int pci_bar_enabled | ( | device_t | dev, |
struct pci_map * | pm | ||
) |
Definition at line 3176 of file pci.c.
References dev, pcicfg_iov::iov_pf, pcicfg_iov::iov_pos, PCI_BAR_MEM, PCICFG_VF, PCIM_BIOS_ENABLE, PCIM_CMD_MEMEN, PCIM_CMD_PORTEN, PCIM_SRIOV_VF_MSE, PCIR_COMMAND, PCIR_IS_BIOS, PCIR_SRIOV_CTL, pci_map::pm_reg, and pci_map::pm_value.
Referenced by pci_bar_mmap(), and pci_ioctl().
void pci_cfg_restore | ( | device_t | dev, |
struct pci_devinfo * | dinfo | ||
) |
Restore the config register state. The state must be previously saved with pci_cfg_save. However, the pci bus driver takes care of that. This function will also return the device to PCI_POWERSTATE_D0 if it is currently in a lower power mode.
Definition at line 6075 of file pci.c.
References dev, pci_cfg_restore_pcie(), pci_cfg_restore_pcix(), pci_iov_cfg_restore(), pci_restore_bars(), pci_resume_msi(), pci_resume_msix(), PCIM_HDRTYPE, PCIM_HDRTYPE_BRIDGE, PCIM_HDRTYPE_CARDBUS, PCIM_HDRTYPE_NORMAL, PCIR_BRIDGECTL_1, PCIR_BRIDGECTL_2, PCIR_CACHELNSZ, PCIR_COMMAND, PCIR_INTLINE, PCIR_INTPIN, PCIR_LATTIMER, PCIR_MAXLAT, PCIR_MINGNT, PCIR_PRIBUS_1, PCIR_PRIBUS_2, PCIR_PROGIF, PCIR_REVID, PCIR_SECBUS_1, PCIR_SECBUS_2, PCIR_SECLAT_1, PCIR_SECLAT_2, PCIR_SUBBUS_1, and PCIR_SUBBUS_2.
Referenced by pci_add_child(), pci_driver_added(), pci_restore_state(), and pci_resume_child().
|
static |
Definition at line 6032 of file pci.c.
References pcicfg_pcie::pcie_device_ctl, pcicfg_pcie::pcie_device_ctl2, pcicfg_pcie::pcie_flags, pcicfg_pcie::pcie_link_ctl, pcicfg_pcie::pcie_link_ctl2, pcicfg_pcie::pcie_location, pcicfg_pcie::pcie_root_ctl, pcicfg_pcie::pcie_slot_ctl, pcicfg_pcie::pcie_slot_ctl2, pcicfg_pcie::pcie_type, PCIEM_FLAGS_SLOT, PCIEM_FLAGS_VERSION, PCIEM_TYPE_DOWNSTREAM_PORT, PCIEM_TYPE_ENDPOINT, PCIEM_TYPE_LEGACY_ENDPOINT, PCIEM_TYPE_ROOT_EC, PCIEM_TYPE_ROOT_PORT, PCIER_DEVICE_CTL, PCIER_DEVICE_CTL2, PCIER_LINK_CTL, PCIER_LINK_CTL2, PCIER_ROOT_CTL, PCIER_SLOT_CTL, PCIER_SLOT_CTL2, and WREG.
Referenced by pci_cfg_restore().
|
static |
Definition at line 6068 of file pci.c.
References dev, and PCIXR_COMMAND.
Referenced by pci_cfg_restore().
void pci_cfg_save | ( | device_t | dev, |
struct pci_devinfo * | dinfo, | ||
int | setstate | ||
) |
Save the config register state. Optionally set the power state to D3 if the third argument is non-zero.
Definition at line 6195 of file pci.c.
References dev, pci_cfg_save_pcie(), pci_cfg_save_pcix(), pci_do_power_nodriver, pci_iov_cfg_save(), PCIC_BASEPERIPH, PCIC_DISPLAY, PCIC_MEMORY, PCIC_STORAGE, PCIM_HDRTYPE, PCIM_HDRTYPE_BRIDGE, PCIM_HDRTYPE_CARDBUS, PCIM_HDRTYPE_NORMAL, PCIR_BRIDGECTL_1, PCIR_BRIDGECTL_2, PCIR_CACHELNSZ, PCIR_CLASS, PCIR_COMMAND, PCIR_DEVICE, PCIR_INTLINE, PCIR_INTPIN, PCIR_LATTIMER, PCIR_MAXLAT, PCIR_MINGNT, PCIR_PRIBUS_1, PCIR_PRIBUS_2, PCIR_PROGIF, PCIR_REVID, PCIR_SECBUS_1, PCIR_SECBUS_2, PCIR_SECLAT_1, PCIR_SECLAT_2, PCIR_SUBBUS_1, PCIR_SUBBUS_2, PCIR_SUBCLASS, PCIR_SUBDEV_0, PCIR_SUBDEV_2, PCIR_SUBVEND_0, PCIR_SUBVEND_2, and PCIR_VENDOR.
Referenced by pci_add_child(), pci_child_detached(), pci_probe_nomatch(), pci_resume_child(), pci_save_state(), and pci_suspend_child().
|
static |
Definition at line 6150 of file pci.c.
References pcicfg_pcie::pcie_device_ctl, pcicfg_pcie::pcie_device_ctl2, pcicfg_pcie::pcie_flags, pcicfg_pcie::pcie_link_ctl, pcicfg_pcie::pcie_link_ctl2, pcicfg_pcie::pcie_location, pcicfg_pcie::pcie_root_ctl, pcicfg_pcie::pcie_slot_ctl, pcicfg_pcie::pcie_slot_ctl2, pcicfg_pcie::pcie_type, PCIEM_FLAGS_SLOT, PCIEM_FLAGS_VERSION, PCIEM_TYPE_DOWNSTREAM_PORT, PCIEM_TYPE_ENDPOINT, PCIEM_TYPE_LEGACY_ENDPOINT, PCIEM_TYPE_ROOT_EC, PCIEM_TYPE_ROOT_PORT, PCIER_DEVICE_CTL, PCIER_DEVICE_CTL2, PCIER_FLAGS, PCIER_LINK_CTL, PCIER_LINK_CTL2, PCIER_ROOT_CTL, PCIER_SLOT_CTL, PCIER_SLOT_CTL2, and RREG.
Referenced by pci_cfg_save().
|
static |
Definition at line 6188 of file pci.c.
References dev, and PCIXR_COMMAND.
Referenced by pci_cfg_save().
void pci_child_deleted | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 5743 of file pci.c.
References child, dev, pci_freecfg(), pci_printf(), PCIM_CMD_MEMEN, PCIM_CMD_PORTEN, and PCIR_COMMAND.
void pci_child_detached | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 5084 of file pci.c.
References child, dev, pci_cfg_save(), and pci_printf().
Referenced by pci_driver_added().
int pci_child_location_method | ( | device_t | dev, |
device_t | child, | ||
struct sbuf * | sb | ||
) |
int pci_child_pnpinfo_method | ( | device_t | dev, |
device_t | child, | ||
struct sbuf * | sb | ||
) |
Definition at line 5913 of file pci.c.
References pcicfg::baseclass, child, pcicfg::device, pcicfg::progif, pcicfg::subclass, pcicfg::subdevice, pcicfg::subvendor, and pcicfg::vendor.
|
static |
Definition at line 2928 of file pci.c.
References child, dev, and PCIR_COMMAND.
Referenced by pci_disable_busmaster_method(), pci_disable_io_method(), and pci_setup_intr().
int pci_deactivate_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Definition at line 5722 of file pci.c.
References child, dev, pci_find_bar(), pci_write_bar(), PCIR_IS_BIOS, rid, and type.
void pci_delete_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid | ||
) |
Definition at line 5785 of file pci.c.
References child, dev, rid, and type.
Referenced by pci_iov_config(), and pci_iov_delete_iov_children().
|
static |
Definition at line 5195 of file pci.c.
References desc, dev, pci_describe_parse_line(), and pci_vendordata.
Referenced by pci_probe_nomatch().
|
static |
Definition at line 5149 of file pci.c.
References desc, pci_vendordata, and pci_vendordata_size.
Referenced by pci_describe_device().
int pci_disable_busmaster_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2945 of file pci.c.
References child, dev, pci_clear_command_bit(), and PCIM_CMD_BUSMASTEREN.
int pci_disable_io_method | ( | device_t | dev, |
device_t | child, | ||
int | space | ||
) |
Definition at line 2971 of file pci.c.
References child, dev, pci_clear_command_bit(), PCIM_CMD_MEMEN, PCIM_CMD_PORTEN, and space.
void pci_disable_msi_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2375 of file pci.c.
References child, pcicfg_msi::msi_ctrl, pcicfg_msi::msi_location, pci_ht_map_msi(), and PCIR_MSI_CTRL.
void pci_driver_added | ( | device_t | dev, |
driver_t * | driver | ||
) |
Definition at line 4716 of file pci.c.
References child, dev, pci_cfg_restore(), pci_child_detached(), pci_print_verbose(), and pci_printf().
|
static |
Definition at line 3868 of file pci.c.
References dev, pcicfg_iov::iov_pos, PCIM_EA_BEI_BAR_0, PCIM_EA_BEI_BAR_5, PCIM_EA_BEI_ROM, PCIM_EA_BEI_VF_BAR_0, PCIM_EA_BEI_VF_BAR_5, PCIR_BAR, PCIR_BIOS, and PCIR_SRIOV_BAR.
Referenced by pci_add_resources_ea(), and pci_ea_is_enabled().
|
static |
Definition at line 769 of file pci.c.
References pcicfg::device, pcicfg::ea, pcicfg_ea::ea_location, pci_ea_entry::eae_base, pci_ea_entry::eae_bei, pci_ea_entry::eae_cfg_offset, pci_ea_entry::eae_flags, pci_ea_entry::eae_max_offset, pcicfg::hdrtype, PCIM_EA_BEI, PCIM_EA_BEI_OFFSET, PCIM_EA_ES, PCIM_EA_FIELD_MASK, PCIM_EA_IS_64, PCIM_EA_NUM_ENT_MASK, PCIM_HDRTYPE, PCIM_HDRTYPE_BRIDGE, PCIR_EA_FIRST_ENT, PCIR_EA_NUM_ENT, REG, val, and pcicfg::vendor.
Referenced by pci_read_cap().
int pci_ea_is_enabled | ( | device_t | dev, |
int | rid | ||
) |
Definition at line 3904 of file pci.c.
References dev, pci_ea_entry::eae_bei, pci_ea_entry::eae_flags, pci_ea_bei_to_rid(), PCIM_EA_ENABLE, and rid.
Referenced by pci_add_resources(), pci_iov_setup_bars(), and pci_reserve_map().
int pci_enable_busmaster_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2938 of file pci.c.
References child, dev, pci_set_command_bit(), and PCIM_CMD_BUSMASTEREN.
int pci_enable_io_method | ( | device_t | dev, |
device_t | child, | ||
int | space | ||
) |
Definition at line 2952 of file pci.c.
References child, dev, pci_set_command_bit(), PCIM_CMD_MEMEN, PCIM_CMD_PORTEN, and space.
void pci_enable_msi_method | ( | device_t | dev, |
device_t | child, | ||
uint64_t | address, | ||
uint16_t | data | ||
) |
Definition at line 2347 of file pci.c.
References address, child, data, pcicfg_msi::msi_ctrl, pcicfg_msi::msi_location, pci_ht_map_msi(), PCIM_MSICTRL_64BIT, PCIM_MSICTRL_MSI_ENABLE, PCIR_MSI_ADDR, PCIR_MSI_ADDR_HIGH, PCIR_MSI_CTRL, PCIR_MSI_DATA, and PCIR_MSI_DATA_64BIT.
void pci_enable_msix_method | ( | device_t | dev, |
device_t | child, | ||
u_int | index, | ||
uint64_t | address, | ||
uint32_t | data | ||
) |
Definition at line 1690 of file pci.c.
References address, child, data, index, pcicfg_msix::msix_ctrl, pcicfg_msix::msix_location, pci_ht_map_msi(), pci_msix_rewrite_table, pci_resume_msix(), pci_write_msix_entry(), PCIM_MSIXCTRL_MSIX_ENABLE, and PCIR_MSIX_CTRL.
struct pcicfg_vpd * pci_fetch_vpd_list | ( | device_t | dev | ) |
Definition at line 1429 of file pci.c.
References dev, pci_read_vpd(), pcicfg::vpd, pcicfg_vpd::vpd_cached, and pcicfg_vpd::vpd_reg.
Referenced by pci_list_vpd().
|
static |
Definition at line 703 of file pci.c.
References pcicfg::baseclass, bus, pcicfg::bus, pcicfg::cachelnsz, pcicfg::cmdreg, pcicfg::device, did, pcicfg::domain, pcicfg::func, pcicfg::hdrtype, pcicfg::intline, pcicfg::intpin, pcicfg::iov, pcicfg::lattimer, pcicfg::mfdev, pci_devq, pci_fixancient(), pci_generation, pci_hdrtypedata(), pci_numdevs, pci_read_cap(), pcib, PCIM_MFDEV, PCIM_STATUS_CAPPRESENT, PCIR_CACHELNSZ, PCIR_CLASS, PCIR_COMMAND, PCIR_HDRTYPE, PCIR_INTLINE, PCIR_INTPIN, PCIR_LATTIMER, PCIR_PROGIF, PCIR_REVID, PCIR_STATUS, PCIR_SUBCLASS, pcicfg::progif, REG, pcicfg::revid, pcicfg::slot, pcicfg::statreg, pcicfg::subclass, pcicfg::subdevice, pcicfg::subvendor, pcicfg::vendor, and vid.
Referenced by pci_read_device().
struct pci_map * pci_find_bar | ( | device_t | dev, |
int | reg | ||
) |
Definition at line 3162 of file pci.c.
References dev, pci_map::pm_reg, and reg.
Referenced by pci_activate_resource(), pci_add_map(), pci_bar_io(), pci_bar_mmap(), pci_deactivate_resource(), pci_ioctl(), pci_reserve_map(), and pci_vf_alloc_mem_resource().
device_t pci_find_bsf | ( | uint8_t | bus, |
uint8_t | slot, | ||
uint8_t | func | ||
) |
Definition at line 440 of file pci.c.
References bus, func, pci_find_dbsf(), and slot.
Referenced by pci_msi_blacklisted(), and pci_msix_blacklisted().
int pci_find_cap_method | ( | device_t | dev, |
device_t | child, | ||
int | capability, | ||
int * | capreg | ||
) |
Definition at line 1526 of file pci.c.
References capability, capreg, child, pcicfg::hdrtype, PCICAP_ID, PCICAP_NEXTPTR, PCIM_HDRTYPE, PCIM_HDRTYPE_BRIDGE, PCIM_HDRTYPE_CARDBUS, PCIM_HDRTYPE_NORMAL, PCIM_STATUS_CAPPRESENT, PCIR_CAP_PTR, PCIR_CAP_PTR_2, PCIR_STATUS, and status.
device_t pci_find_class | ( | uint8_t | class, |
uint8_t | subclass | ||
) |
device_t pci_find_class_from | ( | uint8_t | class, |
uint8_t | subclass, | ||
device_t | from | ||
) |
device_t pci_find_dbsf | ( | uint32_t | domain, |
uint8_t | bus, | ||
uint8_t | slot, | ||
uint8_t | func | ||
) |
Definition at line 449 of file pci.c.
References bus, func, pci_devq, and slot.
Referenced by pci_find_bsf(), pci_ioctl(), and pci_lookup().
device_t pci_find_device | ( | uint16_t | vendor, |
uint16_t | device | ||
) |
int pci_find_extcap_method | ( | device_t | dev, |
device_t | child, | ||
int | capability, | ||
int * | capreg | ||
) |
Definition at line 1606 of file pci.c.
References capability, capreg, child, PCI_EXTCAP_ID, PCI_EXTCAP_NEXTPTR, pcicfg::pcie, pcicfg_pcie::pcie_location, and PCIR_EXTCAP.
int pci_find_htcap_method | ( | device_t | dev, |
device_t | child, | ||
int | capability, | ||
int * | capreg | ||
) |
Definition at line 1445 of file pci.c.
References capability, capreg, child, PCIM_HTCAP_HOST, PCIM_HTCAP_SLAVE, PCIM_HTCMD_CAP_MASK, PCIR_HT_COMMAND, PCIY_HT, and val.
int pci_find_next_cap_method | ( | device_t | dev, |
device_t | child, | ||
int | capability, | ||
int | start, | ||
int * | capreg | ||
) |
Definition at line 1579 of file pci.c.
References capability, capreg, child, PCICAP_ID, PCICAP_NEXTPTR, and start.
int pci_find_next_extcap_method | ( | device_t | dev, |
device_t | child, | ||
int | capability, | ||
int | start, | ||
int * | capreg | ||
) |
Definition at line 1643 of file pci.c.
References capability, capreg, child, PCI_EXTCAP_ID, PCI_EXTCAP_NEXTPTR, pcicfg::pcie, pcicfg_pcie::pcie_location, and start.
int pci_find_next_htcap_method | ( | device_t | dev, |
device_t | child, | ||
int | capability, | ||
int | start, | ||
int * | capreg | ||
) |
Definition at line 1485 of file pci.c.
References capability, capreg, child, PCICAP_ID, PCIM_HTCAP_HOST, PCIM_HTCAP_SLAVE, PCIM_HTCMD_CAP_MASK, PCIR_HT_COMMAND, PCIY_HT, start, and val.
device_t pci_find_pcie_root_port | ( | device_t | dev | ) |
Definition at line 6331 of file pci.c.
References bus, dev, pcib, and PCIEM_TYPE_ROOT_PORT.
Referenced by pcie_setup_mps().
|
static |
Definition at line 632 of file pci.c.
References pcicfg::baseclass, pcicfg::hdrtype, PCIC_BRIDGE, PCIM_HDRTYPE, PCIM_HDRTYPE_BRIDGE, PCIM_HDRTYPE_NORMAL, PCIS_BRIDGE_PCI, and pcicfg::subclass.
Referenced by pci_fill_devinfo().
int pci_freecfg | ( | struct pci_devinfo * | dinfo | ) |
Definition at line 2773 of file pci.c.
References pci_devq, pci_generation, and pci_numdevs.
Referenced by pci_child_deleted().
int pci_get_device_path_method | ( | device_t | bus, |
device_t | child, | ||
const char * | locator, | ||
struct sbuf * | sb | ||
) |
bus_dma_tag_t pci_get_dma_tag | ( | device_t | bus, |
device_t | dev | ||
) |
Definition at line 5842 of file pci.c.
References bus, and pci_softc::sc_dma_tag.
|
static |
int pci_get_max_payload | ( | device_t | dev | ) |
Definition at line 2233 of file pci.c.
References dev, PCIEM_CTL_MAX_PAYLOAD, PCIER_DEVICE_CTL, and val.
int pci_get_max_read_req | ( | device_t | dev | ) |
Definition at line 2249 of file pci.c.
References dev, PCIEM_CTL_MAX_READ_REQUEST, PCIER_DEVICE_CTL, and val.
int pci_get_powerstate_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2880 of file pci.c.
References child, dev, PCIM_PSTAT_D0, PCIM_PSTAT_D1, PCIM_PSTAT_D2, PCIM_PSTAT_D3, PCIM_PSTAT_DMASK, pcicfg::pp, pcicfg_pp::pp_cap, pcicfg_pp::pp_status, and status.
int pci_get_relaxed_ordering_enabled | ( | device_t | dev | ) |
Definition at line 2218 of file pci.c.
References dev, PCIEM_CTL_RELAXED_ORD_ENABLE, PCIER_DEVICE_CTL, and val.
struct resource_list * pci_get_resource_list | ( | device_t | dev, |
device_t | child | ||
) |
int pci_get_vpd_ident_method | ( | device_t | dev, |
device_t | child, | ||
const char ** | identptr | ||
) |
Definition at line 1390 of file pci.c.
References child, dev, identptr, pci_read_vpd(), pcicfg::vpd, pcicfg_vpd::vpd_cached, pcicfg_vpd::vpd_ident, and pcicfg_vpd::vpd_reg.
int pci_get_vpd_readonly_method | ( | device_t | dev, |
device_t | child, | ||
const char * | kw, | ||
const char ** | vptr | ||
) |
Definition at line 1407 of file pci.c.
References child, dev, vpd_readonly::keyword, kw, pci_read_vpd(), vpd_readonly::value, pcicfg::vpd, pcicfg_vpd::vpd_cached, pcicfg_vpd::vpd_reg, pcicfg_vpd::vpd_rocnt, pcicfg_vpd::vpd_ros, and vptr.
|
static |
Definition at line 426 of file pci.c.
References pci_quirk::devid, pci_quirks, and pci_quirk::type.
Referenced by pci_add_map(), pci_msi_blacklisted(), pci_msi_device_blacklisted(), pci_msix_blacklisted(), pci_msix_device_blacklisted(), and pci_setup_intr().
|
static |
Definition at line 645 of file pci.c.
References pcicfg_bridge::br_control, pcicfg_bridge::br_pribus, pcicfg_bridge::br_secbus, pcicfg_bridge::br_seclat, pcicfg_bridge::br_subbus, pcicfg::bridge, pcicfg::hdrtype, pcicfg::maxlat, pcicfg::mingnt, pcicfg::nummaps, PCI_MAXMAPS_0, PCI_MAXMAPS_1, PCI_MAXMAPS_2, PCIM_HDRTYPE, PCIM_HDRTYPE_BRIDGE, PCIM_HDRTYPE_CARDBUS, PCIM_HDRTYPE_NORMAL, PCIR_BRIDGECTL_1, PCIR_BRIDGECTL_2, PCIR_MAXLAT, PCIR_MINGNT, PCIR_PRIBUS_1, PCIR_PRIBUS_2, PCIR_SECBUS_1, PCIR_SECBUS_2, PCIR_SECLAT_1, PCIR_SECLAT_2, PCIR_SUBBUS_1, PCIR_SUBBUS_2, PCIR_SUBDEV_0, PCIR_SUBDEV_2, PCIR_SUBVEND_0, PCIR_SUBVEND_2, REG, pcicfg::subdevice, and pcicfg::subvendor.
Referenced by pci_fill_devinfo().
|
static |
void pci_ht_map_msi | ( | device_t | dev, |
uint64_t | addr | ||
) |
Definition at line 2193 of file pci.c.
References addr, dev, pcicfg_ht::ht_msiaddr, pcicfg_ht::ht_msictrl, pcicfg_ht::ht_msimap, PCIM_HTCMD_MSI_ENABLE, and PCIR_HT_COMMAND.
Referenced by pci_disable_msi_method(), pci_enable_msi_method(), pci_enable_msix_method(), and pcib_map_msi().
|
static |
Definition at line 4131 of file pci.c.
References dev, func, pci_add_child(), pci_read_device(), pcib, and slot.
Referenced by pci_add_children(), and pci_rescan_method().
|
static |
Definition at line 4696 of file pci.c.
References data, pci_vendordata, and pci_vendordata_size.
Referenced by pci_modevent().
|
static |
Definition at line 5956 of file pci.c.
References bus, dev, func, name, PCI_BUSMAX, PCI_DOMAINMAX, pci_find_dbsf(), PCI_FUNCMAX, PCI_SLOTMAX, PCIE_ARI_FUNCMAX, slot, and val.
Referenced by pci_modevent().
|
static |
Definition at line 536 of file pci.c.
References PCI_BAR_MEM, PCIM_BAR_IO_BASE, and PCIM_BAR_MEM_BASE.
Referenced by pci_add_map(), pci_ata_maps(), and pci_mapsize().
|
static |
Definition at line 608 of file pci.c.
References PCI_BAR_IO, PCIM_BAR_MEM_1MB, PCIM_BAR_MEM_32, PCIM_BAR_MEM_64, and PCIM_BAR_MEM_TYPE.
Referenced by pci_add_map(), pci_read_bar(), pci_restore_bars(), and pci_write_bar().
int pci_mapsize | ( | uint64_t | testval | ) |
Definition at line 561 of file pci.c.
References pci_mapbase().
Referenced by pci_add_map(), pci_iov_alloc_bar_ea(), pci_iov_setup_bars(), and pci_reserve_map().
|
static |
Definition at line 548 of file pci.c.
References PCI_BAR_IO, and PCIM_BAR_MEM_PREFETCH.
Referenced by pci_add_map().
|
static |
Definition at line 1718 of file pci.c.
References dev, index, pcicfg_msix::msix_msgnum, pcicfg_msix::msix_table_offset, pcicfg_msix::msix_table_res, PCIM_MSIX_VCTRL_MASK, and val.
Referenced by pci_alloc_msix_method(), pci_remap_intr_method(), pci_resume_msix(), and pci_teardown_intr().
const struct pci_device_table * pci_match_device | ( | device_t | child, |
const struct pci_device_table * | id, | ||
size_t | nelt | ||
) |
Definition at line 6682 of file pci.c.
References child, pci_device_table::device, id, pci_device_table::revid, subclass, pci_device_table::subdevice, pci_device_table::subvendor, and pci_device_table::vendor.
|
static |
Definition at line 3058 of file pci.c.
References dev, PCIM_CMD_MEMEN, and PCIR_COMMAND.
Referenced by pci_add_map().
|
static |
Definition at line 6005 of file pci.c.
References pci_devq, pci_generation, pci_load_vendor_data(), pci_lookup(), and pcicdev.
|
static |
Definition at line 2514 of file pci.c.
References dev, pci_find_bsf(), pci_has_quirk(), pci_honor_msi_blacklist, pci_msi_device_blacklisted(), PCI_QUIRK_ENABLE_MSI_VM, pcie_chipset, and pcix_chipset.
Referenced by pci_alloc_msi_method(), and pci_msix_blacklisted().
int pci_msi_count_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2760 of file pci.c.
References child, pcicfg_msi::msi_location, pcicfg_msi::msi_msgnum, and pci_do_msi.
int pci_msi_device_blacklisted | ( | device_t | dev | ) |
Definition at line 2497 of file pci.c.
References dev, pci_has_quirk(), pci_honor_msi_blacklist, and PCI_QUIRK_DISABLE_MSI.
Referenced by pci_msi_blacklisted(), pci_msix_device_blacklisted(), and pcib_attach_common().
|
static |
Definition at line 2566 of file pci.c.
References dev, pci_find_bsf(), pci_has_quirk(), pci_honor_msi_blacklist, pci_msi_blacklisted(), and PCI_QUIRK_DISABLE_MSIX.
Referenced by pci_alloc_msix_method().
int pci_msix_count_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2157 of file pci.c.
References child, pcicfg_msix::msix_location, pcicfg_msix::msix_msgnum, and pci_do_msix.
int pci_msix_device_blacklisted | ( | device_t | dev | ) |
Definition at line 2548 of file pci.c.
References dev, pci_has_quirk(), pci_honor_msi_blacklist, pci_msi_device_blacklisted(), and PCI_QUIRK_DISABLE_MSIX.
Referenced by pcib_attach_common().
int pci_msix_pba_bar_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2168 of file pci.c.
References child, pcicfg_msix::msix_location, pcicfg_msix::msix_pba_bar, and pci_do_msix.
int pci_msix_table_bar_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2179 of file pci.c.
References child, pcicfg_msix::msix_location, pcicfg_msix::msix_table_bar, and pci_do_msix.
int pci_pending_msix | ( | device_t | dev, |
u_int | index | ||
) |
Definition at line 1756 of file pci.c.
References dev, index, pcicfg_msix::msix_pba_offset, pcicfg_msix::msix_pba_res, and pcicfg_msix::msix_table_len.
|
static |
Definition at line 3052 of file pci.c.
References dev, PCIM_CMD_PORTEN, and PCIR_COMMAND.
Referenced by pci_add_map().
int pci_power_reset | ( | device_t | dev | ) |
Definition at line 6599 of file pci.c.
References dev.
Referenced by pci_reset_child().
int pci_print_child | ( | device_t | dev, |
device_t | child | ||
) |
void pci_print_faulted_dev | ( | void | ) |
Definition at line 6732 of file pci.c.
References dev, pci_devq, pci_print_faulted_dev_name(), PCIEM_STA_CORRECTABLE_ERROR, PCIEM_STA_FATAL_ERROR, PCIEM_STA_NON_FATAL_ERROR, PCIEM_STA_UNSUPPORTED_REQ, PCIER_DEVICE_CTL, PCIER_DEVICE_STA, PCIM_STATUS_MDPERR, PCIM_STATUS_PERR, PCIM_STATUS_RMABORT, PCIM_STATUS_RTABORT, PCIM_STATUS_SERR, PCIM_STATUS_STABORT, PCIR_AER_CAP_CONTROL, PCIR_AER_COR_MASK, PCIR_AER_COR_STATUS, PCIR_AER_HEADER_LOG, PCIR_AER_UC_MASK, PCIR_AER_UC_SEVERITY, PCIR_AER_UC_STATUS, PCIR_STATUS, PCIZ_AER, and status.
|
static |
Definition at line 6718 of file pci.c.
References dev.
Referenced by pci_print_faulted_dev().
void pci_print_verbose | ( | struct pci_devinfo * | dinfo | ) |
Definition at line 2995 of file pci.c.
References pcicfg::baseclass, pcicfg::bus, pcicfg::cachelnsz, pcicfg::cmdreg, pcicfg::dev, pcicfg::device, pcicfg::domain, pcicfg::func, pcicfg::hdrtype, pcicfg::intline, pcicfg::intpin, pcicfg::lattimer, pcicfg::maxlat, pcicfg::mfdev, pcicfg::mingnt, pcicfg::msi, pcicfg_msi::msi_ctrl, pcicfg_msi::msi_location, pcicfg_msi::msi_msgnum, pcicfg::msix, pcicfg_msix::msix_location, pcicfg_msix::msix_msgnum, pcicfg_msix::msix_pba_bar, pcicfg_msix::msix_table_bar, PCIM_MSICTRL_64BIT, PCIM_MSICTRL_VECTOR, PCIM_PCAP_D1SUPP, PCIM_PCAP_D2SUPP, PCIM_PCAP_SPEC, PCIM_PSTAT_DMASK, pcicfg::pp, pcicfg_pp::pp_cap, pcicfg_pp::pp_status, pcicfg::progif, pcicfg::revid, pcicfg::slot, pcicfg::statreg, status, pcicfg::subclass, and pcicfg::vendor.
Referenced by pci_add_child(), and pci_driver_added().
|
static |
Definition at line 520 of file pci.c.
References pcicfg::bus, pcicfg::domain, pcicfg::func, and pcicfg::slot.
Referenced by pci_add_child_clear_aer(), pci_child_deleted(), pci_child_detached(), pci_driver_added(), pci_read_vpd(), pci_set_powerstate_method(), and pcie_flr().
void pci_probe_nomatch | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 5037 of file pci.c.
References child, dev, pci_cfg_save(), pci_describe_device(), pci_nomatch_tab, report, and subclass.
void pci_read_bar | ( | device_t | dev, |
int | reg, | ||
pci_addr_t * | mapp, | ||
pci_addr_t * | testvalp, | ||
int * | bar64 | ||
) |
Definition at line 3064 of file pci.c.
References dev, PCI_BAR_MEM, pci_maprange(), PCIM_CMD_MEMEN, PCIM_CMD_PORTEN, PCIR_COMMAND, PCIR_IS_BIOS, and reg.
Referenced by pci_add_map(), pci_iov_setup_bars(), and pci_reserve_map().
|
static |
Definition at line 843 of file pci.c.
References addr, pcicfg::bus, pcicfg::domain, pcicfg::ea, pcicfg_ea::ea_location, pcicfg::func, pcicfg::hdrtype, pcicfg::ht, pcicfg_ht::ht_msiaddr, pcicfg_ht::ht_msictrl, pcicfg_ht::ht_msimap, pcicfg_ht::ht_slave, pcicfg::msi, pcicfg_msi::msi_ctrl, pcicfg_msi::msi_location, pcicfg_msi::msi_msgnum, pcicfg::msix, pcicfg_msix::msix_ctrl, pcicfg_msix::msix_location, pcicfg_msix::msix_msgnum, pcicfg_msix::msix_pba_bar, pcicfg_msix::msix_pba_offset, pcicfg_msix::msix_table_bar, pcicfg_msix::msix_table_offset, pci_ea_fill_info(), pcib, PCICAP_ID, PCICAP_NEXTPTR, pcicfg::pcie, pcie_chipset, pcicfg_pcie::pcie_location, pcicfg_pcie::pcie_type, PCIEM_FLAGS_TYPE, PCIER_FLAGS, PCIM_HDRTYPE, PCIM_HDRTYPE_BRIDGE, PCIM_HDRTYPE_CARDBUS, PCIM_HDRTYPE_NORMAL, PCIM_HTCAP_MSI_MAPPING, PCIM_HTCAP_SLAVE, PCIM_HTCMD_CAP_MASK, PCIM_HTCMD_MSI_ENABLE, PCIM_HTCMD_MSI_FIXED, PCIM_MSICTRL_MMC_MASK, PCIM_MSIX_BIR_MASK, PCIM_MSIXCTRL_TABLE_SIZE, PCIR_BAR, PCIR_CAP_PTR, PCIR_CAP_PTR_2, PCIR_HT_COMMAND, PCIR_HTMSI_ADDRESS_HI, PCIR_HTMSI_ADDRESS_LO, PCIR_MSI_CTRL, PCIR_MSIX_CTRL, PCIR_MSIX_PBA, PCIR_MSIX_TABLE, PCIR_POWER_BSE, PCIR_POWER_CAP, PCIR_POWER_DATA, PCIR_POWER_STATUS, PCIR_SUBVENDCAP_ID, pcicfg::pcix, pcix_chipset, pcicfg_pcix::pcix_location, PCIY_EA, PCIY_EXPRESS, PCIY_HT, PCIY_MSI, PCIY_MSIX, PCIY_PCIX, PCIY_PMG, PCIY_SUBVENDOR, PCIY_VPD, pcicfg::pp, pcicfg_pp::pp_bse, pcicfg_pp::pp_cap, pcicfg_pp::pp_data, pcicfg_pp::pp_status, REG, pcicfg::slot, pcicfg::subdevice, pcicfg::subvendor, val, pcicfg::vpd, pcicfg_vpd::vpd_reg, and WREG.
Referenced by pci_fill_devinfo().
uint32_t pci_read_config_method | ( | device_t | dev, |
device_t | child, | ||
int | reg, | ||
int | width | ||
) |
Definition at line 5851 of file pci.c.
References pcicfg::bus, child, dev, pcicfg::device, pcicfg::flags, pcicfg::func, PCICFG_VF, PCIR_DEVICE, PCIR_VENDOR, reg, pcicfg::slot, pcicfg::vendor, and width.
struct pci_devinfo * pci_read_device | ( | device_t | pcib, |
device_t | bus, | ||
int | d, | ||
int | b, | ||
int | s, | ||
int | f | ||
) |
Definition at line 680 of file pci.c.
References bus, did, pci_fill_devinfo(), pcib, PCIR_DEVICE, PCIR_VENDOR, PCIV_INVALID, REG, and vid.
Referenced by pci_identify_function().
int pci_read_ivar | ( | device_t | dev, |
device_t | child, | ||
int | which, | ||
uintptr_t * | result | ||
) |
Definition at line 5248 of file pci.c.
References pcicfg::baseclass, pcicfg::bus, pcicfg::cachelnsz, child, pcicfg::cmdreg, pcicfg::device, pcicfg::domain, pcicfg::func, pcicfg::hdrtype, pcicfg::intline, pcicfg::intpin, pcicfg::lattimer, pcicfg::maxlat, pcicfg::mingnt, PCIM_HDRTYPE_NORMAL, pcicfg::progif, pcicfg::revid, pcicfg::slot, pcicfg::subclass, pcicfg::subdevice, pcicfg::subvendor, and pcicfg::vendor.
|
static |
Definition at line 1088 of file pci.c.
References vpd_readstate::bytesinval, vpd_readstate::cfg, vpd_readstate::cksum, vpd_readonly::keyword, vpd_write::keyword, vpd_readonly::len, vpd_write::len, name, vpd_readstate::off, pci_printf(), vpd_readstate::pcib, pcib, vpd_write::start, state, vpd_readstate::val, vpd_readonly::value, vpd_write::value, pcicfg::vpd, pcicfg_vpd::vpd_cached, pcicfg_vpd::vpd_ident, vpd_nextbyte(), pcicfg_vpd::vpd_rocnt, pcicfg_vpd::vpd_ros, pcicfg_vpd::vpd_w, and pcicfg_vpd::vpd_wcnt.
Referenced by pci_fetch_vpd_list(), pci_get_vpd_ident_method(), and pci_get_vpd_readonly_method().
|
static |
Definition at line 1014 of file pci.c.
References count, data, PCI_VPD_TIMEOUT, PCIR_VPD_ADDR, PCIR_VPD_DATA, REG, reg, pcicfg::vpd, pcicfg_vpd::vpd_reg, and WREG.
Referenced by vpd_nextbyte().
int pci_release_msi_method | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2706 of file pci.c.
References child, dev, irqs, pcicfg_msi::msi_addr, pcicfg_msi::msi_alloc, pcicfg_msi::msi_ctrl, pcicfg_msi::msi_data, pcicfg_msi::msi_handlers, pcicfg_msi::msi_location, pci_release_msix(), PCIM_MSICTRL_MSI_ENABLE, and PCIR_MSI_CTRL.
|
static |
Definition at line 2104 of file pci.c.
References child, dev, pcicfg_msix::msix_alloc, pcicfg_msix::msix_ctrl, pcicfg_msix::msix_location, pcicfg_msix::msix_table, pcicfg_msix::msix_table_len, pcicfg_msix::msix_vectors, msix_table_entry::mte_handlers, msix_table_entry::mte_vector, msix_vector::mv_irq, and PCIR_MSIX_CTRL.
Referenced by pci_release_msi_method().
int pci_release_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Definition at line 5643 of file pci.c.
References child, dev, pcicfg::hdrtype, pci_vf_release_mem_resource(), PCICFG_VF, PCIM_HDRTYPE_BRIDGE, PCIR_IOBASEL_1, PCIR_MEMBASE_1, PCIR_PMBASEL_1, rid, and type.
Referenced by pci_iov_config(), and pci_iov_delete_iov_children().
|
static |
Definition at line 2421 of file pci.c.
References addr, bus, data, dev, irq, pcicfg::msi, pcicfg_msi::msi_alloc, pcicfg_msi::msi_handlers, pcicfg::msix, pcicfg_msix::msix_alloc, pcicfg_msix::msix_table, pcicfg_msix::msix_table_len, pcicfg_msix::msix_vectors, msix_table_entry::mte_handlers, msix_table_entry::mte_vector, msix_vector::mv_address, msix_vector::mv_data, msix_vector::mv_irq, pci_mask_msix(), and pci_unmask_msix().
int pci_remap_msix_method | ( | device_t | dev, |
device_t | child, | ||
int | count, | ||
const u_int * | vectors | ||
) |
Definition at line 1982 of file pci.c.
References child, count, dev, irq, pcicfg_msix::msix_alloc, pcicfg_msix::msix_msgnum, pcicfg_msix::msix_table, pcicfg_msix::msix_table_len, pcicfg_msix::msix_vectors, msix_table_entry::mte_handlers, msix_table_entry::mte_vector, msix_vector::mv_irq, and vectors.
int pci_rescan_method | ( | device_t | dev | ) |
Definition at line 4191 of file pci.c.
References child, dev, maxslots, pci_identify_function(), PCI_MAXHDRTYPE, pcib, PCIM_HDRTYPE, PCIM_MFDEV, PCIR_HDRTYPE, PCIR_VENDOR, PCIV_INVALID, and REG.
struct resource * pci_reserve_map | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int * | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count, | ||
u_int | num, | ||
u_int | flags | ||
) |
Definition at line 5421 of file pci.c.
References child, count, dev, pci_add_bar(), PCI_BAR_MEM, pci_ea_is_enabled(), pci_find_bar(), pci_mapsize(), pci_read_bar(), pci_romsize(), pci_write_bar(), PCIM_BAR_MEM_PREFETCH, PCIM_CMD_MEMEN, PCIM_CMD_PORTEN, PCIR_COMMAND, PCIR_IS_BIOS, pci_map::pm_size, pci_map::pm_value, rid, start, and type.
Referenced by pci_alloc_multi_resource().
|
static |
Definition at line 6654 of file pci.c.
References child, dev, pci_power_reset(), and pcie_flr().
|
static |
Definition at line 6636 of file pci.c.
References child, dev, and pci_restore_state().
|
static |
Definition at line 6645 of file pci.c.
References child, dev, and pci_save_state().
|
static |
Definition at line 3228 of file pci.c.
References dev, pci_maprange(), PCIR_IS_BIOS, pci_map::pm_reg, and pci_map::pm_value.
Referenced by pci_cfg_restore().
void pci_restore_state | ( | device_t | dev | ) |
Definition at line 6313 of file pci.c.
References dev, and pci_cfg_restore().
Referenced by pci_reset_post().
int pci_resume | ( | device_t | dev | ) |
Definition at line 4657 of file pci.c.
References child, dev, PCIC_BASEPERIPH, PCIC_BRIDGE, PCIC_DISPLAY, and PCIC_MEMORY.
int pci_resume_child | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 4628 of file pci.c.
References child, dev, pci_cfg_restore(), pci_cfg_save(), pci_do_power_resume, pci_do_power_suspend, and pci_set_power_child().
|
static |
Definition at line 2395 of file pci.c.
References address, data, dev, pcicfg_msi::msi_addr, pcicfg_msi::msi_ctrl, pcicfg_msi::msi_data, pcicfg_msi::msi_location, PCIM_MSICTRL_64BIT, PCIM_MSICTRL_MSI_ENABLE, PCIR_MSI_ADDR, PCIR_MSI_ADDR_HIGH, PCIR_MSI_CTRL, PCIR_MSI_DATA, and PCIR_MSI_DATA_64BIT.
Referenced by pci_cfg_restore().
|
static |
Definition at line 1774 of file pci.c.
References dev, pcicfg_msix::msix_alloc, pcicfg_msix::msix_ctrl, pcicfg_msix::msix_location, pcicfg_msix::msix_msgnum, pcicfg_msix::msix_table, pcicfg_msix::msix_table_len, pcicfg_msix::msix_vectors, msix_table_entry::mte_handlers, msix_table_entry::mte_vector, msix_vector::mv_address, msix_vector::mv_data, pci_mask_msix(), pci_unmask_msix(), pci_write_msix_entry(), and PCIR_MSIX_CTRL.
Referenced by pci_cfg_restore(), and pci_enable_msix_method().
|
static |
Definition at line 580 of file pci.c.
References PCIM_BIOS_ADDR_MASK.
Referenced by pci_romsize().
|
static |
Definition at line 589 of file pci.c.
References pci_rombase().
Referenced by pci_reserve_map().
void pci_save_state | ( | device_t | dev | ) |
Definition at line 6304 of file pci.c.
References dev, and pci_cfg_save().
Referenced by pci_reset_prepare().
|
static |
Definition at line 2918 of file pci.c.
References child, dev, and PCIR_COMMAND.
Referenced by pci_enable_busmaster_method(), pci_enable_io_method(), pci_setup_intr(), and pci_teardown_intr().
int pci_set_max_read_req | ( | device_t | dev, |
int | size | ||
) |
Definition at line 2265 of file pci.c.
References dev, PCIER_DEVICE_CTL, and val.
|
static |
Definition at line 4569 of file pci.c.
References child, dev, pcib, and state.
Referenced by pci_resume_child(), and pci_suspend_child().
int pci_set_powerstate_method | ( | device_t | dev, |
device_t | child, | ||
int | state | ||
) |
Definition at line 2808 of file pci.c.
References child, dev, pci_printf(), PCIM_PCAP_D1SUPP, PCIM_PCAP_D2SUPP, PCIM_PSTAT_D0, PCIM_PSTAT_D1, PCIM_PSTAT_D2, PCIM_PSTAT_D3, pcicfg::pp, pcicfg_pp::pp_cap, pcicfg_pp::pp_status, state, and status.
int pci_setup_intr | ( | device_t | dev, |
device_t | child, | ||
struct resource * | irq, | ||
int | flags, | ||
driver_filter_t * | filter, | ||
driver_intr_t * | intr, | ||
void * | arg, | ||
void ** | cookiep | ||
) |
Definition at line 4745 of file pci.c.
References addr, child, data, dev, irq, pcicfg::msix, pcicfg_msix::msix_table_len, msix_table_entry::mte_handlers, msix_table_entry::mte_vector, msix_vector::mv_address, msix_vector::mv_data, msix_vector::mv_irq, pci_clear_command_bit(), pci_has_quirk(), PCI_QUIRK_MSI_INTX_BUG, pci_set_command_bit(), pci_unmask_msix(), PCIM_CMD_INTxDIS, and rid.
int pci_suspend_child | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 4589 of file pci.c.
References child, dev, pci_cfg_save(), pci_do_power_suspend, and pci_set_power_child().
int pci_teardown_intr | ( | device_t | dev, |
device_t | child, | ||
struct resource * | irq, | ||
void * | cookie | ||
) |
Definition at line 4853 of file pci.c.
References child, dev, irq, pcicfg::msi, pcicfg_msi::msi_alloc, pcicfg::msix, pcicfg_msix::msix_table_len, msix_table_entry::mte_handlers, pci_mask_msix(), pci_set_command_bit(), PCIM_CMD_INTxDIS, and rid.
|
static |
Definition at line 1737 of file pci.c.
References dev, index, pcicfg_msix::msix_table_len, pcicfg_msix::msix_table_offset, pcicfg_msix::msix_table_res, and val.
Referenced by pci_remap_intr_method(), pci_resume_msix(), and pci_setup_intr().
|
static |
Definition at line 3141 of file pci.c.
References dev, pci_maprange(), PCIR_IS_BIOS, pci_map::pm_reg, and pci_map::pm_value.
Referenced by pci_activate_resource(), pci_add_map(), pci_deactivate_resource(), and pci_reserve_map().
void pci_write_config_method | ( | device_t | dev, |
device_t | child, | ||
int | reg, | ||
uint32_t | val, | ||
int | width | ||
) |
Definition at line 5892 of file pci.c.
References pcicfg::bus, child, dev, pcicfg::func, reg, pcicfg::slot, val, and width.
int pci_write_ivar | ( | device_t | dev, |
device_t | child, | ||
int | which, | ||
uintptr_t | value | ||
) |
|
static |
Definition at line 1676 of file pci.c.
References address, data, dev, index, pcicfg_msix::msix_table_len, pcicfg_msix::msix_table_offset, and pcicfg_msix::msix_table_res.
Referenced by pci_enable_msix_method(), and pci_resume_msix().
uint32_t pcie_adjust_config | ( | device_t | dev, |
int | reg, | ||
uint32_t | mask, | ||
uint32_t | value, | ||
int | width | ||
) |
void pcie_apei_error | ( | device_t | dev, |
int | sev, | ||
uint8_t * | aerp | ||
) |
Definition at line 6459 of file pci.c.
References dev, PCIEM_STA_CORRECTABLE_ERROR, PCIEM_STA_FATAL_ERROR, PCIEM_STA_NON_FATAL_ERROR, PCIEM_STA_UNSUPPORTED_REQ, PCIER_DEVICE_STA, PCIR_AER_CAP_CONTROL, PCIR_AER_COR_MASK, PCIR_AER_COR_STATUS, PCIR_AER_UC_MASK, PCIR_AER_UC_SEVERITY, PCIR_AER_UC_STATUS, and PCIZ_AER.
bool pcie_flr | ( | device_t | dev, |
u_int | max_delay, | ||
bool | force | ||
) |
Definition at line 6536 of file pci.c.
References dev, pci_printf(), pcie_get_max_completion_timeout(), pcie_wait_for_pending_transactions(), PCIEM_CAP_FLR, PCIEM_CTL_INITIATE_FLR, PCIEM_STA_TRANSACTION_PND, PCIER_DEVICE_CAP, PCIER_DEVICE_CTL, PCIER_DEVICE_STA, PCIM_CMD_BUSMASTEREN, and PCIR_COMMAND.
Referenced by pci_reset_child().
int pcie_get_max_completion_timeout | ( | device_t | dev | ) |
Definition at line 6416 of file pci.c.
References dev, PCIEM_CAP2_COMP_TIMO_RANGES, PCIEM_CTL2_COMP_TIMO_100US, PCIEM_CTL2_COMP_TIMO_10MS, PCIEM_CTL2_COMP_TIMO_13S, PCIEM_CTL2_COMP_TIMO_210MS, PCIEM_CTL2_COMP_TIMO_3500MS, PCIEM_CTL2_COMP_TIMO_55MS, PCIEM_CTL2_COMP_TIMO_64S, PCIEM_CTL2_COMP_TIMO_900MS, PCIEM_CTL2_COMP_TIMO_VAL, PCIEM_FLAGS_VERSION, PCIER_DEVICE_CAP2, and PCIER_DEVICE_CTL2.
Referenced by pcie_flr().
int pcie_link_reset | ( | device_t | port, |
int | pcie_location | ||
) |
Definition at line 6619 of file pci.c.
References PCIEM_LINK_CTL_LINK_DIS, PCIEM_LINK_CTL_RETRAIN_LINK, PCIEM_LINK_STA_TRAINING, PCIER_LINK_CTL, and PCIER_LINK_STA.
Referenced by pcib_reset_child().
uint32_t pcie_read_config | ( | device_t | dev, |
int | reg, | ||
int | width | ||
) |
|
static |
Definition at line 4320 of file pci.c.
References dev, pci_find_pcie_root_port(), pcie_adjust_config(), pcie_read_config(), PCIEM_CAP_MAX_PAYLOAD, PCIEM_CTL_MAX_PAYLOAD, PCIER_DEVICE_CAP, and PCIER_DEVICE_CTL.
Referenced by pci_add_child().
bool pcie_wait_for_pending_transactions | ( | device_t | dev, |
u_int | max_delay | ||
) |
Definition at line 6380 of file pci.c.
References dev, PCIEM_STA_TRANSACTION_PND, and PCIER_DEVICE_STA.
Referenced by pcie_flr().
void pcie_write_config | ( | device_t | dev, |
int | reg, | ||
uint32_t | value, | ||
int | width | ||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
clear_aer_on_attach | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_clear_aer_on_attach, | ||
0 | , | ||
"Clear port and device AER state on driver attach" | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
clear_bars | , | ||
CTLFLAG_RDTUN | , | ||
& | pci_clear_bars, | ||
0 | , | ||
"Ignore firmware-assigned resources for BARs." | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
do_power_nodriver | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_do_power_nodriver, | ||
0 | , | ||
"Place a function into D3 state when no driver attaches to it. 0 means" " disable. 1 means conservatively place devices into D3 state. 2 means" " aggressively place devices into D3 state. 3 means put absolutely" " everything in D3 state." | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
do_power_resume | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_do_power_resume, | ||
1 | , | ||
"Transition from D3 -> D0 on resume." | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
do_power_suspend | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_do_power_suspend, | ||
1 | , | ||
"Transition from D0 -> D3 on suspend." | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
enable_ari | , | ||
CTLFLAG_RDTUN | , | ||
& | pci_enable_ari, | ||
0 | , | ||
"Enable support for PCIe Alternative RID Interpretation" | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
enable_aspm | , | ||
CTLFLAG_RDTUN | , | ||
& | pci_enable_aspm, | ||
0 | , | ||
"Enable support for PCIe Active State Power Management" | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
enable_io_modes | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_enable_io_modes, | ||
1 | , | ||
"Enable I/O and memory bits in the config register. Some BIOSes do not" " enable these bits correctly. We'd like to do this all the | time, | ||
but" " there are some peripherals that this causes problems with." | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
enable_msi | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_do_msi, | ||
1 | , | ||
"Enable support for MSI interrupts" | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
enable_msix | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_do_msix, | ||
1 | , | ||
"Enable support for MSI-X interrupts" | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
honor_msi_blacklist | , | ||
CTLFLAG_RDTUN | , | ||
& | pci_honor_msi_blacklist, | ||
1 | , | ||
"Honor chipset blacklist for MSI/MSI-X" | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
msix_rewrite_table | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_msix_rewrite_table, | ||
0 | , | ||
"Rewrite entire MSI-X table when updating MSI-X entries" | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
realloc_bars | , | ||
CTLFLAG_RWTUN | , | ||
& | pci_do_realloc_bars, | ||
0 | , | ||
"Attempt to allocate a new range for any BARs whose original " "firmware-assigned ranges fail to allocate during the initial device scan." | |||
) |
SYSCTL_INT | ( | _hw_pci | , |
OID_AUTO | , | ||
usb_early_takeover | , | ||
CTLFLAG_RDTUN | , | ||
& | pci_usb_takeover, | ||
1 | , | ||
"Enable early takeover of USB controllers. Disable this if you depend on" " BIOS emulation of USB | devices, | ||
that is you use USB devices(like" " keyboard or mouse) but do not load USB drivers" | |||
) |
|
static |
Definition at line 3569 of file pci.c.
References rid.
Referenced by pci_add_resources().
|
static |
Definition at line 1064 of file pci.c.
References vpd_readstate::bytesinval, vpd_readstate::cfg, vpd_readstate::cksum, data, vpd_readstate::off, pci_read_vpd_reg(), vpd_readstate::pcib, reg, and vpd_readstate::val.
Referenced by pci_read_vpd().
|
static |
Definition at line 3649 of file pci.c.
Referenced by pci_add_resources().
const char* desc |
Definition at line 4943 of file pci.c.
Referenced by pci_describe_device(), and pci_describe_parse_line().
|
static |
Definition at line 420 of file pci.c.
Referenced by pci_add_child().
|
static |
Definition at line 402 of file pci.c.
Referenced by pci_add_map().
struct devlist pci_devq |
Definition at line 334 of file pci.c.
Referenced by pci_fill_devinfo(), pci_find_class(), pci_find_class_from(), pci_find_dbsf(), pci_find_device(), pci_freecfg(), pci_ioctl(), pci_modevent(), and pci_print_faulted_dev().
|
static |
Definition at line 374 of file pci.c.
Referenced by pci_alloc_msi_method(), and pci_msi_count_method().
|
static |
Definition at line 378 of file pci.c.
Referenced by pci_alloc_msix_method(), pci_msix_count_method(), pci_msix_pba_bar_method(), and pci_msix_table_bar_method().
|
static |
Definition at line 356 of file pci.c.
Referenced by pci_cfg_save().
int pci_do_power_resume = 1 |
Definition at line 364 of file pci.c.
Referenced by pci_resume_child().
int pci_do_power_suspend = 1 |
Definition at line 369 of file pci.c.
Referenced by pci_resume_child(), and pci_suspend_child().
|
static |
Definition at line 350 of file pci.c.
Referenced by pci_add_map().
|
static |
Definition at line 412 of file pci.c.
Referenced by pci_add_children().
|
static |
Definition at line 343 of file pci.c.
Referenced by pci_add_map().
uint32_t pci_generation |
Definition at line 335 of file pci.c.
Referenced by pci_fill_devinfo(), pci_freecfg(), pci_ioctl(), and pci_modevent().
|
static |
Definition at line 387 of file pci.c.
Referenced by pci_msi_blacklisted(), pci_msi_device_blacklisted(), pci_msix_blacklisted(), and pci_msix_device_blacklisted().
|
static |
Definition at line 382 of file pci.c.
Referenced by pci_enable_msix_method().
const struct { ... } pci_nomatch_tab[] |
Referenced by pci_probe_nomatch().
uint32_t pci_numdevs = 0 |
Definition at line 336 of file pci.c.
Referenced by pci_fill_devinfo(), pci_freecfg(), and pci_ioctl().
|
static |
Definition at line 251 of file pci.c.
Referenced by pci_add_resources(), and pci_has_quirk().
|
static |
Definition at line 394 of file pci.c.
Referenced by pci_add_resources().
|
static |
Definition at line 234 of file pci.c.
Referenced by pci_describe_device(), pci_describe_parse_line(), and pci_load_vendor_data().
|
static |
Definition at line 235 of file pci.c.
Referenced by pci_describe_parse_line(), and pci_load_vendor_data().
|
static |
Definition at line 337 of file pci.c.
Referenced by pci_msi_blacklisted(), and pci_read_cap().
|
static |
Definition at line 337 of file pci.c.
Referenced by pci_msi_blacklisted(), and pci_read_cap().
int report |
Definition at line 4942 of file pci.c.
Referenced by pci_probe_nomatch().
int subclass |
Definition at line 4941 of file pci.c.
Referenced by pci_find_class(), pci_find_class_from(), pci_match_device(), and pci_probe_nomatch().