bhnd(4): Use the new BHND_CAP_BP64 capability flag to exclude DMA
translations unsupported by the backplane.
This commit is contained in:
parent
82a840f165
commit
286c7eb892
@ -2128,7 +2128,14 @@ bhndb_get_dma_translation(device_t dev, device_t child, u_int width,
|
||||
if (sc->bus_res->res->dma_tags == NULL)
|
||||
return (ENODEV);
|
||||
|
||||
/* Find the best matching descriptor for the requested type */
|
||||
/* Is the requested width supported? */
|
||||
if (width > BHND_DMA_ADDR_32BIT) {
|
||||
/* Backplane must support 64-bit addressing */
|
||||
if (!(sc->chipid.chip_caps & BHND_CAP_BP64))
|
||||
width = BHND_DMA_ADDR_32BIT;
|
||||
}
|
||||
|
||||
/* Find the best matching descriptor for the requested width */
|
||||
addr_mask = BHND_DMA_ADDR_BITMASK(width);
|
||||
|
||||
match = NULL;
|
||||
|
@ -234,10 +234,11 @@ bhnd_nexus_get_dma_translation(device_t dev, device_t child,
|
||||
KASSERT(width > 0 && width <= BHND_DMA_ADDR_64BIT,
|
||||
("invalid width %u", width));
|
||||
|
||||
/* Is the requested width supported? */
|
||||
if (width > BHND_DMA_ADDR_32BIT) {
|
||||
/* Backplane must support 64-bit addressing */
|
||||
if (!(bp->cc_caps & CHIPC_CAP_BKPLN64))
|
||||
return (ENOENT);
|
||||
if (!(bp->cid.chip_caps & BHND_CAP_BP64))
|
||||
width = BHND_DMA_ADDR_32BIT;
|
||||
}
|
||||
|
||||
/* No DMA address translation required */
|
||||
|
Loading…
Reference in New Issue
Block a user