Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2008-2009, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef __MSM_DMA_TEST__ |
| 15 | #define __MSM_DMA_TEST__ |
| 16 | |
| 17 | #include <linux/ioctl.h> |
| 18 | |
| 19 | #define MSM_DMA_IOC_MAGIC 0x83 |
| 20 | |
| 21 | /* The testing driver can manage a series of buffers. These are |
| 22 | * allocated and freed using these calls. */ |
| 23 | struct msm_dma_alloc_req { |
| 24 | int size; /* Size of this request, in bytes. */ |
| 25 | int bufnum; /* OUT: Number of buffer allocated. */ |
| 26 | }; |
| 27 | #define MSM_DMA_IOALLOC _IOWR(MSM_DMA_IOC_MAGIC, 2, struct msm_dma_alloc_req) |
| 28 | |
| 29 | /* Free the specified buffer. */ |
| 30 | #define MSM_DMA_IOFREE _IOW(MSM_DMA_IOC_MAGIC, 3, int) |
| 31 | |
| 32 | /* Free all used buffers. */ |
| 33 | #define MSM_DMA_IOFREEALL _IO(MSM_DMA_IOC_MAGIC, 7) |
| 34 | |
| 35 | /* Read/write data into kernel buffer. */ |
| 36 | struct msm_dma_bufxfer { |
| 37 | void *data; |
| 38 | int size; |
| 39 | int bufnum; |
| 40 | }; |
| 41 | #define MSM_DMA_IOWBUF _IOW(MSM_DMA_IOC_MAGIC, 4, struct msm_dma_bufxfer) |
| 42 | #define MSM_DMA_IORBUF _IOW(MSM_DMA_IOC_MAGIC, 5, struct msm_dma_bufxfer) |
| 43 | |
| 44 | /* Use the data mover to copy from one buffer to another. */ |
| 45 | struct msm_dma_scopy { |
| 46 | int srcbuf; |
| 47 | int destbuf; |
| 48 | int size; |
| 49 | }; |
| 50 | #define MSM_DMA_IOSCOPY _IOW(MSM_DMA_IOC_MAGIC, 6, struct msm_dma_scopy) |
| 51 | |
| 52 | #endif /* __MSM_DMA_TEST__ */ |