1/*
2 * This header was generated from the Linux kernel headers by update_headers.py,
3 * to provide necessary information from kernel to userspace, such as constants,
4 * structures, and macros, and thus, contains no copyrightable information.
5 */
6#ifndef _UAPI__SOUND_ASEQUENCER_H
7#define _UAPI__SOUND_ASEQUENCER_H
8#include <sound/asound.h>
9#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 2)
10#define SNDRV_SEQ_EVENT_SYSTEM		0
11#define SNDRV_SEQ_EVENT_RESULT		1
12#define SNDRV_SEQ_EVENT_NOTE		5
13#define SNDRV_SEQ_EVENT_NOTEON		6
14#define SNDRV_SEQ_EVENT_NOTEOFF		7
15#define SNDRV_SEQ_EVENT_KEYPRESS	8
16
17#define SNDRV_SEQ_EVENT_CONTROLLER	10
18#define SNDRV_SEQ_EVENT_PGMCHANGE	11
19#define SNDRV_SEQ_EVENT_CHANPRESS	12
20#define SNDRV_SEQ_EVENT_PITCHBEND	13
21#define SNDRV_SEQ_EVENT_CONTROL14	14
22#define SNDRV_SEQ_EVENT_NONREGPARAM	15
23#define SNDRV_SEQ_EVENT_REGPARAM	16
24#define SNDRV_SEQ_EVENT_SONGPOS		20
25#define SNDRV_SEQ_EVENT_SONGSEL		21
26#define SNDRV_SEQ_EVENT_QFRAME		22
27#define SNDRV_SEQ_EVENT_TIMESIGN	23
28#define SNDRV_SEQ_EVENT_KEYSIGN		24
29
30#define SNDRV_SEQ_EVENT_START		30
31#define SNDRV_SEQ_EVENT_CONTINUE	31
32#define SNDRV_SEQ_EVENT_STOP		32
33#define	SNDRV_SEQ_EVENT_SETPOS_TICK	33
34#define SNDRV_SEQ_EVENT_SETPOS_TIME	34
35#define SNDRV_SEQ_EVENT_TEMPO		35
36#define SNDRV_SEQ_EVENT_CLOCK		36
37#define SNDRV_SEQ_EVENT_TICK		37
38#define SNDRV_SEQ_EVENT_QUEUE_SKEW	38
39#define SNDRV_SEQ_EVENT_TUNE_REQUEST	40
40#define SNDRV_SEQ_EVENT_RESET		41
41#define SNDRV_SEQ_EVENT_SENSING		42
42#define SNDRV_SEQ_EVENT_ECHO		50
43#define SNDRV_SEQ_EVENT_OSS		51
44#define SNDRV_SEQ_EVENT_CLIENT_START	60
45#define SNDRV_SEQ_EVENT_CLIENT_EXIT	61
46#define SNDRV_SEQ_EVENT_CLIENT_CHANGE	62
47#define SNDRV_SEQ_EVENT_PORT_START	63
48#define SNDRV_SEQ_EVENT_PORT_EXIT	64
49#define SNDRV_SEQ_EVENT_PORT_CHANGE	65
50#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED	66
51#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67
52#define SNDRV_SEQ_EVENT_USR0		90
53#define SNDRV_SEQ_EVENT_USR1		91
54#define SNDRV_SEQ_EVENT_USR2		92
55#define SNDRV_SEQ_EVENT_USR3		93
56#define SNDRV_SEQ_EVENT_USR4		94
57#define SNDRV_SEQ_EVENT_USR5		95
58#define SNDRV_SEQ_EVENT_USR6		96
59#define SNDRV_SEQ_EVENT_USR7		97
60#define SNDRV_SEQ_EVENT_USR8		98
61#define SNDRV_SEQ_EVENT_USR9		99
62#define SNDRV_SEQ_EVENT_SYSEX		130
63#define SNDRV_SEQ_EVENT_BOUNCE		131
64#define SNDRV_SEQ_EVENT_USR_VAR0	135
65#define SNDRV_SEQ_EVENT_USR_VAR1	136
66#define SNDRV_SEQ_EVENT_USR_VAR2	137
67#define SNDRV_SEQ_EVENT_USR_VAR3	138
68#define SNDRV_SEQ_EVENT_USR_VAR4	139
69#define SNDRV_SEQ_EVENT_KERNEL_ERROR	150
70#define SNDRV_SEQ_EVENT_KERNEL_QUOTE	151
71#define SNDRV_SEQ_EVENT_NONE		255
72typedef unsigned char snd_seq_event_type_t;
73struct snd_seq_addr {
74	unsigned char client;
75	unsigned char port;
76};
77struct snd_seq_connect {
78	struct snd_seq_addr sender;
79	struct snd_seq_addr dest;
80};
81#define SNDRV_SEQ_ADDRESS_UNKNOWN	253
82#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS	254
83#define SNDRV_SEQ_ADDRESS_BROADCAST	255
84#define SNDRV_SEQ_QUEUE_DIRECT		253
85
86#define SNDRV_SEQ_TIME_STAMP_TICK	(0<<0)
87#define SNDRV_SEQ_TIME_STAMP_REAL	(1<<0)
88#define SNDRV_SEQ_TIME_STAMP_MASK	(1<<0)
89#define SNDRV_SEQ_TIME_MODE_ABS		(0<<1)
90#define SNDRV_SEQ_TIME_MODE_REL		(1<<1)
91#define SNDRV_SEQ_TIME_MODE_MASK	(1<<1)
92#define SNDRV_SEQ_EVENT_LENGTH_FIXED	(0<<2)
93#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE	(1<<2)
94#define SNDRV_SEQ_EVENT_LENGTH_VARUSR	(2<<2)
95#define SNDRV_SEQ_EVENT_LENGTH_MASK	(3<<2)
96#define SNDRV_SEQ_PRIORITY_NORMAL	(0<<4)
97#define SNDRV_SEQ_PRIORITY_HIGH		(1<<4)
98#define SNDRV_SEQ_PRIORITY_MASK		(1<<4)
99
100struct snd_seq_ev_note {
101	unsigned char channel;
102	unsigned char note;
103	unsigned char velocity;
104	unsigned char off_velocity;
105	unsigned int duration;
106};
107
108struct snd_seq_ev_ctrl {
109	unsigned char channel;
110	unsigned char unused1, unused2, unused3;
111	unsigned int param;
112	signed int value;
113};
114
115struct snd_seq_ev_raw8 {
116	unsigned char d[12];
117};
118
119struct snd_seq_ev_raw32 {
120	unsigned int d[3];
121};
122
123struct snd_seq_ev_ext {
124	unsigned int len;
125	void *ptr;
126} __attribute__((packed));
127struct snd_seq_result {
128	int event;
129	int result;
130};
131struct snd_seq_real_time {
132	unsigned int tv_sec;
133	unsigned int tv_nsec;
134};
135typedef unsigned int snd_seq_tick_time_t;
136union snd_seq_timestamp {
137	snd_seq_tick_time_t tick;
138	struct snd_seq_real_time time;
139};
140struct snd_seq_queue_skew {
141	unsigned int value;
142	unsigned int base;
143};
144
145struct snd_seq_ev_queue_control {
146	unsigned char queue;
147	unsigned char pad[3];
148	union {
149		signed int value;
150		union snd_seq_timestamp time;
151		unsigned int position;
152		struct snd_seq_queue_skew skew;
153		unsigned int d32[2];
154		unsigned char d8[8];
155	} param;
156};
157
158struct snd_seq_ev_quote {
159	struct snd_seq_addr origin;
160	unsigned short value;
161	struct snd_seq_event *event;
162} __attribute__((packed));
163
164struct snd_seq_event {
165	snd_seq_event_type_t type;
166	unsigned char flags;
167	char tag;
168
169	unsigned char queue;
170	union snd_seq_timestamp time;
171	struct snd_seq_addr source;
172	struct snd_seq_addr dest;
173	union {
174		struct snd_seq_ev_note note;
175		struct snd_seq_ev_ctrl control;
176		struct snd_seq_ev_raw8 raw8;
177		struct snd_seq_ev_raw32 raw32;
178		struct snd_seq_ev_ext ext;
179		struct snd_seq_ev_queue_control queue;
180		union snd_seq_timestamp time;
181		struct snd_seq_addr addr;
182		struct snd_seq_connect connect;
183		struct snd_seq_result result;
184		struct snd_seq_ev_quote quote;
185	} data;
186};
187struct snd_seq_event_bounce {
188	int err;
189	struct snd_seq_event event;
190
191};
192
193struct snd_seq_system_info {
194	int queues;
195	int clients;
196	int ports;
197	int channels;
198	int cur_clients;
199	int cur_queues;
200	char reserved[24];
201};
202
203struct snd_seq_running_info {
204	unsigned char client;
205	unsigned char big_endian;
206	unsigned char cpu_mode;
207	unsigned char pad;
208	unsigned char reserved[12];
209};
210
211#define SNDRV_SEQ_CLIENT_SYSTEM		0
212
213#define SNDRV_SEQ_CLIENT_DUMMY		14
214#define SNDRV_SEQ_CLIENT_OSS		15
215
216typedef int __bitwise snd_seq_client_type_t;
217#define	NO_CLIENT	((__force snd_seq_client_type_t) 0)
218#define	USER_CLIENT	((__force snd_seq_client_type_t) 1)
219#define	KERNEL_CLIENT	((__force snd_seq_client_type_t) 2)
220
221
222#define SNDRV_SEQ_FILTER_BROADCAST	(1<<0)
223#define SNDRV_SEQ_FILTER_MULTICAST	(1<<1)
224#define SNDRV_SEQ_FILTER_BOUNCE		(1<<2)
225#define SNDRV_SEQ_FILTER_USE_EVENT	(1<<31)
226struct snd_seq_client_info {
227	int client;
228	snd_seq_client_type_t type;
229	char name[64];
230	unsigned int filter;
231	unsigned char multicast_filter[8];
232	unsigned char event_filter[32];
233	int num_ports;
234	int event_lost;
235	int card;
236	int pid;
237	char reserved[56];
238};
239struct snd_seq_client_pool {
240	int client;
241	int output_pool;
242	int input_pool;
243	int output_room;
244	int output_free;
245	int input_free;
246	char reserved[64];
247};
248#define SNDRV_SEQ_REMOVE_INPUT		(1<<0)
249#define SNDRV_SEQ_REMOVE_OUTPUT		(1<<1)
250#define SNDRV_SEQ_REMOVE_DEST		(1<<2)
251#define SNDRV_SEQ_REMOVE_DEST_CHANNEL	(1<<3)
252#define SNDRV_SEQ_REMOVE_TIME_BEFORE	(1<<4)
253#define SNDRV_SEQ_REMOVE_TIME_AFTER	(1<<5)
254#define SNDRV_SEQ_REMOVE_TIME_TICK	(1<<6)
255#define SNDRV_SEQ_REMOVE_EVENT_TYPE	(1<<7)
256#define SNDRV_SEQ_REMOVE_IGNORE_OFF 	(1<<8)
257#define SNDRV_SEQ_REMOVE_TAG_MATCH 	(1<<9)
258struct snd_seq_remove_events {
259	unsigned int  remove_mode;
260	union snd_seq_timestamp time;
261	unsigned char queue;
262	struct snd_seq_addr dest;
263	unsigned char channel;
264	int  type;
265	char  tag;
266	int  reserved[10];
267};
268
269#define SNDRV_SEQ_PORT_SYSTEM_TIMER	0
270#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE	1
271
272#define SNDRV_SEQ_PORT_CAP_READ		(1<<0)
273#define SNDRV_SEQ_PORT_CAP_WRITE	(1<<1)
274#define SNDRV_SEQ_PORT_CAP_SYNC_READ	(1<<2)
275#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE	(1<<3)
276#define SNDRV_SEQ_PORT_CAP_DUPLEX	(1<<4)
277#define SNDRV_SEQ_PORT_CAP_SUBS_READ	(1<<5)
278#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE	(1<<6)
279#define SNDRV_SEQ_PORT_CAP_NO_EXPORT	(1<<7)
280
281#define SNDRV_SEQ_PORT_TYPE_SPECIFIC	(1<<0)
282#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1)
283#define SNDRV_SEQ_PORT_TYPE_MIDI_GM	(1<<2)
284#define SNDRV_SEQ_PORT_TYPE_MIDI_GS	(1<<3)
285#define SNDRV_SEQ_PORT_TYPE_MIDI_XG	(1<<4)
286#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32	(1<<5)
287#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2	(1<<6)
288#define SNDRV_SEQ_PORT_TYPE_SYNTH	(1<<10)
289#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11)
290#define SNDRV_SEQ_PORT_TYPE_SAMPLE	(1<<12)
291#define SNDRV_SEQ_PORT_TYPE_HARDWARE	(1<<16)
292#define SNDRV_SEQ_PORT_TYPE_SOFTWARE	(1<<17)
293#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER	(1<<18)
294#define SNDRV_SEQ_PORT_TYPE_PORT	(1<<19)
295#define SNDRV_SEQ_PORT_TYPE_APPLICATION	(1<<20)
296#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT	(1<<0)
297#define SNDRV_SEQ_PORT_FLG_TIMESTAMP	(1<<1)
298#define SNDRV_SEQ_PORT_FLG_TIME_REAL	(1<<2)
299struct snd_seq_port_info {
300	struct snd_seq_addr addr;
301	char name[64];
302	unsigned int capability;
303	unsigned int type;
304	int midi_channels;
305	int midi_voices;
306	int synth_voices;
307	int read_use;
308	int write_use;
309	void *kernel;
310	unsigned int flags;
311	unsigned char time_queue;
312	char reserved[59];
313};
314#define SNDRV_SEQ_QUEUE_FLG_SYNC	(1<<0)
315struct snd_seq_queue_info {
316	int queue;
317
318	int owner;
319	unsigned locked:1;
320	char name[64];
321	unsigned int flags;
322	char reserved[60];
323};
324struct snd_seq_queue_status {
325	int queue;
326	int events;
327	snd_seq_tick_time_t tick;
328	struct snd_seq_real_time time;
329	int running;
330	int flags;
331	char reserved[64];
332};
333struct snd_seq_queue_tempo {
334	int queue;
335	unsigned int tempo;
336	int ppq;
337	unsigned int skew_value;
338	unsigned int skew_base;
339	char reserved[24];
340};
341#define SNDRV_SEQ_TIMER_ALSA		0
342#define SNDRV_SEQ_TIMER_MIDI_CLOCK	1
343#define SNDRV_SEQ_TIMER_MIDI_TICK	2
344struct snd_seq_queue_timer {
345	int queue;
346	int type;
347	union {
348		struct {
349			struct snd_timer_id id;
350			unsigned int resolution;
351		} alsa;
352	} u;
353	char reserved[64];
354};
355struct snd_seq_queue_client {
356	int queue;
357	int client;
358	int used;
359
360	char reserved[64];
361};
362#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE	(1<<0)
363#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP	(1<<1)
364#define SNDRV_SEQ_PORT_SUBS_TIME_REAL	(1<<2)
365struct snd_seq_port_subscribe {
366	struct snd_seq_addr sender;
367	struct snd_seq_addr dest;
368	unsigned int voices;
369	unsigned int flags;
370	unsigned char queue;
371	unsigned char pad[3];
372	char reserved[64];
373};
374#define SNDRV_SEQ_QUERY_SUBS_READ	0
375#define SNDRV_SEQ_QUERY_SUBS_WRITE	1
376struct snd_seq_query_subs {
377	struct snd_seq_addr root;
378	int type;
379	int index;
380	int num_subs;
381	struct snd_seq_addr addr;
382	unsigned char queue;
383	unsigned int flags;
384	char reserved[64];
385};
386#define SNDRV_SEQ_IOCTL_PVERSION	_IOR ('S', 0x00, int)
387#define SNDRV_SEQ_IOCTL_CLIENT_ID	_IOR ('S', 0x01, int)
388#define SNDRV_SEQ_IOCTL_SYSTEM_INFO	_IOWR('S', 0x02, struct snd_seq_system_info)
389#define SNDRV_SEQ_IOCTL_RUNNING_MODE	_IOWR('S', 0x03, struct snd_seq_running_info)
390#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO	_IOWR('S', 0x10, struct snd_seq_client_info)
391#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO	_IOW ('S', 0x11, struct snd_seq_client_info)
392#define SNDRV_SEQ_IOCTL_CREATE_PORT	_IOWR('S', 0x20, struct snd_seq_port_info)
393#define SNDRV_SEQ_IOCTL_DELETE_PORT	_IOW ('S', 0x21, struct snd_seq_port_info)
394#define SNDRV_SEQ_IOCTL_GET_PORT_INFO	_IOWR('S', 0x22, struct snd_seq_port_info)
395#define SNDRV_SEQ_IOCTL_SET_PORT_INFO	_IOW ('S', 0x23, struct snd_seq_port_info)
396#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT	_IOW ('S', 0x30, struct snd_seq_port_subscribe)
397#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
398#define SNDRV_SEQ_IOCTL_CREATE_QUEUE	_IOWR('S', 0x32, struct snd_seq_queue_info)
399#define SNDRV_SEQ_IOCTL_DELETE_QUEUE	_IOW ('S', 0x33, struct snd_seq_queue_info)
400#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO	_IOWR('S', 0x34, struct snd_seq_queue_info)
401#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO	_IOWR('S', 0x35, struct snd_seq_queue_info)
402#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE	_IOWR('S', 0x36, struct snd_seq_queue_info)
403#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
404#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO	_IOWR('S', 0x41, struct snd_seq_queue_tempo)
405#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO	_IOW ('S', 0x42, struct snd_seq_queue_tempo)
406#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER	_IOWR('S', 0x45, struct snd_seq_queue_timer)
407#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER	_IOW ('S', 0x46, struct snd_seq_queue_timer)
408#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT	_IOWR('S', 0x49, struct snd_seq_queue_client)
409#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT	_IOW ('S', 0x4a, struct snd_seq_queue_client)
410#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL	_IOWR('S', 0x4b, struct snd_seq_client_pool)
411#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL	_IOW ('S', 0x4c, struct snd_seq_client_pool)
412#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS	_IOW ('S', 0x4e, struct snd_seq_remove_events)
413#define SNDRV_SEQ_IOCTL_QUERY_SUBS	_IOWR('S', 0x4f, struct snd_seq_query_subs)
414#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION	_IOWR('S', 0x50, struct snd_seq_port_subscribe)
415#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT	_IOWR('S', 0x51, struct snd_seq_client_info)
416#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT	_IOWR('S', 0x52, struct snd_seq_port_info)
417#endif
418