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

     1  # Copyright 2018 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/time.h>
     7  include <uapi/sound/asound.h>
     8  
     9  resource fd_midi[fd]
    10  
    11  syz_open_dev$sndmidi(dev ptr[in, string["/dev/snd/midiC#D#"]], id intptr, flags flags[open_flags]) fd_midi
    12  syz_open_dev$dmmidi(dev ptr[in, string["/dev/dmmidi#"]], id intptr, flags flags[open_flags]) fd_midi
    13  syz_open_dev$admmidi(dev ptr[in, string["/dev/admmidi#"]], id intptr, flags flags[open_flags]) fd_midi
    14  syz_open_dev$amidi(dev ptr[in, string["/dev/amidi#"]], id intptr, flags flags[open_flags]) fd_midi
    15  syz_open_dev$midi(dev ptr[in, string["/dev/midi#"]], id intptr, flags flags[open_flags]) fd_midi
    16  
    17  write$midi(fd fd_midi, data ptr[in, array[int8]], len bytesize[data])
    18  read$midi(fd fd_midi, data ptr[out, array[int8]], len bytesize[data])
    19  ioctl$SNDRV_RAWMIDI_IOCTL_PVERSION(fd fd_midi, cmd const[SNDRV_RAWMIDI_IOCTL_PVERSION], arg ptr[out, int32])
    20  ioctl$SNDRV_RAWMIDI_IOCTL_INFO(fd fd_midi, cmd const[SNDRV_RAWMIDI_IOCTL_INFO], arg ptr[out, snd_rawmidi_info])
    21  ioctl$SNDRV_RAWMIDI_IOCTL_PARAMS(fd fd_midi, cmd const[SNDRV_RAWMIDI_IOCTL_PARAMS], arg ptr[inout, snd_rawmidi_params])
    22  ioctl$SNDRV_RAWMIDI_IOCTL_STATUS32(fd fd_midi, cmd const[SNDRV_RAWMIDI_IOCTL_STATUS32], arg ptr[inout, snd_rawmidi_status32])
    23  ioctl$SNDRV_RAWMIDI_IOCTL_STATUS64(fd fd_midi, cmd const[SNDRV_RAWMIDI_IOCTL_STATUS64], arg ptr[inout, snd_rawmidi_status64])
    24  ioctl$SNDRV_RAWMIDI_IOCTL_DROP(fd fd_midi, cmd const[SNDRV_RAWMIDI_IOCTL_DROP], arg ptr[in, int32])
    25  ioctl$SNDRV_RAWMIDI_IOCTL_DRAIN(fd fd_midi, cmd const[SNDRV_RAWMIDI_IOCTL_DRAIN], arg ptr[in, int32])
    26  
    27  snd_rawmidi_info {
    28  	device			int32
    29  	subdevice		int32
    30  	stream			flags[sndrv_rawmidi_stream, int32]
    31  	card			const[0, int32]
    32  	flags			const[0, int32]
    33  	id			array[const[0, int8], 64]
    34  	name			array[const[0, int8], 80]
    35  	subname			array[const[0, int8], 32]
    36  	subdevices_count	const[0, int32]
    37  	subdevices_avail	const[0, int32]
    38  	reserved		array[const[0, int8], 64]
    39  }
    40  
    41  snd_rawmidi_params {
    42  	stream			flags[sndrv_rawmidi_stream, int32]
    43  	buffer_size		intptr
    44  	avail_min		intptr
    45  	no_active_sensing	int32:1
    46  	mode			int32
    47  	reserved		array[const[0, int8], 12]
    48  }
    49  
    50  snd_rawmidi_status32 {
    51  	stream		flags[sndrv_rawmidi_stream, int32]
    52  	tstamp_sec	const[0, int32]
    53  	tstamp_nsec	const[0, int32]
    54  	avail		const[0, int32]
    55  	xruns		const[0, int32]
    56  	reserved	array[const[0, int8], 16]
    57  }
    58  
    59  snd_rawmidi_status64 {
    60  	stream		flags[sndrv_rawmidi_stream, int32]
    61  	rsvd		array[const[0, int8], 4]
    62  	tstamp_sec	const[0, int64]
    63  	tstamp_nsec	const[0, int64]
    64  	avail		const[0, intptr]
    65  	xruns		const[0, intptr]
    66  	reserved	array[const[0, int8], 16]
    67  }
    68  
    69  define SNDRV_RAWMIDI_IOCTL_STATUS32	_IOWR('W', 0x20, char[36])
    70  define SNDRV_RAWMIDI_IOCTL_STATUS64	_IOWR('W', 0x20, char[56])
    71  
    72  sndrv_rawmidi_stream = SNDRV_RAWMIDI_STREAM_OUTPUT, SNDRV_RAWMIDI_STREAM_INPUT