summaryrefslogtreecommitdiffstats
path: root/sound/firewire/amdtp-am824.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/amdtp-am824.c')
-rw-r--r--sound/firewire/amdtp-am824.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sound/firewire/amdtp-am824.c b/sound/firewire/amdtp-am824.c
index 99c567ded7a3..03a7e0533131 100644
--- a/sound/firewire/amdtp-am824.c
+++ b/sound/firewire/amdtp-am824.c
@@ -284,7 +284,7 @@ static void midi_rate_use_one_byte(struct amdtp_stream *s, unsigned int port)
}
static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer,
- unsigned int frames)
+ unsigned int frames, unsigned int data_block_counter)
{
struct amdtp_am824 *p = s->protocol;
unsigned int f, port;
@@ -293,7 +293,7 @@ static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer,
for (f = 0; f < frames; f++) {
b = (u8 *)&buffer[p->midi_position];
- port = (s->data_block_counter + f) % 8;
+ port = (data_block_counter + f) % 8;
if (f < MAX_MIDI_RX_BLOCKS &&
midi_ratelimit_per_packet(s, port) &&
p->midi[port] != NULL &&
@@ -311,8 +311,8 @@ static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer,
}
}
-static void read_midi_messages(struct amdtp_stream *s,
- __be32 *buffer, unsigned int frames)
+static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer,
+ unsigned int frames, unsigned int data_block_counter)
{
struct amdtp_am824 *p = s->protocol;
int len;
@@ -323,7 +323,7 @@ static void read_midi_messages(struct amdtp_stream *s,
unsigned int port = f;
if (!(s->flags & CIP_UNALIGHED_DBC))
- port += s->data_block_counter;
+ port += data_block_counter;
port %= 8;
b = (u8 *)&buffer[p->midi_position];
@@ -335,8 +335,9 @@ static void read_midi_messages(struct amdtp_stream *s,
}
}
-static unsigned int process_rx_data_blocks(struct amdtp_stream *s, __be32 *buffer,
- unsigned int data_blocks, unsigned int *syt)
+static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
+ __be32 *buffer, unsigned int data_blocks,
+ unsigned int data_block_counter, unsigned int *syt)
{
struct amdtp_am824 *p = s->protocol;
struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
@@ -351,13 +352,14 @@ static unsigned int process_rx_data_blocks(struct amdtp_stream *s, __be32 *buffe
}
if (p->midi_ports)
- write_midi_messages(s, buffer, data_blocks);
+ write_midi_messages(s, buffer, data_blocks, data_block_counter);
return pcm_frames;
}
-static unsigned int process_tx_data_blocks(struct amdtp_stream *s, __be32 *buffer,
- unsigned int data_blocks, unsigned int *syt)
+static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
+ __be32 *buffer, unsigned int data_blocks,
+ unsigned int data_block_counter, unsigned int *syt)
{
struct amdtp_am824 *p = s->protocol;
struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
@@ -371,7 +373,7 @@ static unsigned int process_tx_data_blocks(struct amdtp_stream *s, __be32 *buffe
}
if (p->midi_ports)
- read_midi_messages(s, buffer, data_blocks);
+ read_midi_messages(s, buffer, data_blocks, data_block_counter);
return pcm_frames;
}