aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/amdtp.h
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-03-15 02:57:24 -0400
committerTakashi Iwai <tiwai@suse.de>2011-03-15 03:42:30 -0400
commitec00f5e444706cb1902731655f3dcd04fc3df7b0 (patch)
treef4fea4c46fa68308f401579ba93dc2c575157ba7 /sound/firewire/amdtp.h
parent5b2599a07eaee53d713fb68f5343eba88fa249c0 (diff)
ALSA: firewire-lib, firewire-speakers: handle packet queueing errors
Add an AMDTP stream error state that occurs when we fail to queue another packet. In this case, the stream is stopped, and the error can be reported when the application tries to restart the PCM stream. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp.h')
-rw-r--r--sound/firewire/amdtp.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
index 02dc1a664b55..537a9cb83581 100644
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
@@ -56,7 +56,7 @@ struct amdtp_out_stream {
56 56
57 struct snd_pcm_substream *pcm; 57 struct snd_pcm_substream *pcm;
58 58
59 unsigned int packet_counter; 59 int packet_index;
60 unsigned int data_block_counter; 60 unsigned int data_block_counter;
61 61
62 unsigned int data_block_state; 62 unsigned int data_block_state;
@@ -111,6 +111,18 @@ static inline void amdtp_out_stream_set_midi(struct amdtp_out_stream *s,
111} 111}
112 112
113/** 113/**
114 * amdtp_out_streaming_error - check for streaming error
115 * @s: the AMDTP output stream
116 *
117 * If this function returns true, the stream's packet queue has stopped due to
118 * an asynchronous error.
119 */
120static inline bool amdtp_out_streaming_error(struct amdtp_out_stream *s)
121{
122 return s->packet_index < 0;
123}
124
125/**
114 * amdtp_out_stream_pcm_prepare - prepare PCM device for running 126 * amdtp_out_stream_pcm_prepare - prepare PCM device for running
115 * @s: the AMDTP output stream 127 * @s: the AMDTP output stream
116 * 128 *