vfio_ccw_cp.h 1.2 KB

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