Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

usb_alloc_coherent(9) [centos man page]

USB_ALLOC_COHERENT(9)						   USB Core APIs					     USB_ALLOC_COHERENT(9)

NAME
usb_alloc_coherent - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP SYNOPSIS
void * usb_alloc_coherent(struct usb_device * dev, size_t size, gfp_t mem_flags, dma_addr_t * dma); ARGUMENTS
dev device the buffer will be used with size requested buffer size mem_flags affect whether allocation may block dma used to return DMA address of buffer RETURN
Either null (indicating no buffer could be allocated), or the cpu-space pointer to a buffer that may be used to perform DMA to the specified device. Such cpu-space buffers are returned along with the DMA address (through the pointer provided). NOTE
These buffers are used with URB_NO_xxx_DMA_MAP set in urb->transfer_flags to avoid behaviors like using "DMA bounce buffers", or thrashing IOMMU hardware during URB completion/resubmit. The implementation varies between platforms, depending on details of how DMA will work to this device. Using these buffers also eliminates cacheline sharing problems on architectures where CPU caches are not DMA-coherent. On systems without bus-snooping caches, these buffers are uncached. When the buffer is no longer used, free it with usb_free_coherent. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 USB_ALLOC_COHERENT(9)

Check Out this Related Man Page

svatophys(9r)															     svatophys(9r)

NAME
svatophys - General: Converts a system virtual address to a physical address SYNOPSIS
kern_return_t svatophys( vm_offset_t kern_addr, vm_offset_t *phys_addr ); ARGUMENTS
Specifies the kernel virtual address. Specifies a pointer to the physical address to be filled in. DESCRIPTION
The svatophys routine converts a system virtual address to the corresponding physical address. All address and data structure manipulation done within the kernel is performed using system virtual addresses. Typically, system virtual addresses are a means of mapping physical memory and I/O space, which often consists of device registers and DMA buffers. In contrast to this, devices are usually unaware of any virtual addressing and for this reason use physical addresses. You use the svatophys routine to perform this address translation. As an example of where you can use this address translation, a disk device driver can use DMA buffers to transfer blocks of data to the disk (for the case of a write operation). The data to be written to disk is present in system memory at a system virtual address known to the driver. To initiate the DMA operation, the disk driver can set up a command packet to specify a write operation to the underlying disk controller hardware. This write command packet contains (among other things) the location of the DMA buffer as a physical address and the length of the buffer. Here, the driver calls the svatophys routine to translate the system virtual address of the DMA buffer to a physical address in the command packet issued to the disk driver. RETURN VALUES
The svatophys routine returns the following: The address translation has been completed successfully. Unable to perform address transla- tion. This value indicates that the address specified by the kern_addr argument is not a valid kernel or system virtual address. svatophys(9r)
Man Page