162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci#ifndef __SOUND_SEQ_OSS_H 362306a36Sopenharmony_ci#define __SOUND_SEQ_OSS_H 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci/* 662306a36Sopenharmony_ci * OSS compatible sequencer driver 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * Copyright (C) 1998,99 Takashi Iwai 962306a36Sopenharmony_ci */ 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#include <sound/asequencer.h> 1262306a36Sopenharmony_ci#include <sound/seq_kernel.h> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci/* 1562306a36Sopenharmony_ci * argument structure for synthesizer operations 1662306a36Sopenharmony_ci */ 1762306a36Sopenharmony_cistruct snd_seq_oss_arg { 1862306a36Sopenharmony_ci /* given by OSS sequencer */ 1962306a36Sopenharmony_ci int app_index; /* application unique index */ 2062306a36Sopenharmony_ci int file_mode; /* file mode - see below */ 2162306a36Sopenharmony_ci int seq_mode; /* sequencer mode - see below */ 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci /* following must be initialized in open callback */ 2462306a36Sopenharmony_ci struct snd_seq_addr addr; /* opened port address */ 2562306a36Sopenharmony_ci void *private_data; /* private data for lowlevel drivers */ 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci /* note-on event passing mode: initially given by OSS seq, 2862306a36Sopenharmony_ci * but configurable by drivers - see below 2962306a36Sopenharmony_ci */ 3062306a36Sopenharmony_ci int event_passing; 3162306a36Sopenharmony_ci}; 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci/* 3562306a36Sopenharmony_ci * synthesizer operation callbacks 3662306a36Sopenharmony_ci */ 3762306a36Sopenharmony_cistruct snd_seq_oss_callback { 3862306a36Sopenharmony_ci struct module *owner; 3962306a36Sopenharmony_ci int (*open)(struct snd_seq_oss_arg *p, void *closure); 4062306a36Sopenharmony_ci int (*close)(struct snd_seq_oss_arg *p); 4162306a36Sopenharmony_ci int (*ioctl)(struct snd_seq_oss_arg *p, unsigned int cmd, unsigned long arg); 4262306a36Sopenharmony_ci int (*load_patch)(struct snd_seq_oss_arg *p, int format, const char __user *buf, int offs, int count); 4362306a36Sopenharmony_ci int (*reset)(struct snd_seq_oss_arg *p); 4462306a36Sopenharmony_ci int (*raw_event)(struct snd_seq_oss_arg *p, unsigned char *data); 4562306a36Sopenharmony_ci}; 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci/* flag: file_mode */ 4862306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_FILE_ACMODE 3 4962306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_FILE_READ 1 5062306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_FILE_WRITE 2 5162306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_FILE_NONBLOCK 4 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci/* flag: seq_mode */ 5462306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_MODE_SYNTH 0 5562306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_MODE_MUSIC 1 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci/* flag: event_passing */ 5862306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_PROCESS_EVENTS 0 /* key == 255 is processed as velocity change */ 5962306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_PASS_EVENTS 1 /* pass all events to callback */ 6062306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_PROCESS_KEYPRESS 2 /* key >= 128 will be processed as key-pressure */ 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci/* default control rate: fixed */ 6362306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_CTRLRATE 100 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci/* default max queue length: configurable by module option */ 6662306a36Sopenharmony_ci#define SNDRV_SEQ_OSS_MAX_QLEN 1024 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci/* 7062306a36Sopenharmony_ci * data pointer to snd_seq_register_device 7162306a36Sopenharmony_ci */ 7262306a36Sopenharmony_cistruct snd_seq_oss_reg { 7362306a36Sopenharmony_ci int type; 7462306a36Sopenharmony_ci int subtype; 7562306a36Sopenharmony_ci int nvoices; 7662306a36Sopenharmony_ci struct snd_seq_oss_callback oper; 7762306a36Sopenharmony_ci void *private_data; 7862306a36Sopenharmony_ci}; 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_ci/* device id */ 8162306a36Sopenharmony_ci#define SNDRV_SEQ_DEV_ID_OSS "seq-oss" 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci#endif /* __SOUND_SEQ_OSS_H */ 84