forked from aws/aws-fpga
-
Notifications
You must be signed in to change notification settings - Fork 1
/
xdma_mod.h
114 lines (101 loc) · 3.33 KB
/
xdma_mod.h
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
112
113
114
/*******************************************************************************
*
* Xilinx XDMA IP Core Linux Driver
* Copyright(c) 2015 - 2020 Xilinx, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* The full GNU General Public License is included in this distribution in
* the file called "LICENSE".
*
* Karen Xie <[email protected]>
*
******************************************************************************/
#ifndef __XDMA_MODULE_H__
#define __XDMA_MODULE_H__
#include <linux/types.h>
#include <linux/module.h>
#include <linux/cdev.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/mm_types.h>
#include <linux/poll.h>
#include <linux/pci.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/workqueue.h>
#include <linux/aio.h>
#include <linux/splice.h>
#include <linux/version.h>
#include <linux/uio.h>
#include <linux/spinlock_types.h>
#include "libxdma.h"
#define MAGIC_ENGINE 0xEEEEEEEEUL
#define MAGIC_DEVICE 0xDDDDDDDDUL
#define MAGIC_CHAR 0xCCCCCCCCUL
#define MAGIC_BITSTREAM 0xBBBBBBBBUL
extern unsigned int desc_blen_max;
extern unsigned int sgdma_timeout;
struct xdma_cdev {
unsigned long magic; /* structure ID for sanity checks */
struct xdma_pci_dev *xpdev;
struct xdma_dev *xdev;
dev_t cdevno; /* character device major:minor */
struct cdev cdev; /* character device embedded struct */
int bar; /* PCIe BAR for HW access, if needed */
unsigned long base; /* bar access offset */
struct xdma_engine *engine; /* engine instance, if needed */
struct xdma_user_irq *user_irq; /* IRQ value, if needed */
struct device *sys_device; /* sysfs device */
spinlock_t lock;
};
/* XDMA PCIe device specific book-keeping */
struct xdma_pci_dev {
unsigned long magic; /* structure ID for sanity checks */
struct pci_dev *pdev; /* pci device struct from probe() */
struct xdma_dev *xdev;
int major; /* major number */
int instance; /* instance number */
int user_max;
int c2h_channel_max;
int h2c_channel_max;
unsigned int flags;
/* character device structures */
struct xdma_cdev ctrl_cdev;
struct xdma_cdev sgdma_c2h_cdev[XDMA_CHANNEL_NUM_MAX];
struct xdma_cdev sgdma_h2c_cdev[XDMA_CHANNEL_NUM_MAX];
struct xdma_cdev events_cdev[16];
struct xdma_cdev user_cdev;
struct xdma_cdev bypass_c2h_cdev[XDMA_CHANNEL_NUM_MAX];
struct xdma_cdev bypass_h2c_cdev[XDMA_CHANNEL_NUM_MAX];
struct xdma_cdev bypass_cdev_base;
struct xdma_cdev xvc_cdev;
void *data;
};
struct xdma_io_cb {
void __user *buf;
size_t len;
unsigned int pages_nr;
struct sg_table sgt;
struct page **pages;
};
#endif /* ifndef __XDMA_MODULE_H__ */