ipa_gsi.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
  3. * Copyright (C) 2019-2020 Linaro Ltd.
  4. */
  5. #ifndef _IPA_GSI_TRANS_H_
  6. #define _IPA_GSI_TRANS_H_
  7. #include <linux/types.h>
  8. struct gsi;
  9. struct gsi_trans;
  10. struct ipa_gsi_endpoint_data;
  11. /**
  12. * ipa_gsi_trans_complete() - GSI transaction completion callback
  13. * @trans: Transaction that has completed
  14. *
  15. * This called from the GSI layer to notify the IPA layer that a
  16. * transaction has completed.
  17. */
  18. void ipa_gsi_trans_complete(struct gsi_trans *trans);
  19. /**
  20. * ipa_gsi_trans_release() - GSI transaction release callback
  21. * @trans: Transaction whose resources should be freed
  22. *
  23. * This called from the GSI layer to notify the IPA layer that a
  24. * transaction is about to be freed, so any resources associated
  25. * with it should be released.
  26. */
  27. void ipa_gsi_trans_release(struct gsi_trans *trans);
  28. /**
  29. * ipa_gsi_channel_tx_queued() - GSI queued to hardware notification
  30. * @gsi: GSI pointer
  31. * @channel_id: Channel number
  32. * @count: Number of transactions queued
  33. * @byte_count: Number of bytes to transfer represented by transactions
  34. *
  35. * This called from the GSI layer to notify the IPA layer that some
  36. * number of transactions have been queued to hardware for execution.
  37. */
  38. void ipa_gsi_channel_tx_queued(struct gsi *gsi, u32 channel_id, u32 count,
  39. u32 byte_count);
  40. /**
  41. * ipa_gsi_channel_tx_completed() - GSI transaction completion callback
  42. * @gsi: GSI pointer
  43. * @channel_id: Channel number
  44. * @count: Number of transactions completed since last report
  45. * @byte_count: Number of bytes transferred represented by transactions
  46. *
  47. * This called from the GSI layer to notify the IPA layer that the hardware
  48. * has reported the completion of some number of transactions.
  49. */
  50. void ipa_gsi_channel_tx_completed(struct gsi *gsi, u32 channel_id, u32 count,
  51. u32 byte_count);
  52. /* ipa_gsi_endpoint_data_empty() - Empty endpoint config data test
  53. * @data: endpoint configuration data
  54. *
  55. * Determines whether an endpoint configuration data entry is empty,
  56. * meaning it contains no valid configuration information and should
  57. * be ignored.
  58. *
  59. * Return: true if empty; false otherwise
  60. */
  61. bool ipa_gsi_endpoint_data_empty(const struct ipa_gsi_endpoint_data *data);
  62. #endif /* _IPA_GSI_TRANS_H_ */