diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2023-01-09 05:17:37 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-01-09 19:04:44 +0300 |
commit | 0cac60c776a6bd15fbadc1c6c5c079b9a0c39634 (patch) | |
tree | 0c4a7f7823d76a4fd9bcc78a6e737ad947e8bc80 /sound/firewire/motu/motu-register-dsp-message-parser.c | |
parent | cec371ff1ab18ddd23ac483e7689d0819c09bf7b (diff) | |
download | linux-0cac60c776a6bd15fbadc1c6c5c079b9a0c39634.tar.xz |
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: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230109021738.75543-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/motu-register-dsp-message-parser.c')
-rw-r--r-- | sound/firewire/motu/motu-register-dsp-message-parser.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/firewire/motu/motu-register-dsp-message-parser.c b/sound/firewire/motu/motu-register-dsp-message-parser.c index 0c587567540f..ef3b0b0f0dab 100644 --- a/sound/firewire/motu/motu-register-dsp-message-parser.c +++ b/sound/firewire/motu/motu-register-dsp-message-parser.c @@ -142,9 +142,11 @@ static void queue_event(struct snd_motu *motu, u8 msg_type, u8 identifier0, u8 i parser->push_pos = pos; } -void snd_motu_register_dsp_message_parser_parse(struct snd_motu *motu, const struct pkt_desc *descs, - unsigned int desc_count, unsigned int data_block_quadlets) +void snd_motu_register_dsp_message_parser_parse(const struct amdtp_stream *s, + 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; bool meter_pos_quirk = parser->meter_pos_quirk; unsigned int pos = parser->push_pos; @@ -153,12 +155,13 @@ void snd_motu_register_dsp_message_parser_parse(struct snd_motu *motu, const str spin_lock_irqsave(&parser->lock, flags); - for (i = 0; i < desc_count; ++i) { - const struct pkt_desc *desc = descs + i; + for (i = 0; i < count; ++i) { __be32 *buffer = desc->ctx_payload; unsigned int data_blocks = desc->data_blocks; int j; + desc = amdtp_stream_next_packet_desc(s, desc); + for (j = 0; j < data_blocks; ++j) { u8 *b = (u8 *)buffer; u8 msg_type = (b[MSG_FLAG_POS] & MSG_FLAG_TYPE_MASK) >> MSG_FLAG_TYPE_SHIFT; |