px_dma.c (1de45cd9) | px_dma.c (b65731f1) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 214 unchanged lines hidden (view full) --- 223px_dma_attach(px_t *px_p) 224{ 225 uint64_t baddr; 226 227 if (px_lib_iommu_getbypass(px_p->px_dip, 0ull, 228 PCI_MAP_ATTR_WRITE|PCI_MAP_ATTR_READ, 229 &baddr) != DDI_ENOTSUP) 230 /* ignore all other errors */ | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 214 unchanged lines hidden (view full) --- 223px_dma_attach(px_t *px_p) 224{ 225 uint64_t baddr; 226 227 if (px_lib_iommu_getbypass(px_p->px_dip, 0ull, 228 PCI_MAP_ATTR_WRITE|PCI_MAP_ATTR_READ, 229 &baddr) != DDI_ENOTSUP) 230 /* ignore all other errors */ |
231 px_p->px_soft_state |= PX_BYPASS_DMA_ALLOWED; | 231 px_p->px_dev_caps |= PX_BYPASS_DMA_ALLOWED; |
232 233 return (DDI_SUCCESS); 234} 235 236/* 237 * px_dma_attr2hdl 238 * 239 * This routine is called from the alloc handle entry point to sanity check the --- 31 unchanged lines hidden (view full) --- 271 nocross--; 272 if (attrp->dma_attr_flags & DDI_DMA_FORCE_PHYSICAL) { /* BYPASS */ 273 274 DBG(DBG_DMA_ALLOCH, px_p->px_dip, "bypass mode\n"); 275 /* 276 * If Bypass DMA is not supported, return error so that 277 * target driver can fall back to dvma mode of operation 278 */ | 232 233 return (DDI_SUCCESS); 234} 235 236/* 237 * px_dma_attr2hdl 238 * 239 * This routine is called from the alloc handle entry point to sanity check the --- 31 unchanged lines hidden (view full) --- 271 nocross--; 272 if (attrp->dma_attr_flags & DDI_DMA_FORCE_PHYSICAL) { /* BYPASS */ 273 274 DBG(DBG_DMA_ALLOCH, px_p->px_dip, "bypass mode\n"); 275 /* 276 * If Bypass DMA is not supported, return error so that 277 * target driver can fall back to dvma mode of operation 278 */ |
279 if (!(px_p->px_soft_state & PX_BYPASS_DMA_ALLOWED)) | 279 if (!(px_p->px_dev_caps & PX_BYPASS_DMA_ALLOWED)) |
280 return (DDI_DMA_BADATTR); 281 mp->dmai_flags |= PX_DMAI_FLAGS_BYPASSREQ; 282 if (nocross != UINT64_MAX) 283 return (DDI_DMA_BADATTR); 284 if (align && (align > MMU_PAGE_SIZE)) 285 return (DDI_DMA_BADATTR); 286 align = 1; /* align on 1 page boundary */ 287 --- 1307 unchanged lines hidden --- | 280 return (DDI_DMA_BADATTR); 281 mp->dmai_flags |= PX_DMAI_FLAGS_BYPASSREQ; 282 if (nocross != UINT64_MAX) 283 return (DDI_DMA_BADATTR); 284 if (align && (align > MMU_PAGE_SIZE)) 285 return (DDI_DMA_BADATTR); 286 align = 1; /* align on 1 page boundary */ 287 --- 1307 unchanged lines hidden --- |