summaryrefslogtreecommitdiffstats
path: root/sound/core/seq
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-06-12 10:10:49 +0200
committerTakashi Iwai <tiwai@suse.de>2023-06-12 18:22:29 +0200
commit5437ac9bad639bb9112e1a749acbe4a143562cdc (patch)
tree1e81649daf96580342a41ee264cad0f8613df918 /sound/core/seq
parentALSA: usb-audio: Add midi2_ump_probe option (diff)
downloadlinux-5437ac9bad639bb9112e1a749acbe4a143562cdc.tar.xz
linux-5437ac9bad639bb9112e1a749acbe4a143562cdc.zip
ALSA: seq: ump: Handle groupless messages
The UMP Utility and Stream messages are "groupless", i.e. an incoming groupless packet should be sent only to the UMP EP port, and the event with the groupless message is sent to UMP EP as is without the group translation per port. Also, the former reserved bit 0 for the client group filter is now used for groupless events. When the bit 0 is set, the groupless events are filtered out and skipped. Link: https://lore.kernel.org/r/20230612081054.17200-6-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq')
-rw-r--r--sound/core/seq/seq_ump_client.c5
-rw-r--r--sound/core/seq/seq_ump_convert.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/sound/core/seq/seq_ump_client.c b/sound/core/seq/seq_ump_client.c
index e24833804094..7739fb3ebf34 100644
--- a/sound/core/seq/seq_ump_client.c
+++ b/sound/core/seq/seq_ump_client.c
@@ -73,7 +73,10 @@ static void seq_ump_input_receive(struct snd_ump_endpoint *ump,
if (!client->opened[STR_IN])
return;
- ev.source.port = ump_group_to_seq_port(ump_message_group(*val));
+ if (ump_is_groupless_msg(ump_message_type(*val)))
+ ev.source.port = 0; /* UMP EP port */
+ else
+ ev.source.port = ump_group_to_seq_port(ump_message_group(*val));
ev.dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS;
ev.flags = SNDRV_SEQ_EVENT_UMP;
memcpy(ev.ump, val, words << 2);
diff --git a/sound/core/seq/seq_ump_convert.c b/sound/core/seq/seq_ump_convert.c
index 14ba6fed9dd1..eb1d86ff6166 100644
--- a/sound/core/seq/seq_ump_convert.c
+++ b/sound/core/seq/seq_ump_convert.c
@@ -534,6 +534,8 @@ static bool ump_event_filtered(struct snd_seq_client *dest,
unsigned char group;
group = ump_message_group(ev->ump[0]);
+ if (ump_is_groupless_msg(ump_message_type(ev->ump[0])))
+ return dest->group_filter & (1U << 0);
/* check the bitmap for 1-based group number */
return dest->group_filter & (1U << (group + 1));
}
@@ -565,6 +567,7 @@ int snd_seq_deliver_from_ump(struct snd_seq_client *source,
event, atomic, hop);
/* non-EP port and different group is set? */
if (dest_port->ump_group &&
+ !ump_is_groupless_msg(type) &&
ump_message_group(*ump_ev->ump) + 1 != dest_port->ump_group)
return deliver_with_group_convert(dest, dest_port,
ump_ev, atomic, hop);