FreeBSD kernel amd64 PCI device code
pci.c File Reference
#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"
Include dependency graph for pci.c:

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_vpdpci_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_mappci_find_bar (device_t dev, int reg)
 
int pci_bar_enabled (device_t dev, struct pci_map *pm)
 
struct pci_mappci_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_tablepci_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 []
 

Macro Definition Documentation

◆ PCI_MAPMEM

#define PCI_MAPMEM   0x01 /* memory map */

Definition at line 330 of file pci.c.

◆ PCI_MAPMEMP

#define PCI_MAPMEMP   0x02 /* prefetchable memory map */

Definition at line 331 of file pci.c.

◆ PCI_MAPPORT

#define PCI_MAPPORT   0x04 /* port map */

Definition at line 332 of file pci.c.

◆ PCI_QUIRK_DISABLE_MSI

#define PCI_QUIRK_DISABLE_MSI   2 /* Neither MSI nor MSI-X work */

Definition at line 241 of file pci.c.

◆ PCI_QUIRK_DISABLE_MSIX

#define PCI_QUIRK_DISABLE_MSIX   5 /* MSI-X doesn't work */

Definition at line 244 of file pci.c.

◆ PCI_QUIRK_ENABLE_MSI_VM

#define PCI_QUIRK_ENABLE_MSI_VM   3 /* Older chipset in VM where MSI works */

Definition at line 242 of file pci.c.

◆ PCI_QUIRK_MAP_REG

#define PCI_QUIRK_MAP_REG   1 /* PCI map register in weird place */

Definition at line 240 of file pci.c.

◆ PCI_QUIRK_MSI_INTX_BUG

#define PCI_QUIRK_MSI_INTX_BUG   6 /* PCIM_CMD_INTxDIS disables MSI */

Definition at line 245 of file pci.c.

◆ PCI_QUIRK_REALLOC_BAR

#define PCI_QUIRK_REALLOC_BAR   7 /* Can't allocate memory at the default address */

Definition at line 246 of file pci.c.

◆ PCI_QUIRK_UNMAP_REG

#define PCI_QUIRK_UNMAP_REG   4 /* Ignore PCI map register */

Definition at line 243 of file pci.c.

◆ PCI_VPD_TIMEOUT

#define PCI_VPD_TIMEOUT   1000000

Definition at line 1011 of file pci.c.

◆ PCIR_IS_BIOS

#define PCIR_IS_BIOS (   cfg,
  reg 
)
Value:
(((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \
((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1))
u_int reg
Definition: pci_dw_if.m:42
#define PCIM_HDRTYPE_NORMAL
Definition: pcireg.h:118
#define PCIR_BIOS
Definition: pcireg.h:247
#define PCIM_HDRTYPE_BRIDGE
Definition: pcireg.h:119
#define PCIR_BIOS_1
Definition: pcireg.h:285

Definition at line 89 of file pci.c.

◆ REG [1/6]

#define REG (   n,
 
)    PCIB_READ_CONFIG(pcib, b, s, f, n, w)

◆ REG [2/6]

#define REG (   n,
 
)    PCIB_READ_CONFIG(pcib, b, s, f, n, w)

◆ REG [3/6]

#define REG (   n,
 
)
Value:
PCIB_READ_CONFIG(pcib, cfg->bus, cfg->slot, cfg->func, \
cfg->ea.ea_location + (n), w)
INTERFACE pcib
Definition: pcib_if.m:34

◆ REG [4/6]

#define REG (   n,
 
)    PCIB_READ_CONFIG(pcib, cfg->bus, cfg->slot, cfg->func, n, w)

◆ REG [5/6]

#define REG (   n,
 
)    PCIB_READ_CONFIG(pcib, busno, s, f, n, w)

◆ REG [6/6]

#define REG (   n,
 
)    PCIB_READ_CONFIG(pcib, busno, s, f, n, w)

◆ RREG

#define RREG (   n)    pci_read_config(dev, pos + (n), 2)

◆ WREG [1/2]

#define WREG (   n,
 
)    pci_write_config(dev, pos + (n), (v), 2)

◆ WREG [2/2]

#define WREG (   n,
  v,
 
)    PCIB_WRITE_CONFIG(pcib, cfg->bus, cfg->slot, cfg->func, n, v, w)

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DEFINE_CLASS_0()

DEFINE_CLASS_0 ( pci  ,
pci_driver  ,
pci_methods  ,
sizeof(struct pci_softc  
)

◆ EARLY_DRIVER_MODULE()

EARLY_DRIVER_MODULE ( pci  ,
pcib  ,
pci_driver  ,
pci_devclass  ,
pci_modevent  ,
NULL  ,
BUS_PASS_BUS   
)

◆ ehci_early_takeover()

static void ehci_early_takeover ( device_t  self)
static

Definition at line 3593 of file pci.c.

References PCIR_BAR, and rid.

Referenced by pci_add_resources().

Here is the caller graph for this function:

◆ MODULE_VERSION()

MODULE_VERSION ( pci  ,
 
)

◆ ohci_early_takeover()

static void ohci_early_takeover ( device_t  self)
static

Definition at line 3532 of file pci.c.

References PCIR_BAR, and rid.

Referenced by pci_add_resources().

Here is the caller graph for this function:

◆ pci_activate_resource()

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.

Here is the call graph for this function:

◆ pci_add_bar()

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().

Here is the caller graph for this function:

◆ pci_add_child()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_add_child_clear_aer()

◆ pci_add_children()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_add_map()

static int pci_add_map ( device_t  bus,
device_t  dev,
int  reg,
struct resource_list *  rl,
int  force,
int  prefetch 
)
static

◆ pci_add_resources()

◆ pci_add_resources_ea()

◆ pci_alloc_devinfo_method()

struct pci_devinfo * pci_alloc_devinfo_method ( device_t  dev)

Definition at line 695 of file pci.c.

◆ pci_alloc_msi_method()

int pci_alloc_msi_method ( device_t  dev,
device_t  child,
int *  count 
)

◆ pci_alloc_msix_method()

◆ pci_alloc_multi_resource()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_alloc_resource()

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 
)

Definition at line 5611 of file pci.c.

References child, count, dev, pci_alloc_multi_resource(), pci_vf_alloc_mem_resource(), PCICFG_VF, rid, start, and type.

Here is the call graph for this function:

◆ pci_assign_interrupt()

static void pci_assign_interrupt ( device_t  bus,
device_t  dev,
int  force_route 
)
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().

Here is the caller graph for this function:

◆ pci_assign_interrupt_method()

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.

◆ pci_ata_maps()

static void pci_ata_maps ( device_t  bus,
device_t  dev,
struct resource_list *  rl,
int  force,
uint32_t  prefetchmask 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_attach()

int pci_attach ( device_t  dev)

Definition at line 4496 of file pci.c.

References dev, pci_add_children(), and pci_attach_common().

Here is the call graph for this function:

◆ 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().

Here is the caller graph for this function:

◆ pci_bar_enabled()

int pci_bar_enabled ( device_t  dev,
struct pci_map pm 
)

◆ pci_cfg_restore()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_cfg_restore_pcie()

◆ pci_cfg_restore_pcix()

static void pci_cfg_restore_pcix ( device_t  dev,
struct pci_devinfo *  dinfo 
)
static

Definition at line 6068 of file pci.c.

References dev, and PCIXR_COMMAND.

Referenced by pci_cfg_restore().

Here is the caller graph for this function:

◆ pci_cfg_save()

◆ pci_cfg_save_pcie()

◆ pci_cfg_save_pcix()

static void pci_cfg_save_pcix ( device_t  dev,
struct pci_devinfo *  dinfo 
)
static

Definition at line 6188 of file pci.c.

References dev, and PCIXR_COMMAND.

Referenced by pci_cfg_save().

Here is the caller graph for this function:

◆ pci_child_added_method()

void pci_child_added_method ( device_t  dev,
device_t  child 
)

Definition at line 4452 of file pci.c.

◆ pci_child_deleted()

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.

Here is the call graph for this function:

◆ pci_child_detached()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_child_location_method()

int pci_child_location_method ( device_t  dev,
device_t  child,
struct sbuf *  sb 
)

Definition at line 5903 of file pci.c.

References child.

◆ pci_child_pnpinfo_method()

int pci_child_pnpinfo_method ( device_t  dev,
device_t  child,
struct sbuf *  sb 
)

◆ pci_clear_command_bit()

static __inline void pci_clear_command_bit ( device_t  dev,
device_t  child,
uint16_t  bit 
)
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().

Here is the caller graph for this function:

◆ pci_deactivate_resource()

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.

Here is the call graph for this function:

◆ pci_delete_resource()

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().

Here is the caller graph for this function:

◆ pci_describe_device()

static char * pci_describe_device ( device_t  dev)
static

Definition at line 5195 of file pci.c.

References desc, dev, pci_describe_parse_line(), and pci_vendordata.

Referenced by pci_probe_nomatch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_describe_parse_line()

static int pci_describe_parse_line ( char **  ptr,
int *  vendor,
int *  device,
char **  desc 
)
static

Definition at line 5149 of file pci.c.

References desc, pci_vendordata, and pci_vendordata_size.

Referenced by pci_describe_device().

Here is the caller graph for this function:

◆ pci_detach()

int pci_detach ( device_t  dev)

Definition at line 4517 of file pci.c.

References dev.

◆ pci_disable_busmaster_method()

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.

Here is the call graph for this function:

◆ pci_disable_io_method()

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.

Here is the call graph for this function:

◆ pci_disable_msi_method()

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.

Here is the call graph for this function:

◆ pci_driver_added()

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().

Here is the call graph for this function:

◆ pci_ea_bei_to_rid()

static int pci_ea_bei_to_rid ( device_t  dev,
int  bei 
)
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().

Here is the caller graph for this function:

◆ pci_ea_fill_info()

◆ pci_ea_is_enabled()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_enable_busmaster_method()

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.

Here is the call graph for this function:

◆ pci_enable_io_method()

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.

Here is the call graph for this function:

◆ pci_enable_msi_method()

void pci_enable_msi_method ( device_t  dev,
device_t  child,
uint64_t  address,
uint16_t  data 
)

◆ pci_enable_msix_method()

void pci_enable_msix_method ( device_t  dev,
device_t  child,
u_int  index,
uint64_t  address,
uint32_t  data 
)

◆ pci_fetch_vpd_list()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_fill_devinfo()

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 
)
static

◆ pci_find_bar()

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().

Here is the caller graph for this function:

◆ pci_find_bsf()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_find_cap_method()

int pci_find_cap_method ( device_t  dev,
device_t  child,
int  capability,
int *  capreg 
)

◆ pci_find_class()

device_t pci_find_class ( uint8_t  class,
uint8_t  subclass 
)

Definition at line 483 of file pci.c.

References pci_devq, and subclass.

◆ pci_find_class_from()

device_t pci_find_class_from ( uint8_t  class,
uint8_t  subclass,
device_t  from 
)

Definition at line 498 of file pci.c.

References pci_devq, and subclass.

◆ pci_find_dbsf()

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().

Here is the caller graph for this function:

◆ pci_find_device()

device_t pci_find_device ( uint16_t  vendor,
uint16_t  device 
)

Definition at line 468 of file pci.c.

References pci_devq.

◆ pci_find_extcap_method()

int pci_find_extcap_method ( device_t  dev,
device_t  child,
int  capability,
int *  capreg 
)

◆ pci_find_htcap_method()

int pci_find_htcap_method ( device_t  dev,
device_t  child,
int  capability,
int *  capreg 
)

◆ pci_find_next_cap_method()

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.

◆ pci_find_next_extcap_method()

int pci_find_next_extcap_method ( device_t  dev,
device_t  child,
int  capability,
int  start,
int *  capreg 
)

◆ pci_find_next_htcap_method()

int pci_find_next_htcap_method ( device_t  dev,
device_t  child,
int  capability,
int  start,
int *  capreg 
)

◆ pci_find_pcie_root_port()

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().

Here is the caller graph for this function:

◆ pci_fixancient()

static void pci_fixancient ( pcicfgregs cfg)
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().

Here is the caller graph for this function:

◆ pci_freecfg()

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().

Here is the caller graph for this function:

◆ pci_get_device_path_method()

int pci_get_device_path_method ( device_t  bus,
device_t  child,
const char *  locator,
struct sbuf *  sb 
)

Definition at line 5928 of file pci.c.

References bus, and child.

◆ pci_get_dma_tag()

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.

◆ pci_get_id_method()

static int pci_get_id_method ( device_t  dev,
device_t  child,
enum pci_id_type  type,
uintptr_t *  rid 
)
static

Definition at line 6322 of file pci.c.

References child, dev, and type.

◆ pci_get_max_payload()

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.

◆ pci_get_max_read_req()

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.

◆ pci_get_powerstate_method()

int pci_get_powerstate_method ( device_t  dev,
device_t  child 
)

◆ pci_get_relaxed_ordering_enabled()

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.

◆ pci_get_resource_list()

struct resource_list * pci_get_resource_list ( device_t  dev,
device_t  child 
)

Definition at line 5815 of file pci.c.

References child.

◆ pci_get_vpd_ident_method()

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.

Here is the call graph for this function:

◆ pci_get_vpd_readonly_method()

int pci_get_vpd_readonly_method ( device_t  dev,
device_t  child,
const char *  kw,
const char **  vptr 
)

◆ pci_has_quirk()

static int pci_has_quirk ( uint32_t  devid,
int  quirk 
)
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().

Here is the caller graph for this function:

◆ pci_hdrtypedata()

◆ pci_hint_device_unit()

static void pci_hint_device_unit ( device_t  acdev,
device_t  child,
const char *  name,
int *  unitp 
)
static

Definition at line 4537 of file pci.c.

References child, and name.

◆ pci_ht_map_msi()

void pci_ht_map_msi ( device_t  dev,
uint64_t  addr 
)

◆ pci_identify_function()

static struct pci_devinfo * pci_identify_function ( device_t  pcib,
device_t  dev,
int  domain,
int  busno,
int  slot,
int  func 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_load_vendor_data()

static void pci_load_vendor_data ( void  )
static

Definition at line 4696 of file pci.c.

References data, pci_vendordata, and pci_vendordata_size.

Referenced by pci_modevent().

Here is the caller graph for this function:

◆ pci_lookup()

static void pci_lookup ( void *  arg,
const char *  name,
device_t *  dev 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_mapbase()

static pci_addr_t pci_mapbase ( uint64_t  mapreg)
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().

Here is the caller graph for this function:

◆ pci_maprange()

static int pci_maprange ( uint64_t  mapreg)
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().

Here is the caller graph for this function:

◆ pci_mapsize()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_maptype()

static const char * pci_maptype ( uint64_t  mapreg)
static

Definition at line 548 of file pci.c.

References PCI_BAR_IO, and PCIM_BAR_MEM_PREFETCH.

Referenced by pci_add_map().

Here is the caller graph for this function:

◆ pci_mask_msix()

void pci_mask_msix ( device_t  dev,
u_int  index 
)
static

◆ pci_match_device()

const struct pci_device_table * pci_match_device ( device_t  child,
const struct pci_device_table id,
size_t  nelt 
)

◆ pci_memen()

static int pci_memen ( device_t  dev)
static

Definition at line 3058 of file pci.c.

References dev, PCIM_CMD_MEMEN, and PCIR_COMMAND.

Referenced by pci_add_map().

Here is the caller graph for this function:

◆ pci_modevent()

static int pci_modevent ( module_t  mod,
int  what,
void *  arg 
)
static

Definition at line 6005 of file pci.c.

References pci_devq, pci_generation, pci_load_vendor_data(), pci_lookup(), and pcicdev.

Here is the call graph for this function:

◆ pci_msi_blacklisted()

static int pci_msi_blacklisted ( void  )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_msi_count_method()

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.

◆ pci_msi_device_blacklisted()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_msix_blacklisted()

static int pci_msix_blacklisted ( void  )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_msix_count_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.

◆ pci_msix_device_blacklisted()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_msix_pba_bar_method()

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.

◆ pci_msix_table_bar_method()

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.

◆ pci_pending_msix()

int pci_pending_msix ( device_t  dev,
u_int  index 
)

◆ pci_porten()

static int pci_porten ( device_t  dev)
static

Definition at line 3052 of file pci.c.

References dev, PCIM_CMD_PORTEN, and PCIR_COMMAND.

Referenced by pci_add_map().

Here is the caller graph for this function:

◆ pci_power_reset()

int pci_power_reset ( device_t  dev)

Definition at line 6599 of file pci.c.

References dev.

Referenced by pci_reset_child().

Here is the caller graph for this function:

◆ pci_print_child()

int pci_print_child ( device_t  dev,
device_t  child 
)

Definition at line 4912 of file pci.c.

References child, and dev.

◆ pci_print_faulted_dev()

◆ pci_print_faulted_dev_name()

static void pci_print_faulted_dev_name ( const struct pci_devinfo *  dinfo)
static

Definition at line 6718 of file pci.c.

References dev.

Referenced by pci_print_faulted_dev().

Here is the caller graph for this function:

◆ pci_print_verbose()

◆ pci_printf()

static int pci_printf ( pcicfgregs cfg,
const char *  fmt,
  ... 
)
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().

Here is the caller graph for this function:

◆ pci_probe()

static int pci_probe ( device_t  dev)
static

Definition at line 4458 of file pci.c.

References dev.

◆ pci_probe_nomatch()

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.

Here is the call graph for this function:

◆ pci_read_bar()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_read_cap()

static void pci_read_cap ( device_t  pcib,
pcicfgregs cfg 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_read_config_method()

uint32_t pci_read_config_method ( device_t  dev,
device_t  child,
int  reg,
int  width 
)

◆ pci_read_device()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_read_ivar()

◆ pci_read_vpd()

◆ pci_read_vpd_reg()

static int pci_read_vpd_reg ( device_t  pcib,
pcicfgregs cfg,
int  reg,
uint32_t *  data 
)
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().

Here is the caller graph for this function:

◆ pci_release_msi_method()

int pci_release_msi_method ( device_t  dev,
device_t  child 
)

◆ pci_release_msix()

static int pci_release_msix ( device_t  dev,
device_t  child 
)
static

◆ pci_release_resource()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_remap_intr_method()

◆ pci_remap_msix_method()

int pci_remap_msix_method ( device_t  dev,
device_t  child,
int  count,
const u_int *  vectors 
)

◆ pci_rescan_method()

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.

Here is the call graph for this function:

◆ pci_reserve_map()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_reset_child()

static int pci_reset_child ( device_t  dev,
device_t  child,
int  flags 
)
static

Definition at line 6654 of file pci.c.

References child, dev, pci_power_reset(), and pcie_flr().

Here is the call graph for this function:

◆ pci_reset_post()

static int pci_reset_post ( device_t  dev,
device_t  child 
)
static

Definition at line 6636 of file pci.c.

References child, dev, and pci_restore_state().

Here is the call graph for this function:

◆ pci_reset_prepare()

static int pci_reset_prepare ( device_t  dev,
device_t  child 
)
static

Definition at line 6645 of file pci.c.

References child, dev, and pci_save_state().

Here is the call graph for this function:

◆ pci_restore_bars()

static void pci_restore_bars ( device_t  dev)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_restore_state()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_resume()

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.

◆ pci_resume_child()

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().

Here is the call graph for this function:

◆ pci_resume_msi()

static void pci_resume_msi ( device_t  dev)
static

◆ pci_resume_msix()

◆ pci_rombase()

static pci_addr_t pci_rombase ( uint64_t  mapreg)
static

Definition at line 580 of file pci.c.

References PCIM_BIOS_ADDR_MASK.

Referenced by pci_romsize().

Here is the caller graph for this function:

◆ pci_romsize()

static int pci_romsize ( uint64_t  testval)
static

Definition at line 589 of file pci.c.

References pci_rombase().

Referenced by pci_reserve_map().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_save_state()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_set_command_bit()

static __inline void pci_set_command_bit ( device_t  dev,
device_t  child,
uint16_t  bit 
)
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().

Here is the caller graph for this function:

◆ pci_set_max_read_req()

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.

◆ pci_set_power_child()

static void pci_set_power_child ( device_t  dev,
device_t  child,
int  state 
)
static

Definition at line 4569 of file pci.c.

References child, dev, pcib, and state.

Referenced by pci_resume_child(), and pci_suspend_child().

Here is the caller graph for this function:

◆ pci_set_powerstate_method()

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.

Here is the call graph for this function:

◆ pci_setup_intr()

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 
)

◆ pci_suspend_child()

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().

Here is the call graph for this function:

◆ pci_teardown_intr()

int pci_teardown_intr ( device_t  dev,
device_t  child,
struct resource *  irq,
void *  cookie 
)

◆ pci_unmask_msix()

void pci_unmask_msix ( device_t  dev,
u_int  index 
)
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().

Here is the caller graph for this function:

◆ pci_write_bar()

static void pci_write_bar ( device_t  dev,
struct pci_map pm,
pci_addr_t  base 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_write_config_method()

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.

◆ pci_write_ivar()

int pci_write_ivar ( device_t  dev,
device_t  child,
int  which,
uintptr_t  value 
)

Definition at line 5339 of file pci.c.

References child, and value.

◆ pci_write_msix_entry()

static void pci_write_msix_entry ( device_t  dev,
u_int  index,
uint64_t  address,
uint32_t  data 
)
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().

Here is the caller graph for this function:

◆ pcie_adjust_config()

uint32_t pcie_adjust_config ( device_t  dev,
int  reg,
uint32_t  mask,
uint32_t  value,
int  width 
)

Definition at line 2322 of file pci.c.

References dev, reg, value, and width.

Referenced by pcie_setup_mps().

Here is the caller graph for this function:

◆ pcie_apei_error()

◆ pcie_flr()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcie_get_max_completion_timeout()

◆ pcie_link_reset()

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().

Here is the caller graph for this function:

◆ pcie_read_config()

uint32_t pcie_read_config ( device_t  dev,
int  reg,
int  width 
)

Definition at line 2287 of file pci.c.

References dev, reg, and width.

Referenced by pcie_setup_mps().

Here is the caller graph for this function:

◆ pcie_setup_mps()

static void pcie_setup_mps ( device_t  dev)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcie_wait_for_pending_transactions()

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().

Here is the caller graph for this function:

◆ pcie_write_config()

void pcie_write_config ( device_t  dev,
int  reg,
uint32_t  value,
int  width 
)

Definition at line 2303 of file pci.c.

References dev, reg, value, and width.

◆ SYSCTL_INT() [1/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
clear_aer_on_attach  ,
CTLFLAG_RWTUN  ,
pci_clear_aer_on_attach,
,
"Clear port and device AER state on driver attach"   
)

◆ SYSCTL_INT() [2/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
clear_bars  ,
CTLFLAG_RDTUN  ,
pci_clear_bars,
,
"Ignore firmware-assigned resources for BARs."   
)

◆ SYSCTL_INT() [3/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
do_power_nodriver  ,
CTLFLAG_RWTUN  ,
pci_do_power_nodriver,
,
"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() [4/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
do_power_resume  ,
CTLFLAG_RWTUN  ,
pci_do_power_resume,
,
"Transition from D3 -> D0 on resume."   
)

◆ SYSCTL_INT() [5/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
do_power_suspend  ,
CTLFLAG_RWTUN  ,
pci_do_power_suspend,
,
"Transition from D0 -> D3 on suspend."   
)

◆ SYSCTL_INT() [6/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
enable_ari  ,
CTLFLAG_RDTUN  ,
pci_enable_ari,
,
"Enable support for PCIe Alternative RID Interpretation"   
)

◆ SYSCTL_INT() [7/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
enable_aspm  ,
CTLFLAG_RDTUN  ,
pci_enable_aspm,
,
"Enable support for PCIe Active State Power Management"   
)

◆ SYSCTL_INT() [8/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
enable_io_modes  ,
CTLFLAG_RWTUN  ,
pci_enable_io_modes,
,
"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() [9/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
enable_msi  ,
CTLFLAG_RWTUN  ,
pci_do_msi,
,
"Enable support for MSI interrupts"   
)

◆ SYSCTL_INT() [10/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
enable_msix  ,
CTLFLAG_RWTUN  ,
pci_do_msix,
,
"Enable support for MSI-X interrupts"   
)

◆ SYSCTL_INT() [11/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
honor_msi_blacklist  ,
CTLFLAG_RDTUN  ,
pci_honor_msi_blacklist,
,
"Honor chipset blacklist for MSI/MSI-X"   
)

◆ SYSCTL_INT() [12/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
msix_rewrite_table  ,
CTLFLAG_RWTUN  ,
pci_msix_rewrite_table,
,
"Rewrite entire MSI-X table when updating MSI-X entries"   
)

◆ SYSCTL_INT() [13/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
realloc_bars  ,
CTLFLAG_RWTUN  ,
pci_do_realloc_bars,
,
"Attempt to allocate a new range for any BARs whose original " "firmware-assigned ranges fail to allocate during the initial device scan."   
)

◆ SYSCTL_INT() [14/14]

SYSCTL_INT ( _hw_pci  ,
OID_AUTO  ,
usb_early_takeover  ,
CTLFLAG_RDTUN  ,
pci_usb_takeover,
,
"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_NODE()

SYSCTL_NODE ( _hw  ,
OID_AUTO  ,
pci  ,
CTLFLAG_RD|  CTLFLAG_MPSAFE,
,
"PCI bus tuning parameters"   
)

◆ uhci_early_takeover()

static void uhci_early_takeover ( device_t  self)
static

Definition at line 3569 of file pci.c.

References rid.

Referenced by pci_add_resources().

Here is the caller graph for this function:

◆ vpd_nextbyte()

static int vpd_nextbyte ( struct vpd_readstate vrs,
uint8_t *  data 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xhci_early_takeover()

static void xhci_early_takeover ( device_t  self)
static

Definition at line 3649 of file pci.c.

References PCIR_BAR, and rid.

Referenced by pci_add_resources().

Here is the caller graph for this function:

Variable Documentation

◆ class

int class

Definition at line 4940 of file pci.c.

◆ desc

const char* desc

Definition at line 4943 of file pci.c.

Referenced by pci_describe_device(), and pci_describe_parse_line().

◆ pci_clear_aer_on_attach

int pci_clear_aer_on_attach = 0
static

Definition at line 420 of file pci.c.

Referenced by pci_add_child().

◆ pci_clear_bars

int pci_clear_bars
static

Definition at line 402 of file pci.c.

Referenced by pci_add_map().

◆ pci_devclass

devclass_t pci_devclass
static

Definition at line 229 of file pci.c.

◆ pci_devq

◆ pci_do_msi

int pci_do_msi = 1
static

Definition at line 374 of file pci.c.

Referenced by pci_alloc_msi_method(), and pci_msi_count_method().

◆ pci_do_msix

int pci_do_msix = 1
static

◆ pci_do_power_nodriver

int pci_do_power_nodriver = 0
static

Definition at line 356 of file pci.c.

Referenced by pci_cfg_save().

◆ pci_do_power_resume

int pci_do_power_resume = 1

Definition at line 364 of file pci.c.

Referenced by pci_resume_child().

◆ pci_do_power_suspend

int pci_do_power_suspend = 1

Definition at line 369 of file pci.c.

Referenced by pci_resume_child(), and pci_suspend_child().

◆ pci_do_realloc_bars

int pci_do_realloc_bars = 1
static

Definition at line 350 of file pci.c.

Referenced by pci_add_map().

◆ pci_enable_ari

int pci_enable_ari = 1
static

Definition at line 412 of file pci.c.

Referenced by pci_add_children().

◆ pci_enable_aspm

int pci_enable_aspm = 1

Definition at line 416 of file pci.c.

◆ pci_enable_io_modes

int pci_enable_io_modes = 1
static

Definition at line 343 of file pci.c.

Referenced by pci_add_map().

◆ pci_generation

uint32_t pci_generation

Definition at line 335 of file pci.c.

Referenced by pci_fill_devinfo(), pci_freecfg(), pci_ioctl(), and pci_modevent().

◆ pci_honor_msi_blacklist

int pci_honor_msi_blacklist = 1
static

◆ pci_methods

device_method_t pci_methods[]
static

Definition at line 144 of file pci.c.

◆ pci_msix_rewrite_table

int pci_msix_rewrite_table = 0
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().

◆ pci_numdevs

uint32_t pci_numdevs = 0

Definition at line 336 of file pci.c.

Referenced by pci_fill_devinfo(), pci_freecfg(), and pci_ioctl().

◆ pci_quirks

const struct pci_quirk pci_quirks[]
static

Definition at line 251 of file pci.c.

Referenced by pci_add_resources(), and pci_has_quirk().

◆ pci_usb_takeover

int pci_usb_takeover = 0
static

Definition at line 394 of file pci.c.

Referenced by pci_add_resources().

◆ pci_vendordata

char* pci_vendordata
static

Definition at line 234 of file pci.c.

Referenced by pci_describe_device(), pci_describe_parse_line(), and pci_load_vendor_data().

◆ pci_vendordata_size

size_t pci_vendordata_size
static

Definition at line 235 of file pci.c.

Referenced by pci_describe_parse_line(), and pci_load_vendor_data().

◆ pcie_chipset

int pcie_chipset
static

Definition at line 337 of file pci.c.

Referenced by pci_msi_blacklisted(), and pci_read_cap().

◆ pcix_chipset

int pcix_chipset
static

Definition at line 337 of file pci.c.

Referenced by pci_msi_blacklisted(), and pci_read_cap().

◆ report

int report

Definition at line 4942 of file pci.c.

Referenced by pci_probe_nomatch().

◆ subclass

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().