From dc0b3db1b4f1895a07e5fe280ee3790e87f97b9f Mon Sep 17 00:00:00 2001 From: Ataberk Date: Sun, 25 Sep 2022 17:22:03 +0200 Subject: Initial commit --- sources/xdma_driver/xdma/xdma_mod.h | 98 +++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/xdma_driver/xdma/xdma_mod.h (limited to 'sources/xdma_driver/xdma/xdma_mod.h') diff --git a/sources/xdma_driver/xdma/xdma_mod.h b/sources/xdma_driver/xdma/xdma_mod.h new file mode 100644 index 0000000..93202b1 --- /dev/null +++ b/sources/xdma_driver/xdma/xdma_mod.h @@ -0,0 +1,98 @@ +/* + * This file is part of the Xilinx DMA IP Core driver for Linux + * + * Copyright (c) 2016-present, Xilinx, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef __XDMA_MODULE_H__ +#define __XDMA_MODULE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libxdma.h" + +#define MAGIC_ENGINE 0xEEEEEEEEUL +#define MAGIC_DEVICE 0xDDDDDDDDUL +#define MAGIC_CHAR 0xCCCCCCCCUL +#define MAGIC_BITSTREAM 0xBBBBBBBBUL + +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__ */ -- cgit v1.2.3