1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#ifndef __SEQ_OSS_DEVICE_H
22#define __SEQ_OSS_DEVICE_H
23
24#include <linux/time.h>
25#include <linux/wait.h>
26#include <linux/slab.h>
27#include <linux/sched.h>
28#include <sound/core.h>
29#include <sound/seq_oss.h>
30#include <sound/rawmidi.h>
31#include <sound/seq_kernel.h>
32#include <sound/info.h>
33
34
35#define SNDRV_SEQ_OSS_MAX_CLIENTS 16
36#define SNDRV_SEQ_OSS_MAX_SYNTH_DEVS 16
37#define SNDRV_SEQ_OSS_MAX_MIDI_DEVS 32
38
39
40#define SNDRV_SEQ_OSS_MAJOR_VERSION 0
41#define SNDRV_SEQ_OSS_MINOR_VERSION 1
42#define SNDRV_SEQ_OSS_TINY_VERSION 8
43#define SNDRV_SEQ_OSS_VERSION_STR "0.1.8"
44
45
46#define SNDRV_SEQ_OSS_PROCNAME "oss"
47
48
49
50
51
52
53typedef unsigned int reltime_t;
54typedef unsigned int abstime_t;
55
56
57
58
59
60struct seq_oss_chinfo {
61 int note, vel;
62};
63
64
65
66
67struct seq_oss_synthinfo {
68 struct snd_seq_oss_arg arg;
69 struct seq_oss_chinfo *ch;
70 struct seq_oss_synth_sysex *sysex;
71 int nr_voices;
72 int opened;
73 int is_midi;
74 int midi_mapped;
75};
76
77
78
79
80
81
82struct seq_oss_devinfo {
83
84 int index;
85 int cseq;
86 int port;
87 int queue;
88
89 struct snd_seq_addr addr;
90
91 int seq_mode;
92 int file_mode;
93
94
95 int max_mididev;
96
97
98 int max_synthdev;
99 struct seq_oss_synthinfo synths[SNDRV_SEQ_OSS_MAX_SYNTH_DEVS];
100 int synth_opened;
101
102
103 struct seq_oss_writeq *writeq;
104
105
106 struct seq_oss_readq *readq;
107
108
109 struct seq_oss_timer *timer;
110};
111
112
113
114
115
116
117
118int snd_seq_oss_create_client(void);
119int snd_seq_oss_delete_client(void);
120
121
122int snd_seq_oss_open(struct file *file, int level);
123void snd_seq_oss_release(struct seq_oss_devinfo *dp);
124int snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long arg);
125int snd_seq_oss_read(struct seq_oss_devinfo *dev, char __user *buf, int count);
126int snd_seq_oss_write(struct seq_oss_devinfo *dp, const char __user *buf, int count, struct file *opt);
127unsigned int snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait);
128
129void snd_seq_oss_reset(struct seq_oss_devinfo *dp);
130void snd_seq_oss_drain_write(struct seq_oss_devinfo *dp);
131
132
133void snd_seq_oss_process_queue(struct seq_oss_devinfo *dp, abstime_t time);
134
135
136
137void snd_seq_oss_system_info_read(struct snd_info_buffer *buf);
138void snd_seq_oss_midi_info_read(struct snd_info_buffer *buf);
139void snd_seq_oss_synth_info_read(struct snd_info_buffer *buf);
140void snd_seq_oss_readq_info_read(struct seq_oss_readq *q, struct snd_info_buffer *buf);
141
142
143#define is_read_mode(mode) ((mode) & SNDRV_SEQ_OSS_FILE_READ)
144#define is_write_mode(mode) ((mode) & SNDRV_SEQ_OSS_FILE_WRITE)
145#define is_nonblock_mode(mode) ((mode) & SNDRV_SEQ_OSS_FILE_NONBLOCK)
146
147
148static inline int
149snd_seq_oss_dispatch(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, int atomic, int hop)
150{
151 return snd_seq_kernel_client_dispatch(dp->cseq, ev, atomic, hop);
152}
153
154
155static inline int
156snd_seq_oss_control(struct seq_oss_devinfo *dp, unsigned int type, void *arg)
157{
158 return snd_seq_kernel_client_ctl(dp->cseq, type, arg);
159}
160
161
162static inline void
163snd_seq_oss_fill_addr(struct seq_oss_devinfo *dp, struct snd_seq_event *ev,
164 int dest_client, int dest_port)
165{
166 ev->queue = dp->queue;
167 ev->source = dp->addr;
168 ev->dest.client = dest_client;
169 ev->dest.port = dest_port;
170}
171
172
173
174char *enabled_str(int bool);
175
176#endif
177