Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: fireface: pick up time stamp for request subaction of asynchronous transaction

The time stamp of isochronous cycle at which asynchronous transaction is
sent is perhaps useful somehow. A commit b2405aa948b9 ("firewire: add
kernel API to access packet structure in request structure for AR context")
adds kernel API to retrieve the time stamp in inner structure of request
subaction.

This commit changes local framework to handle message delivered by the
asynchronous transaction so that time stamp is picked up by the kernel API.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230112120954.500692-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Sakamoto and committed by
Takashi Iwai
4bdcb8d2 50c597c7

+6 -5
+2 -2
sound/firewire/fireface/ff-protocol-former.c
··· 403 403 // A write transaction to clear registered higher 4 bytes of destination address 404 404 // has an effect to suppress asynchronous transaction from device. 405 405 static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf, 406 - size_t length) 406 + size_t length, u32 tstamp) 407 407 { 408 408 int i; 409 409 ··· 554 554 // in its lower offset and expects userspace application to configure the 555 555 // register for it. 556 556 static void ff400_handle_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf, 557 - size_t length) 557 + size_t length, u32 tstamp) 558 558 { 559 559 int i; 560 560
+1 -1
sound/firewire/fireface/ff-protocol-latter.c
··· 394 394 // (0x'....'....'0000'0000) and expects userspace application to configure the 395 395 // register for it. 396 396 static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf, 397 - size_t length) 397 + size_t length, u32 tstamp) 398 398 { 399 399 u32 data = le32_to_cpu(*buf); 400 400 unsigned int index = (data & 0x000000f0) >> 4;
+2 -1
sound/firewire/fireface/ff-transaction.c
··· 131 131 { 132 132 struct snd_ff *ff = callback_data; 133 133 __le32 *buf = data; 134 + u32 tstamp = fw_request_get_timestamp(request); 134 135 135 136 fw_send_response(card, request, RCODE_COMPLETE); 136 137 137 138 offset -= ff->async_handler.offset; 138 - ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length); 139 + ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length, tstamp); 139 140 } 140 141 141 142 static int allocate_own_address(struct snd_ff *ff, int i)
+1 -1
sound/firewire/fireface/ff.h
··· 111 111 112 112 struct snd_ff_protocol { 113 113 void (*handle_msg)(struct snd_ff *ff, unsigned int offset, const __le32 *buf, 114 - size_t length); 114 + size_t length, u32 tstamp); 115 115 int (*fill_midi_msg)(struct snd_ff *ff, 116 116 struct snd_rawmidi_substream *substream, 117 117 unsigned int port);