cmp.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef SOUND_FIREWIRE_CMP_H_INCLUDED
  2. #define SOUND_FIREWIRE_CMP_H_INCLUDED
  3. #include <linux/mutex.h>
  4. #include <linux/types.h>
  5. #include "iso-resources.h"
  6. struct fw_unit;
  7. enum cmp_direction {
  8. CMP_INPUT = 0,
  9. CMP_OUTPUT,
  10. };
  11. /**
  12. * struct cmp_connection - manages an isochronous connection to a device
  13. * @speed: the connection's actual speed
  14. *
  15. * This structure manages (using CMP) an isochronous stream between the local
  16. * computer and a device's input plug (iPCR) and output plug (oPCR).
  17. *
  18. * There is no corresponding oPCR created on the local computer, so it is not
  19. * possible to overlay connections on top of this one.
  20. */
  21. struct cmp_connection {
  22. int speed;
  23. /* private: */
  24. bool connected;
  25. struct mutex mutex;
  26. struct fw_iso_resources resources;
  27. __be32 last_pcr_value;
  28. unsigned int pcr_index;
  29. unsigned int max_speed;
  30. enum cmp_direction direction;
  31. };
  32. int cmp_connection_init(struct cmp_connection *connection,
  33. struct fw_unit *unit,
  34. enum cmp_direction direction,
  35. unsigned int pcr_index);
  36. int cmp_connection_check_used(struct cmp_connection *connection, bool *used);
  37. void cmp_connection_destroy(struct cmp_connection *connection);
  38. int cmp_connection_establish(struct cmp_connection *connection,
  39. unsigned int max_payload);
  40. int cmp_connection_update(struct cmp_connection *connection);
  41. void cmp_connection_break(struct cmp_connection *connection);
  42. #endif