ALSA: fireface: change prototype of handler for async transaction with MIDI messages

In a series of Fireface, devices transfer asynchronous transaction with
MIDI messages. In the transaction, content is different depending on
models. ALSA fireface driver has protocol-dependent handler to pick up
MIDI messages from the content.

In latter models of the series, the transaction is transferred to range
of address sequentially. This seems to check continuity of transferred
messages.

This commit changes prototype of the handler to receive offset of
address for received transactions.

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-01-22 22:17:00 +09:00 committed by Takashi Iwai
parent 9935d55b02
commit 6c644e4e95
3 changed files with 9 additions and 4 deletions

View File

@ -375,7 +375,8 @@ static void ff800_finish_session(struct snd_ff *ff)
FF800_ISOC_COMM_STOP, &reg, sizeof(reg), 0); FF800_ISOC_COMM_STOP, &reg, sizeof(reg), 0);
} }
static void ff800_handle_midi_msg(struct snd_ff *ff, __le32 *buf, size_t length) static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
__le32 *buf, size_t length)
{ {
int i; int i;
@ -502,7 +503,8 @@ static void ff400_finish_session(struct snd_ff *ff)
FF400_ISOC_COMM_STOP, &reg, sizeof(reg), 0); FF400_ISOC_COMM_STOP, &reg, sizeof(reg), 0);
} }
static void ff400_handle_midi_msg(struct snd_ff *ff, __le32 *buf, size_t length) static void ff400_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
__le32 *buf, size_t length)
{ {
int i; int i;

View File

@ -146,7 +146,9 @@ static void handle_midi_msg(struct fw_card *card, struct fw_request *request,
fw_send_response(card, request, RCODE_COMPLETE); fw_send_response(card, request, RCODE_COMPLETE);
ff->spec->protocol->handle_midi_msg(ff, buf, length); offset -= ff->async_handler.offset;
ff->spec->protocol->handle_midi_msg(ff, (unsigned int)offset, buf,
length);
} }
static int allocate_own_address(struct snd_ff *ff, int i) static int allocate_own_address(struct snd_ff *ff, int i)

View File

@ -103,7 +103,8 @@ enum snd_ff_clock_src {
}; };
struct snd_ff_protocol { struct snd_ff_protocol {
void (*handle_midi_msg)(struct snd_ff *ff, __le32 *buf, size_t length); void (*handle_midi_msg)(struct snd_ff *ff, unsigned int offset,
__le32 *buf, size_t length);
int (*get_clock)(struct snd_ff *ff, unsigned int *rate, int (*get_clock)(struct snd_ff *ff, unsigned int *rate,
enum snd_ff_clock_src *src); enum snd_ff_clock_src *src);
int (*switch_fetching_mode)(struct snd_ff *ff, bool enable); int (*switch_fetching_mode)(struct snd_ff *ff, bool enable);