Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/amd/amdvi_priv.h
Show First 20 Lines • Show All 369 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/* | /* | ||||
* AMD IOMMU softc. | * AMD IOMMU softc. | ||||
*/ | */ | ||||
struct amdvi_softc { | struct amdvi_softc { | ||||
struct amdvi_ctrl *ctrl; /* Control area. */ | struct amdvi_ctrl *ctrl; /* Control area. */ | ||||
device_t dev; /* IOMMU device. */ | device_t dev; /* IOMMU device. */ | ||||
device_t pci_dev; /* IOMMU PCI function device. */ | |||||
enum IvrsType ivhd_type; /* IOMMU IVHD type. */ | enum IvrsType ivhd_type; /* IOMMU IVHD type. */ | ||||
bool iotlb; /* IOTLB supported by IOMMU */ | bool iotlb; /* IOTLB supported by IOMMU */ | ||||
struct amdvi_cmd *cmd; /* Command descriptor area. */ | struct amdvi_cmd *cmd; /* Command descriptor area. */ | ||||
int cmd_max; /* Max number of commands. */ | int cmd_max; /* Max number of commands. */ | ||||
uint64_t cmp_data; /* Command completion write back. */ | uint64_t cmp_data; /* Command completion write back. */ | ||||
struct amdvi_event *event; /* Event descriptor area. */ | struct amdvi_event *event; /* Event descriptor area. */ | ||||
struct resource *event_res; /* Event interrupt resource. */ | struct resource *event_res; /* Event interrupt resource. */ | ||||
void *event_tag; /* Event interrupt tag. */ | void *event_tag; /* Event interrupt tag. */ | ||||
int event_max; /* Max number of events. */ | int event_max; /* Max number of events. */ | ||||
int event_irq; | |||||
int event_rid; | int event_rid; | ||||
/* ACPI various flags. */ | /* ACPI various flags. */ | ||||
uint32_t ivhd_flag; /* ACPI IVHD flag. */ | uint32_t ivhd_flag; /* ACPI IVHD flag. */ | ||||
uint32_t ivhd_feature; /* ACPI v1 Reserved or v2 attribute. */ | uint32_t ivhd_feature; /* ACPI v1 Reserved or v2 attribute. */ | ||||
uint64_t ext_feature; /* IVHD EFR */ | uint64_t ext_feature; /* IVHD EFR */ | ||||
/* PCI related. */ | /* PCI related. */ | ||||
uint16_t cap_off; /* PCI Capability offset. */ | uint16_t cap_off; /* PCI Capability offset. */ | ||||
uint8_t pci_cap; /* PCI capability. */ | uint8_t pci_cap; /* PCI capability. */ | ||||
uint16_t pci_seg; /* IOMMU PCI domain/segment. */ | uint16_t pci_seg; /* IOMMU PCI domain/segment. */ | ||||
uint16_t pci_rid; /* PCI BDF of IOMMU */ | uint16_t pci_rid; /* PCI BDF of IOMMU */ | ||||
/* Device range under this IOMMU. */ | /* Device range under this IOMMU. */ | ||||
uint16_t start_dev_rid; /* First device under this IOMMU. */ | uint16_t start_dev_rid; /* First device under this IOMMU. */ | ||||
uint16_t end_dev_rid; /* Last device under this IOMMU. */ | uint16_t end_dev_rid; /* Last device under this IOMMU. */ | ||||
/* BIOS provided device configuration for end points. */ | /* BIOS provided device configuration for end points. */ | ||||
struct ivhd_dev_cfg dev_cfg[10]; | struct ivhd_dev_cfg dev_cfg[10]; | ||||
int dev_cfg_cnt; | int dev_cfg_cnt; | ||||
/* Software statistics. */ | /* Software statistics. */ | ||||
uint64_t event_intr_cnt; /* Total event INTR count. */ | uint64_t event_intr_cnt; /* Total event INTR count. */ | ||||
uint64_t total_cmd; /* Total number of commands. */ | uint64_t total_cmd; /* Total number of commands. */ | ||||
}; | }; | ||||
extern driver_t amdiommu_driver; | |||||
int amdvi_setup_hw(struct amdvi_softc *softc); | int amdvi_setup_hw(struct amdvi_softc *softc); | ||||
int amdvi_teardown_hw(struct amdvi_softc *softc); | int amdvi_teardown_hw(struct amdvi_softc *softc); | ||||
#endif /* _AMDVI_PRIV_H_ */ | #endif /* _AMDVI_PRIV_H_ */ |