Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iop_adma.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2006, Intel Corporation.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms and conditions of the GNU General Public License,
6  * version 2, as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU General Public License along with
14  * this program; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16  *
17  */
18 #ifndef IOP_ADMA_H
19 #define IOP_ADMA_H
20 #include <linux/types.h>
21 #include <linux/dmaengine.h>
22 #include <linux/interrupt.h>
23 
24 #define IOP_ADMA_SLOT_SIZE 32
25 #define IOP_ADMA_THRESHOLD 4
26 #ifdef DEBUG
27 #define IOP_PARANOIA 1
28 #else
29 #define IOP_PARANOIA 0
30 #endif
31 #define iop_paranoia(x) BUG_ON(IOP_PARANOIA && (x))
32 
43  int id;
47 };
48 
62 struct iop_adma_chan {
63  int pending;
64  spinlock_t lock; /* protects the descriptor slot pool */
66  struct list_head chain;
68  struct dma_chan common;
73 };
74 
97  void *hw_desc;
103  size_t unmap_len;
106  union {
110  };
111 };
112 
114  int hw_id;
116  size_t pool_size;
117 };
118 
119 #define to_iop_sw_desc(addr_hw_desc) \
120  container_of(addr_hw_desc, struct iop_adma_desc_slot, hw_desc)
121 #define iop_hw_desc_slot_idx(hw_desc, idx) \
122  ( (void *) (((unsigned long) hw_desc) + ((idx) << 5)) )
123 #endif