i915_pxp_tee_interface.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: MIT */
  2. /*
  3. * Copyright © 2020 Intel Corporation
  4. */
  5. #ifndef _I915_PXP_TEE_INTERFACE_H_
  6. #define _I915_PXP_TEE_INTERFACE_H_
  7. #include <linux/mutex.h>
  8. #include <linux/device.h>
  9. struct scatterlist;
  10. /**
  11. * struct i915_pxp_component_ops - ops for PXP services.
  12. */
  13. struct i915_pxp_component_ops {
  14. /**
  15. * @owner: Module providing the ops.
  16. */
  17. struct module *owner;
  18. /**
  19. * @send: Send a PXP message.
  20. */
  21. int (*send)(struct device *dev, const void *message, size_t size,
  22. unsigned long timeout_ms);
  23. /**
  24. * @recv: Receive a PXP message.
  25. */
  26. int (*recv)(struct device *dev, void *buffer, size_t size,
  27. unsigned long timeout_ms);
  28. /**
  29. * @gsc_command: Send a GSC command.
  30. */
  31. ssize_t (*gsc_command)(struct device *dev, u8 client_id, u32 fence_id,
  32. struct scatterlist *sg_in, size_t total_in_len,
  33. struct scatterlist *sg_out);
  34. };
  35. /**
  36. * struct i915_pxp_component - Used for communication between i915 and TEE
  37. * drivers for the PXP services
  38. */
  39. struct i915_pxp_component {
  40. /**
  41. * @tee_dev: device that provide the PXP service from TEE Bus.
  42. */
  43. struct device *tee_dev;
  44. /**
  45. * @ops: Ops implemented by TEE driver, used by i915 driver.
  46. */
  47. const struct i915_pxp_component_ops *ops;
  48. /**
  49. * @mutex: To protect the above members.
  50. */
  51. struct mutex mutex;
  52. };
  53. #endif /* _I915_TEE_PXP_INTERFACE_H_ */