host-drivers/base-driver/vca/plx87xx/plx_hw.c
ssize_t plx_read_dma_mapped_mem(struct plx_device *xdev,
	__u64 * dma_addr, __u32 * dma_size, char *out_buf, ssize_t out_buf_size)
{
	ssize_t dma_size_read = readq(dma_size);
	ssize_t size = min(dma_size_read, out_buf_size - 1);
	ssize_t count = 0;
	char *mem;


	if (out_buf_size == 0) {
		dev_err(&xdev->pdev->dev,
			"%s empty output buffer!\n",
			__func__);
		return 0;
	}

	mem = plx_ioremap(xdev, *dma_addr, size);
	if (!mem)
		return 0;

	memcpy_fromio(out_buf, mem, size);
	out_buf[size] = 0;
	count = strnlen(out_buf, size);

	plx_iounmap(xdev, mem);

	return count;
}
/**
 * plx_read_dma_mapped_mem - Mapped remote memory and copy string.
 * @xdev: pointer to plx_device instance
 * @dma_addr: remote address to copy
 * @dma_size: remote address size to copy
 * @out_buf: destination buffer to copy
 * @out_buf_size: destination buffer size
 *
 * RETURNS: size of copy string without end zero char.
 *
 */
Mapped remote memory and copy string.

size of copy string without end zero char.
Mapped remote memory and copy string . size of copy string without end zero char .
ssize_t plx_read_dma_mapped_mem(struct plx_device *xdev,
	__u64 * dma_addr, __u32 * dma_size, char *out_buf, ssize_t out_buf_size)
{
	ssize_t dma_size_read = readq(dma_size);
	ssize_t size = min(dma_size_read, out_buf_size - 1);
	ssize_t count = 0;
	char *mem;
	if (out_buf_size == 0) {
		dev_err(&xdev->pdev->dev,
			"%s empty output buffer!\n",
			__func__);
		return 0;
	}
	mem = plx_ioremap(xdev, *dma_addr, size);
	if (!mem)
		return 0;
	memcpy_fromio(out_buf, mem, size);
	out_buf[size] = 0;
	count = strnlen(out_buf, size);
	plx_iounmap(xdev, mem);
	return count;
}
ssize_t plx_read_dma_mapped_mem ( struct plx_device * xdev , __u64 * dma_addr , __u32 * dma_size , char * out_buf , ssize_t out_buf_size ) { ssize_t dma_size_read = readq ( dma_size ) ; ssize_t size = min ( dma_size_read , out_buf_size - 1 ) ; ssize_t count = 0 ; char * mem ; if ( out_buf_size == 0 ) { dev_err ( & xdev -> pdev -> dev , " \n " , __func__ ) ; return 0 ; } mem = plx_ioremap ( xdev , * dma_addr , size ) ; if ( ! mem ) return 0 ; memcpy_fromio ( out_buf , mem , size ) ; out_buf [ size ] = 0 ; count = strnlen ( out_buf , size ) ; plx_iounmap ( xdev , mem ) ; return count ; }
plx_read_dma_mapped_mem - Mapped remote memory and copy string.
plx_read_dma_mapped_mem - Mapped remote memory and copy string .