| 1 |
|
| 2 | |
| 3 | * ALSA sequencer FIFO
|
| 4 | * Copyright (c) 1998 by Frank van de Pol <[email protected]>
|
| 5 |
|
| 6 | #ifndef __SND_SEQ_FIFO_H
|
| 7 | #define __SND_SEQ_FIFO_H
|
| 8 |
|
| 9 | #include "seq_memory.h"
|
| 10 | #include "seq_lock.h"
|
| 11 |
|
| 12 |
|
| 13 | |
| 14 |
|
| 15 | struct snd_seq_fifo {
|
| 16 | struct snd_seq_pool *pool;
|
| 17 | struct snd_seq_event_cell *head;
|
| 18 | struct snd_seq_event_cell *tail;
|
| 19 | int cells;
|
| 20 | spinlock_t lock;
|
| 21 | snd_use_lock_t use_lock;
|
| 22 | wait_queue_head_t input_sleep;
|
| 23 | atomic_t overflow;
|
| 24 |
|
| 25 | };
|
| 26 |
|
| 27 |
|
| 28 | struct snd_seq_fifo *snd_seq_fifo_new(int poolsize);
|
| 29 |
|
| 30 |
|
| 31 | void snd_seq_fifo_delete(struct snd_seq_fifo **f);
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 | int snd_seq_fifo_event_in(struct snd_seq_fifo *f, struct snd_seq_event *event);
|
| 36 |
|
| 37 |
|
| 38 | #define snd_seq_fifo_lock(fifo) snd_use_lock_use(&(fifo)->use_lock)
|
| 39 | #define snd_seq_fifo_unlock(fifo) snd_use_lock_free(&(fifo)->use_lock)
|
| 40 | DEFINE_GUARD(snd_seq_fifo, struct snd_seq_fifo *, snd_seq_fifo_lock(_T), snd_seq_fifo_unlock(_T))
|
| 41 |
|
| 42 |
|
| 43 | int snd_seq_fifo_cell_out(struct snd_seq_fifo *f, struct snd_seq_event_cell **cellp, int nonblock);
|
| 44 |
|
| 45 |
|
| 46 | void snd_seq_fifo_cell_putback(struct snd_seq_fifo *f, struct snd_seq_event_cell *cell);
|
| 47 |
|
| 48 |
|
| 49 | void snd_seq_fifo_clear(struct snd_seq_fifo *f);
|
| 50 |
|
| 51 |
|
| 52 | int snd_seq_fifo_poll_wait(struct snd_seq_fifo *f, struct file *file, poll_table *wait);
|
| 53 |
|
| 54 |
|
| 55 | int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize);
|
| 56 |
|
| 57 |
|
| 58 | int snd_seq_fifo_unused_cells(struct snd_seq_fifo *f);
|
| 59 |
|
| 60 | #endif
|