aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq/seq_fifo.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/seq/seq_fifo.c')
-rw-r--r--sound/core/seq/seq_fifo.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c
index 4767cfdc361f..6b055aed7a4b 100644
--- a/sound/core/seq/seq_fifo.c
+++ b/sound/core/seq/seq_fifo.c
@@ -29,9 +29,9 @@
29/* FIFO */ 29/* FIFO */
30 30
31/* create new fifo */ 31/* create new fifo */
32fifo_t *snd_seq_fifo_new(int poolsize) 32struct snd_seq_fifo *snd_seq_fifo_new(int poolsize)
33{ 33{
34 fifo_t *f; 34 struct snd_seq_fifo *f;
35 35
36 f = kzalloc(sizeof(*f), GFP_KERNEL); 36 f = kzalloc(sizeof(*f), GFP_KERNEL);
37 if (f == NULL) { 37 if (f == NULL) {
@@ -62,9 +62,9 @@ fifo_t *snd_seq_fifo_new(int poolsize)
62 return f; 62 return f;
63} 63}
64 64
65void snd_seq_fifo_delete(fifo_t **fifo) 65void snd_seq_fifo_delete(struct snd_seq_fifo **fifo)
66{ 66{
67 fifo_t *f; 67 struct snd_seq_fifo *f;
68 68
69 snd_assert(fifo != NULL, return); 69 snd_assert(fifo != NULL, return);
70 f = *fifo; 70 f = *fifo;
@@ -88,12 +88,12 @@ void snd_seq_fifo_delete(fifo_t **fifo)
88 kfree(f); 88 kfree(f);
89} 89}
90 90
91static snd_seq_event_cell_t *fifo_cell_out(fifo_t *f); 91static struct snd_seq_event_cell *fifo_cell_out(struct snd_seq_fifo *f);
92 92
93/* clear queue */ 93/* clear queue */
94void snd_seq_fifo_clear(fifo_t *f) 94void snd_seq_fifo_clear(struct snd_seq_fifo *f)
95{ 95{
96 snd_seq_event_cell_t *cell; 96 struct snd_seq_event_cell *cell;
97 unsigned long flags; 97 unsigned long flags;
98 98
99 /* clear overflow flag */ 99 /* clear overflow flag */
@@ -110,9 +110,10 @@ void snd_seq_fifo_clear(fifo_t *f)
110 110
111 111
112/* enqueue event to fifo */ 112/* enqueue event to fifo */
113int snd_seq_fifo_event_in(fifo_t *f, snd_seq_event_t *event) 113int snd_seq_fifo_event_in(struct snd_seq_fifo *f,
114 struct snd_seq_event *event)
114{ 115{
115 snd_seq_event_cell_t *cell; 116 struct snd_seq_event_cell *cell;
116 unsigned long flags; 117 unsigned long flags;
117 int err; 118 int err;
118 119
@@ -148,9 +149,9 @@ int snd_seq_fifo_event_in(fifo_t *f, snd_seq_event_t *event)
148} 149}
149 150
150/* dequeue cell from fifo */ 151/* dequeue cell from fifo */
151static snd_seq_event_cell_t *fifo_cell_out(fifo_t *f) 152static struct snd_seq_event_cell *fifo_cell_out(struct snd_seq_fifo *f)
152{ 153{
153 snd_seq_event_cell_t *cell; 154 struct snd_seq_event_cell *cell;
154 155
155 if ((cell = f->head) != NULL) { 156 if ((cell = f->head) != NULL) {
156 f->head = cell->next; 157 f->head = cell->next;
@@ -167,9 +168,10 @@ static snd_seq_event_cell_t *fifo_cell_out(fifo_t *f)
167} 168}
168 169
169/* dequeue cell from fifo and copy on user space */ 170/* dequeue cell from fifo and copy on user space */
170int snd_seq_fifo_cell_out(fifo_t *f, snd_seq_event_cell_t **cellp, int nonblock) 171int snd_seq_fifo_cell_out(struct snd_seq_fifo *f,
172 struct snd_seq_event_cell **cellp, int nonblock)
171{ 173{
172 snd_seq_event_cell_t *cell; 174 struct snd_seq_event_cell *cell;
173 unsigned long flags; 175 unsigned long flags;
174 wait_queue_t wait; 176 wait_queue_t wait;
175 177
@@ -202,7 +204,8 @@ int snd_seq_fifo_cell_out(fifo_t *f, snd_seq_event_cell_t **cellp, int nonblock)
202} 204}
203 205
204 206
205void snd_seq_fifo_cell_putback(fifo_t *f, snd_seq_event_cell_t *cell) 207void snd_seq_fifo_cell_putback(struct snd_seq_fifo *f,
208 struct snd_seq_event_cell *cell)
206{ 209{
207 unsigned long flags; 210 unsigned long flags;
208 211
@@ -217,18 +220,19 @@ void snd_seq_fifo_cell_putback(fifo_t *f, snd_seq_event_cell_t *cell)
217 220
218 221
219/* polling; return non-zero if queue is available */ 222/* polling; return non-zero if queue is available */
220int snd_seq_fifo_poll_wait(fifo_t *f, struct file *file, poll_table *wait) 223int snd_seq_fifo_poll_wait(struct snd_seq_fifo *f, struct file *file,
224 poll_table *wait)
221{ 225{
222 poll_wait(file, &f->input_sleep, wait); 226 poll_wait(file, &f->input_sleep, wait);
223 return (f->cells > 0); 227 return (f->cells > 0);
224} 228}
225 229
226/* change the size of pool; all old events are removed */ 230/* change the size of pool; all old events are removed */
227int snd_seq_fifo_resize(fifo_t *f, int poolsize) 231int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize)
228{ 232{
229 unsigned long flags; 233 unsigned long flags;
230 pool_t *newpool, *oldpool; 234 struct snd_seq_pool *newpool, *oldpool;
231 snd_seq_event_cell_t *cell, *next, *oldhead; 235 struct snd_seq_event_cell *cell, *next, *oldhead;
232 236
233 snd_assert(f != NULL && f->pool != NULL, return -EINVAL); 237 snd_assert(f != NULL && f->pool != NULL, return -EINVAL);
234 238