-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdma_op.h
More file actions
111 lines (99 loc) · 2.12 KB
/
dma_op.h
File metadata and controls
111 lines (99 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
* Copyright (C) 2016 University of Granada
* Miguel Jimenez Lopez <klyone@ugr.es>
*
* DMA Operation functions (header).
*
* This source code is licensed under the GNU General Public License,
* Version 2. See the file COPYING for more details.
*/
#ifndef DMA_OP_H
#define DMA_OP_H
#include "dma_xfer.h"
/**
*
* DMA Operation structure. It contains several DMA transactions/transfers.
*
*/
struct dma_op {
/* Xfer list */
struct list_head list_dma_xfer;
};
/**
*
* dma_op_create - Create a new DMA Operation.
*
* @gfp: Specific flags to request memory.
*
* Return: A DMA Operation.
*
*/
struct dma_op * dma_op_create(gfp_t gfp);
/**
*
* dma_op_add_xfer - Add a new DMA Xfer to the DMA Operation.
*
* @op : DMA Operation pointer.
* @xfer: DMA Xfer pointer.
*
* Return: 0 if sucess and an error code otherwise.
*
*/
int dma_op_add_xfer(struct dma_op * op, \
struct dma_xfer * xfer);
/**
*
* dma_op_del_xfer - Remove new DMA Xfer from the DMA Operation.
*
* @op : DMA Operation pointer.
* @xfer: DMA Xfer pointer.
*
* Return: 0 if sucess and an error code otherwise.
*
*/
int dma_op_del_xfer(struct dma_op * op, \
struct dma_xfer * xfer);
/**
*
* dma_op_add_xfer - Remove all DMA Xfers from the DMA Operation.
*
* @op : DMA Operation pointer.
* @xfer: DMA Xfer pointer.
*
* Return: 0 if sucess and an error code otherwise.
*
*/
int dma_op_clear_xfer(struct dma_op * op);
/**
*
* dma_op_start - Start all the transfers of the DMA Operation.
*
* Return: 0 if success and an error code otherwise.
*
*/
int dma_op_start(struct dma_op * op);
/**
* dma_op_all_xfers_completed - Check if all Xfers have been
* completed.
*
* Return: 1 if all xfers have completed and 0 otherwise.
*
*/
int dma_op_all_xfers_completed(struct dma_op * op);
/**
* dma_op_xfer_error - Check if any error occurs in
* some xfer.
*
* Return: 1 if any xfer has not completed properly and 0 otherwise.
*
*/
int dma_op_xfer_error(struct dma_op * op);
/**
*
* dma_op_free - Destroy a DMA Operation.
*
* @xfer: DMA Operation pointer.
*
*/
void dma_op_free(struct dma_op * op);
#endif /* DMA_OP_H */