github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/dev_sequencer.txt (about)

     1  # Copyright 2020 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <uapi/asm/ioctl.h>
     5  include <uapi/linux/fcntl.h>
     6  include <uapi/linux/soundcard.h>
     7  include <sound/core/seq/oss/seq_oss_device.h>
     8  include <sound/asoundef.h>
     9  include <uapi/sound/sfnt_info.h>
    10  include <sound/core/seq/oss/seq_oss_event.h>
    11  
    12  resource fd_seq[fd]
    13  
    14  openat$sequencer(fd const[AT_FDCWD], file ptr[in, string["/dev/sequencer"]], flags flags[open_flags], mode const[0]) fd_seq
    15  openat$sequencer2(fd const[AT_FDCWD], file ptr[in, string["/dev/sequencer2"]], flags flags[open_flags], mode const[0]) fd_seq
    16  read$sequencer(fd fd_seq, buffer ptr[out, array[int8]], count bytesize[buffer])
    17  write$sequencer(fd fd_seq, buffer ptr[in, array[evrec_write]], count bytesize[buffer])
    18  
    19  define MIN_OSS_TEMPO	8
    20  define MAX_OSS_TEMPO	360
    21  define MIN_OSS_TIMEBASE	1
    22  define MAX_OSS_TIMEBASE	1000
    23  
    24  ioctl$SNDCTL_TMR_TIMEBASE(fd fd_seq, cmd const[SNDCTL_TMR_TIMEBASE], carg ptr[in, int32[MIN_OSS_TIMEBASE:MAX_OSS_TIMEBASE]])
    25  ioctl$SNDCTL_TMR_TEMPO(fd fd_seq, cmd const[SNDCTL_TMR_TEMPO], carg ptr[in, int32[MIN_OSS_TEMPO:MAX_OSS_TEMPO]])
    26  ioctl$SNDCTL_TMR_START(fd fd_seq, cmd const[SNDCTL_TMR_START])
    27  ioctl$SNDCTL_TMR_STOP(fd fd_seq, cmd const[SNDCTL_TMR_STOP])
    28  ioctl$SNDCTL_TMR_CONTINUE(fd fd_seq, cmd const[SNDCTL_TMR_CONTINUE])
    29  ioctl$SNDCTL_TMR_METRONOME(fd fd_seq, cmd const[SNDCTL_TMR_METRONOME])
    30  ioctl$SNDCTL_TMR_SOURCE(fd fd_seq, cmd const[SNDCTL_TMR_SOURCE])
    31  ioctl$SNDCTL_TMR_SELECT(fd fd_seq, cmd const[SNDCTL_TMR_SELECT])
    32  ioctl$SNDCTL_SEQ_CTRLRATE(fd fd_seq, cmd const[SNDCTL_SEQ_CTRLRATE], carg ptr[inout, int32])
    33  ioctl$SNDCTL_SEQ_PANIC(fd fd_seq, cmd const[SNDCTL_SEQ_PANIC])
    34  ioctl$SNDCTL_SEQ_SYNC(fd fd_seq, cmd const[SNDCTL_SEQ_SYNC])
    35  ioctl$SNDCTL_SEQ_RESET(fd fd_seq, cmd const[SNDCTL_SEQ_RESET])
    36  ioctl$SNDCTL_SEQ_TESTMIDI(fd fd_seq, cmd const[SNDCTL_SEQ_TESTMIDI], carg ptr[in, int32])
    37  ioctl$SNDCTL_SEQ_GETINCOUNT(fd fd_seq, cmd const[SNDCTL_SEQ_GETINCOUNT], carg ptr[out, int32])
    38  ioctl$SNDCTL_SEQ_GETOUTCOUNT(fd fd_seq, cmd const[SNDCTL_SEQ_GETOUTCOUNT], carg ptr[out, int32])
    39  ioctl$SNDCTL_SEQ_GETTIME(fd fd_seq, cmd const[SNDCTL_SEQ_GETTIME], carg ptr[out, int32])
    40  ioctl$SNDCTL_SEQ_RESETSAMPLES(fd fd_seq, cmd const[SNDCTL_SEQ_RESETSAMPLES], carg ptr[in, int32])
    41  ioctl$SNDCTL_SEQ_NRSYNTHS(fd fd_seq, cmd const[SNDCTL_SEQ_NRSYNTHS], carg ptr[out, int32])
    42  ioctl$SNDCTL_SEQ_NRMIDIS(fd fd_seq, cmd const[SNDCTL_SEQ_NRMIDIS], carg ptr[out, int32])
    43  ioctl$SNDCTL_SYNTH_MEMAVL(fd fd_seq, cmd const[SNDCTL_SYNTH_MEMAVL], carg ptr[inout, int32])
    44  ioctl$SNDCTL_FM_4OP_ENABLE(fd fd_seq, cmd const[SNDCTL_FM_4OP_ENABLE], carg ptr[in, int32])
    45  ioctl$SNDCTL_SYNTH_INFO(fd fd_seq, cmd const[SNDCTL_SYNTH_INFO], carg ptr[inout, synth_info])
    46  ioctl$SNDCTL_SYNTH_ID(fd fd_seq, cmd const[SNDCTL_SYNTH_ID], carg ptr[inout, synth_info])
    47  ioctl$SNDCTL_SEQ_OUTOFBAND(fd fd_seq, cmd const[SNDCTL_SEQ_OUTOFBAND], carg ptr[in, evrec])
    48  ioctl$SNDCTL_MIDI_INFO(fd fd_seq, cmd const[SNDCTL_MIDI_INFO], carg ptr[inout, midi_info])
    49  ioctl$SNDCTL_SEQ_THRESHOLD(fd fd_seq, cmd const[SNDCTL_SEQ_THRESHOLD], carg ptr[in, int32])
    50  ioctl$SNDCTL_MIDI_PRETIME(fd fd_seq, cmd const[SNDCTL_MIDI_PRETIME], carg ptr[inout, int32])
    51  ioctl$SNDCTL_FM_LOAD_INSTR(fd fd_seq, cmd const[SNDCTL_FM_LOAD_INSTR])
    52  
    53  synth_info {
    54  	name		array[int8, 30]
    55  	device		int32
    56  	synth_type	flags[synth_type_flags, int32]
    57  	synth_subtype	flags[synth_subtype_flags, int32]
    58  	perc_mode	int32
    59  	nr_voices	int32
    60  	nr_drums	int32
    61  	instr_bank_size	int32
    62  	capabilities	flags[capabilities_flags, int32]
    63  	dummies		array[int32, 19]
    64  }
    65  
    66  midi_info {
    67  	name		array[int8, 30]
    68  	device		int32
    69  	capabilities	int32
    70  	dev_type	int32
    71  	dummies		array[int32, 18]
    72  }
    73  
    74  evrec_write [
    75  	s	evrec_short
    76  	n	evrec_note
    77  	l	evrec_long
    78  	v	evrec_voice
    79  	t	evrec_timer
    80  	e	evrec_extended
    81  	x	evrec_sysex
    82  	echo	int32
    83  	raw	evrec_raw
    84  	generic	evrec_generic
    85  ] [varlen]
    86  
    87  evrec [
    88  	s	evrec_short
    89  	n	evrec_note
    90  	l	evrec_long
    91  	v	evrec_voice
    92  	t	evrec_timer
    93  	e	evrec_extended
    94  	x	evrec_sysex
    95  	echo	int32
    96  	raw	evrec_raw
    97  	generic	evrec_generic
    98  ]
    99  
   100  evrec_short {
   101  	code	const[SEQ_MIDIPUTC, int8]
   102  	parm1	evrec_short_parm1
   103  	dev	int8[0:SNDRV_SEQ_OSS_MAX_MIDI_DEVS]
   104  	parm2	int8
   105  }
   106  
   107  evrec_short_parm1 [
   108  	SEQ_MIDIPUTC	int8[MIDI_CMD_NOTE_OFF:MIDI_CMD_COMMON_RESET]
   109  	generic		int8
   110  ]
   111  
   112  evrec_note {
   113  	code	flags[evrec_note_code, int8]
   114  	chn	int8
   115  	note	evrec_note_note
   116  	vel	int8
   117  }
   118  
   119  evrec_note_note [
   120  	SEQ_NOTEON	midi_note
   121  	generic		int8
   122  ]
   123  
   124  midi_note [
   125  	note	int8[0:127]
   126  	special	const[255, int8]
   127  ]
   128  
   129  evrec_timer {
   130  	code	flags[evrec_timer_code, int8]
   131  	cmd	flags[evrec_timer_cmd, int8]
   132  	dummy1	int8
   133  	dummy2	int8
   134  	time	evrec_timer_time
   135  }
   136  
   137  evrec_timer_time [
   138  	TMR_WAIT_ABS	const[0, int32]
   139  	generic		int32
   140  ]
   141  
   142  evrec_extended {
   143  	code	const[SEQ_EXTENDED, int8]
   144  	cmd	flags[evrec_extended_cmd, int8]
   145  	dev	int8[0:15]
   146  	chn	int8
   147  	p1	evrec_extended_p1
   148  	p2	int8
   149  	p3	int8
   150  	p4	int8
   151  }
   152  
   153  evrec_extended_p1 [
   154  	SEQ_CONTROLLER	flags[evrec_extended_p1_flags, int8]
   155  	SEQ_NOTEON	midi_note
   156  	generic		int8
   157  ]
   158  
   159  evrec_long {
   160  	code	const[EV_CHN_COMMON, int8]
   161  	dev	int8[0:15]
   162  	cmd	flags[evrec_long_cmd, int8]
   163  	chn	int8[0:31]
   164  	p1	int8
   165  	p2	int8
   166  	val	int16
   167  }
   168  
   169  evrec_voice {
   170  	code	const[EV_CHN_VOICE, int8]
   171  	dev	int8[0:15]
   172  	cmd	flags[evrec_voice_cmd, int8]
   173  	chn	int8[0:31]
   174  	note	evrec_voice_note
   175  	parm	int8
   176  	dummy	int16
   177  }
   178  
   179  evrec_voice_note [
   180  	MIDI_NOTEON	midi_note
   181  	generic		int8
   182  ]
   183  
   184  evrec_sysex {
   185  	code	const[EV_SYSEX, int8]
   186  	dev	int8[0:15]
   187  	buf	array[int8, 6]
   188  }
   189  
   190  evrec_raw {
   191  	code	flags[evrec_raw_code, int8]
   192  	dev	int8[0:15]
   193  	arr	array[int8, 6]
   194  }
   195  
   196  evrec_generic {
   197  	code	flags[evrec_generic_flags, int8]
   198  }
   199  
   200  synth_type_flags = SYNTH_TYPE_FM, SYNTH_TYPE_SAMPLE, SYNTH_TYPE_MIDI
   201  synth_subtype_flags = FM_TYPE_ADLIB, FM_TYPE_OPL3, MIDI_TYPE_MPU401
   202  capabilities_flags = SYNTH_CAP_PERCMODE, SYNTH_CAP_OPL3, SYNTH_CAP_INPUT
   203  
   204  evrec_extended_cmd = SEQ_NOTEOFF, SEQ_NOTEON, SEQ_PGMCHANGE, SEQ_AFTERTOUCH, SEQ_BALANCE, SEQ_CONTROLLER, SEQ_VOLMODE
   205  evrec_extended_p1_flags = CTRL_PITCH_BENDER, CTRL_PITCH_BENDER_RANGE
   206  evrec_voice_cmd = MIDI_NOTEON, MIDI_NOTEOFF, MIDI_KEY_PRESSURE
   207  evrec_timer_code = EV_TIMING, SEQ_SYNCTIMER
   208  evrec_timer_cmd = TMR_ECHO, TMR_STOP, TMR_CONTINUE, TMR_TEMPO, TMR_WAIT_REL, TMR_WAIT_ABS, TMR_START
   209  evrec_long_cmd = MIDI_PGM_CHANGE, MIDI_CTL_CHANGE, MIDI_PITCH_BEND, MIDI_CHN_PRESSURE
   210  evrec_note_code = SEQ_NOTEOFF, SEQ_NOTEON, SEQ_PGMCHANGE
   211  evrec_generic_flags = EV_SEQ_LOCAL, SEQ_ECHO, SEQ_WAIT
   212  evrec_raw_code = SEQ_VOLMODE, SEQ_PRIVATE