Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
midibuf.c File Reference
#include <linux/stddef.h>
#include <linux/kmod.h>
#include <linux/spinlock.h>
#include "sound_config.h"

Go to the source code of this file.

Data Structures

struct  midi_buf
 
struct  midi_parms
 

Macros

#define MIDIBUF_C
 
#define MAX_QUEUE_SIZE   4000
 
#define DATA_AVAIL(q)   (q->len)
 
#define SPACE_AVAIL(q)   (MAX_QUEUE_SIZE - q->len)
 
#define QUEUE_BYTE(q, data)
 
#define REMOVE_BYTE(q, data)
 

Functions

int MIDIbuf_open (int dev, struct file *file)
 
void MIDIbuf_release (int dev, struct file *file)
 
int MIDIbuf_write (int dev, struct file *file, const char __user *buf, int count)
 
int MIDIbuf_read (int dev, struct file *file, char __user *buf, int count)
 
int MIDIbuf_ioctl (int dev, struct file *file, unsigned int cmd, void __user *arg)
 
unsigned int MIDIbuf_poll (int dev, struct file *file, poll_table *wait)
 
int MIDIbuf_avail (int dev)
 
 EXPORT_SYMBOL (MIDIbuf_avail)
 

Macro Definition Documentation

#define DATA_AVAIL (   q)    (q->len)

Definition at line 58 of file midibuf.c.

#define MAX_QUEUE_SIZE   4000

Definition at line 28 of file midibuf.c.

#define MIDIBUF_C

Definition at line 19 of file midibuf.c.

#define QUEUE_BYTE (   q,
  data 
)
Value:
if (SPACE_AVAIL(q)) \
{ \
unsigned long flags; \
spin_lock_irqsave(&lock, flags); \
q->queue[q->tail] = (data); \
q->len++; q->tail = (q->tail+1) % MAX_QUEUE_SIZE; \
spin_unlock_irqrestore(&lock, flags); \
}

Definition at line 61 of file midibuf.c.

#define REMOVE_BYTE (   q,
  data 
)
Value:
if (DATA_AVAIL(q)) \
{ \
unsigned long flags; \
spin_lock_irqsave(&lock, flags); \
data = q->queue[q->head]; \
q->len--; q->head = (q->head+1) % MAX_QUEUE_SIZE; \
spin_unlock_irqrestore(&lock, flags); \
}

Definition at line 71 of file midibuf.c.

#define SPACE_AVAIL (   q)    (MAX_QUEUE_SIZE - q->len)

Definition at line 59 of file midibuf.c.

Function Documentation

EXPORT_SYMBOL ( MIDIbuf_avail  )
int MIDIbuf_avail ( int  dev)

Definition at line 418 of file midibuf.c.

int MIDIbuf_ioctl ( int  dev,
struct file file,
unsigned int  cmd,
void __user arg 
)

Definition at line 362 of file midibuf.c.

int MIDIbuf_open ( int  dev,
struct file file 
)

Definition at line 156 of file midibuf.c.

unsigned int MIDIbuf_poll ( int  dev,
struct file file,
poll_table wait 
)

Definition at line 398 of file midibuf.c.

int MIDIbuf_read ( int  dev,
struct file file,
char __user buf,
int  count 
)

Definition at line 314 of file midibuf.c.

void MIDIbuf_release ( int  dev,
struct file file 
)

Definition at line 215 of file midibuf.c.

int MIDIbuf_write ( int  dev,
struct file file,
const char __user buf,
int  count 
)

Definition at line 260 of file midibuf.c.