Commit 0cac60c7 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: firewire-lib: use circular linked list for context payload processing layer

The list of packet descriptor is passed to context payload processing
layer so that each driver can copy PCM frames, MIDI messages, and device
specific data between packet payload buffer and intermediate buffer for
user space application.

The list of packet descriptor was replaced by circular linked list in a
previous commit. This commit uses circular linked in context payload
processing layer as well.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230109021738.75543-3-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent cec371ff
...@@ -347,16 +347,15 @@ static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer, ...@@ -347,16 +347,15 @@ static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer,
} }
static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
struct amdtp_am824 *p = s->protocol; struct amdtp_am824 *p = s->protocol;
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -371,22 +370,23 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, ...@@ -371,22 +370,23 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
write_midi_messages(s, buf, data_blocks, write_midi_messages(s, buf, data_blocks,
desc->data_block_counter); desc->data_block_counter);
} }
desc = amdtp_stream_next_packet_desc(s, desc);
} }
return pcm_frames; return pcm_frames;
} }
static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
struct amdtp_am824 *p = s->protocol; struct amdtp_am824 *p = s->protocol;
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -399,6 +399,8 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, ...@@ -399,6 +399,8 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
read_midi_messages(s, buf, data_blocks, read_midi_messages(s, buf, data_blocks,
desc->data_block_counter); desc->data_block_counter);
} }
desc = amdtp_stream_next_packet_desc(s, desc);
} }
return pcm_frames; return pcm_frames;
......
...@@ -1028,13 +1028,13 @@ static inline void cancel_stream(struct amdtp_stream *s) ...@@ -1028,13 +1028,13 @@ static inline void cancel_stream(struct amdtp_stream *s)
static void process_ctx_payloads(struct amdtp_stream *s, static void process_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *descs,
unsigned int packets) unsigned int count)
{ {
struct snd_pcm_substream *pcm; struct snd_pcm_substream *pcm;
unsigned int pcm_frames; unsigned int pcm_frames;
pcm = READ_ONCE(s->pcm); pcm = READ_ONCE(s->pcm);
pcm_frames = s->process_ctx_payloads(s, descs, packets, pcm); pcm_frames = s->process_ctx_payloads(s, descs, count, pcm);
if (pcm) if (pcm)
update_pcm_pointers(s, pcm, pcm_frames); update_pcm_pointers(s, pcm, pcm_frames);
} }
......
...@@ -110,7 +110,7 @@ struct amdtp_stream; ...@@ -110,7 +110,7 @@ struct amdtp_stream;
typedef unsigned int (*amdtp_stream_process_ctx_payloads_t)( typedef unsigned int (*amdtp_stream_process_ctx_payloads_t)(
struct amdtp_stream *s, struct amdtp_stream *s,
const struct pkt_desc *desc, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm); struct snd_pcm_substream *pcm);
struct amdtp_domain; struct amdtp_domain;
......
...@@ -342,15 +342,14 @@ void amdtp_dot_midi_trigger(struct amdtp_stream *s, unsigned int port, ...@@ -342,15 +342,14 @@ void amdtp_dot_midi_trigger(struct amdtp_stream *s, unsigned int port,
} }
static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -360,21 +359,22 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, ...@@ -360,21 +359,22 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
} }
read_midi_messages(s, buf, data_blocks); read_midi_messages(s, buf, data_blocks);
desc = amdtp_stream_next_packet_desc(s, desc);
} }
return pcm_frames; return pcm_frames;
} }
static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -387,6 +387,8 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, ...@@ -387,6 +387,8 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
write_midi_messages(s, buf, data_blocks, write_midi_messages(s, buf, data_blocks,
desc->data_block_counter); desc->data_block_counter);
desc = amdtp_stream_next_packet_desc(s, desc);
} }
return pcm_frames; return pcm_frames;
......
...@@ -113,15 +113,14 @@ int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s, ...@@ -113,15 +113,14 @@ int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
} }
static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__le32 *buf = (__le32 *)desc->ctx_payload; __le32 *buf = (__le32 *)desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -131,21 +130,22 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, ...@@ -131,21 +130,22 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
} else { } else {
write_pcm_silence(s, buf, data_blocks); write_pcm_silence(s, buf, data_blocks);
} }
desc = amdtp_stream_next_packet_desc(s, desc);
} }
return pcm_frames; return pcm_frames;
} }
static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__le32 *buf = (__le32 *)desc->ctx_payload; __le32 *buf = (__le32 *)desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -153,6 +153,8 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, ...@@ -153,6 +153,8 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
read_pcm_s32(s, pcm, buf, data_blocks, pcm_frames); read_pcm_s32(s, pcm, buf, data_blocks, pcm_frames);
pcm_frames += data_blocks; pcm_frames += data_blocks;
} }
desc = amdtp_stream_next_packet_desc(s, desc);
} }
return pcm_frames; return pcm_frames;
......
...@@ -284,19 +284,19 @@ static void __maybe_unused copy_message(u64 *frames, __be32 *buffer, ...@@ -284,19 +284,19 @@ static void __maybe_unused copy_message(u64 *frames, __be32 *buffer,
} }
} }
static void probe_tracepoints_events(struct amdtp_stream *s, static void probe_tracepoints_events(struct amdtp_stream *s, const struct pkt_desc *desc,
const struct pkt_desc *descs, unsigned int count)
unsigned int packets)
{ {
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
trace_data_block_sph(s, data_blocks, buf); trace_data_block_sph(s, data_blocks, buf);
trace_data_block_message(s, data_blocks, buf); trace_data_block_message(s, data_blocks, buf);
desc = amdtp_stream_next_packet_desc(s, desc);
} }
} }
...@@ -329,12 +329,13 @@ static void cache_event_offsets(struct amdtp_motu_cache *cache, const __be32 *bu ...@@ -329,12 +329,13 @@ static void cache_event_offsets(struct amdtp_motu_cache *cache, const __be32 *bu
} }
static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
struct snd_motu *motu = container_of(s, struct snd_motu, tx_stream); struct snd_motu *motu = container_of(s, struct snd_motu, tx_stream);
struct amdtp_motu *p = s->protocol; struct amdtp_motu *p = s->protocol;
const struct pkt_desc *cursor = desc;
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
...@@ -342,8 +343,7 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, ...@@ -342,8 +343,7 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
p->cache->tx_cycle_count = (s->domain->processing_cycle.tx_start % CYCLES_PER_SECOND); p->cache->tx_cycle_count = (s->domain->processing_cycle.tx_start % CYCLES_PER_SECOND);
// For data block processing. // For data block processing.
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -356,20 +356,20 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, ...@@ -356,20 +356,20 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
if (p->midi_ports) if (p->midi_ports)
read_midi_messages(s, buf, data_blocks); read_midi_messages(s, buf, data_blocks);
}
if (motu->spec->flags & SND_MOTU_SPEC_REGISTER_DSP) { desc = amdtp_stream_next_packet_desc(s, desc);
snd_motu_register_dsp_message_parser_parse(motu, descs, packets,
s->data_block_quadlets);
} else if (motu->spec->flags & SND_MOTU_SPEC_COMMAND_DSP) {
snd_motu_command_dsp_message_parser_parse(motu, descs, packets,
s->data_block_quadlets);
} }
desc = cursor;
if (motu->spec->flags & SND_MOTU_SPEC_REGISTER_DSP)
snd_motu_register_dsp_message_parser_parse(s, desc, count);
else if (motu->spec->flags & SND_MOTU_SPEC_COMMAND_DSP)
snd_motu_command_dsp_message_parser_parse(s, desc, count);
// For tracepoints. // For tracepoints.
if (trace_data_block_sph_enabled() || if (trace_data_block_sph_enabled() ||
trace_data_block_message_enabled()) trace_data_block_message_enabled())
probe_tracepoints_events(s, descs, packets); probe_tracepoints_events(s, desc, count);
return pcm_frames; return pcm_frames;
} }
...@@ -397,11 +397,12 @@ static void write_sph(struct amdtp_motu_cache *cache, __be32 *buffer, unsigned i ...@@ -397,11 +397,12 @@ static void write_sph(struct amdtp_motu_cache *cache, __be32 *buffer, unsigned i
} }
static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
struct amdtp_motu *p = s->protocol; struct amdtp_motu *p = s->protocol;
const struct pkt_desc *cursor = desc;
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
...@@ -409,8 +410,7 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, ...@@ -409,8 +410,7 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
p->cache->rx_cycle_count = (s->domain->processing_cycle.rx_start % CYCLES_PER_SECOND); p->cache->rx_cycle_count = (s->domain->processing_cycle.rx_start % CYCLES_PER_SECOND);
// For data block processing. // For data block processing.
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -425,12 +425,16 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, ...@@ -425,12 +425,16 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
write_midi_messages(s, buf, data_blocks); write_midi_messages(s, buf, data_blocks);
write_sph(p->cache, buf, data_blocks, s->data_block_quadlets); write_sph(p->cache, buf, data_blocks, s->data_block_quadlets);
desc = amdtp_stream_next_packet_desc(s, desc);
} }
desc = cursor;
// For tracepoints. // For tracepoints.
if (trace_data_block_sph_enabled() || if (trace_data_block_sph_enabled() ||
trace_data_block_message_enabled()) trace_data_block_message_enabled())
probe_tracepoints_events(s, descs, packets); probe_tracepoints_events(s, desc, count);
return pcm_frames; return pcm_frames;
} }
......
...@@ -80,9 +80,11 @@ int snd_motu_command_dsp_message_parser_init(struct snd_motu *motu, enum cip_sfc ...@@ -80,9 +80,11 @@ int snd_motu_command_dsp_message_parser_init(struct snd_motu *motu, enum cip_sfc
#define FRAGMENTS_PER_VALUE 4 #define FRAGMENTS_PER_VALUE 4
#define VALUES_AT_IMAGE_END 0xffffffffffffffff #define VALUES_AT_IMAGE_END 0xffffffffffffffff
void snd_motu_command_dsp_message_parser_parse(struct snd_motu *motu, const struct pkt_desc *descs, void snd_motu_command_dsp_message_parser_parse(const struct amdtp_stream *s,
unsigned int desc_count, unsigned int data_block_quadlets) const struct pkt_desc *desc, unsigned int count)
{ {
struct snd_motu *motu = container_of(s, struct snd_motu, tx_stream);
unsigned int data_block_quadlets = s->data_block_quadlets;
struct msg_parser *parser = motu->message_parser; struct msg_parser *parser = motu->message_parser;
unsigned int interval = parser->interval; unsigned int interval = parser->interval;
unsigned long flags; unsigned long flags;
...@@ -90,12 +92,13 @@ void snd_motu_command_dsp_message_parser_parse(struct snd_motu *motu, const stru ...@@ -90,12 +92,13 @@ void snd_motu_command_dsp_message_parser_parse(struct snd_motu *motu, const stru
spin_lock_irqsave(&parser->lock, flags); spin_lock_irqsave(&parser->lock, flags);
for (i = 0; i < desc_count; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buffer = desc->ctx_payload; __be32 *buffer = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
int j; int j;
desc = amdtp_stream_next_packet_desc(s, desc);
for (j = 0; j < data_blocks; ++j) { for (j = 0; j < data_blocks; ++j) {
u8 *b = (u8 *)buffer; u8 *b = (u8 *)buffer;
buffer += data_block_quadlets; buffer += data_block_quadlets;
......
...@@ -142,9 +142,11 @@ static void queue_event(struct snd_motu *motu, u8 msg_type, u8 identifier0, u8 i ...@@ -142,9 +142,11 @@ static void queue_event(struct snd_motu *motu, u8 msg_type, u8 identifier0, u8 i
parser->push_pos = pos; parser->push_pos = pos;
} }
void snd_motu_register_dsp_message_parser_parse(struct snd_motu *motu, const struct pkt_desc *descs, void snd_motu_register_dsp_message_parser_parse(const struct amdtp_stream *s,
unsigned int desc_count, unsigned int data_block_quadlets) const struct pkt_desc *desc, unsigned int count)
{ {
struct snd_motu *motu = container_of(s, struct snd_motu, tx_stream);
unsigned int data_block_quadlets = s->data_block_quadlets;
struct msg_parser *parser = motu->message_parser; struct msg_parser *parser = motu->message_parser;
bool meter_pos_quirk = parser->meter_pos_quirk; bool meter_pos_quirk = parser->meter_pos_quirk;
unsigned int pos = parser->push_pos; unsigned int pos = parser->push_pos;
...@@ -153,12 +155,13 @@ void snd_motu_register_dsp_message_parser_parse(struct snd_motu *motu, const str ...@@ -153,12 +155,13 @@ void snd_motu_register_dsp_message_parser_parse(struct snd_motu *motu, const str
spin_lock_irqsave(&parser->lock, flags); spin_lock_irqsave(&parser->lock, flags);
for (i = 0; i < desc_count; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buffer = desc->ctx_payload; __be32 *buffer = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
int j; int j;
desc = amdtp_stream_next_packet_desc(s, desc);
for (j = 0; j < data_blocks; ++j) { for (j = 0; j < data_blocks; ++j) {
u8 *b = (u8 *)buffer; u8 *b = (u8 *)buffer;
u8 msg_type = (b[MSG_FLAG_POS] & MSG_FLAG_TYPE_MASK) >> MSG_FLAG_TYPE_SHIFT; u8 msg_type = (b[MSG_FLAG_POS] & MSG_FLAG_TYPE_MASK) >> MSG_FLAG_TYPE_SHIFT;
......
...@@ -279,8 +279,8 @@ static inline int snd_motu_protocol_cache_packet_formats(struct snd_motu *motu) ...@@ -279,8 +279,8 @@ static inline int snd_motu_protocol_cache_packet_formats(struct snd_motu *motu)
int snd_motu_register_dsp_message_parser_new(struct snd_motu *motu); int snd_motu_register_dsp_message_parser_new(struct snd_motu *motu);
int snd_motu_register_dsp_message_parser_init(struct snd_motu *motu); int snd_motu_register_dsp_message_parser_init(struct snd_motu *motu);
void snd_motu_register_dsp_message_parser_parse(struct snd_motu *motu, const struct pkt_desc *descs, void snd_motu_register_dsp_message_parser_parse(const struct amdtp_stream *s,
unsigned int desc_count, unsigned int data_block_quadlets); const struct pkt_desc *descs, unsigned int count);
void snd_motu_register_dsp_message_parser_copy_meter(struct snd_motu *motu, void snd_motu_register_dsp_message_parser_copy_meter(struct snd_motu *motu,
struct snd_firewire_motu_register_dsp_meter *meter); struct snd_firewire_motu_register_dsp_meter *meter);
void snd_motu_register_dsp_message_parser_copy_parameter(struct snd_motu *motu, void snd_motu_register_dsp_message_parser_copy_parameter(struct snd_motu *motu,
...@@ -290,8 +290,8 @@ bool snd_motu_register_dsp_message_parser_copy_event(struct snd_motu *motu, u32 ...@@ -290,8 +290,8 @@ bool snd_motu_register_dsp_message_parser_copy_event(struct snd_motu *motu, u32
int snd_motu_command_dsp_message_parser_new(struct snd_motu *motu); int snd_motu_command_dsp_message_parser_new(struct snd_motu *motu);
int snd_motu_command_dsp_message_parser_init(struct snd_motu *motu, enum cip_sfc sfc); int snd_motu_command_dsp_message_parser_init(struct snd_motu *motu, enum cip_sfc sfc);
void snd_motu_command_dsp_message_parser_parse(struct snd_motu *motu, const struct pkt_desc *descs, void snd_motu_command_dsp_message_parser_parse(const struct amdtp_stream *s,
unsigned int desc_count, unsigned int data_block_quadlets); const struct pkt_desc *descs, unsigned int count);
void snd_motu_command_dsp_message_parser_copy_meter(struct snd_motu *motu, void snd_motu_command_dsp_message_parser_copy_meter(struct snd_motu *motu,
struct snd_firewire_motu_command_dsp_meter *meter); struct snd_firewire_motu_command_dsp_meter *meter);
......
...@@ -177,15 +177,14 @@ static void read_status_messages(struct amdtp_stream *s, ...@@ -177,15 +177,14 @@ static void read_status_messages(struct amdtp_stream *s,
} }
static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -195,21 +194,22 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s, ...@@ -195,21 +194,22 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
} }
read_status_messages(s, buf, data_blocks); read_status_messages(s, buf, data_blocks);
desc = amdtp_stream_next_packet_desc(s, desc);
} }
return pcm_frames; return pcm_frames;
} }
static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs, const struct pkt_desc *desc,
unsigned int packets, unsigned int count,
struct snd_pcm_substream *pcm) struct snd_pcm_substream *pcm)
{ {
unsigned int pcm_frames = 0; unsigned int pcm_frames = 0;
int i; int i;
for (i = 0; i < packets; ++i) { for (i = 0; i < count; ++i) {
const struct pkt_desc *desc = descs + i;
__be32 *buf = desc->ctx_payload; __be32 *buf = desc->ctx_payload;
unsigned int data_blocks = desc->data_blocks; unsigned int data_blocks = desc->data_blocks;
...@@ -219,6 +219,8 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s, ...@@ -219,6 +219,8 @@ static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
} else { } else {
write_pcm_silence(s, buf, data_blocks); write_pcm_silence(s, buf, data_blocks);
} }
desc = amdtp_stream_next_packet_desc(s, desc);
} }
return pcm_frames; return pcm_frames;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment