ALSA: firewire-lib: pass packet descriptor to data block processing layer

This commit changes signature of callback function to call data block
processing layer with packet descriptor. At present, the layer is called
per packet.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Sakamoto
2019-07-22 12:37:03 +09:00
committed by Takashi Iwai
parent 0f5cfcb24d
commit d2c104a342
7 changed files with 97 additions and 88 deletions

View File

@@ -103,17 +103,18 @@ int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
}
static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
const struct pkt_desc *desc,
struct snd_pcm_substream *pcm)
{
struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
unsigned int pcm_frames;
if (pcm) {
write_pcm_s32(s, pcm, (__le32 *)buffer, data_blocks);
pcm_frames = data_blocks;
write_pcm_s32(s, pcm, (__le32 *)desc->ctx_payload,
desc->data_blocks);
pcm_frames = desc->data_blocks;
} else {
write_pcm_silence(s, (__le32 *)buffer, data_blocks);
write_pcm_silence(s, (__le32 *)desc->ctx_payload,
desc->data_blocks);
pcm_frames = 0;
}
@@ -121,15 +122,15 @@ static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
}
static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
__be32 *buffer, unsigned int data_blocks,
unsigned int data_block_counter)
const struct pkt_desc *desc,
struct snd_pcm_substream *pcm)
{
struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
unsigned int pcm_frames;
if (pcm) {
read_pcm_s32(s, pcm, (__le32 *)buffer, data_blocks);
pcm_frames = data_blocks;
read_pcm_s32(s, pcm, (__le32 *)desc->ctx_payload,
desc->data_blocks);
pcm_frames = desc->data_blocks;
} else {
pcm_frames = 0;
}