Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
rawmidi.c File Reference
#include <sound/core.h>
#include <linux/major.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/wait.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <sound/rawmidi.h>
#include <sound/info.h>
#include <sound/control.h>
#include <sound/minors.h>
#include <sound/initval.h>

Go to the source code of this file.

Macros

#define snd_rawmidi_ioctl_compat   NULL
 

Functions

 MODULE_AUTHOR ("Jaroslav Kysela <[email protected]>")
 
 MODULE_DESCRIPTION ("Midlevel RawMidi code for ALSA.")
 
 MODULE_LICENSE ("GPL")
 
int snd_rawmidi_drop_output (struct snd_rawmidi_substream *substream)
 
int snd_rawmidi_drain_output (struct snd_rawmidi_substream *substream)
 
int snd_rawmidi_drain_input (struct snd_rawmidi_substream *substream)
 
int snd_rawmidi_kernel_open (struct snd_card *card, int device, int subdevice, int mode, struct snd_rawmidi_file *rfile)
 
int snd_rawmidi_kernel_release (struct snd_rawmidi_file *rfile)
 
int snd_rawmidi_info_select (struct snd_card *card, struct snd_rawmidi_info *info)
 
int snd_rawmidi_output_params (struct snd_rawmidi_substream *substream, struct snd_rawmidi_params *params)
 
int snd_rawmidi_input_params (struct snd_rawmidi_substream *substream, struct snd_rawmidi_params *params)
 
int snd_rawmidi_receive (struct snd_rawmidi_substream *substream, const unsigned char *buffer, int count)
 
long snd_rawmidi_kernel_read (struct snd_rawmidi_substream *substream, unsigned char *buf, long count)
 
int snd_rawmidi_transmit_empty (struct snd_rawmidi_substream *substream)
 
int snd_rawmidi_transmit_peek (struct snd_rawmidi_substream *substream, unsigned char *buffer, int count)
 
int snd_rawmidi_transmit_ack (struct snd_rawmidi_substream *substream, int count)
 
int snd_rawmidi_transmit (struct snd_rawmidi_substream *substream, unsigned char *buffer, int count)
 
long snd_rawmidi_kernel_write (struct snd_rawmidi_substream *substream, const unsigned char *buf, long count)
 
int snd_rawmidi_new (struct snd_card *card, char *id, int device, int output_count, int input_count, struct snd_rawmidi **rrawmidi)
 
void snd_rawmidi_set_ops (struct snd_rawmidi *rmidi, int stream, struct snd_rawmidi_ops *ops)
 

Macro Definition Documentation

#define snd_rawmidi_ioctl_compat   NULL

Definition at line 1320 of file rawmidi.c.

Function Documentation

MODULE_AUTHOR ( "Jaroslav Kysela <[email protected]>"  )
MODULE_DESCRIPTION ( "Midlevel RawMidi code for ALSA."  )
MODULE_LICENSE ( "GPL"  )
int snd_rawmidi_drain_input ( struct snd_rawmidi_substream substream)

Definition at line 198 of file rawmidi.c.

int snd_rawmidi_drain_output ( struct snd_rawmidi_substream substream)

Definition at line 169 of file rawmidi.c.

int snd_rawmidi_drop_output ( struct snd_rawmidi_substream substream)

Definition at line 155 of file rawmidi.c.

int snd_rawmidi_info_select ( struct snd_card card,
struct snd_rawmidi_info info 
)

Definition at line 578 of file rawmidi.c.

int snd_rawmidi_input_params ( struct snd_rawmidi_substream substream,
struct snd_rawmidi_params params 
)

Definition at line 650 of file rawmidi.c.

int snd_rawmidi_kernel_open ( struct snd_card card,
int  device,
int  subdevice,
int  mode,
struct snd_rawmidi_file rfile 
)

Definition at line 320 of file rawmidi.c.

long snd_rawmidi_kernel_read ( struct snd_rawmidi_substream substream,
unsigned char buf,
long  count 
)

Definition at line 965 of file rawmidi.c.

int snd_rawmidi_kernel_release ( struct snd_rawmidi_file rfile)

Definition at line 514 of file rawmidi.c.

long snd_rawmidi_kernel_write ( struct snd_rawmidi_substream substream,
const unsigned char buf,
long  count 
)

Definition at line 1211 of file rawmidi.c.

int snd_rawmidi_new ( struct snd_card card,
char id,
int  device,
int  output_count,
int  input_count,
struct snd_rawmidi **  rrawmidi 
)

snd_rawmidi_new - create a rawmidi instance : the card instance : the id string : the device index : the number of output streams : the number of input streams : the pointer to store the new rawmidi instance

Creates a new rawmidi instance. Use snd_rawmidi_set_ops() to set the operators to the new instance.

Returns zero if successful, or a negative error code on failure.

Definition at line 1443 of file rawmidi.c.

int snd_rawmidi_output_params ( struct snd_rawmidi_substream substream,
struct snd_rawmidi_params params 
)

Definition at line 621 of file rawmidi.c.

int snd_rawmidi_receive ( struct snd_rawmidi_substream substream,
const unsigned char buffer,
int  count 
)

snd_rawmidi_receive - receive the input data from the device : the rawmidi substream : the buffer pointer : the data size to read

Reads the data from the internal buffer.

Returns the size of read data, or a negative error code on failure.

Definition at line 868 of file rawmidi.c.

void snd_rawmidi_set_ops ( struct snd_rawmidi rmidi,
int  stream,
struct snd_rawmidi_ops ops 
)

snd_rawmidi_set_ops - set the rawmidi operators : the rawmidi instance : the stream direction, SNDRV_RAWMIDI_STREAM_XXX : the operator table

Sets the rawmidi operators for the given stream direction.

Definition at line 1665 of file rawmidi.c.

int snd_rawmidi_transmit ( struct snd_rawmidi_substream substream,
unsigned char buffer,
int  count 
)

snd_rawmidi_transmit - copy from the buffer to the device : the rawmidi substream : the buffer pointer : the data size to transfer

Copies data from the buffer to the device and advances the pointer.

Returns the copied size if successful, or a negative error code on failure.

Definition at line 1145 of file rawmidi.c.

int snd_rawmidi_transmit_ack ( struct snd_rawmidi_substream substream,
int  count 
)

snd_rawmidi_transmit_ack - acknowledge the transmission : the rawmidi substream : the tranferred count

Advances the hardware pointer for the internal output buffer with the given size and updates the condition. Call after the transmission is finished.

Returns the advanced size if successful, or a negative error code on failure.

Definition at line 1112 of file rawmidi.c.

int snd_rawmidi_transmit_empty ( struct snd_rawmidi_substream substream)

snd_rawmidi_transmit_empty - check whether the output buffer is empty : the rawmidi substream

Returns 1 if the internal output buffer is empty, 0 if not.

Definition at line 1030 of file rawmidi.c.

int snd_rawmidi_transmit_peek ( struct snd_rawmidi_substream substream,
unsigned char buffer,
int  count 
)

snd_rawmidi_transmit_peek - copy data from the internal buffer : the rawmidi substream : the buffer pointer : data size to transfer

Copies data from the internal output buffer to the given buffer.

Call this in the interrupt handler when the midi output is ready, and call snd_rawmidi_transmit_ack() after the transmission is finished.

Returns the size of copied data, or a negative error code on failure.

Definition at line 1060 of file rawmidi.c.