1
2
3
4
5
6 #ifndef __SND_SEQ_QUEUE_H
7 #define __SND_SEQ_QUEUE_H
8
9 #include "seq_memory.h"
10 #include "seq_prioq.h"
11 #include "seq_timer.h"
12 #include "seq_lock.h"
13 #include <linux/interrupt.h>
14 #include <linux/list.h>
15 #include <linux/bitops.h>
16
17 #define SEQ_QUEUE_NO_OWNER (-1)
18
19 struct snd_seq_queue {
20 int queue;
21
22 char name[64];
23
24 struct snd_seq_prioq *tickq;
25 struct snd_seq_prioq *timeq;
26
27 struct snd_seq_timer *timer;
28 int owner;
29 unsigned int locked:1,
30 klocked:1,
31 check_again:1,
32 check_blocked:1;
33
34 unsigned int flags;
35 unsigned int info_flags;
36
37 spinlock_t owner_lock;
38 spinlock_t check_lock;
39
40
41 DECLARE_BITMAP(clients_bitmap, SNDRV_SEQ_MAX_CLIENTS);
42 unsigned int clients;
43 struct mutex timer_mutex;
44
45 snd_use_lock_t use_lock;
46 };
47
48
49
50 int snd_seq_queue_get_cur_queues(void);
51
52
53 void snd_seq_queues_delete(void);
54
55
56
57 struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags);
58
59
60 int snd_seq_queue_delete(int client, int queueid);
61
62
63 void snd_seq_queue_client_termination(int client);
64
65
66 void snd_seq_queue_client_leave(int client);
67
68
69 int snd_seq_enqueue_event(struct snd_seq_event_cell *cell, int atomic, int hop);
70
71
72 void snd_seq_queue_client_leave_cells(int client);
73 void snd_seq_queue_remove_cells(int client, struct snd_seq_remove_events *info);
74
75
76 struct snd_seq_queue *queueptr(int queueid);
77
78 #define queuefree(q) snd_use_lock_free(&(q)->use_lock)
79
80
81 struct snd_seq_queue *snd_seq_queue_find_name(char *name);
82
83
84 void snd_seq_check_queue(struct snd_seq_queue *q, int atomic, int hop);
85
86
87 int snd_seq_queue_check_access(int queueid, int client);
88 int snd_seq_queue_timer_set_tempo(int queueid, int client, struct snd_seq_queue_tempo *info);
89 int snd_seq_queue_set_owner(int queueid, int client, int locked);
90 int snd_seq_queue_set_locked(int queueid, int client, int locked);
91 int snd_seq_queue_timer_open(int queueid);
92 int snd_seq_queue_timer_close(int queueid);
93 int snd_seq_queue_use(int queueid, int client, int use);
94 int snd_seq_queue_is_used(int queueid, int client);
95
96 int snd_seq_control_queue(struct snd_seq_event *ev, int atomic, int hop);
97
98 #endif