Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * OSS compatible sequencer driver
0004  * read fifo queue
0005  *
0006  * Copyright (C) 1998,99 Takashi Iwai <tiwai@suse.de>
0007  */
0008 
0009 #ifndef __SEQ_OSS_READQ_H
0010 #define __SEQ_OSS_READQ_H
0011 
0012 #include "seq_oss_device.h"
0013 
0014 
0015 /*
0016  * definition of read queue
0017  */
0018 struct seq_oss_readq {
0019     union evrec *q;
0020     int qlen;
0021     int maxlen;
0022     int head, tail;
0023     unsigned long pre_event_timeout;
0024     unsigned long input_time;
0025     wait_queue_head_t midi_sleep;
0026     spinlock_t lock;
0027 };
0028 
0029 struct seq_oss_readq *snd_seq_oss_readq_new(struct seq_oss_devinfo *dp, int maxlen);
0030 void snd_seq_oss_readq_delete(struct seq_oss_readq *q);
0031 void snd_seq_oss_readq_clear(struct seq_oss_readq *readq);
0032 unsigned int snd_seq_oss_readq_poll(struct seq_oss_readq *readq, struct file *file, poll_table *wait);
0033 int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, unsigned char *data, int len);
0034 int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev,
0035                 struct snd_seq_event *ev);
0036 int snd_seq_oss_readq_put_event(struct seq_oss_readq *readq, union evrec *ev);
0037 int snd_seq_oss_readq_put_timestamp(struct seq_oss_readq *readq, unsigned long curt, int seq_mode);
0038 int snd_seq_oss_readq_pick(struct seq_oss_readq *q, union evrec *rec);
0039 void snd_seq_oss_readq_wait(struct seq_oss_readq *q);
0040 void snd_seq_oss_readq_free(struct seq_oss_readq *q);
0041 
0042 #define snd_seq_oss_readq_lock(q, flags) spin_lock_irqsave(&(q)->lock, flags)
0043 #define snd_seq_oss_readq_unlock(q, flags) spin_unlock_irqrestore(&(q)->lock, flags)
0044 
0045 #endif