xref: /linux/include/sound/ump_msg.h (revision cdd5b5a9761fd66d17586e4f4ba6588c70e640ea)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Universal MIDI Packet (UMP): Message Definitions
4  */
5 #ifndef __SOUND_UMP_MSG_H
6 #define __SOUND_UMP_MSG_H
7 
8 /* MIDI 1.0 / 2.0 Status Code (4bit) */
9 enum {
10 	UMP_MSG_STATUS_PER_NOTE_RCC = 0x0,
11 	UMP_MSG_STATUS_PER_NOTE_ACC = 0x1,
12 	UMP_MSG_STATUS_RPN = 0x2,
13 	UMP_MSG_STATUS_NRPN = 0x3,
14 	UMP_MSG_STATUS_RELATIVE_RPN = 0x4,
15 	UMP_MSG_STATUS_RELATIVE_NRPN = 0x5,
16 	UMP_MSG_STATUS_PER_NOTE_PITCH_BEND = 0x6,
17 	UMP_MSG_STATUS_NOTE_OFF = 0x8,
18 	UMP_MSG_STATUS_NOTE_ON = 0x9,
19 	UMP_MSG_STATUS_POLY_PRESSURE = 0xa,
20 	UMP_MSG_STATUS_CC = 0xb,
21 	UMP_MSG_STATUS_PROGRAM = 0xc,
22 	UMP_MSG_STATUS_CHANNEL_PRESSURE = 0xd,
23 	UMP_MSG_STATUS_PITCH_BEND = 0xe,
24 	UMP_MSG_STATUS_PER_NOTE_MGMT = 0xf,
25 };
26 
27 /* MIDI 1.0 Channel Control (7bit) */
28 enum {
29 	UMP_CC_BANK_SELECT = 0,
30 	UMP_CC_MODULATION = 1,
31 	UMP_CC_BREATH = 2,
32 	UMP_CC_FOOT = 4,
33 	UMP_CC_PORTAMENTO_TIME = 5,
34 	UMP_CC_DATA = 6,
35 	UMP_CC_VOLUME = 7,
36 	UMP_CC_BALANCE = 8,
37 	UMP_CC_PAN = 10,
38 	UMP_CC_EXPRESSION = 11,
39 	UMP_CC_EFFECT_CONTROL_1 = 12,
40 	UMP_CC_EFFECT_CONTROL_2 = 13,
41 	UMP_CC_GP_1 = 16,
42 	UMP_CC_GP_2 = 17,
43 	UMP_CC_GP_3 = 18,
44 	UMP_CC_GP_4 = 19,
45 	UMP_CC_BANK_SELECT_LSB = 32,
46 	UMP_CC_MODULATION_LSB = 33,
47 	UMP_CC_BREATH_LSB = 34,
48 	UMP_CC_FOOT_LSB = 36,
49 	UMP_CC_PORTAMENTO_TIME_LSB = 37,
50 	UMP_CC_DATA_LSB = 38,
51 	UMP_CC_VOLUME_LSB = 39,
52 	UMP_CC_BALANCE_LSB = 40,
53 	UMP_CC_PAN_LSB = 42,
54 	UMP_CC_EXPRESSION_LSB = 43,
55 	UMP_CC_EFFECT1_LSB = 44,
56 	UMP_CC_EFFECT2_LSB = 45,
57 	UMP_CC_GP_1_LSB = 48,
58 	UMP_CC_GP_2_LSB = 49,
59 	UMP_CC_GP_3_LSB = 50,
60 	UMP_CC_GP_4_LSB = 51,
61 	UMP_CC_SUSTAIN = 64,
62 	UMP_CC_PORTAMENTO_SWITCH = 65,
63 	UMP_CC_SOSTENUTO = 66,
64 	UMP_CC_SOFT_PEDAL = 67,
65 	UMP_CC_LEGATO = 68,
66 	UMP_CC_HOLD_2 = 69,
67 	UMP_CC_SOUND_CONTROLLER_1 = 70,
68 	UMP_CC_SOUND_CONTROLLER_2 = 71,
69 	UMP_CC_SOUND_CONTROLLER_3 = 72,
70 	UMP_CC_SOUND_CONTROLLER_4 = 73,
71 	UMP_CC_SOUND_CONTROLLER_5 = 74,
72 	UMP_CC_SOUND_CONTROLLER_6 = 75,
73 	UMP_CC_SOUND_CONTROLLER_7 = 76,
74 	UMP_CC_SOUND_CONTROLLER_8 = 77,
75 	UMP_CC_SOUND_CONTROLLER_9 = 78,
76 	UMP_CC_SOUND_CONTROLLER_10 = 79,
77 	UMP_CC_GP_5 = 80,
78 	UMP_CC_GP_6 = 81,
79 	UMP_CC_GP_7 = 82,
80 	UMP_CC_GP_8 = 83,
81 	UMP_CC_PORTAMENTO_CONTROL = 84,
82 	UMP_CC_EFFECT_1 = 91,
83 	UMP_CC_EFFECT_2 = 92,
84 	UMP_CC_EFFECT_3 = 93,
85 	UMP_CC_EFFECT_4 = 94,
86 	UMP_CC_EFFECT_5 = 95,
87 	UMP_CC_DATA_INC = 96,
88 	UMP_CC_DATA_DEC = 97,
89 	UMP_CC_NRPN_LSB = 98,
90 	UMP_CC_NRPN_MSB = 99,
91 	UMP_CC_RPN_LSB = 100,
92 	UMP_CC_RPN_MSB = 101,
93 	UMP_CC_ALL_SOUND_OFF = 120,
94 	UMP_CC_RESET_ALL = 121,
95 	UMP_CC_LOCAL_CONTROL = 122,
96 	UMP_CC_ALL_NOTES_OFF = 123,
97 	UMP_CC_OMNI_OFF = 124,
98 	UMP_CC_OMNI_ON = 125,
99 	UMP_CC_POLY_OFF = 126,
100 	UMP_CC_POLY_ON = 127,
101 };
102 
103 /* MIDI 1.0 / 2.0 System Messages (0xfx) */
104 enum {
105 	UMP_SYSTEM_STATUS_MIDI_TIME_CODE = 0xf1,
106 	UMP_SYSTEM_STATUS_SONG_POSITION = 0xf2,
107 	UMP_SYSTEM_STATUS_SONG_SELECT = 0xf3,
108 	UMP_SYSTEM_STATUS_TUNE_REQUEST = 0xf6,
109 	UMP_SYSTEM_STATUS_TIMING_CLOCK = 0xf8,
110 	UMP_SYSTEM_STATUS_START = 0xfa,
111 	UMP_SYSTEM_STATUS_CONTINUE = 0xfb,
112 	UMP_SYSTEM_STATUS_STOP = 0xfc,
113 	UMP_SYSTEM_STATUS_ACTIVE_SENSING = 0xfe,
114 	UMP_SYSTEM_STATUS_RESET = 0xff,
115 };
116 
117 /* MIDI 1.0 Realtime and SysEx status messages (0xfx) */
118 enum {
119 	UMP_MIDI1_MSG_REALTIME		= 0xf0,	/* mask */
120 	UMP_MIDI1_MSG_SYSEX_START	= 0xf0,
121 	UMP_MIDI1_MSG_SYSEX_END		= 0xf7,
122 };
123 
124 /*
125  * UMP Message Definitions
126  */
127 
128 /* MIDI 1.0 Note Off / Note On (32bit) */
129 struct snd_ump_midi1_msg_note {
130 #ifdef __BIG_ENDIAN_BITFIELD
131 	u32 type:4;
132 	u32 group:4;
133 	u32 status:4;
134 	u32 channel:4;
135 	u32 note:8;
136 	u32 velocity:8;
137 #else
138 	u32 velocity:8;
139 	u32 note:8;
140 	u32 channel:4;
141 	u32 status:4;
142 	u32 group:4;
143 	u32 type:4;
144 #endif
145 } __packed;
146 
147 /* MIDI 1.0 Poly Pressure (32bit) */
148 struct snd_ump_midi1_msg_paf {
149 #ifdef __BIG_ENDIAN_BITFIELD
150 	u32 type:4;
151 	u32 group:4;
152 	u32 status:4;
153 	u32 channel:4;
154 	u32 note:8;
155 	u32 data:8;
156 #else
157 	u32 data:8;
158 	u32 note:8;
159 	u32 channel:4;
160 	u32 status:4;
161 	u32 group:4;
162 	u32 type:4;
163 #endif
164 } __packed;
165 
166 /* MIDI 1.0 Control Change (32bit) */
167 struct snd_ump_midi1_msg_cc {
168 #ifdef __BIG_ENDIAN_BITFIELD
169 	u32 type:4;
170 	u32 group:4;
171 	u32 status:4;
172 	u32 channel:4;
173 	u32 index:8;
174 	u32 data:8;
175 #else
176 	u32 data:8;
177 	u32 index:8;
178 	u32 channel:4;
179 	u32 status:4;
180 	u32 group:4;
181 	u32 type:4;
182 #endif
183 } __packed;
184 
185 /* MIDI 1.0 Program Change (32bit) */
186 struct snd_ump_midi1_msg_program {
187 #ifdef __BIG_ENDIAN_BITFIELD
188 	u32 type:4;
189 	u32 group:4;
190 	u32 status:4;
191 	u32 channel:4;
192 	u32 program:8;
193 	u32 reserved:8;
194 #else
195 	u32 reserved:8;
196 	u32 program:8;
197 	u32 channel:4;
198 	u32 status:4;
199 	u32 group:4;
200 	u32 type:4;
201 #endif
202 } __packed;
203 
204 /* MIDI 1.0 Channel Pressure (32bit) */
205 struct snd_ump_midi1_msg_caf {
206 #ifdef __BIG_ENDIAN_BITFIELD
207 	u32 type:4;
208 	u32 group:4;
209 	u32 status:4;
210 	u32 channel:4;
211 	u32 data:8;
212 	u32 reserved:8;
213 #else
214 	u32 reserved:8;
215 	u32 data:8;
216 	u32 channel:4;
217 	u32 status:4;
218 	u32 group:4;
219 	u32 type:4;
220 #endif
221 } __packed;
222 
223 /* MIDI 1.0 Pitch Bend (32bit) */
224 struct snd_ump_midi1_msg_pitchbend {
225 #ifdef __BIG_ENDIAN_BITFIELD
226 	u32 type:4;
227 	u32 group:4;
228 	u32 status:4;
229 	u32 channel:4;
230 	u32 data_lsb:8;
231 	u32 data_msb:8;
232 #else
233 	u32 data_msb:8;
234 	u32 data_lsb:8;
235 	u32 channel:4;
236 	u32 status:4;
237 	u32 group:4;
238 	u32 type:4;
239 #endif
240 } __packed;
241 
242 /* System Common and Real Time messages (32bit); no channel field */
243 struct snd_ump_system_msg {
244 #ifdef __BIG_ENDIAN_BITFIELD
245 	u32 type:4;
246 	u32 group:4;
247 	u32 status:8;
248 	u32 parm1:8;
249 	u32 parm2:8;
250 #else
251 	u32 parm2:8;
252 	u32 parm1:8;
253 	u32 status:8;
254 	u32 group:4;
255 	u32 type:4;
256 #endif
257 } __packed;
258 
259 /* MIDI 1.0 UMP CVM (32bit) */
260 union snd_ump_midi1_msg {
261 	struct snd_ump_midi1_msg_note note;
262 	struct snd_ump_midi1_msg_paf paf;
263 	struct snd_ump_midi1_msg_cc cc;
264 	struct snd_ump_midi1_msg_program pg;
265 	struct snd_ump_midi1_msg_caf caf;
266 	struct snd_ump_midi1_msg_pitchbend pb;
267 	struct snd_ump_system_msg system;
268 	u32 raw;
269 };
270 
271 /* MIDI 2.0 Note Off / Note On (64bit) */
272 struct snd_ump_midi2_msg_note {
273 #ifdef __BIG_ENDIAN_BITFIELD
274 	/* 0 */
275 	u32 type:4;
276 	u32 group:4;
277 	u32 status:4;
278 	u32 channel:4;
279 	u32 note:8;
280 	u32 attribute_type:8;
281 	/* 1 */
282 	u32 velocity:16;
283 	u32 attribute_data:16;
284 #else
285 	/* 0 */
286 	u32 attribute_type:8;
287 	u32 note:8;
288 	u32 channel:4;
289 	u32 status:4;
290 	u32 group:4;
291 	u32 type:4;
292 	/* 1 */
293 	u32 attribute_data:16;
294 	u32 velocity:16;
295 #endif
296 } __packed;
297 
298 /* MIDI 2.0 Poly Pressure (64bit) */
299 struct snd_ump_midi2_msg_paf {
300 #ifdef __BIG_ENDIAN_BITFIELD
301 	/* 0 */
302 	u32 type:4;
303 	u32 group:4;
304 	u32 status:4;
305 	u32 channel:4;
306 	u32 note:8;
307 	u32 reserved:8;
308 	/* 1 */
309 	u32 data;
310 #else
311 	/* 0 */
312 	u32 reserved:8;
313 	u32 note:8;
314 	u32 channel:4;
315 	u32 status:4;
316 	u32 group:4;
317 	u32 type:4;
318 	/* 1 */
319 	u32 data;
320 #endif
321 } __packed;
322 
323 /* MIDI 2.0 Per-Note Controller (64bit) */
324 struct snd_ump_midi2_msg_pernote_cc {
325 #ifdef __BIG_ENDIAN_BITFIELD
326 	/* 0 */
327 	u32 type:4;
328 	u32 group:4;
329 	u32 status:4;
330 	u32 channel:4;
331 	u32 note:8;
332 	u32 index:8;
333 	/* 1 */
334 	u32 data;
335 #else
336 	/* 0 */
337 	u32 index:8;
338 	u32 note:8;
339 	u32 channel:4;
340 	u32 status:4;
341 	u32 group:4;
342 	u32 type:4;
343 	/* 1 */
344 	u32 data;
345 #endif
346 } __packed;
347 
348 /* MIDI 2.0 Per-Note Management (64bit) */
349 struct snd_ump_midi2_msg_pernote_mgmt {
350 #ifdef __BIG_ENDIAN_BITFIELD
351 	/* 0 */
352 	u32 type:4;
353 	u32 group:4;
354 	u32 status:4;
355 	u32 channel:4;
356 	u32 note:8;
357 	u32 flags:8;
358 	/* 1 */
359 	u32 reserved;
360 #else
361 	/* 0 */
362 	u32 flags:8;
363 	u32 note:8;
364 	u32 channel:4;
365 	u32 status:4;
366 	u32 group:4;
367 	u32 type:4;
368 	/* 1 */
369 	u32 reserved;
370 #endif
371 } __packed;
372 
373 /* MIDI 2.0 Control Change (64bit) */
374 struct snd_ump_midi2_msg_cc {
375 #ifdef __BIG_ENDIAN_BITFIELD
376 	/* 0 */
377 	u32 type:4;
378 	u32 group:4;
379 	u32 status:4;
380 	u32 channel:4;
381 	u32 index:8;
382 	u32 reserved:8;
383 	/* 1 */
384 	u32 data;
385 #else
386 	/* 0 */
387 	u32 reserved:8;
388 	u32 index:8;
389 	u32 channel:4;
390 	u32 status:4;
391 	u32 group:4;
392 	u32 type:4;
393 	/* 1 */
394 	u32 data;
395 #endif
396 } __packed;
397 
398 /* MIDI 2.0 Registered Controller (RPN) / Assignable Controller (NRPN) (64bit) */
399 struct snd_ump_midi2_msg_rpn {
400 #ifdef __BIG_ENDIAN_BITFIELD
401 	/* 0 */
402 	u32 type:4;
403 	u32 group:4;
404 	u32 status:4;
405 	u32 channel:4;
406 	u32 bank:8;
407 	u32 index:8;
408 	/* 1 */
409 	u32 data;
410 #else
411 	/* 0 */
412 	u32 index:8;
413 	u32 bank:8;
414 	u32 channel:4;
415 	u32 status:4;
416 	u32 group:4;
417 	u32 type:4;
418 	/* 1 */
419 	u32 data;
420 #endif
421 } __packed;
422 
423 /* MIDI 2.0 Program Change (64bit) */
424 struct snd_ump_midi2_msg_program {
425 #ifdef __BIG_ENDIAN_BITFIELD
426 	/* 0 */
427 	u32 type:4;
428 	u32 group:4;
429 	u32 status:4;
430 	u32 channel:4;
431 	u32 reserved:15;
432 	u32 bank_valid:1;
433 	/* 1 */
434 	u32 program:8;
435 	u32 reserved2:8;
436 	u32 bank_msb:8;
437 	u32 bank_lsb:8;
438 #else
439 	/* 0 */
440 	u32 bank_valid:1;
441 	u32 reserved:15;
442 	u32 channel:4;
443 	u32 status:4;
444 	u32 group:4;
445 	u32 type:4;
446 	/* 1 */
447 	u32 bank_lsb:8;
448 	u32 bank_msb:8;
449 	u32 reserved2:8;
450 	u32 program:8;
451 #endif
452 } __packed;
453 
454 /* MIDI 2.0 Channel Pressure (64bit) */
455 struct snd_ump_midi2_msg_caf {
456 #ifdef __BIG_ENDIAN_BITFIELD
457 	/* 0 */
458 	u32 type:4;
459 	u32 group:4;
460 	u32 status:4;
461 	u32 channel:4;
462 	u32 reserved:16;
463 	/* 1 */
464 	u32 data;
465 #else
466 	/* 0 */
467 	u32 reserved:16;
468 	u32 channel:4;
469 	u32 status:4;
470 	u32 group:4;
471 	u32 type:4;
472 	/* 1 */
473 	u32 data;
474 #endif
475 } __packed;
476 
477 /* MIDI 2.0 Pitch Bend (64bit) */
478 struct snd_ump_midi2_msg_pitchbend {
479 #ifdef __BIG_ENDIAN_BITFIELD
480 	/* 0 */
481 	u32 type:4;
482 	u32 group:4;
483 	u32 status:4;
484 	u32 channel:4;
485 	u32 reserved:16;
486 	/* 1 */
487 	u32 data;
488 #else
489 	/* 0 */
490 	u32 reserved:16;
491 	u32 channel:4;
492 	u32 status:4;
493 	u32 group:4;
494 	u32 type:4;
495 	/* 1 */
496 	u32 data;
497 #endif
498 } __packed;
499 
500 /* MIDI 2.0 Per-Note Pitch Bend (64bit) */
501 struct snd_ump_midi2_msg_pernote_pitchbend {
502 #ifdef __BIG_ENDIAN_BITFIELD
503 	/* 0 */
504 	u32 type:4;
505 	u32 group:4;
506 	u32 status:4;
507 	u32 channel:4;
508 	u32 note:8;
509 	u32 reserved:8;
510 	/* 1 */
511 	u32 data;
512 #else
513 	/* 0 */
514 	u32 reserved:8;
515 	u32 note:8;
516 	u32 channel:4;
517 	u32 status:4;
518 	u32 group:4;
519 	u32 type:4;
520 	/* 1 */
521 	u32 data;
522 #endif
523 } __packed;
524 
525 /* MIDI 2.0 UMP CVM (64bit) */
526 union snd_ump_midi2_msg {
527 	struct snd_ump_midi2_msg_note note;
528 	struct snd_ump_midi2_msg_paf paf;
529 	struct snd_ump_midi2_msg_pernote_cc pernote_cc;
530 	struct snd_ump_midi2_msg_pernote_mgmt pernote_mgmt;
531 	struct snd_ump_midi2_msg_cc cc;
532 	struct snd_ump_midi2_msg_rpn rpn;
533 	struct snd_ump_midi2_msg_program pg;
534 	struct snd_ump_midi2_msg_caf caf;
535 	struct snd_ump_midi2_msg_pitchbend pb;
536 	struct snd_ump_midi2_msg_pernote_pitchbend pernote_pb;
537 	u32 raw[2];
538 };
539 
540 /* UMP Stream Message: Endpoint Discovery (128bit) */
541 struct snd_ump_stream_msg_ep_discovery {
542 #ifdef __BIG_ENDIAN_BITFIELD
543 	/* 0 */
544 	u32 type:4;
545 	u32 format:2;
546 	u32 status:10;
547 	u32 ump_version_major:8;
548 	u32 ump_version_minor:8;
549 	/* 1 */
550 	u32 reserved:24;
551 	u32 filter_bitmap:8;
552 	/* 2-3 */
553 	u32 reserved2[2];
554 #else
555 	/* 0 */
556 	u32 ump_version_minor:8;
557 	u32 ump_version_major:8;
558 	u32 status:10;
559 	u32 format:2;
560 	u32 type:4;
561 	/* 1 */
562 	u32 filter_bitmap:8;
563 	u32 reserved:24;
564 	/* 2-3 */
565 	u32 reserved2[2];
566 #endif
567 } __packed;
568 
569 /* UMP Stream Message: Endpoint Info Notification (128bit) */
570 struct snd_ump_stream_msg_ep_info {
571 #ifdef __BIG_ENDIAN_BITFIELD
572 	/* 0 */
573 	u32 type:4;
574 	u32 format:2;
575 	u32 status:10;
576 	u32 ump_version_major:8;
577 	u32 ump_version_minor:8;
578 	/* 1 */
579 	u32 static_function_block:1;
580 	u32 num_function_blocks:7;
581 	u32 reserved:8;
582 	u32 protocol:8;
583 	u32 reserved2:6;
584 	u32 jrts:2;
585 	/* 2-3 */
586 	u32 reserved3[2];
587 #else
588 	/* 0 */
589 	u32 ump_version_minor:8;
590 	u32 ump_version_major:8;
591 	u32 status:10;
592 	u32 format:2;
593 	u32 type:4;
594 	/* 1 */
595 	u32 jrts:2;
596 	u32 reserved2:6;
597 	u32 protocol:8;
598 	u32 reserved:8;
599 	u32 num_function_blocks:7;
600 	u32 static_function_block:1;
601 	/* 2-3 */
602 	u32 reserved3[2];
603 #endif
604 } __packed;
605 
606 /* UMP Stream Message: Device Info Notification (128bit) */
607 struct snd_ump_stream_msg_devince_info {
608 #ifdef __BIG_ENDIAN_BITFIELD
609 	/* 0 */
610 	u32 type:4;
611 	u32 format:2;
612 	u32 status:10;
613 	u32 reserved:16;
614 	/* 1 */
615 	u32 manufacture_id;
616 	/* 2 */
617 	u8 family_lsb;
618 	u8 family_msb;
619 	u8 model_lsb;
620 	u8 model_msb;
621 	/* 3 */
622 	u32 sw_revision;
623 #else
624 	/* 0 */
625 	u32 reserved:16;
626 	u32 status:10;
627 	u32 format:2;
628 	u32 type:4;
629 	/* 1 */
630 	u32 manufacture_id;
631 	/* 2 */
632 	u8 model_msb;
633 	u8 model_lsb;
634 	u8 family_msb;
635 	u8 family_lsb;
636 	/* 3 */
637 	u32 sw_revision;
638 #endif
639 } __packed;
640 
641 /* UMP Stream Message: Stream Config Request / Notification (128bit) */
642 struct snd_ump_stream_msg_stream_cfg {
643 #ifdef __BIG_ENDIAN_BITFIELD
644 	/* 0 */
645 	u32 type:4;
646 	u32 format:2;
647 	u32 status:10;
648 	u32 protocol:8;
649 	u32 reserved:6;
650 	u32 jrts:2;
651 	/* 1-3 */
652 	u32 reserved2[3];
653 #else
654 	/* 0 */
655 	u32 jrts:2;
656 	u32 reserved:6;
657 	u32 protocol:8;
658 	u32 status:10;
659 	u32 format:2;
660 	u32 type:4;
661 	/* 1-3 */
662 	u32 reserved2[3];
663 #endif
664 } __packed;
665 
666 /* UMP Stream Message: Function Block Discovery (128bit) */
667 struct snd_ump_stream_msg_fb_discovery {
668 #ifdef __BIG_ENDIAN_BITFIELD
669 	/* 0 */
670 	u32 type:4;
671 	u32 format:2;
672 	u32 status:10;
673 	u32 function_block_id:8;
674 	u32 filter:8;
675 	/* 1-3 */
676 	u32 reserved[3];
677 #else
678 	/* 0 */
679 	u32 filter:8;
680 	u32 function_block_id:8;
681 	u32 status:10;
682 	u32 format:2;
683 	u32 type:4;
684 	/* 1-3 */
685 	u32 reserved[3];
686 #endif
687 } __packed;
688 
689 /* UMP Stream Message: Function Block Info Notification (128bit) */
690 struct snd_ump_stream_msg_fb_info {
691 #ifdef __BIG_ENDIAN_BITFIELD
692 	/* 0 */
693 	u32 type:4;
694 	u32 format:2;
695 	u32 status:10;
696 	u32 active:1;
697 	u32 function_block_id:7;
698 	u32 reserved:2;
699 	u32 ui_hint:2;
700 	u32 midi_10:2;
701 	u32 direction:2;
702 	/* 1 */
703 	u32 first_group:8;
704 	u32 num_groups:8;
705 	u32 midi_ci_version:8;
706 	u32 sysex8_streams:8;
707 	/* 2-3 */
708 	u32 reserved2[2];
709 #else
710 	/* 0 */
711 	u32 direction:2;
712 	u32 midi_10:2;
713 	u32 ui_hint:2;
714 	u32 reserved:2;
715 	u32 function_block_id:7;
716 	u32 active:1;
717 	u32 status:10;
718 	u32 format:2;
719 	u32 type:4;
720 	/* 1 */
721 	u32 sysex8_streams:8;
722 	u32 midi_ci_version:8;
723 	u32 num_groups:8;
724 	u32 first_group:8;
725 	/* 2-3 */
726 	u32 reserved2[2];
727 #endif
728 } __packed;
729 
730 /* UMP Stream Message: Function Block Name Notification (128bit) */
731 struct snd_ump_stream_msg_fb_name {
732 #ifdef __BIG_ENDIAN_BITFIELD
733 	/* 0 */
734 	u16 type:4;
735 	u16 format:2;
736 	u16 status:10;
737 	u8 function_block_id;
738 	u8 name0;
739 	/* 1-3 */
740 	u8 name[12];
741 #else
742 	/* 0 */
743 	u8 name0;
744 	u8 function_block_id;
745 	u16 status:10;
746 	u16 format:2;
747 	u16 type:4;
748 	/* 1-3 */
749 	u8 name[12]; // FIXME: byte order
750 #endif
751 } __packed;
752 
753 /* MIDI 2.0 Stream Messages (128bit) */
754 union snd_ump_stream_msg {
755 	struct snd_ump_stream_msg_ep_discovery ep_discovery;
756 	struct snd_ump_stream_msg_ep_info ep_info;
757 	struct snd_ump_stream_msg_devince_info device_info;
758 	struct snd_ump_stream_msg_stream_cfg stream_cfg;
759 	struct snd_ump_stream_msg_fb_discovery fb_discovery;
760 	struct snd_ump_stream_msg_fb_info fb_info;
761 	struct snd_ump_stream_msg_fb_name fb_name;
762 	u32 raw[4];
763 };
764 
765 #endif /* __SOUND_UMP_MSG_H */
766