1/*
2 * Copyright (c) 2014 ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#ifndef LIB_DMA_DESCRIPTORS_H
11#define LIB_DMA_DESCRIPTORS_H
12
13struct dma_descriptor;
14
15/// flags how the descriptors are mapped
16#define DMA_DESC_MAP_FLAGS VREGION_FLAGS_READ_WRITE
17
18/*
19 * ----------------------------------------------------------------------------
20 * Getters / Setters
21 * ----------------------------------------------------------------------------
22 */
23
24/**
25 * \brief returns the corresponding IOAT DMA request this descriptor belongs
26 *
27 * \param desc IOAT DMA descriptor
28 *
29 * \brief pointer to the request
30 *        NULL if there is none
31 */
32struct dma_request *dma_desc_get_request(struct dma_descriptor *desc);
33
34/**
35 * \brief returns a pointer to the next descriptor in the descriptor chain
36 *
37 * \param desc IOAT DMA descriptor
38 *
39 * \returns next descriptor
40 *          NULL if the end of chain
41 */
42struct dma_descriptor *dma_desc_get_next(struct dma_descriptor *desc);
43
44#endif  /* LIB_DMA_DESCRIPTORS_H */
45