vfio_ccw_cp.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * channel program interfaces
  4. *
  5. * Copyright IBM Corp. 2017
  6. *
  7. * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
  8. * Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
  9. */
  10. #ifndef _VFIO_CCW_CP_H_
  11. #define _VFIO_CCW_CP_H_
  12. #include <asm/cio.h>
  13. #include <asm/scsw.h>
  14. #include "orb.h"
  15. /**
  16. * struct channel_program - manage information for channel program
  17. * @ccwchain_list: list head of ccwchains
  18. * @orb: orb for the currently processed ssch request
  19. * @mdev: the mediated device to perform page pinning/unpinning
  20. *
  21. * @ccwchain_list is the head of a ccwchain list, that contents the
  22. * translated result of the guest channel program that pointed out by
  23. * the iova parameter when calling cp_init.
  24. */
  25. struct channel_program {
  26. struct list_head ccwchain_list;
  27. union orb orb;
  28. struct device *mdev;
  29. };
  30. extern int cp_init(struct channel_program *cp, struct device *mdev,
  31. union orb *orb);
  32. extern void cp_free(struct channel_program *cp);
  33. extern int cp_prefetch(struct channel_program *cp);
  34. extern union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm);
  35. extern void cp_update_scsw(struct channel_program *cp, union scsw *scsw);
  36. extern bool cp_iova_pinned(struct channel_program *cp, u64 iova);
  37. #endif