Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\dma\swiotlb.c Create Date:2022-07-28 10:36:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Create a swiotlb mapping for the buffer at @phys, and in case of DMAing* to the device copy the data into it as well.

Proto:bool swiotlb_map(struct device *dev, phys_addr_t *phys, dma_addr_t *dma_addr, size_t size, enum dma_data_direction dir, unsigned long attrs)

Type:bool

Parameter:

TypeParameterName
struct device *dev
phys_addr_t *phys
dma_addr_t *dma_addr
size_tsize
enum dma_data_directiondir
unsigned longattrs
665  trace_swiotlb_bounced(dev, * dma_addr, size, swiotlb_force)
667  If Value for the false possibility is greater at compile time(swiotlb_force == swiotlb=noforce ) Then
668  dev_warn_ratelimited(dev, "Cannot do DMA to address %pa\n", phys)
670  Return false
674  phys = swiotlb_tbl_map_single(dev, __phys_to_dma(dev, Used to do a quick range check in swiotlb_tbl_unmap_single and* swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this* API.), * phys, size, size, dir, attrs)
676  If phys == DMA_MAPPING_ERROR Then Return false
680  dma_addr = __phys_to_dma(dev, * phys)
681  If Value for the false possibility is greater at compile time(!dma_capable(dev, * dma_addr, size, true)) Then
682  lb_addr is the physical address of the bounce buffer to unmap.
684  Return false
687  Return true