1 #ifndef __GENWQE_DRIVER_H__
2 #define __GENWQE_DRIVER_H__
5 * IBM Accelerator Family 'GenWQE'
7 * (C) Copyright IBM Corp. 2013
9 * Author: Frank Haverkamp <haver@linux.vnet.ibm.com>
10 * Author: Joerg-Stephan Vogt <jsvogt@de.ibm.com>
11 * Author: Michael Jung <mijung@de.ibm.com>
12 * Author: Michael Ruettger <michael@ibmra.de>
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License (version 2 only)
16 * as published by the Free Software Foundation.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
24 #include <linux/types.h>
25 #include <linux/stddef.h>
26 #include <linux/cdev.h>
27 #include <linux/list.h>
28 #include <linux/kthread.h>
29 #include <linux/scatterlist.h>
30 #include <linux/iommu.h>
31 #include <linux/spinlock.h>
32 #include <linux/mutex.h>
33 #include <linux/platform_device.h>
34 #include <linux/printk.h>
36 #include <asm/byteorder.h>
37 #include <linux/genwqe/genwqe_card.h>
39 #define DRV_VERS_STRING "2.0.0"
42 * Static minor number assignement, until we decide/implement
45 #define GENWQE_MAX_MINOR 128 /* up to 128 possible genwqe devices */
48 * genwqe_requ_alloc() - Allocate a new DDCB execution request
50 * This data structure contains the user visiable fields of the DDCB
53 * Return: ptr to genwqe_ddcb_cmd data structure
55 struct genwqe_ddcb_cmd
*ddcb_requ_alloc(void);
58 * ddcb_requ_free() - Free DDCB execution request.
59 * @req: ptr to genwqe_ddcb_cmd data structure.
61 void ddcb_requ_free(struct genwqe_ddcb_cmd
*req
);
63 u32
genwqe_crc32(u8
*buff
, size_t len
, u32 init
);
65 static inline void genwqe_hexdump(struct pci_dev
*pci_dev
,
66 const void *buff
, unsigned int size
)
70 scnprintf(prefix
, sizeof(prefix
), "%s %s: ",
71 GENWQE_DEVNAME
, pci_name(pci_dev
));
73 print_hex_dump_debug(prefix
, DUMP_PREFIX_OFFSET
, 16, 1, buff
,
77 #endif /* __GENWQE_DRIVER_H__ */