Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/pcivar.h
Show All 33 Lines | |||||
/* some PCI bus constants */ | /* some PCI bus constants */ | ||||
#define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */ | #define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */ | ||||
#define PCI_MAXMAPS_1 2 /* max. no. of maps for PCI to PCI bridge */ | #define PCI_MAXMAPS_1 2 /* max. no. of maps for PCI to PCI bridge */ | ||||
#define PCI_MAXMAPS_2 1 /* max. no. of maps for CardBus bridge */ | #define PCI_MAXMAPS_2 1 /* max. no. of maps for CardBus bridge */ | ||||
typedef uint64_t pci_addr_t; | typedef uint64_t pci_addr_t; | ||||
struct nvlist; | |||||
/* Config registers for PCI-PCI and PCI-Cardbus bridges. */ | /* Config registers for PCI-PCI and PCI-Cardbus bridges. */ | ||||
struct pcicfg_bridge { | struct pcicfg_bridge { | ||||
uint8_t br_seclat; | uint8_t br_seclat; | ||||
uint8_t br_subbus; | uint8_t br_subbus; | ||||
uint8_t br_secbus; | uint8_t br_secbus; | ||||
uint8_t br_pribus; | uint8_t br_pribus; | ||||
uint16_t br_control; | uint16_t br_control; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 477 Lines • ▼ Show 20 Lines | pci_get_rid(device_t dev) | ||||
return (PCI_GET_RID(device_get_parent(dev), dev)); | return (PCI_GET_RID(device_get_parent(dev), dev)); | ||||
} | } | ||||
static __inline void | static __inline void | ||||
pci_child_added(device_t dev) | pci_child_added(device_t dev) | ||||
{ | { | ||||
return (PCI_CHILD_ADDED(device_get_parent(dev), dev)); | return (PCI_CHILD_ADDED(device_get_parent(dev), dev)); | ||||
} | |||||
static __inline int | |||||
pci_iov_attach(device_t dev, struct nvlist *pf_schema, struct nvlist *vf_schema) | |||||
{ | |||||
return (PCI_IOV_ATTACH(device_get_parent(dev), dev, pf_schema, | |||||
vf_schema)); | |||||
} | |||||
static __inline int | |||||
pci_iov_detach(device_t dev) | |||||
{ | |||||
return (PCI_IOV_DETACH(device_get_parent(dev), dev)); | |||||
} | } | ||||
device_t pci_find_bsf(uint8_t, uint8_t, uint8_t); | device_t pci_find_bsf(uint8_t, uint8_t, uint8_t); | ||||
device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t); | device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t); | ||||
device_t pci_find_device(uint16_t, uint16_t); | device_t pci_find_device(uint16_t, uint16_t); | ||||
device_t pci_find_class(uint8_t class, uint8_t subclass); | device_t pci_find_class(uint8_t class, uint8_t subclass); | ||||
/* Can be used by drivers to manage the MSI-X table. */ | /* Can be used by drivers to manage the MSI-X table. */ | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |