Blame view

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