[ifxmips] add .32 patches
[openwrt.git] / target / linux / ifxmips / files-2.6.32 / drivers / crypto / ifxmips / ifxmips_deu_dma.h
1 /*
2  *   This program is free software; you can redistribute it and/or modify
3  *   it under the terms of the GNU General Public License as published by
4  *   the Free Software Foundation; either version 2 of the License, or
5  *   (at your option) any later version.
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  *   You should have received a copy of the GNU General Public License
13  *   along with this program; if not, write to the Free Software
14  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
15  *
16  *   Copyright (C) 2010 Ralph Hempel <ralph.hempel@lantiq.com>
17  *   Copyright (C) 2009 Mohammad Firdaus
18  */
19
20 /*!
21   \addtogroup    IFX_DEU IFX_DEU_DRIVERS
22   \ingroup       API
23   \brief         ifx deu driver module
24 */
25
26 /*!
27   \file         ifxmips_deu_dma.h
28   \ingroup      IFX_DEU
29   \brief        DMA deu driver header file
30 */
31
32 #ifndef IFXMIPS_DEU_DMA_H
33 #define IFXMIPS_DEU_DMA_H
34
35 #include <linux/init.h>
36 #include <linux/module.h>
37 #include <linux/mm.h>
38 #include <linux/crypto.h>
39 #include <asm/scatterlist.h>
40 #include <asm/byteorder.h>
41 #include <linux/skbuff.h>
42 #include <linux/netdevice.h>
43
44 // must match the size of memory block allocated for g_dma_block and g_dma_block2
45 #define DEU_MAX_PACKET_SIZE    (PAGE_SIZE >> 1)
46
47 typedef struct ifx_deu_device {
48         struct dma_device_info *dma_device;
49         u8 *dst;
50         u8 *src;
51         int len;
52         int dst_count;
53         int src_count;
54         int recv_count;
55         int packet_size;
56         int packet_num;
57         wait_queue_t wait;
58 } _ifx_deu_device;
59
60 extern _ifx_deu_device ifx_deu[1];
61
62 extern int deu_dma_intr_handler (struct dma_device_info *, int);
63 extern u8 *deu_dma_buffer_alloc (int, int *, void **);
64 extern int deu_dma_buffer_free (u8 *, void *);
65 extern void deu_dma_inactivate_poll(struct dma_device_info* dma_dev);
66 extern void deu_dma_activate_poll (struct dma_device_info* dma_dev);
67 extern struct dma_device_info* deu_dma_reserve(struct dma_device_info** dma_device);
68 extern int deu_dma_release(struct dma_device_info** dma_device);
69
70 #endif  /* IFMIPS_DEU_DMA_H */