FreeBSD kernel amd64 PCI device code
pcib_private.h File Reference
#include <sys/taskqueue.h>
Include dependency graph for pcib_private.h:
This graph shows which files directly or indirectly include this file:

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)
 

Macro Definition Documentation

◆ PCIB_DETACH_PENDING

#define PCIB_DETACH_PENDING   0x40

Definition at line 116 of file pcib_private.h.

◆ PCIB_DETACHING

#define PCIB_DETACHING   0x80

Definition at line 117 of file pcib_private.h.

◆ PCIB_DISABLE_MSI

#define PCIB_DISABLE_MSI   0x2

Definition at line 111 of file pcib_private.h.

◆ PCIB_DISABLE_MSIX

#define PCIB_DISABLE_MSIX   0x4

Definition at line 112 of file pcib_private.h.

◆ PCIB_ENABLE_ARI

#define PCIB_ENABLE_ARI   0x8

Definition at line 113 of file pcib_private.h.

◆ PCIB_HOTPLUG

#define PCIB_HOTPLUG   0x10

Definition at line 114 of file pcib_private.h.

◆ PCIB_HOTPLUG_CMD_PENDING

#define PCIB_HOTPLUG_CMD_PENDING   0x20

Definition at line 115 of file pcib_private.h.

◆ PCIB_HP_LOCK

#define PCIB_HP_LOCK (   sc)    mtx_lock((sc)->pcie_hp_lock)

Definition at line 146 of file pcib_private.h.

◆ PCIB_HP_LOCK_ASSERT

#define PCIB_HP_LOCK_ASSERT (   sc)    mtx_assert((sc)->pcie_hp_lock, MA_OWNED)

Definition at line 148 of file pcib_private.h.

◆ PCIB_HP_UNLOCK

#define PCIB_HP_UNLOCK (   sc)    mtx_unlock((sc)->pcie_hp_lock)

Definition at line 147 of file pcib_private.h.

◆ PCIB_SUBTRACTIVE

#define PCIB_SUBTRACTIVE   0x1

Definition at line 110 of file pcib_private.h.

◆ PCIB_SUPPORTED_ARI_VER

#define PCIB_SUPPORTED_ARI_VER   1

Definition at line 150 of file pcib_private.h.

Typedef Documentation

◆ pci_read_config_fn

typedef uint32_t pci_read_config_fn(int b, int s, int f, int reg, int width)

Definition at line 152 of file pcib_private.h.

Function Documentation

◆ DECLARE_CLASS()

DECLARE_CLASS ( pcib_driver  )

◆ host_pcib_get_busno()

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.

◆ pcib_alloc_msi()

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.

◆ pcib_alloc_msix()

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.

◆ pcib_alloc_resource()

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 
)

◆ pcib_attach()

int pcib_attach ( device_t  dev)

Definition at line 1755 of file pci_pci.c.

References dev, pcib_attach_child(), and pcib_attach_common().

Here is the call graph for this function:

◆ pcib_attach_child()

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

Here is the caller graph for this function:

◆ pcib_attach_common()

◆ pcib_bridge_init()

void pcib_bridge_init ( device_t  dev)

◆ pcib_child_present()

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.

◆ pcib_decode_rid()

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.

◆ pcib_detach()

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.

◆ pcib_get_id()

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.

◆ pcib_map_msi()

int pcib_map_msi ( device_t  pcib,
device_t  dev,
int  irq,
uint64_t *  addr,
uint32_t *  data 
)

Definition at line 2820 of file pci_pci.c.

References addr, bus, data, dev, irq, pci_ht_map_msi(), and pcib.

Here is the call graph for this function:

◆ pcib_maxfuncs()

int pcib_maxfuncs ( device_t  dev)

Definition at line 52 of file pcib_support.c.

References PCI_FUNCMAX.

◆ pcib_maxslots()

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

Here is the caller graph for this function:

◆ pcib_read_ivar()

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.

◆ pcib_release_msi()

int pcib_release_msi ( device_t  pcib,
device_t  dev,
int  count,
int *  irqs 
)

Definition at line 2787 of file pci_pci.c.

References bus, count, dev, irqs, and pcib.

◆ pcib_release_msix()

int pcib_release_msix ( device_t  pcib,
device_t  dev,
int  irq 
)

Definition at line 2810 of file pci_pci.c.

References bus, dev, irq, and pcib.

◆ pcib_request_feature()

int pcib_request_feature ( device_t  dev,
enum pci_feature  feature 
)

Definition at line 2963 of file pci_pci.c.

References dev, and feature.

◆ pcib_request_feature_allow()

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.

◆ pcib_route_interrupt()

int pcib_route_interrupt ( device_t  pcib,
device_t  dev,
int  pin 
)

Definition at line 2739 of file pci_pci.c.

References bus, dev, pcib, and pin.

◆ pcib_write_ivar()

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

Definition at line 1865 of file pci_pci.c.