FreeBSD kernel amd64 PCI device code
|
#include <sys/taskqueue.h>
Go to the source code of this file.
Data Structures | |
struct | pcib_secbus |
struct | pcib_softc |
Macros | |
#define | PCIB_SUBTRACTIVE 0x1 |
#define | PCIB_DISABLE_MSI 0x2 |
#define | PCIB_DISABLE_MSIX 0x4 |
#define | PCIB_ENABLE_ARI 0x8 |
#define | PCIB_HOTPLUG 0x10 |
#define | PCIB_HOTPLUG_CMD_PENDING 0x20 |
#define | PCIB_DETACH_PENDING 0x40 |
#define | PCIB_DETACHING 0x80 |
#define | PCIB_HP_LOCK(sc) mtx_lock((sc)->pcie_hp_lock) |
#define | PCIB_HP_UNLOCK(sc) mtx_unlock((sc)->pcie_hp_lock) |
#define | PCIB_HP_LOCK_ASSERT(sc) mtx_assert((sc)->pcie_hp_lock, MA_OWNED) |
#define | PCIB_SUPPORTED_ARI_VER 1 |
Typedefs | |
typedef uint32_t | pci_read_config_fn(int b, int s, int f, int reg, int width) |
Functions | |
DECLARE_CLASS (pcib_driver) | |
int | host_pcib_get_busno (pci_read_config_fn read_config, int bus, int slot, int func, uint8_t *busnum) |
int | pcib_attach (device_t dev) |
int | pcib_attach_child (device_t dev) |
void | pcib_attach_common (device_t dev) |
void | pcib_bridge_init (device_t dev) |
int | pcib_child_present (device_t dev, device_t child) |
int | pcib_detach (device_t dev) |
int | pcib_read_ivar (device_t dev, device_t child, int which, uintptr_t *result) |
int | pcib_write_ivar (device_t dev, device_t child, int which, uintptr_t value) |
struct resource * | pcib_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 | pcib_maxslots (device_t dev) |
int | pcib_maxfuncs (device_t dev) |
int | pcib_route_interrupt (device_t pcib, device_t dev, int pin) |
int | pcib_alloc_msi (device_t pcib, device_t dev, int count, int maxcount, int *irqs) |
int | pcib_release_msi (device_t pcib, device_t dev, int count, int *irqs) |
int | pcib_alloc_msix (device_t pcib, device_t dev, int *irq) |
int | pcib_release_msix (device_t pcib, device_t dev, int irq) |
int | pcib_map_msi (device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data) |
int | pcib_get_id (device_t pcib, device_t dev, enum pci_id_type type, uintptr_t *id) |
void | pcib_decode_rid (device_t pcib, uint16_t rid, int *bus, int *slot, int *func) |
int | pcib_request_feature (device_t dev, enum pci_feature feature) |
int | pcib_request_feature_allow (device_t pcib, device_t dev, enum pci_feature feature) |
#define PCIB_DETACH_PENDING 0x40 |
Definition at line 116 of file pcib_private.h.
#define PCIB_DETACHING 0x80 |
Definition at line 117 of file pcib_private.h.
#define PCIB_DISABLE_MSI 0x2 |
Definition at line 111 of file pcib_private.h.
#define PCIB_DISABLE_MSIX 0x4 |
Definition at line 112 of file pcib_private.h.
#define PCIB_ENABLE_ARI 0x8 |
Definition at line 113 of file pcib_private.h.
#define PCIB_HOTPLUG 0x10 |
Definition at line 114 of file pcib_private.h.
#define PCIB_HOTPLUG_CMD_PENDING 0x20 |
Definition at line 115 of file pcib_private.h.
#define PCIB_HP_LOCK | ( | sc | ) | mtx_lock((sc)->pcie_hp_lock) |
Definition at line 146 of file pcib_private.h.
#define PCIB_HP_LOCK_ASSERT | ( | sc | ) | mtx_assert((sc)->pcie_hp_lock, MA_OWNED) |
Definition at line 148 of file pcib_private.h.
#define PCIB_HP_UNLOCK | ( | sc | ) | mtx_unlock((sc)->pcie_hp_lock) |
Definition at line 147 of file pcib_private.h.
#define PCIB_SUBTRACTIVE 0x1 |
Definition at line 110 of file pcib_private.h.
#define PCIB_SUPPORTED_ARI_VER 1 |
Definition at line 150 of file pcib_private.h.
Definition at line 152 of file pcib_private.h.
DECLARE_CLASS | ( | pcib_driver | ) |
int host_pcib_get_busno | ( | pci_read_config_fn | read_config, |
int | bus, | ||
int | slot, | ||
int | func, | ||
uint8_t * | busnum | ||
) |
Definition at line 53 of file pci_subr.c.
References bus, func, id, PCIR_DEVVENDOR, read_config, and slot.
int pcib_alloc_msi | ( | device_t | pcib, |
device_t | dev, | ||
int | count, | ||
int | maxcount, | ||
int * | irqs | ||
) |
Definition at line 2773 of file pci_pci.c.
References bus, count, dev, pcib_softc::flags, irqs, maxcount, pcib, and PCIB_DISABLE_MSI.
int pcib_alloc_msix | ( | device_t | pcib, |
device_t | dev, | ||
int * | irq | ||
) |
Definition at line 2797 of file pci_pci.c.
References bus, dev, pcib_softc::flags, irq, pcib, and PCIB_DISABLE_MSIX.
struct resource * pcib_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 2439 of file pci_pci.c.
References pcib_softc::bridgectl, child, count, dev, pcib_softc::flags, pcib_softc::iobase, pcib_softc::iolimit, pcib_softc::membase, pcib_softc::memlimit, name, PCIB_BCR_VGA_ENABLE, pcib_is_io_open(), pcib_is_nonprefetch_open(), pcib_is_prefetch_open(), PCIB_SUBTRACTIVE, pcib_softc::pmembase, pcib_softc::pmemlimit, rid, start, and type.
int pcib_attach | ( | device_t | dev | ) |
Definition at line 1755 of file pci_pci.c.
References dev, pcib_attach_child(), and pcib_attach_common().
int pcib_attach_child | ( | device_t | dev | ) |
Definition at line 1733 of file pci_pci.c.
References pcib_softc::bus, pcib_softc::child, dev, and pcib_secbus::sec.
Referenced by pcib_attach().
void pcib_attach_common | ( | device_t | dev | ) |
Definition at line 1537 of file pci_pci.c.
References pcib_softc::bridgectl, pcib_softc::bus, dev, pcib_softc::dev, pcib_softc::domain, pcib_softc::flags, pcib_softc::iobase, pcib_softc::iolimit, pcib_softc::membase, pcib_softc::memlimit, pci_msi_device_blacklisted(), pci_msix_device_blacklisted(), PCIB_BCR_ISA_ENABLE, PCIB_BCR_VGA_ENABLE, pcib_cfg_save(), PCIB_DISABLE_MSI, PCIB_DISABLE_MSIX, PCIB_HOTPLUG, pcib_is_io_open(), pcib_is_nonprefetch_open(), pcib_is_prefetch_open(), PCIB_SUBTRACTIVE, PCIP_BRIDGE_PCI_SUBTRACTIVE, PCIR_BRIDGECTL_1, PCIR_PRIBUS_1, PCIR_PROGIF, PCIR_SECBUS_1, PCIR_SUBBUS_1, pcib_softc::pmembase, pcib_softc::pmemlimit, pcib_softc::pribus, pcib_secbus::sec, and pcib_secbus::sub.
Referenced by pcib_attach().
void pcib_bridge_init | ( | device_t | dev | ) |
Definition at line 1818 of file pci_pci.c.
References dev, PCIR_IOBASEH_1, PCIR_IOBASEL_1, PCIR_IOLIMITH_1, PCIR_IOLIMITL_1, PCIR_MEMBASE_1, PCIR_MEMLIMIT_1, PCIR_PMBASEH_1, PCIR_PMBASEL_1, PCIR_PMLIMITH_1, and PCIR_PMLIMITL_1.
int pcib_child_present | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 1833 of file pci_pci.c.
References dev, pcib_softc::flags, and PCIB_HOTPLUG.
void pcib_decode_rid | ( | device_t | pcib, |
uint16_t | rid, | ||
int * | bus, | ||
int * | slot, | ||
int * | func | ||
) |
Definition at line 74 of file pcib_support.c.
References bus, func, PCI_RID2BUS, PCI_RID2FUNC, PCI_RID2SLOT, rid, and slot.
int pcib_detach | ( | device_t | dev | ) |
Definition at line 1763 of file pci_pci.c.
References pcib_softc::bus, dev, pcib_softc::flags, and PCIB_HOTPLUG.
int pcib_get_id | ( | device_t | pcib, |
device_t | dev, | ||
enum pci_id_type | type, | ||
uintptr_t * | id | ||
) |
Definition at line 58 of file pcib_support.c.
References bus, dev, func, PCI_ID_RID, PCI_RID, slot, and type.
int pcib_map_msi | ( | device_t | pcib, |
device_t | dev, | ||
int | irq, | ||
uint64_t * | addr, | ||
uint32_t * | data | ||
) |
int pcib_maxfuncs | ( | device_t | dev | ) |
Definition at line 52 of file pcib_support.c.
References PCI_FUNCMAX.
int pcib_maxslots | ( | device_t | dev | ) |
Definition at line 2629 of file pci_pci.c.
References dev, PCI_SLOTMAX, PCIEM_FLAGS_TYPE, PCIEM_TYPE_DOWNSTREAM_PORT, PCIEM_TYPE_ROOT_PORT, PCIER_FLAGS, PCIY_EXPRESS, and val.
Referenced by pcib_ari_maxslots().
int pcib_read_ivar | ( | device_t | dev, |
device_t | child, | ||
int | which, | ||
uintptr_t * | result | ||
) |
Definition at line 1849 of file pci_pci.c.
References pcib_softc::bus, dev, pcib_softc::domain, and pcib_secbus::sec.
int pcib_release_msi | ( | device_t | pcib, |
device_t | dev, | ||
int | count, | ||
int * | irqs | ||
) |
int pcib_release_msix | ( | device_t | pcib, |
device_t | dev, | ||
int | irq | ||
) |
int pcib_request_feature | ( | device_t | dev, |
enum pci_feature | feature | ||
) |
int pcib_request_feature_allow | ( | device_t | pcib, |
device_t | dev, | ||
enum pci_feature | feature | ||
) |
Definition at line 2944 of file pci_pci.c.
References feature, PCI_FEATURE_AER, and PCI_FEATURE_HP.
int pcib_route_interrupt | ( | device_t | pcib, |
device_t | dev, | ||
int | pin | ||
) |