Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iommu/busdma_iommu.c
Show First 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
ctx = iommu_instantiate_ctx(unit, child, false); | ctx = iommu_instantiate_ctx(unit, child, false); | ||||
res = ctx == NULL ? NULL : (bus_dma_tag_t)ctx->tag; | res = ctx == NULL ? NULL : (bus_dma_tag_t)ctx->tag; | ||||
return (res); | return (res); | ||||
} | } | ||||
bool | bool | ||||
bus_dma_dmar_set_buswide(device_t dev) | bus_dma_iommu_set_buswide(device_t dev) | ||||
{ | { | ||||
struct iommu_unit *unit; | struct iommu_unit *unit; | ||||
device_t parent; | device_t parent; | ||||
u_int busno, slot, func; | u_int busno, slot, func; | ||||
parent = device_get_parent(dev); | parent = device_get_parent(dev); | ||||
if (device_get_devclass(parent) != devclass_find("pci")) | if (device_get_devclass(parent) != devclass_find("pci")) | ||||
return (false); | return (false); | ||||
unit = iommu_find(dev, bootverbose); | unit = iommu_find(dev, bootverbose); | ||||
if (unit == NULL) | if (unit == NULL) | ||||
return (false); | return (false); | ||||
busno = pci_get_bus(dev); | busno = pci_get_bus(dev); | ||||
slot = pci_get_slot(dev); | slot = pci_get_slot(dev); | ||||
func = pci_get_function(dev); | func = pci_get_function(dev); | ||||
if (slot != 0 || func != 0) { | if (slot != 0 || func != 0) { | ||||
if (bootverbose) { | if (bootverbose) { | ||||
device_printf(dev, | device_printf(dev, | ||||
"dmar%d pci%d:%d:%d requested buswide busdma\n", | "iommu%d pci%d:%d:%d requested buswide busdma\n", | ||||
unit->unit, busno, slot, func); | unit->unit, busno, slot, func); | ||||
} | } | ||||
return (false); | return (false); | ||||
} | } | ||||
dmar_set_buswide_ctx(unit, busno); | iommu_set_buswide_ctx(unit, busno); | ||||
return (true); | return (true); | ||||
} | } | ||||
static MALLOC_DEFINE(M_IOMMU_DMAMAP, "iommu_dmamap", "IOMMU DMA Map"); | static MALLOC_DEFINE(M_IOMMU_DMAMAP, "iommu_dmamap", "IOMMU DMA Map"); | ||||
static void iommu_bus_schedule_dmamap(struct iommu_unit *unit, | static void iommu_bus_schedule_dmamap(struct iommu_unit *unit, | ||||
struct bus_dmamap_iommu *map); | struct bus_dmamap_iommu *map); | ||||
▲ Show 20 Lines • Show All 717 Lines • Show Last 20 Lines |