genwqe_driver.h 2.1 KB

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