1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef __GENWQE_DRIVER_H__
3 #define __GENWQE_DRIVER_H__
6 * IBM Accelerator Family 'GenWQE'
8 * (C) Copyright IBM Corp. 2013
10 * Author: Frank Haverkamp <haver@linux.vnet.ibm.com>
11 * Author: Joerg-Stephan Vogt <jsvogt@de.ibm.com>
12 * Author: Michael Jung <mijung@gmx.net>
13 * Author: Michael Ruettger <michael@ibmra.de>
16 #include <linux/types.h>
17 #include <linux/stddef.h>
18 #include <linux/cdev.h>
19 #include <linux/list.h>
20 #include <linux/kthread.h>
21 #include <linux/scatterlist.h>
22 #include <linux/iommu.h>
23 #include <linux/spinlock.h>
24 #include <linux/mutex.h>
25 #include <linux/platform_device.h>
26 #include <linux/printk.h>
28 #include <asm/byteorder.h>
29 #include <linux/genwqe/genwqe_card.h>
31 #define DRV_VERSION "2.0.25"
34 * Static minor number assignement, until we decide/implement
37 #define GENWQE_MAX_MINOR 128 /* up to 128 possible genwqe devices */
40 * genwqe_requ_alloc() - Allocate a new DDCB execution request
42 * This data structure contains the user visiable fields of the DDCB
45 * Return: ptr to genwqe_ddcb_cmd data structure
47 struct genwqe_ddcb_cmd
*ddcb_requ_alloc(void);
50 * ddcb_requ_free() - Free DDCB execution request.
51 * @req: ptr to genwqe_ddcb_cmd data structure.
53 void ddcb_requ_free(struct genwqe_ddcb_cmd
*req
);
55 u32
genwqe_crc32(u8
*buff
, size_t len
, u32 init
);
57 static inline void genwqe_hexdump(struct pci_dev
*pci_dev
,
58 const void *buff
, unsigned int size
)
62 scnprintf(prefix
, sizeof(prefix
), "%s %s: ",
63 GENWQE_DEVNAME
, pci_name(pci_dev
));
65 print_hex_dump_debug(prefix
, DUMP_PREFIX_OFFSET
, 16, 1, buff
,
69 #endif /* __GENWQE_DRIVER_H__ */