Commit 03da312a authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: Emu-X synth

Modules: Common EMU synth,SoundFont,Synth

Remove xxx_t typedefs from the Emu-X synth support.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ee42381e
...@@ -36,39 +36,40 @@ ...@@ -36,39 +36,40 @@
*/ */
#define SNDRV_EMUX_USE_RAW_EFFECT #define SNDRV_EMUX_USE_RAW_EFFECT
struct snd_emux;
/* struct snd_emux_port;
* typedefs struct snd_emux_voice;
*/ struct snd_emux_effect_table;
typedef struct snd_emux_effect_table snd_emux_effect_table_t;
typedef struct snd_emux_port snd_emux_port_t;
typedef struct snd_emux_voice snd_emux_voice_t;
typedef struct snd_emux snd_emux_t;
/* /*
* operators * operators
*/ */
typedef struct snd_emux_operators { struct snd_emux_operators {
struct module *owner; struct module *owner;
snd_emux_voice_t *(*get_voice)(snd_emux_t *emu, snd_emux_port_t *port); struct snd_emux_voice *(*get_voice)(struct snd_emux *emu,
int (*prepare)(snd_emux_voice_t *vp); struct snd_emux_port *port);
void (*trigger)(snd_emux_voice_t *vp); int (*prepare)(struct snd_emux_voice *vp);
void (*release)(snd_emux_voice_t *vp); void (*trigger)(struct snd_emux_voice *vp);
void (*update)(snd_emux_voice_t *vp, int update); void (*release)(struct snd_emux_voice *vp);
void (*terminate)(snd_emux_voice_t *vp); void (*update)(struct snd_emux_voice *vp, int update);
void (*free_voice)(snd_emux_voice_t *vp); void (*terminate)(struct snd_emux_voice *vp);
void (*reset)(snd_emux_t *emu, int ch); void (*free_voice)(struct snd_emux_voice *vp);
/* the first parameters are snd_emux_t */ void (*reset)(struct snd_emux *emu, int ch);
int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count); /* the first parameters are struct snd_emux */
int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr); int (*sample_new)(struct snd_emux *emu, struct snd_sf_sample *sp,
void (*sample_reset)(snd_emux_t *emu); struct snd_util_memhdr *hdr,
int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count); const void __user *data, long count);
void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset); int (*sample_free)(struct snd_emux *emu, struct snd_sf_sample *sp,
struct snd_util_memhdr *hdr);
void (*sample_reset)(struct snd_emux *emu);
int (*load_fx)(struct snd_emux *emu, int type, int arg,
const void __user *data, long count);
void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed,
struct snd_midi_channel_set *chset);
#ifdef CONFIG_SND_SEQUENCER_OSS #ifdef CONFIG_SND_SEQUENCER_OSS
int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2); int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2);
#endif #endif
} snd_emux_operators_t; };
/* /*
...@@ -90,46 +91,46 @@ typedef struct snd_emux_operators { ...@@ -90,46 +91,46 @@ typedef struct snd_emux_operators {
*/ */
struct snd_emux { struct snd_emux {
snd_card_t *card; /* assigned card */ struct snd_card *card; /* assigned card */
/* following should be initialized before registration */ /* following should be initialized before registration */
int max_voices; /* Number of voices */ int max_voices; /* Number of voices */
int mem_size; /* memory size (in byte) */ int mem_size; /* memory size (in byte) */
int num_ports; /* number of ports to be created */ int num_ports; /* number of ports to be created */
int pitch_shift; /* pitch shift value (for Emu10k1) */ int pitch_shift; /* pitch shift value (for Emu10k1) */
snd_emux_operators_t ops; /* operators */ struct snd_emux_operators ops; /* operators */
void *hw; /* hardware */ void *hw; /* hardware */
unsigned long flags; /* other conditions */ unsigned long flags; /* other conditions */
int midi_ports; /* number of virtual midi devices */ int midi_ports; /* number of virtual midi devices */
int midi_devidx; /* device offset of virtual midi */ int midi_devidx; /* device offset of virtual midi */
unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */ unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */
int hwdep_idx; /* hwdep device index */ int hwdep_idx; /* hwdep device index */
snd_hwdep_t *hwdep; /* hwdep device */ struct snd_hwdep *hwdep; /* hwdep device */
/* private */ /* private */
int num_voices; /* current number of voices */ int num_voices; /* current number of voices */
snd_sf_list_t *sflist; /* root of SoundFont list */ struct snd_sf_list *sflist; /* root of SoundFont list */
snd_emux_voice_t *voices; /* Voices (EMU 'channel') */ struct snd_emux_voice *voices; /* Voices (EMU 'channel') */
int use_time; /* allocation counter */ int use_time; /* allocation counter */
spinlock_t voice_lock; /* Lock for voice access */ spinlock_t voice_lock; /* Lock for voice access */
struct semaphore register_mutex; struct semaphore register_mutex;
int client; /* For the sequencer client */ int client; /* For the sequencer client */
int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */ int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */
snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS]; struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS];
int used; /* use counter */ int used; /* use counter */
char *name; /* name of the device (internal) */ char *name; /* name of the device (internal) */
snd_rawmidi_t **vmidi; struct snd_rawmidi **vmidi;
struct timer_list tlist; /* for pending note-offs */ struct timer_list tlist; /* for pending note-offs */
int timer_active; int timer_active;
snd_util_memhdr_t *memhdr; /* memory chunk information */ struct snd_util_memhdr *memhdr; /* memory chunk information */
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
snd_info_entry_t *proc; struct snd_info_entry *proc;
#endif #endif
#ifdef CONFIG_SND_SEQUENCER_OSS #ifdef CONFIG_SND_SEQUENCER_OSS
snd_seq_device_t *oss_synth; struct snd_seq_device *oss_synth;
#endif #endif
}; };
...@@ -139,18 +140,18 @@ struct snd_emux { ...@@ -139,18 +140,18 @@ struct snd_emux {
*/ */
struct snd_emux_port { struct snd_emux_port {
snd_midi_channel_set_t chset; struct snd_midi_channel_set chset;
snd_emux_t *emu; struct snd_emux *emu;
char port_mode; /* operation mode */ char port_mode; /* operation mode */
int volume_atten; /* emuX raw attenuation */ int volume_atten; /* emuX raw attenuation */
unsigned long drum_flags; /* drum bitmaps */ unsigned long drum_flags; /* drum bitmaps */
int ctrls[EMUX_MD_END]; /* control parameters */ int ctrls[EMUX_MD_END]; /* control parameters */
#ifdef SNDRV_EMUX_USE_RAW_EFFECT #ifdef SNDRV_EMUX_USE_RAW_EFFECT
snd_emux_effect_table_t *effect; struct snd_emux_effect_table *effect;
#endif #endif
#ifdef CONFIG_SND_SEQUENCER_OSS #ifdef CONFIG_SND_SEQUENCER_OSS
snd_seq_oss_arg_t *oss_arg; struct snd_seq_oss_arg *oss_arg;
#endif #endif
}; };
...@@ -179,16 +180,16 @@ struct snd_emux_voice { ...@@ -179,16 +180,16 @@ struct snd_emux_voice {
unsigned char key; unsigned char key;
unsigned char velocity; /* Velocity of current note */ unsigned char velocity; /* Velocity of current note */
snd_sf_zone_t *zone; /* Zone assigned to this note */ struct snd_sf_zone *zone; /* Zone assigned to this note */
void *block; /* sample block pointer (optional) */ void *block; /* sample block pointer (optional) */
snd_midi_channel_t *chan; /* Midi channel for this note */ struct snd_midi_channel *chan; /* Midi channel for this note */
snd_emux_port_t *port; /* associated port */ struct snd_emux_port *port; /* associated port */
snd_emux_t *emu; /* assigned root info */ struct snd_emux *emu; /* assigned root info */
void *hw; /* hardware pointer (emu8000_t or emu10k1_t) */ void *hw; /* hardware pointer (emu8000 or emu10k1) */
unsigned long ontime; /* jiffies at note triggered */ unsigned long ontime; /* jiffies at note triggered */
/* Emu8k/Emu10k1 registers */ /* Emu8k/Emu10k1 registers */
soundfont_voice_info_t reg; struct soundfont_voice_info reg;
/* additional registers */ /* additional registers */
int avol; /* volume attenuation */ int avol; /* volume attenuation */
...@@ -229,15 +230,15 @@ struct snd_emux_effect_table { ...@@ -229,15 +230,15 @@ struct snd_emux_effect_table {
/* /*
* prototypes - interface to Emu10k1 and Emu8k routines * prototypes - interface to Emu10k1 and Emu8k routines
*/ */
int snd_emux_new(snd_emux_t **remu); int snd_emux_new(struct snd_emux **remu);
int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name); int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name);
int snd_emux_free(snd_emux_t *emu); int snd_emux_free(struct snd_emux *emu);
/* /*
* exported functions * exported functions
*/ */
void snd_emux_terminate_all(snd_emux_t *emu); void snd_emux_terminate_all(struct snd_emux *emu);
void snd_emux_lock_voice(snd_emux_t *emu, int voice); void snd_emux_lock_voice(struct snd_emux *emu, int voice);
void snd_emux_unlock_voice(snd_emux_t *emu, int voice); void snd_emux_unlock_voice(struct snd_emux *emu, int voice);
#endif /* __SOUND_EMUX_SYNTH_H */ #endif /* __SOUND_EMUX_SYNTH_H */
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#endif #endif
/* patch interface header: 16 bytes */ /* patch interface header: 16 bytes */
typedef struct soundfont_patch_info_t { struct soundfont_patch_info {
unsigned short key; /* use the key below */ unsigned short key; /* use the key below */
#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07) #define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)
...@@ -59,7 +59,7 @@ typedef struct soundfont_patch_info_t { ...@@ -59,7 +59,7 @@ typedef struct soundfont_patch_info_t {
short reserved; /* word alignment data */ short reserved; /* word alignment data */
/* the actual patch data begins after this */ /* the actual patch data begins after this */
} soundfont_patch_info_t; };
/* /*
...@@ -68,7 +68,7 @@ typedef struct soundfont_patch_info_t { ...@@ -68,7 +68,7 @@ typedef struct soundfont_patch_info_t {
#define SNDRV_SFNT_PATCH_NAME_LEN 32 #define SNDRV_SFNT_PATCH_NAME_LEN 32
typedef struct soundfont_open_parm_t { struct soundfont_open_parm {
unsigned short type; /* sample type */ unsigned short type; /* sample type */
#define SNDRV_SFNT_PAT_TYPE_MISC 0 #define SNDRV_SFNT_PAT_TYPE_MISC 0
#define SNDRV_SFNT_PAT_TYPE_GUS 6 #define SNDRV_SFNT_PAT_TYPE_GUS 6
...@@ -78,7 +78,7 @@ typedef struct soundfont_open_parm_t { ...@@ -78,7 +78,7 @@ typedef struct soundfont_open_parm_t {
short reserved; short reserved;
char name[SNDRV_SFNT_PATCH_NAME_LEN]; char name[SNDRV_SFNT_PATCH_NAME_LEN];
} soundfont_open_parm_t; };
/* /*
...@@ -86,7 +86,7 @@ typedef struct soundfont_open_parm_t { ...@@ -86,7 +86,7 @@ typedef struct soundfont_open_parm_t {
*/ */
/* wave table envelope & effect parameters to control EMU8000 */ /* wave table envelope & effect parameters to control EMU8000 */
typedef struct soundfont_voice_parm_t { struct soundfont_voice_parm {
unsigned short moddelay; /* modulation delay (0x8000) */ unsigned short moddelay; /* modulation delay (0x8000) */
unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */ unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */
unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */ unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */
...@@ -108,11 +108,11 @@ typedef struct soundfont_voice_parm_t { ...@@ -108,11 +108,11 @@ typedef struct soundfont_voice_parm_t {
unsigned char chorus; /* chorus send (0x00) */ unsigned char chorus; /* chorus send (0x00) */
unsigned char reverb; /* reverb send (0x00) */ unsigned char reverb; /* reverb send (0x00) */
unsigned short reserved[4]; /* not used */ unsigned short reserved[4]; /* not used */
} soundfont_voice_parm_t; };
/* wave table parameters: 92 bytes */ /* wave table parameters: 92 bytes */
typedef struct soundfont_voice_info_t { struct soundfont_voice_info {
unsigned short sf_id; /* file id (should be zero) */ unsigned short sf_id; /* file id (should be zero) */
unsigned short sample; /* sample id */ unsigned short sample; /* sample id */
int start, end; /* sample offset correction */ int start, end; /* sample offset correction */
...@@ -135,13 +135,13 @@ typedef struct soundfont_voice_info_t { ...@@ -135,13 +135,13 @@ typedef struct soundfont_voice_info_t {
unsigned char amplitude; /* sample volume (127 max) */ unsigned char amplitude; /* sample volume (127 max) */
unsigned char attenuation; /* attenuation (0.375dB) */ unsigned char attenuation; /* attenuation (0.375dB) */
short scaleTuning; /* pitch scale tuning(%), normally 100 */ short scaleTuning; /* pitch scale tuning(%), normally 100 */
soundfont_voice_parm_t parm; /* voice envelope parameters */ struct soundfont_voice_parm parm; /* voice envelope parameters */
unsigned short sample_mode; /* sample mode_flag (set by driver) */ unsigned short sample_mode; /* sample mode_flag (set by driver) */
} soundfont_voice_info_t; };
/* instrument info header: 4 bytes */ /* instrument info header: 4 bytes */
typedef struct soundfont_voice_rec_hdr_t { struct soundfont_voice_rec_hdr {
unsigned char bank; /* midi bank number */ unsigned char bank; /* midi bank number */
unsigned char instr; /* midi preset number */ unsigned char instr; /* midi preset number */
char nvoices; /* number of voices */ char nvoices; /* number of voices */
...@@ -149,7 +149,7 @@ typedef struct soundfont_voice_rec_hdr_t { ...@@ -149,7 +149,7 @@ typedef struct soundfont_voice_rec_hdr_t {
#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */ #define SNDRV_SFNT_WR_APPEND 0 /* append anyway */
#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */ #define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */
#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */ #define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */
} soundfont_voice_rec_hdr_t; };
/* /*
...@@ -157,7 +157,7 @@ typedef struct soundfont_voice_rec_hdr_t { ...@@ -157,7 +157,7 @@ typedef struct soundfont_voice_rec_hdr_t {
*/ */
/* wave table sample header: 32 bytes */ /* wave table sample header: 32 bytes */
typedef struct soundfont_sample_info_t { struct soundfont_sample_info {
unsigned short sf_id; /* file id (should be zero) */ unsigned short sf_id; /* file id (should be zero) */
unsigned short sample; /* sample id */ unsigned short sample; /* sample id */
int start, end; /* start & end offset */ int start, end; /* start & end offset */
...@@ -174,17 +174,17 @@ typedef struct soundfont_sample_info_t { ...@@ -174,17 +174,17 @@ typedef struct soundfont_sample_info_t {
#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */ #define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */
#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */ #define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */
unsigned int truesize; /* used memory size (set by driver) */ unsigned int truesize; /* used memory size (set by driver) */
} soundfont_sample_info_t; };
/* /*
* voice preset mapping (aliasing) * voice preset mapping (aliasing)
*/ */
typedef struct soundfont_voice_map_t { struct soundfont_voice_map {
int map_bank, map_instr, map_key; /* key = -1 means all keys */ int map_bank, map_instr, map_key; /* key = -1 means all keys */
int src_bank, src_instr, src_key; int src_bank, src_instr, src_key;
} soundfont_voice_map_t; };
/* /*
...@@ -195,7 +195,7 @@ typedef struct soundfont_voice_map_t { ...@@ -195,7 +195,7 @@ typedef struct soundfont_voice_map_t {
#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */ #define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */
struct sndrv_emux_misc_mode { struct snd_emux_misc_mode {
int port; /* -1 = all */ int port; /* -1 = all */
int mode; int mode;
int value; int value;
...@@ -204,11 +204,11 @@ struct sndrv_emux_misc_mode { ...@@ -204,11 +204,11 @@ struct sndrv_emux_misc_mode {
enum { enum {
SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int), SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int),
SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, soundfont_patch_info_t), SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, struct soundfont_patch_info),
SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82), SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82),
SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83), SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83),
SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int), SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int),
SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct sndrv_emux_misc_mode), SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct snd_emux_misc_mode),
}; };
#endif /* __SOUND_SFNT_INFO_H */ #endif /* __SOUND_SFNT_INFO_H */
...@@ -29,94 +29,93 @@ ...@@ -29,94 +29,93 @@
#define SF_MAX_PRESETS 256 /* drums are mapped from 128 to 256 */ #define SF_MAX_PRESETS 256 /* drums are mapped from 128 to 256 */
#define SF_IS_DRUM_BANK(z) ((z) == 128) #define SF_IS_DRUM_BANK(z) ((z) == 128)
typedef struct snd_sf_zone { struct snd_sf_zone {
struct snd_sf_zone *next; /* Link to next */ struct snd_sf_zone *next; /* Link to next */
unsigned char bank; /* Midi bank for this zone */ unsigned char bank; /* Midi bank for this zone */
unsigned char instr; /* Midi program for this zone */ unsigned char instr; /* Midi program for this zone */
unsigned char mapped; /* True if mapped to something else */ unsigned char mapped; /* True if mapped to something else */
soundfont_voice_info_t v; /* All the soundfont parameters */ struct soundfont_voice_info v; /* All the soundfont parameters */
int counter; int counter;
struct snd_sf_sample *sample; /* Link to sample */ struct snd_sf_sample *sample; /* Link to sample */
/* The following deals with preset numbers (programs) */ /* The following deals with preset numbers (programs) */
struct snd_sf_zone *next_instr; /* Next zone of this instrument */ struct snd_sf_zone *next_instr; /* Next zone of this instrument */
struct snd_sf_zone *next_zone; /* Next zone in play list */ struct snd_sf_zone *next_zone; /* Next zone in play list */
} snd_sf_zone_t; };
typedef struct snd_sf_sample { struct snd_sf_sample {
soundfont_sample_info_t v; struct soundfont_sample_info v;
int counter; int counter;
snd_util_memblk_t *block; /* allocated data block */ struct snd_util_memblk *block; /* allocated data block */
struct snd_sf_sample *next; struct snd_sf_sample *next;
} snd_sf_sample_t; };
/* /*
* This represents all the information relating to a soundfont. * This represents all the information relating to a soundfont.
*/ */
typedef struct snd_soundfont { struct snd_soundfont {
struct snd_soundfont *next; /* Link to next */ struct snd_soundfont *next; /* Link to next */
/*struct snd_soundfont *prev;*/ /* Link to previous */ /*struct snd_soundfont *prev;*/ /* Link to previous */
short id; /* file id */ short id; /* file id */
short type; /* font type */ short type; /* font type */
unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN]; /* identifier */ unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN]; /* identifier */
snd_sf_zone_t *zones; /* Font information */ struct snd_sf_zone *zones; /* Font information */
snd_sf_sample_t *samples; /* The sample headers */ struct snd_sf_sample *samples; /* The sample headers */
} snd_soundfont_t; };
/* /*
* Type of the sample access callback * Type of the sample access callback
*/ */
typedef int (*snd_sf_sample_new_t)(void *private_data, snd_sf_sample_t *sp, struct snd_sf_callback {
snd_util_memhdr_t *hdr, const void __user *buf, long count);
typedef int (*snd_sf_sample_free_t)(void *private_data, snd_sf_sample_t *sp,
snd_util_memhdr_t *hdr);
typedef void (*snd_sf_sample_reset_t)(void *private);
typedef struct snd_sf_callback {
void *private_data; void *private_data;
snd_sf_sample_new_t sample_new; int (*sample_new)(void *private_data, struct snd_sf_sample *sp,
snd_sf_sample_free_t sample_free; struct snd_util_memhdr *hdr,
snd_sf_sample_reset_t sample_reset; const void __user *buf, long count);
} snd_sf_callback_t; int (*sample_free)(void *private_data, struct snd_sf_sample *sp,
struct snd_util_memhdr *hdr);
void (*sample_reset)(void *private);
};
/* /*
* List of soundfonts. * List of soundfonts.
*/ */
typedef struct snd_sf_list { struct snd_sf_list {
snd_soundfont_t *currsf; /* The currently open soundfont */ struct snd_soundfont *currsf; /* The currently open soundfont */
int open_client; /* client pointer for lock */ int open_client; /* client pointer for lock */
int mem_used; /* used memory size */ int mem_used; /* used memory size */
snd_sf_zone_t *presets[SF_MAX_PRESETS]; struct snd_sf_zone *presets[SF_MAX_PRESETS];
snd_soundfont_t *fonts; /* The list of soundfonts */ struct snd_soundfont *fonts; /* The list of soundfonts */
int fonts_size; /* number of fonts allocated */ int fonts_size; /* number of fonts allocated */
int zone_counter; /* last allocated time for zone */ int zone_counter; /* last allocated time for zone */
int sample_counter; /* last allocated time for sample */ int sample_counter; /* last allocated time for sample */
int zone_locked; /* locked time for zone */ int zone_locked; /* locked time for zone */
int sample_locked; /* locked time for sample */ int sample_locked; /* locked time for sample */
snd_sf_callback_t callback; /* callback functions */ struct snd_sf_callback callback; /* callback functions */
int presets_locked; int presets_locked;
struct semaphore presets_mutex; struct semaphore presets_mutex;
spinlock_t lock; spinlock_t lock;
snd_util_memhdr_t *memhdr; struct snd_util_memhdr *memhdr;
} snd_sf_list_t; };
/* Prototypes for soundfont.c */ /* Prototypes for soundfont.c */
int snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client); int snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int client);
int snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,
long count, int client); long count, int client);
int snd_soundfont_close_check(snd_sf_list_t *sflist, int client); int snd_soundfont_close_check(struct snd_sf_list *sflist, int client);
snd_sf_list_t *snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr); struct snd_sf_list *snd_sf_new(struct snd_sf_callback *callback,
void snd_sf_free(snd_sf_list_t *sflist); struct snd_util_memhdr *hdr);
void snd_sf_free(struct snd_sf_list *sflist);
int snd_soundfont_remove_samples(snd_sf_list_t *sflist); int snd_soundfont_remove_samples(struct snd_sf_list *sflist);
int snd_soundfont_remove_unlocked(snd_sf_list_t *sflist); int snd_soundfont_remove_unlocked(struct snd_sf_list *sflist);
int snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
int preset, int bank, int preset, int bank,
int def_preset, int def_bank, int def_preset, int def_bank,
snd_sf_zone_t **table, int max_layers); struct snd_sf_zone **table, int max_layers);
/* Parameter conversions */ /* Parameter conversions */
int snd_sf_calc_parm_hold(int msec); int snd_sf_calc_parm_hold(int msec);
......
...@@ -20,29 +20,25 @@ ...@@ -20,29 +20,25 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
typedef struct snd_util_memblk snd_util_memblk_t;
typedef struct snd_util_memhdr snd_util_memhdr_t;
typedef unsigned int snd_util_unit_t;
/* /*
* memory block * memory block
*/ */
struct snd_util_memblk { struct snd_util_memblk {
snd_util_unit_t size; /* size of this block */ unsigned int size; /* size of this block */
snd_util_unit_t offset; /* zero-offset of this block */ unsigned int offset; /* zero-offset of this block */
struct list_head list; /* link */ struct list_head list; /* link */
}; };
#define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(snd_util_memblk_t)) #define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(struct snd_util_memblk))
/* /*
* memory management information * memory management information
*/ */
struct snd_util_memhdr { struct snd_util_memhdr {
snd_util_unit_t size; /* size of whole data */ unsigned int size; /* size of whole data */
struct list_head block; /* block linked-list header */ struct list_head block; /* block linked-list header */
int nblocks; /* # of allocated blocks */ int nblocks; /* # of allocated blocks */
snd_util_unit_t used; /* used memory size */ unsigned int used; /* used memory size */
int block_extra_size; /* extra data size of chunk */ int block_extra_size; /* extra data size of chunk */
struct semaphore block_mutex; /* lock */ struct semaphore block_mutex; /* lock */
}; };
...@@ -50,15 +46,17 @@ struct snd_util_memhdr { ...@@ -50,15 +46,17 @@ struct snd_util_memhdr {
/* /*
* prototypes * prototypes
*/ */
snd_util_memhdr_t *snd_util_memhdr_new(int memsize); struct snd_util_memhdr *snd_util_memhdr_new(int memsize);
void snd_util_memhdr_free(snd_util_memhdr_t *hdr); void snd_util_memhdr_free(struct snd_util_memhdr *hdr);
snd_util_memblk_t *snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size); struct snd_util_memblk *snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size);
int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk); int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk);
int snd_util_mem_avail(snd_util_memhdr_t *hdr); int snd_util_mem_avail(struct snd_util_memhdr *hdr);
/* functions without mutex */ /* functions without mutex */
snd_util_memblk_t *__snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size); struct snd_util_memblk *__snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size);
void __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk); void __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk);
snd_util_memblk_t *__snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, struct list_head *prev); struct snd_util_memblk *__snd_util_memblk_new(struct snd_util_memhdr *hdr,
unsigned int units,
struct list_head *prev);
#endif /* __SOUND_UTIL_MEM_H */ #endif /* __SOUND_UTIL_MEM_H */
...@@ -35,9 +35,9 @@ MODULE_LICENSE("GPL"); ...@@ -35,9 +35,9 @@ MODULE_LICENSE("GPL");
/* /*
* create a new hardware dependent device for Emu8000/Emu10k1 * create a new hardware dependent device for Emu8000/Emu10k1
*/ */
int snd_emux_new(snd_emux_t **remu) int snd_emux_new(struct snd_emux **remu)
{ {
snd_emux_t *emu; struct snd_emux *emu;
*remu = NULL; *remu = NULL;
emu = kzalloc(sizeof(*emu), GFP_KERNEL); emu = kzalloc(sizeof(*emu), GFP_KERNEL);
...@@ -66,33 +66,33 @@ int snd_emux_new(snd_emux_t **remu) ...@@ -66,33 +66,33 @@ int snd_emux_new(snd_emux_t **remu)
/* /*
*/ */
static int sf_sample_new(void *private_data, snd_sf_sample_t *sp, static int sf_sample_new(void *private_data, struct snd_sf_sample *sp,
snd_util_memhdr_t *hdr, struct snd_util_memhdr *hdr,
const void __user *buf, long count) const void __user *buf, long count)
{ {
snd_emux_t *emu = private_data; struct snd_emux *emu = private_data;
return emu->ops.sample_new(emu, sp, hdr, buf, count); return emu->ops.sample_new(emu, sp, hdr, buf, count);
} }
static int sf_sample_free(void *private_data, snd_sf_sample_t *sp, static int sf_sample_free(void *private_data, struct snd_sf_sample *sp,
snd_util_memhdr_t *hdr) struct snd_util_memhdr *hdr)
{ {
snd_emux_t *emu = private_data; struct snd_emux *emu = private_data;
return emu->ops.sample_free(emu, sp, hdr); return emu->ops.sample_free(emu, sp, hdr);
} }
static void sf_sample_reset(void *private_data) static void sf_sample_reset(void *private_data)
{ {
snd_emux_t *emu = private_data; struct snd_emux *emu = private_data;
emu->ops.sample_reset(emu); emu->ops.sample_reset(emu);
} }
int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name)
{ {
int err; int err;
snd_sf_callback_t sf_cb; struct snd_sf_callback sf_cb;
snd_assert(emu->hw != NULL, return -EINVAL); snd_assert(emu->hw != NULL, return -EINVAL);
snd_assert(emu->max_voices > 0, return -EINVAL); snd_assert(emu->max_voices > 0, return -EINVAL);
...@@ -101,7 +101,8 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) ...@@ -101,7 +101,8 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name)
emu->card = card; emu->card = card;
emu->name = kstrdup(name, GFP_KERNEL); emu->name = kstrdup(name, GFP_KERNEL);
emu->voices = kcalloc(emu->max_voices, sizeof(snd_emux_voice_t), GFP_KERNEL); emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice),
GFP_KERNEL);
if (emu->voices == NULL) if (emu->voices == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -138,7 +139,7 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) ...@@ -138,7 +139,7 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name)
/* /*
*/ */
int snd_emux_free(snd_emux_t *emu) int snd_emux_free(struct snd_emux *emu)
{ {
unsigned long flags; unsigned long flags;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define xoffsetof(type,tag) ((long)(&((type)NULL)->tag) - (long)(NULL)) #define xoffsetof(type,tag) ((long)(&((type)NULL)->tag) - (long)(NULL))
#define parm_offset(tag) xoffsetof(soundfont_voice_parm_t*, tag) #define parm_offset(tag) xoffsetof(struct soundfont_voice_parm *, tag)
#define PARM_IS_BYTE (1 << 0) #define PARM_IS_BYTE (1 << 0)
#define PARM_IS_WORD (1 << 1) #define PARM_IS_WORD (1 << 1)
...@@ -97,10 +97,10 @@ static struct emux_parm_defs { ...@@ -97,10 +97,10 @@ static struct emux_parm_defs {
/* set byte effect value */ /* set byte effect value */
static void static void
effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type) effect_set_byte(unsigned char *valp, struct snd_midi_channel *chan, int type)
{ {
short effect; short effect;
snd_emux_effect_table_t *fx = chan->private; struct snd_emux_effect_table *fx = chan->private;
effect = fx->val[type]; effect = fx->val[type];
if (fx->flag[type] == EMUX_FX_FLAG_ADD) { if (fx->flag[type] == EMUX_FX_FLAG_ADD) {
...@@ -118,10 +118,10 @@ effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type) ...@@ -118,10 +118,10 @@ effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type)
/* set word effect value */ /* set word effect value */
static void static void
effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type) effect_set_word(unsigned short *valp, struct snd_midi_channel *chan, int type)
{ {
int effect; int effect;
snd_emux_effect_table_t *fx = chan->private; struct snd_emux_effect_table *fx = chan->private;
effect = *(unsigned short*)&fx->val[type]; effect = *(unsigned short*)&fx->val[type];
if (fx->flag[type] == EMUX_FX_FLAG_ADD) if (fx->flag[type] == EMUX_FX_FLAG_ADD)
...@@ -135,10 +135,10 @@ effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type) ...@@ -135,10 +135,10 @@ effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type)
/* address offset */ /* address offset */
static int static int
effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode) effect_get_offset(struct snd_midi_channel *chan, int lo, int hi, int mode)
{ {
int addr = 0; int addr = 0;
snd_emux_effect_table_t *fx = chan->private; struct snd_emux_effect_table *fx = chan->private;
if (fx->flag[hi]) if (fx->flag[hi])
addr = (short)fx->val[hi]; addr = (short)fx->val[hi];
...@@ -153,7 +153,8 @@ effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode) ...@@ -153,7 +153,8 @@ effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode)
#ifdef CONFIG_SND_SEQUENCER_OSS #ifdef CONFIG_SND_SEQUENCER_OSS
/* change effects - for OSS sequencer compatibility */ /* change effects - for OSS sequencer compatibility */
void void
snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val) snd_emux_send_effect_oss(struct snd_emux_port *port,
struct snd_midi_channel *chan, int type, int val)
{ {
int mode; int mode;
...@@ -173,13 +174,14 @@ snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int ty ...@@ -173,13 +174,14 @@ snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int ty
* if update is necessary, call emu8000_control * if update is necessary, call emu8000_control
*/ */
void void
snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode) snd_emux_send_effect(struct snd_emux_port *port, struct snd_midi_channel *chan,
int type, int val, int mode)
{ {
int i; int i;
int offset; int offset;
unsigned char *srcp, *origp; unsigned char *srcp, *origp;
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_effect_table_t *fx; struct snd_emux_effect_table *fx;
unsigned long flags; unsigned long flags;
emu = port->emu; emu = port->emu;
...@@ -206,7 +208,7 @@ snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, ...@@ -206,7 +208,7 @@ snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type,
/* modify the register values */ /* modify the register values */
spin_lock_irqsave(&emu->voice_lock, flags); spin_lock_irqsave(&emu->voice_lock, flags);
for (i = 0; i < emu->max_voices; i++) { for (i = 0; i < emu->max_voices; i++) {
snd_emux_voice_t *vp = &emu->voices[i]; struct snd_emux_voice *vp = &emu->voices[i];
if (!STATE_IS_PLAYING(vp->state) || vp->chan != chan) if (!STATE_IS_PLAYING(vp->state) || vp->chan != chan)
continue; continue;
srcp = (unsigned char*)&vp->reg.parm + offset; srcp = (unsigned char*)&vp->reg.parm + offset;
...@@ -228,10 +230,10 @@ snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, ...@@ -228,10 +230,10 @@ snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type,
/* copy wavetable registers to voice table */ /* copy wavetable registers to voice table */
void void
snd_emux_setup_effect(snd_emux_voice_t *vp) snd_emux_setup_effect(struct snd_emux_voice *vp)
{ {
snd_midi_channel_t *chan = vp->chan; struct snd_midi_channel *chan = vp->chan;
snd_emux_effect_table_t *fx; struct snd_emux_effect_table *fx;
unsigned char *srcp; unsigned char *srcp;
int i; int i;
...@@ -275,10 +277,11 @@ snd_emux_setup_effect(snd_emux_voice_t *vp) ...@@ -275,10 +277,11 @@ snd_emux_setup_effect(snd_emux_voice_t *vp)
* effect table * effect table
*/ */
void void
snd_emux_create_effect(snd_emux_port_t *p) snd_emux_create_effect(struct snd_emux_port *p)
{ {
int i; int i;
p->effect = kcalloc(p->chset.max_channels, sizeof(snd_emux_effect_table_t), GFP_KERNEL); p->effect = kcalloc(p->chset.max_channels,
sizeof(struct snd_emux_effect_table), GFP_KERNEL);
if (p->effect) { if (p->effect) {
for (i = 0; i < p->chset.max_channels; i++) for (i = 0; i < p->chset.max_channels; i++)
p->chset.channels[i].private = p->effect + i; p->chset.channels[i].private = p->effect + i;
...@@ -289,17 +292,18 @@ snd_emux_create_effect(snd_emux_port_t *p) ...@@ -289,17 +292,18 @@ snd_emux_create_effect(snd_emux_port_t *p)
} }
void void
snd_emux_delete_effect(snd_emux_port_t *p) snd_emux_delete_effect(struct snd_emux_port *p)
{ {
kfree(p->effect); kfree(p->effect);
p->effect = NULL; p->effect = NULL;
} }
void void
snd_emux_clear_effect(snd_emux_port_t *p) snd_emux_clear_effect(struct snd_emux_port *p)
{ {
if (p->effect) { if (p->effect) {
memset(p->effect, 0, sizeof(snd_emux_effect_table_t) * p->chset.max_channels); memset(p->effect, 0, sizeof(struct snd_emux_effect_table) *
p->chset.max_channels);
} }
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* open the hwdep device * open the hwdep device
*/ */
static int static int
snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file) snd_emux_hwdep_open(struct snd_hwdep *hw, struct file *file)
{ {
return 0; return 0;
} }
...@@ -39,7 +39,7 @@ snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file) ...@@ -39,7 +39,7 @@ snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file)
* close the device * close the device
*/ */
static int static int
snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file) snd_emux_hwdep_release(struct snd_hwdep *hw, struct file *file)
{ {
return 0; return 0;
} }
...@@ -51,10 +51,10 @@ snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file) ...@@ -51,10 +51,10 @@ snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file)
* load patch * load patch
*/ */
static int static int
snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg) snd_emux_hwdep_load_patch(struct snd_emux *emu, void __user *arg)
{ {
int err; int err;
soundfont_patch_info_t patch; struct soundfont_patch_info patch;
if (copy_from_user(&patch, arg, sizeof(patch))) if (copy_from_user(&patch, arg, sizeof(patch)))
return -EFAULT; return -EFAULT;
...@@ -77,9 +77,9 @@ snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg) ...@@ -77,9 +77,9 @@ snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg)
* set misc mode * set misc mode
*/ */
static int static int
snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg) snd_emux_hwdep_misc_mode(struct snd_emux *emu, void __user *arg)
{ {
struct sndrv_emux_misc_mode info; struct snd_emux_misc_mode info;
int i; int i;
if (copy_from_user(&info, arg, sizeof(info))) if (copy_from_user(&info, arg, sizeof(info)))
...@@ -102,9 +102,10 @@ snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg) ...@@ -102,9 +102,10 @@ snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg)
* ioctl * ioctl
*/ */
static int static int
snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg) snd_emux_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
unsigned int cmd, unsigned long arg)
{ {
snd_emux_t *emu = hw->private_data; struct snd_emux *emu = hw->private_data;
switch (cmd) { switch (cmd) {
case SNDRV_EMUX_IOCTL_VERSION: case SNDRV_EMUX_IOCTL_VERSION:
...@@ -136,9 +137,9 @@ snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsi ...@@ -136,9 +137,9 @@ snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsi
*/ */
int int
snd_emux_init_hwdep(snd_emux_t *emu) snd_emux_init_hwdep(struct snd_emux *emu)
{ {
snd_hwdep_t *hw; struct snd_hwdep *hw;
int err; int err;
if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0) if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0)
...@@ -162,7 +163,7 @@ snd_emux_init_hwdep(snd_emux_t *emu) ...@@ -162,7 +163,7 @@ snd_emux_init_hwdep(snd_emux_t *emu)
* unregister * unregister
*/ */
void void
snd_emux_delete_hwdep(snd_emux_t *emu) snd_emux_delete_hwdep(struct snd_emux *emu)
{ {
if (emu->hwdep) { if (emu->hwdep) {
snd_device_free(emu->card, emu->hwdep); snd_device_free(emu->card, emu->hwdep);
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
*/ */
/* NRPN / CC -> Emu8000 parameter converter */ /* NRPN / CC -> Emu8000 parameter converter */
typedef struct { struct nrpn_conv_table {
int control; int control;
int effect; int effect;
int (*convert)(int val); int (*convert)(int val);
} nrpn_conv_table; };
/* effect sensitivity */ /* effect sensitivity */
...@@ -48,8 +48,9 @@ typedef struct { ...@@ -48,8 +48,9 @@ typedef struct {
* convert NRPN/control values * convert NRPN/control values
*/ */
static int send_converted_effect(nrpn_conv_table *table, int num_tables, static int send_converted_effect(struct nrpn_conv_table *table, int num_tables,
snd_emux_port_t *port, snd_midi_channel_t *chan, struct snd_emux_port *port,
struct snd_midi_channel *chan,
int type, int val, int mode) int type, int val, int mode)
{ {
int i, cval; int i, cval;
...@@ -178,7 +179,7 @@ static int fx_conv_Q(int val) ...@@ -178,7 +179,7 @@ static int fx_conv_Q(int val)
} }
static nrpn_conv_table awe_effects[] = static struct nrpn_conv_table awe_effects[] =
{ {
{ 0, EMUX_FX_LFO1_DELAY, fx_lfo1_delay}, { 0, EMUX_FX_LFO1_DELAY, fx_lfo1_delay},
{ 1, EMUX_FX_LFO1_FREQ, fx_lfo1_freq}, { 1, EMUX_FX_LFO1_FREQ, fx_lfo1_freq},
...@@ -265,7 +266,7 @@ static int gs_vib_delay(int val) ...@@ -265,7 +266,7 @@ static int gs_vib_delay(int val)
return -(val - 64) * gs_sense[FX_VIBDELAY] / 50; return -(val - 64) * gs_sense[FX_VIBDELAY] / 50;
} }
static nrpn_conv_table gs_effects[] = static struct nrpn_conv_table gs_effects[] =
{ {
{32, EMUX_FX_CUTOFF, gs_cutoff}, {32, EMUX_FX_CUTOFF, gs_cutoff},
{33, EMUX_FX_FILTERQ, gs_filterQ}, {33, EMUX_FX_FILTERQ, gs_filterQ},
...@@ -282,9 +283,10 @@ static nrpn_conv_table gs_effects[] = ...@@ -282,9 +283,10 @@ static nrpn_conv_table gs_effects[] =
* NRPN events * NRPN events
*/ */
void void
snd_emux_nrpn(void *p, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset) snd_emux_nrpn(void *p, struct snd_midi_channel *chan,
struct snd_midi_channel_set *chset)
{ {
snd_emux_port_t *port; struct snd_emux_port *port;
port = p; port = p;
snd_assert(port != NULL, return); snd_assert(port != NULL, return);
...@@ -348,7 +350,7 @@ static int xg_release(int val) ...@@ -348,7 +350,7 @@ static int xg_release(int val)
return -(val - 64) * xg_sense[FX_RELEASE] / 64; return -(val - 64) * xg_sense[FX_RELEASE] / 64;
} }
static nrpn_conv_table xg_effects[] = static struct nrpn_conv_table xg_effects[] =
{ {
{71, EMUX_FX_CUTOFF, xg_cutoff}, {71, EMUX_FX_CUTOFF, xg_cutoff},
{74, EMUX_FX_FILTERQ, xg_filterQ}, {74, EMUX_FX_FILTERQ, xg_filterQ},
...@@ -357,7 +359,8 @@ static nrpn_conv_table xg_effects[] = ...@@ -357,7 +359,8 @@ static nrpn_conv_table xg_effects[] =
}; };
int int
snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param) snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan,
int param)
{ {
return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects), return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects),
port, chan, param, port, chan, param,
...@@ -369,10 +372,11 @@ snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param) ...@@ -369,10 +372,11 @@ snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param)
* receive sysex * receive sysex
*/ */
void void
snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset) snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed,
struct snd_midi_channel_set *chset)
{ {
snd_emux_port_t *port; struct snd_emux_port *port;
snd_emux_t *emu; struct snd_emux *emu;
port = p; port = p;
snd_assert(port != NULL, return); snd_assert(port != NULL, return);
......
...@@ -31,19 +31,25 @@ ...@@ -31,19 +31,25 @@
#include "emux_voice.h" #include "emux_voice.h"
#include <sound/asoundef.h> #include <sound/asoundef.h>
static int snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure); static int snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure);
static int snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg); static int snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg);
static int snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg); static int snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd,
static int snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count); unsigned long ioarg);
static int snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg); static int snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
static int snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop); const char __user *buf, int offs, int count);
static void reset_port_mode(snd_emux_port_t *port, int midi_mode); static int snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg);
static void emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop); static int snd_emux_event_oss_input(struct snd_seq_event *ev, int direct,
static void gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop); void *private, int atomic, int hop);
static void fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop); static void reset_port_mode(struct snd_emux_port *port, int midi_mode);
static void emuspec_control(struct snd_emux *emu, struct snd_emux_port *port,
int cmd, unsigned char *event, int atomic, int hop);
static void gusspec_control(struct snd_emux *emu, struct snd_emux_port *port,
int cmd, unsigned char *event, int atomic, int hop);
static void fake_event(struct snd_emux *emu, struct snd_emux_port *port,
int ch, int param, int val, int atomic, int hop);
/* operators */ /* operators */
static snd_seq_oss_callback_t oss_callback = { static struct snd_seq_oss_callback oss_callback = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = snd_emux_open_seq_oss, .open = snd_emux_open_seq_oss,
.close = snd_emux_close_seq_oss, .close = snd_emux_close_seq_oss,
...@@ -58,13 +64,13 @@ static snd_seq_oss_callback_t oss_callback = { ...@@ -58,13 +64,13 @@ static snd_seq_oss_callback_t oss_callback = {
*/ */
void void
snd_emux_init_seq_oss(snd_emux_t *emu) snd_emux_init_seq_oss(struct snd_emux *emu)
{ {
snd_seq_oss_reg_t *arg; struct snd_seq_oss_reg *arg;
snd_seq_device_t *dev; struct snd_seq_device *dev;
if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS, if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS,
sizeof(snd_seq_oss_reg_t), &dev) < 0) sizeof(struct snd_seq_oss_reg), &dev) < 0)
return; return;
emu->oss_synth = dev; emu->oss_synth = dev;
...@@ -85,7 +91,7 @@ snd_emux_init_seq_oss(snd_emux_t *emu) ...@@ -85,7 +91,7 @@ snd_emux_init_seq_oss(snd_emux_t *emu)
* unregister * unregister
*/ */
void void
snd_emux_detach_seq_oss(snd_emux_t *emu) snd_emux_detach_seq_oss(struct snd_emux *emu)
{ {
if (emu->oss_synth) { if (emu->oss_synth) {
snd_device_free(emu->card, emu->oss_synth); snd_device_free(emu->card, emu->oss_synth);
...@@ -101,11 +107,11 @@ snd_emux_detach_seq_oss(snd_emux_t *emu) ...@@ -101,11 +107,11 @@ snd_emux_detach_seq_oss(snd_emux_t *emu)
* open port for OSS sequencer * open port for OSS sequencer
*/ */
static int static int
snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure) snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
{ {
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_port_t *p; struct snd_emux_port *p;
snd_seq_port_callback_t callback; struct snd_seq_port_callback callback;
char tmpname[64]; char tmpname[64];
emu = closure; emu = closure;
...@@ -153,7 +159,7 @@ snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure) ...@@ -153,7 +159,7 @@ snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure)
* reset port mode * reset port mode
*/ */
static void static void
reset_port_mode(snd_emux_port_t *port, int midi_mode) reset_port_mode(struct snd_emux_port *port, int midi_mode)
{ {
if (midi_mode) { if (midi_mode) {
port->port_mode = SNDRV_EMUX_PORT_MODE_OSS_MIDI; port->port_mode = SNDRV_EMUX_PORT_MODE_OSS_MIDI;
...@@ -173,10 +179,10 @@ reset_port_mode(snd_emux_port_t *port, int midi_mode) ...@@ -173,10 +179,10 @@ reset_port_mode(snd_emux_port_t *port, int midi_mode)
* close port * close port
*/ */
static int static int
snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg) snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg)
{ {
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_port_t *p; struct snd_emux_port *p;
snd_assert(arg != NULL, return -ENXIO); snd_assert(arg != NULL, return -ENXIO);
p = arg->private_data; p = arg->private_data;
...@@ -200,11 +206,11 @@ snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg) ...@@ -200,11 +206,11 @@ snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg)
* load patch * load patch
*/ */
static int static int
snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
const char __user *buf, int offs, int count) const char __user *buf, int offs, int count)
{ {
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_port_t *p; struct snd_emux_port *p;
int rc; int rc;
snd_assert(arg != NULL, return -ENXIO); snd_assert(arg != NULL, return -ENXIO);
...@@ -218,7 +224,7 @@ snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, ...@@ -218,7 +224,7 @@ snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
rc = snd_soundfont_load_guspatch(emu->sflist, buf, count, rc = snd_soundfont_load_guspatch(emu->sflist, buf, count,
SF_CLIENT_NO(p->chset.port)); SF_CLIENT_NO(p->chset.port));
else if (format == SNDRV_OSS_SOUNDFONT_PATCH) { else if (format == SNDRV_OSS_SOUNDFONT_PATCH) {
soundfont_patch_info_t patch; struct soundfont_patch_info patch;
if (count < (int)sizeof(patch)) if (count < (int)sizeof(patch))
rc = -EINVAL; rc = -EINVAL;
if (copy_from_user(&patch, buf, sizeof(patch))) if (copy_from_user(&patch, buf, sizeof(patch)))
...@@ -242,10 +248,10 @@ snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, ...@@ -242,10 +248,10 @@ snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
* ioctl * ioctl
*/ */
static int static int
snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg) snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, unsigned long ioarg)
{ {
snd_emux_port_t *p; struct snd_emux_port *p;
snd_emux_t *emu; struct snd_emux *emu;
snd_assert(arg != NULL, return -ENXIO); snd_assert(arg != NULL, return -ENXIO);
p = arg->private_data; p = arg->private_data;
...@@ -273,9 +279,9 @@ snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long i ...@@ -273,9 +279,9 @@ snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long i
* reset device * reset device
*/ */
static int static int
snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg) snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg)
{ {
snd_emux_port_t *p; struct snd_emux_port *p;
snd_assert(arg != NULL, return -ENXIO); snd_assert(arg != NULL, return -ENXIO);
p = arg->private_data; p = arg->private_data;
...@@ -289,11 +295,11 @@ snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg) ...@@ -289,11 +295,11 @@ snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg)
* receive raw events: only SEQ_PRIVATE is accepted. * receive raw events: only SEQ_PRIVATE is accepted.
*/ */
static int static int
snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data, snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, void *private_data,
int atomic, int hop) int atomic, int hop)
{ {
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_port_t *p; struct snd_emux_port *p;
unsigned char cmd, *data; unsigned char cmd, *data;
p = private_data; p = private_data;
...@@ -320,14 +326,14 @@ snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data, ...@@ -320,14 +326,14 @@ snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data,
* OSS/AWE driver specific h/w controls * OSS/AWE driver specific h/w controls
*/ */
static void static void
emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, emuspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd,
unsigned char *event, int atomic, int hop) unsigned char *event, int atomic, int hop)
{ {
int voice; int voice;
unsigned short p1; unsigned short p1;
short p2; short p2;
int i; int i;
snd_midi_channel_t *chan; struct snd_midi_channel *chan;
voice = event[3]; voice = event[3];
if (voice < 0 || voice >= port->chset.max_channels) if (voice < 0 || voice >= port->chset.max_channels)
...@@ -415,14 +421,14 @@ emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, ...@@ -415,14 +421,14 @@ emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd,
#include <linux/ultrasound.h> #include <linux/ultrasound.h>
static void static void
gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, gusspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd,
unsigned char *event, int atomic, int hop) unsigned char *event, int atomic, int hop)
{ {
int voice; int voice;
unsigned short p1; unsigned short p1;
short p2; short p2;
int plong; int plong;
snd_midi_channel_t *chan; struct snd_midi_channel *chan;
if (port->port_mode != SNDRV_EMUX_PORT_MODE_OSS_SYNTH) if (port->port_mode != SNDRV_EMUX_PORT_MODE_OSS_SYNTH)
return; return;
...@@ -483,9 +489,9 @@ gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, ...@@ -483,9 +489,9 @@ gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd,
* send an event to midi emulation * send an event to midi emulation
*/ */
static void static void
fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop) fake_event(struct snd_emux *emu, struct snd_emux_port *port, int ch, int param, int val, int atomic, int hop)
{ {
snd_seq_event_t ev; struct snd_seq_event ev;
memset(&ev, 0, sizeof(ev)); memset(&ev, 0, sizeof(ev));
ev.type = SNDRV_SEQ_EVENT_CONTROLLER; ev.type = SNDRV_SEQ_EVENT_CONTROLLER;
ev.data.control.channel = ch; ev.data.control.channel = ch;
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
static void static void
snd_emux_proc_info_read(snd_info_entry_t *entry, snd_emux_proc_info_read(struct snd_info_entry *entry,
snd_info_buffer_t *buf) struct snd_info_buffer *buf)
{ {
snd_emux_t *emu; struct snd_emux *emu;
int i; int i;
emu = entry->private_data; emu = entry->private_data;
...@@ -66,7 +66,7 @@ snd_emux_proc_info_read(snd_info_entry_t *entry, ...@@ -66,7 +66,7 @@ snd_emux_proc_info_read(snd_info_entry_t *entry,
} }
#if 0 /* debug */ #if 0 /* debug */
if (emu->voices[0].state != SNDRV_EMUX_ST_OFF && emu->voices[0].ch >= 0) { if (emu->voices[0].state != SNDRV_EMUX_ST_OFF && emu->voices[0].ch >= 0) {
snd_emux_voice_t *vp = &emu->voices[0]; struct snd_emux_voice *vp = &emu->voices[0];
snd_iprintf(buf, "voice 0: on\n"); snd_iprintf(buf, "voice 0: on\n");
snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n", snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n",
vp->reg.parm.moddelay, vp->reg.parm.moddelay,
...@@ -107,9 +107,9 @@ snd_emux_proc_info_read(snd_info_entry_t *entry, ...@@ -107,9 +107,9 @@ snd_emux_proc_info_read(snd_info_entry_t *entry,
} }
void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device) void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device)
{ {
snd_info_entry_t *entry; struct snd_info_entry *entry;
char name[64]; char name[64];
sprintf(name, "wavetableD%d", device); sprintf(name, "wavetableD%d", device);
...@@ -127,7 +127,7 @@ void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device) ...@@ -127,7 +127,7 @@ void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device)
emu->proc = entry; emu->proc = entry;
} }
void snd_emux_proc_free(snd_emux_t *emu) void snd_emux_proc_free(struct snd_emux *emu)
{ {
if (emu->proc) { if (emu->proc) {
snd_info_unregister(emu->proc); snd_info_unregister(emu->proc);
......
...@@ -25,15 +25,15 @@ ...@@ -25,15 +25,15 @@
/* Prototypes for static functions */ /* Prototypes for static functions */
static void free_port(void *private); static void free_port(void *private);
static void snd_emux_init_port(snd_emux_port_t *p); static void snd_emux_init_port(struct snd_emux_port *p);
static int snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info); static int snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info);
static int snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info); static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info);
static int get_client(snd_card_t *card, int index, char *name); static int get_client(struct snd_card *card, int index, char *name);
/* /*
* MIDI emulation operators * MIDI emulation operators
*/ */
static snd_midi_op_t emux_ops = { static struct snd_midi_op emux_ops = {
snd_emux_note_on, snd_emux_note_on,
snd_emux_note_off, snd_emux_note_off,
snd_emux_key_press, snd_emux_key_press,
...@@ -65,10 +65,10 @@ static snd_midi_op_t emux_ops = { ...@@ -65,10 +65,10 @@ static snd_midi_op_t emux_ops = {
* can connect to these ports to play midi data. * can connect to these ports to play midi data.
*/ */
int int
snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index) snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index)
{ {
int i; int i;
snd_seq_port_callback_t pinfo; struct snd_seq_port_callback pinfo;
char tmpname[64]; char tmpname[64];
sprintf(tmpname, "%s WaveTable", emu->name); sprintf(tmpname, "%s WaveTable", emu->name);
...@@ -94,7 +94,7 @@ snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index) ...@@ -94,7 +94,7 @@ snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index)
pinfo.event_input = snd_emux_event_input; pinfo.event_input = snd_emux_event_input;
for (i = 0; i < emu->num_ports; i++) { for (i = 0; i < emu->num_ports; i++) {
snd_emux_port_t *p; struct snd_emux_port *p;
sprintf(tmpname, "%s Port %d", emu->name, i); sprintf(tmpname, "%s Port %d", emu->name, i);
p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS, p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS,
...@@ -119,7 +119,7 @@ snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index) ...@@ -119,7 +119,7 @@ snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index)
* destroy the kernel client. * destroy the kernel client.
*/ */
void void
snd_emux_detach_seq(snd_emux_t *emu) snd_emux_detach_seq(struct snd_emux *emu)
{ {
if (emu->voices) if (emu->voices)
snd_emux_terminate_all(emu); snd_emux_terminate_all(emu);
...@@ -137,12 +137,12 @@ snd_emux_detach_seq(snd_emux_t *emu) ...@@ -137,12 +137,12 @@ snd_emux_detach_seq(snd_emux_t *emu)
* create a sequencer port and channel_set * create a sequencer port and channel_set
*/ */
snd_emux_port_t * struct snd_emux_port *
snd_emux_create_port(snd_emux_t *emu, char *name, snd_emux_create_port(struct snd_emux *emu, char *name,
int max_channels, int oss_port, int max_channels, int oss_port,
snd_seq_port_callback_t *callback) struct snd_seq_port_callback *callback)
{ {
snd_emux_port_t *p; struct snd_emux_port *p;
int i, type, cap; int i, type, cap;
/* Allocate structures for this channel */ /* Allocate structures for this channel */
...@@ -150,7 +150,7 @@ snd_emux_create_port(snd_emux_t *emu, char *name, ...@@ -150,7 +150,7 @@ snd_emux_create_port(snd_emux_t *emu, char *name,
snd_printk("no memory\n"); snd_printk("no memory\n");
return NULL; return NULL;
} }
p->chset.channels = kcalloc(max_channels, sizeof(snd_midi_channel_t), GFP_KERNEL); p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL);
if (p->chset.channels == NULL) { if (p->chset.channels == NULL) {
snd_printk("no memory\n"); snd_printk("no memory\n");
kfree(p); kfree(p);
...@@ -190,7 +190,7 @@ snd_emux_create_port(snd_emux_t *emu, char *name, ...@@ -190,7 +190,7 @@ snd_emux_create_port(snd_emux_t *emu, char *name,
static void static void
free_port(void *private_data) free_port(void *private_data)
{ {
snd_emux_port_t *p; struct snd_emux_port *p;
p = private_data; p = private_data;
if (p) { if (p) {
...@@ -209,7 +209,7 @@ free_port(void *private_data) ...@@ -209,7 +209,7 @@ free_port(void *private_data)
* initialize the port specific parameters * initialize the port specific parameters
*/ */
static void static void
snd_emux_init_port(snd_emux_port_t *p) snd_emux_init_port(struct snd_emux_port *p)
{ {
p->drum_flags = DEFAULT_DRUM_FLAGS; p->drum_flags = DEFAULT_DRUM_FLAGS;
p->volume_atten = 0; p->volume_atten = 0;
...@@ -222,7 +222,7 @@ snd_emux_init_port(snd_emux_port_t *p) ...@@ -222,7 +222,7 @@ snd_emux_init_port(snd_emux_port_t *p)
* reset port * reset port
*/ */
void void
snd_emux_reset_port(snd_emux_port_t *port) snd_emux_reset_port(struct snd_emux_port *port)
{ {
int i; int i;
...@@ -241,7 +241,7 @@ snd_emux_reset_port(snd_emux_port_t *port) ...@@ -241,7 +241,7 @@ snd_emux_reset_port(snd_emux_port_t *port)
port->ctrls[EMUX_MD_REALTIME_PAN] = 1; port->ctrls[EMUX_MD_REALTIME_PAN] = 1;
for (i = 0; i < port->chset.max_channels; i++) { for (i = 0; i < port->chset.max_channels; i++) {
snd_midi_channel_t *chan = port->chset.channels + i; struct snd_midi_channel *chan = port->chset.channels + i;
chan->drum_channel = ((port->drum_flags >> i) & 1) ? 1 : 0; chan->drum_channel = ((port->drum_flags >> i) & 1) ? 1 : 0;
} }
} }
...@@ -251,10 +251,10 @@ snd_emux_reset_port(snd_emux_port_t *port) ...@@ -251,10 +251,10 @@ snd_emux_reset_port(snd_emux_port_t *port)
* input sequencer event * input sequencer event
*/ */
int int
snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data, snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data,
int atomic, int hop) int atomic, int hop)
{ {
snd_emux_port_t *port; struct snd_emux_port *port;
port = private_data; port = private_data;
snd_assert(port != NULL && ev != NULL, return -EINVAL); snd_assert(port != NULL && ev != NULL, return -EINVAL);
...@@ -269,7 +269,7 @@ snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data, ...@@ -269,7 +269,7 @@ snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data,
* increment usage count * increment usage count
*/ */
int int
snd_emux_inc_count(snd_emux_t *emu) snd_emux_inc_count(struct snd_emux *emu)
{ {
emu->used++; emu->used++;
if (!try_module_get(emu->ops.owner)) if (!try_module_get(emu->ops.owner))
...@@ -288,7 +288,7 @@ snd_emux_inc_count(snd_emux_t *emu) ...@@ -288,7 +288,7 @@ snd_emux_inc_count(snd_emux_t *emu)
* decrease usage count * decrease usage count
*/ */
void void
snd_emux_dec_count(snd_emux_t *emu) snd_emux_dec_count(struct snd_emux *emu)
{ {
module_put(emu->card->module); module_put(emu->card->module);
emu->used--; emu->used--;
...@@ -302,10 +302,10 @@ snd_emux_dec_count(snd_emux_t *emu) ...@@ -302,10 +302,10 @@ snd_emux_dec_count(snd_emux_t *emu)
* Routine that is called upon a first use of a particular port * Routine that is called upon a first use of a particular port
*/ */
static int static int
snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info) snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info)
{ {
snd_emux_port_t *p; struct snd_emux_port *p;
snd_emux_t *emu; struct snd_emux *emu;
p = private_data; p = private_data;
snd_assert(p != NULL, return -EINVAL); snd_assert(p != NULL, return -EINVAL);
...@@ -323,10 +323,10 @@ snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info) ...@@ -323,10 +323,10 @@ snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info)
* Routine that is called upon the last unuse() of a particular port. * Routine that is called upon the last unuse() of a particular port.
*/ */
static int static int
snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info) snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info)
{ {
snd_emux_port_t *p; struct snd_emux_port *p;
snd_emux_t *emu; struct snd_emux *emu;
p = private_data; p = private_data;
snd_assert(p != NULL, return -EINVAL); snd_assert(p != NULL, return -EINVAL);
...@@ -345,10 +345,10 @@ snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info) ...@@ -345,10 +345,10 @@ snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info)
* Create a sequencer client * Create a sequencer client
*/ */
static int static int
get_client(snd_card_t *card, int index, char *name) get_client(struct snd_card *card, int index, char *name)
{ {
snd_seq_client_callback_t callbacks; struct snd_seq_client_callback callbacks;
snd_seq_client_info_t cinfo; struct snd_seq_client_info cinfo;
int client; int client;
memset(&callbacks, 0, sizeof(callbacks)); memset(&callbacks, 0, sizeof(callbacks));
...@@ -374,7 +374,7 @@ get_client(snd_card_t *card, int index, char *name) ...@@ -374,7 +374,7 @@ get_client(snd_card_t *card, int index, char *name)
/* /*
* attach virtual rawmidi devices * attach virtual rawmidi devices
*/ */
int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card) int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card)
{ {
int i; int i;
...@@ -382,13 +382,13 @@ int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card) ...@@ -382,13 +382,13 @@ int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card)
if (emu->midi_ports <= 0) if (emu->midi_ports <= 0)
return 0; return 0;
emu->vmidi = kcalloc(emu->midi_ports, sizeof(snd_rawmidi_t*), GFP_KERNEL); emu->vmidi = kcalloc(emu->midi_ports, sizeof(struct snd_rawmidi *), GFP_KERNEL);
if (emu->vmidi == NULL) if (emu->vmidi == NULL)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < emu->midi_ports; i++) { for (i = 0; i < emu->midi_ports; i++) {
snd_rawmidi_t *rmidi; struct snd_rawmidi *rmidi;
snd_virmidi_dev_t *rdev; struct snd_virmidi_dev *rdev;
if (snd_virmidi_new(card, emu->midi_devidx + i, &rmidi) < 0) if (snd_virmidi_new(card, emu->midi_devidx + i, &rmidi) < 0)
goto __error; goto __error;
rdev = rmidi->private_data; rdev = rmidi->private_data;
...@@ -411,7 +411,7 @@ int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card) ...@@ -411,7 +411,7 @@ int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card)
return -ENOMEM; return -ENOMEM;
} }
int snd_emux_delete_virmidi(snd_emux_t *emu) int snd_emux_delete_virmidi(struct snd_emux *emu)
{ {
int i; int i;
......
...@@ -36,30 +36,34 @@ ...@@ -36,30 +36,34 @@
#define LIMITVALUE(x, a, b) do { if ((x) < (a)) (x) = (a); else if ((x) > (b)) (x) = (b); } while (0) #define LIMITVALUE(x, a, b) do { if ((x) < (a)) (x) = (a); else if ((x) > (b)) (x) = (b); } while (0)
#define LIMITMAX(x, a) do {if ((x) > (a)) (x) = (a); } while (0) #define LIMITMAX(x, a) do {if ((x) > (a)) (x) = (a); } while (0)
static int get_zone(snd_emux_t *emu, snd_emux_port_t *port, int *notep, int vel, snd_midi_channel_t *chan, snd_sf_zone_t **table); static int get_zone(struct snd_emux *emu, struct snd_emux_port *port,
static int get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan); int *notep, int vel, struct snd_midi_channel *chan,
static void terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free); struct snd_sf_zone **table);
static void exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass); static int get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan);
static void terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free); static void terminate_note1(struct snd_emux *emu, int note,
static void update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update); struct snd_midi_channel *chan, int free);
static void setup_voice(snd_emux_voice_t *vp); static void exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port,
static int calc_pan(snd_emux_voice_t *vp); int exclass);
static int calc_volume(snd_emux_voice_t *vp); static void terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free);
static int calc_pitch(snd_emux_voice_t *vp); static void update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update);
static void setup_voice(struct snd_emux_voice *vp);
static int calc_pan(struct snd_emux_voice *vp);
static int calc_volume(struct snd_emux_voice *vp);
static int calc_pitch(struct snd_emux_voice *vp);
/* /*
* Start a note. * Start a note.
*/ */
void void
snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
{ {
snd_emux_t *emu; struct snd_emux *emu;
int i, key, nvoices; int i, key, nvoices;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
snd_sf_zone_t *table[SNDRV_EMUX_MAX_MULTI_VOICES]; struct snd_sf_zone *table[SNDRV_EMUX_MAX_MULTI_VOICES];
unsigned long flags; unsigned long flags;
snd_emux_port_t *port; struct snd_emux_port *port;
port = p; port = p;
snd_assert(port != NULL && chan != NULL, return); snd_assert(port != NULL && chan != NULL, return);
...@@ -76,7 +80,7 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) ...@@ -76,7 +80,7 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
/* exclusive note off */ /* exclusive note off */
for (i = 0; i < nvoices; i++) { for (i = 0; i < nvoices; i++) {
snd_sf_zone_t *zp = table[i]; struct snd_sf_zone *zp = table[i];
if (zp && zp->v.exclusiveClass) if (zp && zp->v.exclusiveClass)
exclusive_note_off(emu, port, zp->v.exclusiveClass); exclusive_note_off(emu, port, zp->v.exclusiveClass);
} }
...@@ -138,7 +142,7 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) ...@@ -138,7 +142,7 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
#ifdef SNDRV_EMUX_USE_RAW_EFFECT #ifdef SNDRV_EMUX_USE_RAW_EFFECT
if (port->port_mode == SNDRV_EMUX_PORT_MODE_OSS_SYNTH) { if (port->port_mode == SNDRV_EMUX_PORT_MODE_OSS_SYNTH) {
/* clear voice position for the next note on this channel */ /* clear voice position for the next note on this channel */
snd_emux_effect_table_t *fx = chan->private; struct snd_emux_effect_table *fx = chan->private;
if (fx) { if (fx) {
fx->flag[EMUX_FX_SAMPLE_START] = 0; fx->flag[EMUX_FX_SAMPLE_START] = 0;
fx->flag[EMUX_FX_COARSE_SAMPLE_START] = 0; fx->flag[EMUX_FX_COARSE_SAMPLE_START] = 0;
...@@ -151,13 +155,13 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) ...@@ -151,13 +155,13 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
* Release a note in response to a midi note off. * Release a note in response to a midi note off.
*/ */
void void
snd_emux_note_off(void *p, int note, int vel, snd_midi_channel_t *chan) snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan)
{ {
int ch; int ch;
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
unsigned long flags; unsigned long flags;
snd_emux_port_t *port; struct snd_emux_port *port;
port = p; port = p;
snd_assert(port != NULL && chan != NULL, return); snd_assert(port != NULL && chan != NULL, return);
...@@ -199,8 +203,8 @@ snd_emux_note_off(void *p, int note, int vel, snd_midi_channel_t *chan) ...@@ -199,8 +203,8 @@ snd_emux_note_off(void *p, int note, int vel, snd_midi_channel_t *chan)
*/ */
void snd_emux_timer_callback(unsigned long data) void snd_emux_timer_callback(unsigned long data)
{ {
snd_emux_t *emu = (snd_emux_t*) data; struct snd_emux *emu = (struct snd_emux *) data;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
int ch, do_again = 0; int ch, do_again = 0;
spin_lock(&emu->voice_lock); spin_lock(&emu->voice_lock);
...@@ -228,13 +232,13 @@ void snd_emux_timer_callback(unsigned long data) ...@@ -228,13 +232,13 @@ void snd_emux_timer_callback(unsigned long data)
* key pressure change * key pressure change
*/ */
void void
snd_emux_key_press(void *p, int note, int vel, snd_midi_channel_t *chan) snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan)
{ {
int ch; int ch;
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
unsigned long flags; unsigned long flags;
snd_emux_port_t *port; struct snd_emux_port *port;
port = p; port = p;
snd_assert(port != NULL && chan != NULL, return); snd_assert(port != NULL && chan != NULL, return);
...@@ -260,10 +264,10 @@ snd_emux_key_press(void *p, int note, int vel, snd_midi_channel_t *chan) ...@@ -260,10 +264,10 @@ snd_emux_key_press(void *p, int note, int vel, snd_midi_channel_t *chan)
* Modulate the voices which belong to the channel * Modulate the voices which belong to the channel
*/ */
void void
snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update) snd_emux_update_channel(struct snd_emux_port *port, struct snd_midi_channel *chan, int update)
{ {
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
int i; int i;
unsigned long flags; unsigned long flags;
...@@ -287,10 +291,10 @@ snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int upd ...@@ -287,10 +291,10 @@ snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int upd
* Modulate all the voices which belong to the port. * Modulate all the voices which belong to the port.
*/ */
void void
snd_emux_update_port(snd_emux_port_t *port, int update) snd_emux_update_port(struct snd_emux_port *port, int update)
{ {
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
int i; int i;
unsigned long flags; unsigned long flags;
...@@ -316,9 +320,9 @@ snd_emux_update_port(snd_emux_port_t *port, int update) ...@@ -316,9 +320,9 @@ snd_emux_update_port(snd_emux_port_t *port, int update)
* control events, not just the midi controllers * control events, not just the midi controllers
*/ */
void void
snd_emux_control(void *p, int type, snd_midi_channel_t *chan) snd_emux_control(void *p, int type, struct snd_midi_channel *chan)
{ {
snd_emux_port_t *port; struct snd_emux_port *port;
port = p; port = p;
snd_assert(port != NULL && chan != NULL, return); snd_assert(port != NULL && chan != NULL, return);
...@@ -364,10 +368,10 @@ snd_emux_control(void *p, int type, snd_midi_channel_t *chan) ...@@ -364,10 +368,10 @@ snd_emux_control(void *p, int type, snd_midi_channel_t *chan)
* terminate note - if free flag is true, free the terminated voice * terminate note - if free flag is true, free the terminated voice
*/ */
static void static void
terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free) terminate_note1(struct snd_emux *emu, int note, struct snd_midi_channel *chan, int free)
{ {
int i; int i;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&emu->voice_lock, flags); spin_lock_irqsave(&emu->voice_lock, flags);
...@@ -385,10 +389,10 @@ terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free) ...@@ -385,10 +389,10 @@ terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free)
* terminate note - exported for midi emulation * terminate note - exported for midi emulation
*/ */
void void
snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan) snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan)
{ {
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_port_t *port; struct snd_emux_port *port;
port = p; port = p;
snd_assert(port != NULL && chan != NULL, return); snd_assert(port != NULL && chan != NULL, return);
...@@ -405,10 +409,10 @@ snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan) ...@@ -405,10 +409,10 @@ snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan)
* Terminate all the notes * Terminate all the notes
*/ */
void void
snd_emux_terminate_all(snd_emux_t *emu) snd_emux_terminate_all(struct snd_emux *emu)
{ {
int i; int i;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&emu->voice_lock, flags); spin_lock_irqsave(&emu->voice_lock, flags);
...@@ -434,11 +438,11 @@ snd_emux_terminate_all(snd_emux_t *emu) ...@@ -434,11 +438,11 @@ snd_emux_terminate_all(snd_emux_t *emu)
* Terminate all voices associated with the given port * Terminate all voices associated with the given port
*/ */
void void
snd_emux_sounds_off_all(snd_emux_port_t *port) snd_emux_sounds_off_all(struct snd_emux_port *port)
{ {
int i; int i;
snd_emux_t *emu; struct snd_emux *emu;
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
unsigned long flags; unsigned long flags;
snd_assert(port != NULL, return); snd_assert(port != NULL, return);
...@@ -468,9 +472,9 @@ snd_emux_sounds_off_all(snd_emux_port_t *port) ...@@ -468,9 +472,9 @@ snd_emux_sounds_off_all(snd_emux_port_t *port)
* is mainly for drums. * is mainly for drums.
*/ */
static void static void
exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass) exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port, int exclass)
{ {
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
int i; int i;
unsigned long flags; unsigned long flags;
...@@ -490,7 +494,7 @@ exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass) ...@@ -490,7 +494,7 @@ exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass)
* if free flag is true, call free_voice after termination * if free flag is true, call free_voice after termination
*/ */
static void static void
terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free) terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free)
{ {
emu->ops.terminate(vp); emu->ops.terminate(vp);
vp->time = emu->use_time++; vp->time = emu->use_time++;
...@@ -508,7 +512,7 @@ terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free) ...@@ -508,7 +512,7 @@ terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free)
* Modulate the voice * Modulate the voice
*/ */
static void static void
update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update) update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update)
{ {
if (!STATE_IS_PLAYING(vp->state)) if (!STATE_IS_PLAYING(vp->state))
return; return;
...@@ -543,9 +547,9 @@ static unsigned short voltarget[16] = { ...@@ -543,9 +547,9 @@ static unsigned short voltarget[16] = {
* will be needed later. * will be needed later.
*/ */
static void static void
setup_voice(snd_emux_voice_t *vp) setup_voice(struct snd_emux_voice *vp)
{ {
soundfont_voice_parm_t *parm; struct soundfont_voice_parm *parm;
int pitch; int pitch;
/* copy the original register values */ /* copy the original register values */
...@@ -636,9 +640,9 @@ static unsigned char pan_volumes[256] = { ...@@ -636,9 +640,9 @@ static unsigned char pan_volumes[256] = {
}; };
static int static int
calc_pan(snd_emux_voice_t *vp) calc_pan(struct snd_emux_voice *vp)
{ {
snd_midi_channel_t *chan = vp->chan; struct snd_midi_channel *chan = vp->chan;
int pan; int pan;
/* pan & loop start (pan 8bit, MSB, 0:right, 0xff:left) */ /* pan & loop start (pan 8bit, MSB, 0:right, 0xff:left) */
...@@ -737,12 +741,12 @@ static unsigned char expressiontab[128] = { ...@@ -737,12 +741,12 @@ static unsigned char expressiontab[128] = {
* voice and channels parameters. * voice and channels parameters.
*/ */
static int static int
calc_volume(snd_emux_voice_t *vp) calc_volume(struct snd_emux_voice *vp)
{ {
int vol; int vol;
int main_vol, expression_vol, master_vol; int main_vol, expression_vol, master_vol;
snd_midi_channel_t *chan = vp->chan; struct snd_midi_channel *chan = vp->chan;
snd_emux_port_t *port = vp->port; struct snd_emux_port *port = vp->port;
expression_vol = chan->control[MIDI_CTL_MSB_EXPRESSION]; expression_vol = chan->control[MIDI_CTL_MSB_EXPRESSION];
LIMITMAX(vp->velocity, 127); LIMITMAX(vp->velocity, 127);
...@@ -775,7 +779,7 @@ calc_volume(snd_emux_voice_t *vp) ...@@ -775,7 +779,7 @@ calc_volume(snd_emux_voice_t *vp)
#ifdef SNDRV_EMUX_USE_RAW_EFFECT #ifdef SNDRV_EMUX_USE_RAW_EFFECT
if (chan->private) { if (chan->private) {
snd_emux_effect_table_t *fx = chan->private; struct snd_emux_effect_table *fx = chan->private;
vol += fx->val[EMUX_FX_ATTEN]; vol += fx->val[EMUX_FX_ATTEN];
} }
#endif #endif
...@@ -808,9 +812,9 @@ calc_volume(snd_emux_voice_t *vp) ...@@ -808,9 +812,9 @@ calc_volume(snd_emux_voice_t *vp)
*/ */
static int static int
calc_pitch(snd_emux_voice_t *vp) calc_pitch(struct snd_emux_voice *vp)
{ {
snd_midi_channel_t *chan = vp->chan; struct snd_midi_channel *chan = vp->chan;
int offset; int offset;
/* calculate offset */ /* calculate offset */
...@@ -837,7 +841,7 @@ calc_pitch(snd_emux_voice_t *vp) ...@@ -837,7 +841,7 @@ calc_pitch(snd_emux_voice_t *vp)
#ifdef SNDRV_EMUX_USE_RAW_EFFECT #ifdef SNDRV_EMUX_USE_RAW_EFFECT
/* add initial pitch correction */ /* add initial pitch correction */
if (chan->private) { if (chan->private) {
snd_emux_effect_table_t *fx = chan->private; struct snd_emux_effect_table *fx = chan->private;
if (fx->flag[EMUX_FX_INIT_PITCH]) if (fx->flag[EMUX_FX_INIT_PITCH])
offset += fx->val[EMUX_FX_INIT_PITCH]; offset += fx->val[EMUX_FX_INIT_PITCH];
} }
...@@ -857,7 +861,7 @@ calc_pitch(snd_emux_voice_t *vp) ...@@ -857,7 +861,7 @@ calc_pitch(snd_emux_voice_t *vp)
* Get the bank number assigned to the channel * Get the bank number assigned to the channel
*/ */
static int static int
get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan) get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan)
{ {
int val; int val;
...@@ -886,8 +890,9 @@ get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan) ...@@ -886,8 +890,9 @@ get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan)
* The resultant zones are stored on table. * The resultant zones are stored on table.
*/ */
static int static int
get_zone(snd_emux_t *emu, snd_emux_port_t *port, get_zone(struct snd_emux *emu, struct snd_emux_port *port,
int *notep, int vel, snd_midi_channel_t *chan, snd_sf_zone_t **table) int *notep, int vel, struct snd_midi_channel *chan,
struct snd_sf_zone **table)
{ {
int preset, bank, def_preset, def_bank; int preset, bank, def_preset, def_bank;
...@@ -910,9 +915,9 @@ get_zone(snd_emux_t *emu, snd_emux_port_t *port, ...@@ -910,9 +915,9 @@ get_zone(snd_emux_t *emu, snd_emux_port_t *port,
/* /*
*/ */
void void
snd_emux_init_voices(snd_emux_t *emu) snd_emux_init_voices(struct snd_emux *emu)
{ {
snd_emux_voice_t *vp; struct snd_emux_voice *vp;
int i; int i;
unsigned long flags; unsigned long flags;
...@@ -932,7 +937,7 @@ snd_emux_init_voices(snd_emux_t *emu) ...@@ -932,7 +937,7 @@ snd_emux_init_voices(snd_emux_t *emu)
/* /*
*/ */
void snd_emux_lock_voice(snd_emux_t *emu, int voice) void snd_emux_lock_voice(struct snd_emux *emu, int voice)
{ {
unsigned long flags; unsigned long flags;
...@@ -947,7 +952,7 @@ void snd_emux_lock_voice(snd_emux_t *emu, int voice) ...@@ -947,7 +952,7 @@ void snd_emux_lock_voice(snd_emux_t *emu, int voice)
/* /*
*/ */
void snd_emux_unlock_voice(snd_emux_t *emu, int voice) void snd_emux_unlock_voice(struct snd_emux *emu, int voice)
{ {
unsigned long flags; unsigned long flags;
......
...@@ -29,60 +29,69 @@ ...@@ -29,60 +29,69 @@
#include <sound/emux_synth.h> #include <sound/emux_synth.h>
/* Prototypes for emux_seq.c */ /* Prototypes for emux_seq.c */
int snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index); int snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index);
void snd_emux_detach_seq(snd_emux_t *emu); void snd_emux_detach_seq(struct snd_emux *emu);
snd_emux_port_t *snd_emux_create_port(snd_emux_t *emu, char *name, int max_channels, int type, snd_seq_port_callback_t *callback); struct snd_emux_port *snd_emux_create_port(struct snd_emux *emu, char *name,
void snd_emux_reset_port(snd_emux_port_t *port); int max_channels, int type,
int snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop); struct snd_seq_port_callback *callback);
int snd_emux_inc_count(snd_emux_t *emu); void snd_emux_reset_port(struct snd_emux_port *port);
void snd_emux_dec_count(snd_emux_t *emu); int snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private,
int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card); int atomic, int hop);
int snd_emux_delete_virmidi(snd_emux_t *emu); int snd_emux_inc_count(struct snd_emux *emu);
void snd_emux_dec_count(struct snd_emux *emu);
int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card);
int snd_emux_delete_virmidi(struct snd_emux *emu);
/* Prototypes for emux_synth.c */ /* Prototypes for emux_synth.c */
void snd_emux_init_voices(snd_emux_t *emu); void snd_emux_init_voices(struct snd_emux *emu);
void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan); void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan);
void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan); void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan);
void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan); void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan);
void snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan); void snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan);
void snd_emux_control(void *p, int type, struct snd_midi_channel *chan); void snd_emux_control(void *p, int type, struct snd_midi_channel *chan);
void snd_emux_sounds_off_all(snd_emux_port_t *port); void snd_emux_sounds_off_all(struct snd_emux_port *port);
void snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update); void snd_emux_update_channel(struct snd_emux_port *port,
void snd_emux_update_port(snd_emux_port_t *port, int update); struct snd_midi_channel *chan, int update);
void snd_emux_update_port(struct snd_emux_port *port, int update);
void snd_emux_timer_callback(unsigned long data); void snd_emux_timer_callback(unsigned long data);
/* emux_effect.c */ /* emux_effect.c */
#ifdef SNDRV_EMUX_USE_RAW_EFFECT #ifdef SNDRV_EMUX_USE_RAW_EFFECT
void snd_emux_create_effect(snd_emux_port_t *p); void snd_emux_create_effect(struct snd_emux_port *p);
void snd_emux_delete_effect(snd_emux_port_t *p); void snd_emux_delete_effect(struct snd_emux_port *p);
void snd_emux_clear_effect(snd_emux_port_t *p); void snd_emux_clear_effect(struct snd_emux_port *p);
void snd_emux_setup_effect(snd_emux_voice_t *vp); void snd_emux_setup_effect(struct snd_emux_voice *vp);
void snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val); void snd_emux_send_effect_oss(struct snd_emux_port *port,
void snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode); struct snd_midi_channel *chan, int type, int val);
void snd_emux_send_effect(struct snd_emux_port *port,
struct snd_midi_channel *chan, int type, int val, int mode);
#endif #endif
/* emux_nrpn.c */ /* emux_nrpn.c */
void snd_emux_sysex(void *private_data, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); void snd_emux_sysex(void *private_data, unsigned char *buf, int len,
int snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param); int parsed, struct snd_midi_channel_set *chset);
void snd_emux_nrpn(void *private_data, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); int snd_emux_xg_control(struct snd_emux_port *port,
struct snd_midi_channel *chan, int param);
void snd_emux_nrpn(void *private_data, struct snd_midi_channel *chan,
struct snd_midi_channel_set *chset);
/* emux_oss.c */ /* emux_oss.c */
void snd_emux_init_seq_oss(snd_emux_t *emu); void snd_emux_init_seq_oss(struct snd_emux *emu);
void snd_emux_detach_seq_oss(snd_emux_t *emu); void snd_emux_detach_seq_oss(struct snd_emux *emu);
/* emux_proc.c */ /* emux_proc.c */
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device); void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device);
void snd_emux_proc_free(snd_emux_t *emu); void snd_emux_proc_free(struct snd_emux *emu);
#endif #endif
#define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON) #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON)
/* emux_hwdep.c */ /* emux_hwdep.c */
int snd_emux_init_hwdep(snd_emux_t *emu); int snd_emux_init_hwdep(struct snd_emux *emu);
void snd_emux_delete_hwdep(snd_emux_t *emu); void snd_emux_delete_hwdep(struct snd_emux *emu);
#endif #endif
...@@ -34,38 +34,49 @@ ...@@ -34,38 +34,49 @@
/* Prototypes for static functions */ /* Prototypes for static functions */
static int open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client); static int open_patch(struct snd_sf_list *sflist, const char __user *data,
static snd_soundfont_t *newsf(snd_sf_list_t *sflist, int type, char *name); int count, int client);
static int is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name); static struct snd_soundfont *newsf(struct snd_sf_list *sflist, int type, char *name);
static int close_patch(snd_sf_list_t *sflist); static int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name);
static int probe_data(snd_sf_list_t *sflist, int sample_id); static int close_patch(struct snd_sf_list *sflist);
static void set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp); static int probe_data(struct snd_sf_list *sflist, int sample_id);
static snd_sf_zone_t *sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf); static void set_zone_counter(struct snd_sf_list *sflist,
static void set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp); struct snd_soundfont *sf, struct snd_sf_zone *zp);
static snd_sf_sample_t *sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf); static struct snd_sf_zone *sf_zone_new(struct snd_sf_list *sflist,
static void sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp); struct snd_soundfont *sf);
static int load_map(snd_sf_list_t *sflist, const void __user *data, int count); static void set_sample_counter(struct snd_sf_list *sflist,
static int load_info(snd_sf_list_t *sflist, const void __user *data, long count); struct snd_soundfont *sf, struct snd_sf_sample *sp);
static int remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr); static struct snd_sf_sample *sf_sample_new(struct snd_sf_list *sflist,
static void init_voice_info(soundfont_voice_info_t *avp); struct snd_soundfont *sf);
static void init_voice_parm(soundfont_voice_parm_t *pp); static void sf_sample_delete(struct snd_sf_list *sflist,
static snd_sf_sample_t *set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp); struct snd_soundfont *sf, struct snd_sf_sample *sp);
static snd_sf_sample_t *find_sample(snd_soundfont_t *sf, int sample_id); static int load_map(struct snd_sf_list *sflist, const void __user *data, int count);
static int load_data(snd_sf_list_t *sflist, const void __user *data, long count); static int load_info(struct snd_sf_list *sflist, const void __user *data, long count);
static void rebuild_presets(snd_sf_list_t *sflist); static int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
static void add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur); int bank, int instr);
static void delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp); static void init_voice_info(struct soundfont_voice_info *avp);
static snd_sf_zone_t *search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key); static void init_voice_parm(struct soundfont_voice_parm *pp);
static int search_zones(snd_sf_list_t *sflist, int *notep, int vel, int preset, int bank, snd_sf_zone_t **table, int max_layers, int level); static struct snd_sf_sample *set_sample(struct snd_soundfont *sf,
struct soundfont_voice_info *avp);
static struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id);
static int load_data(struct snd_sf_list *sflist, const void __user *data, long count);
static void rebuild_presets(struct snd_sf_list *sflist);
static void add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur);
static void delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp);
static struct snd_sf_zone *search_first_zone(struct snd_sf_list *sflist,
int bank, int preset, int key);
static int search_zones(struct snd_sf_list *sflist, int *notep, int vel,
int preset, int bank, struct snd_sf_zone **table,
int max_layers, int level);
static int get_index(int bank, int instr, int key); static int get_index(int bank, int instr, int key);
static void snd_sf_init(snd_sf_list_t *sflist); static void snd_sf_init(struct snd_sf_list *sflist);
static void snd_sf_clear(snd_sf_list_t *sflist); static void snd_sf_clear(struct snd_sf_list *sflist);
/* /*
* lock access to sflist * lock access to sflist
*/ */
static void static void
lock_preset(snd_sf_list_t *sflist) lock_preset(struct snd_sf_list *sflist)
{ {
unsigned long flags; unsigned long flags;
down(&sflist->presets_mutex); down(&sflist->presets_mutex);
...@@ -79,7 +90,7 @@ lock_preset(snd_sf_list_t *sflist) ...@@ -79,7 +90,7 @@ lock_preset(snd_sf_list_t *sflist)
* remove lock * remove lock
*/ */
static void static void
unlock_preset(snd_sf_list_t *sflist) unlock_preset(struct snd_sf_list *sflist)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&sflist->lock, flags); spin_lock_irqsave(&sflist->lock, flags);
...@@ -93,7 +104,7 @@ unlock_preset(snd_sf_list_t *sflist) ...@@ -93,7 +104,7 @@ unlock_preset(snd_sf_list_t *sflist)
* close the patch if the patch was opened by this client. * close the patch if the patch was opened by this client.
*/ */
int int
snd_soundfont_close_check(snd_sf_list_t *sflist, int client) snd_soundfont_close_check(struct snd_sf_list *sflist, int client)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&sflist->lock, flags); spin_lock_irqsave(&sflist->lock, flags);
...@@ -115,9 +126,10 @@ snd_soundfont_close_check(snd_sf_list_t *sflist, int client) ...@@ -115,9 +126,10 @@ snd_soundfont_close_check(snd_sf_list_t *sflist, int client)
* it wants to do with it. * it wants to do with it.
*/ */
int int
snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client) snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
long count, int client)
{ {
soundfont_patch_info_t patch; struct soundfont_patch_info patch;
unsigned long flags; unsigned long flags;
int rc; int rc;
...@@ -215,10 +227,11 @@ is_special_type(int type) ...@@ -215,10 +227,11 @@ is_special_type(int type)
/* open patch; create sf list */ /* open patch; create sf list */
static int static int
open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client) open_patch(struct snd_sf_list *sflist, const char __user *data,
int count, int client)
{ {
soundfont_open_parm_t parm; struct soundfont_open_parm parm;
snd_soundfont_t *sf; struct snd_soundfont *sf;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&sflist->lock, flags); spin_lock_irqsave(&sflist->lock, flags);
...@@ -251,10 +264,10 @@ open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client ...@@ -251,10 +264,10 @@ open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client
/* /*
* Allocate a new soundfont structure. * Allocate a new soundfont structure.
*/ */
static snd_soundfont_t * static struct snd_soundfont *
newsf(snd_sf_list_t *sflist, int type, char *name) newsf(struct snd_sf_list *sflist, int type, char *name)
{ {
snd_soundfont_t *sf; struct snd_soundfont *sf;
/* check the shared fonts */ /* check the shared fonts */
if (type & SNDRV_SFNT_PAT_SHARED) { if (type & SNDRV_SFNT_PAT_SHARED) {
...@@ -287,7 +300,7 @@ newsf(snd_sf_list_t *sflist, int type, char *name) ...@@ -287,7 +300,7 @@ newsf(snd_sf_list_t *sflist, int type, char *name)
/* check if the given name matches to the existing list */ /* check if the given name matches to the existing list */
static int static int
is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name) is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name)
{ {
return ((sf->type & SNDRV_SFNT_PAT_SHARED) && return ((sf->type & SNDRV_SFNT_PAT_SHARED) &&
(sf->type & 0x0f) == (type & 0x0f) && (sf->type & 0x0f) == (type & 0x0f) &&
...@@ -299,7 +312,7 @@ is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name) ...@@ -299,7 +312,7 @@ is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name)
* Close the current patch. * Close the current patch.
*/ */
static int static int
close_patch(snd_sf_list_t *sflist) close_patch(struct snd_sf_list *sflist)
{ {
unsigned long flags; unsigned long flags;
...@@ -316,7 +329,7 @@ close_patch(snd_sf_list_t *sflist) ...@@ -316,7 +329,7 @@ close_patch(snd_sf_list_t *sflist)
/* probe sample in the current list -- nothing to be loaded */ /* probe sample in the current list -- nothing to be loaded */
static int static int
probe_data(snd_sf_list_t *sflist, int sample_id) probe_data(struct snd_sf_list *sflist, int sample_id)
{ {
/* patch must be opened */ /* patch must be opened */
if (sflist->currsf) { if (sflist->currsf) {
...@@ -331,7 +344,8 @@ probe_data(snd_sf_list_t *sflist, int sample_id) ...@@ -331,7 +344,8 @@ probe_data(snd_sf_list_t *sflist, int sample_id)
* increment zone counter * increment zone counter
*/ */
static void static void
set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp) set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,
struct snd_sf_zone *zp)
{ {
zp->counter = sflist->zone_counter++; zp->counter = sflist->zone_counter++;
if (sf->type & SNDRV_SFNT_PAT_LOCKED) if (sf->type & SNDRV_SFNT_PAT_LOCKED)
...@@ -341,10 +355,10 @@ set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp) ...@@ -341,10 +355,10 @@ set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp)
/* /*
* allocate a new zone record * allocate a new zone record
*/ */
static snd_sf_zone_t * static struct snd_sf_zone *
sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
{ {
snd_sf_zone_t *zp; struct snd_sf_zone *zp;
if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL) if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL)
return NULL; return NULL;
...@@ -362,7 +376,8 @@ sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) ...@@ -362,7 +376,8 @@ sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf)
* increment sample couter * increment sample couter
*/ */
static void static void
set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp) set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,
struct snd_sf_sample *sp)
{ {
sp->counter = sflist->sample_counter++; sp->counter = sflist->sample_counter++;
if (sf->type & SNDRV_SFNT_PAT_LOCKED) if (sf->type & SNDRV_SFNT_PAT_LOCKED)
...@@ -372,10 +387,10 @@ set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t * ...@@ -372,10 +387,10 @@ set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *
/* /*
* allocate a new sample list record * allocate a new sample list record
*/ */
static snd_sf_sample_t * static struct snd_sf_sample *
sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
{ {
snd_sf_sample_t *sp; struct snd_sf_sample *sp;
if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL) if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL)
return NULL; return NULL;
...@@ -392,7 +407,8 @@ sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) ...@@ -392,7 +407,8 @@ sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf)
* only the last allocated sample can be deleted. * only the last allocated sample can be deleted.
*/ */
static void static void
sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp) sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf,
struct snd_sf_sample *sp)
{ {
/* only last sample is accepted */ /* only last sample is accepted */
if (sp == sf->samples) { if (sp == sf->samples) {
...@@ -404,11 +420,11 @@ sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp ...@@ -404,11 +420,11 @@ sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp
/* load voice map */ /* load voice map */
static int static int
load_map(snd_sf_list_t *sflist, const void __user *data, int count) load_map(struct snd_sf_list *sflist, const void __user *data, int count)
{ {
snd_sf_zone_t *zp, *prevp; struct snd_sf_zone *zp, *prevp;
snd_soundfont_t *sf; struct snd_soundfont *sf;
soundfont_voice_map_t map; struct soundfont_voice_map map;
/* get the link info */ /* get the link info */
if (count < (int)sizeof(map)) if (count < (int)sizeof(map))
...@@ -469,9 +485,10 @@ load_map(snd_sf_list_t *sflist, const void __user *data, int count) ...@@ -469,9 +485,10 @@ load_map(snd_sf_list_t *sflist, const void __user *data, int count)
/* remove the present instrument layers */ /* remove the present instrument layers */
static int static int
remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr) remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
int bank, int instr)
{ {
snd_sf_zone_t *prev, *next, *p; struct snd_sf_zone *prev, *next, *p;
int removed = 0; int removed = 0;
prev = NULL; prev = NULL;
...@@ -500,11 +517,11 @@ remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr) ...@@ -500,11 +517,11 @@ remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr)
* open soundfont. * open soundfont.
*/ */
static int static int
load_info(snd_sf_list_t *sflist, const void __user *data, long count) load_info(struct snd_sf_list *sflist, const void __user *data, long count)
{ {
snd_soundfont_t *sf; struct snd_soundfont *sf;
snd_sf_zone_t *zone; struct snd_sf_zone *zone;
soundfont_voice_rec_hdr_t hdr; struct soundfont_voice_rec_hdr hdr;
int i; int i;
/* patch must be opened */ /* patch must be opened */
...@@ -529,7 +546,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count) ...@@ -529,7 +546,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count)
return -EINVAL; return -EINVAL;
} }
if (count < (long)sizeof(soundfont_voice_info_t)*hdr.nvoices) { if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) {
printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n", printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n",
count, hdr.nvoices); count, hdr.nvoices);
return -EINVAL; return -EINVAL;
...@@ -553,7 +570,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count) ...@@ -553,7 +570,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count)
} }
for (i = 0; i < hdr.nvoices; i++) { for (i = 0; i < hdr.nvoices; i++) {
snd_sf_zone_t tmpzone; struct snd_sf_zone tmpzone;
/* copy awe_voice_info parameters */ /* copy awe_voice_info parameters */
if (copy_from_user(&tmpzone.v, data, sizeof(tmpzone.v))) { if (copy_from_user(&tmpzone.v, data, sizeof(tmpzone.v))) {
...@@ -590,7 +607,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count) ...@@ -590,7 +607,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count)
/* initialize voice_info record */ /* initialize voice_info record */
static void static void
init_voice_info(soundfont_voice_info_t *avp) init_voice_info(struct soundfont_voice_info *avp)
{ {
memset(avp, 0, sizeof(*avp)); memset(avp, 0, sizeof(*avp));
...@@ -614,7 +631,7 @@ init_voice_info(soundfont_voice_info_t *avp) ...@@ -614,7 +631,7 @@ init_voice_info(soundfont_voice_info_t *avp)
* Chorus and Reverb effects are zero. * Chorus and Reverb effects are zero.
*/ */
static void static void
init_voice_parm(soundfont_voice_parm_t *pp) init_voice_parm(struct soundfont_voice_parm *pp)
{ {
memset(pp, 0, sizeof(*pp)); memset(pp, 0, sizeof(*pp));
...@@ -635,10 +652,10 @@ init_voice_parm(soundfont_voice_parm_t *pp) ...@@ -635,10 +652,10 @@ init_voice_parm(soundfont_voice_parm_t *pp)
} }
/* search the specified sample */ /* search the specified sample */
static snd_sf_sample_t * static struct snd_sf_sample *
set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp) set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp)
{ {
snd_sf_sample_t *sample; struct snd_sf_sample *sample;
sample = find_sample(sf, avp->sample); sample = find_sample(sf, avp->sample);
if (sample == NULL) if (sample == NULL)
...@@ -661,10 +678,10 @@ set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp) ...@@ -661,10 +678,10 @@ set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp)
} }
/* find the sample pointer with the given id in the soundfont */ /* find the sample pointer with the given id in the soundfont */
static snd_sf_sample_t * static struct snd_sf_sample *
find_sample(snd_soundfont_t *sf, int sample_id) find_sample(struct snd_soundfont *sf, int sample_id)
{ {
snd_sf_sample_t *p; struct snd_sf_sample *p;
if (sf == NULL) if (sf == NULL)
return NULL; return NULL;
...@@ -684,11 +701,11 @@ find_sample(snd_soundfont_t *sf, int sample_id) ...@@ -684,11 +701,11 @@ find_sample(snd_soundfont_t *sf, int sample_id)
* routine. * routine.
*/ */
static int static int
load_data(snd_sf_list_t *sflist, const void __user *data, long count) load_data(struct snd_sf_list *sflist, const void __user *data, long count)
{ {
snd_soundfont_t *sf; struct snd_soundfont *sf;
soundfont_sample_info_t sample_info; struct soundfont_sample_info sample_info;
snd_sf_sample_t *sp; struct snd_sf_sample *sp;
long off; long off;
/* patch must be opened */ /* patch must be opened */
...@@ -922,12 +939,13 @@ int snd_sf_vol_table[128] = { ...@@ -922,12 +939,13 @@ int snd_sf_vol_table[128] = {
/* load GUS patch */ /* load GUS patch */
static int static int
load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int client) load_guspatch(struct snd_sf_list *sflist, const char __user *data,
long count, int client)
{ {
struct patch_info patch; struct patch_info patch;
snd_soundfont_t *sf; struct snd_soundfont *sf;
snd_sf_zone_t *zone; struct snd_sf_zone *zone;
snd_sf_sample_t *smp; struct snd_sf_sample *smp;
int note, sample_id; int note, sample_id;
int rc; int rc;
...@@ -992,7 +1010,8 @@ load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int cl ...@@ -992,7 +1010,8 @@ load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int cl
*/ */
if (sflist->callback.sample_new) { if (sflist->callback.sample_new) {
rc = sflist->callback.sample_new rc = sflist->callback.sample_new
(sflist->callback.private_data, smp, sflist->memhdr, data, count); (sflist->callback.private_data, smp, sflist->memhdr,
data, count);
if (rc < 0) { if (rc < 0) {
sf_sample_delete(sflist, sf, smp); sf_sample_delete(sflist, sf, smp);
return rc; return rc;
...@@ -1095,7 +1114,7 @@ load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int cl ...@@ -1095,7 +1114,7 @@ load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int cl
/* load GUS patch */ /* load GUS patch */
int int
snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data, snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,
long count, int client) long count, int client)
{ {
int rc; int rc;
...@@ -1114,10 +1133,10 @@ snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data, ...@@ -1114,10 +1133,10 @@ snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data,
* bank/key combination). * bank/key combination).
*/ */
static void static void
rebuild_presets(snd_sf_list_t *sflist) rebuild_presets(struct snd_sf_list *sflist)
{ {
snd_soundfont_t *sf; struct snd_soundfont *sf;
snd_sf_zone_t *cur; struct snd_sf_zone *cur;
/* clear preset table */ /* clear preset table */
memset(sflist->presets, 0, sizeof(sflist->presets)); memset(sflist->presets, 0, sizeof(sflist->presets));
...@@ -1142,15 +1161,15 @@ rebuild_presets(snd_sf_list_t *sflist) ...@@ -1142,15 +1161,15 @@ rebuild_presets(snd_sf_list_t *sflist)
* add the given zone to preset table * add the given zone to preset table
*/ */
static void static void
add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur) add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur)
{ {
snd_sf_zone_t *zone; struct snd_sf_zone *zone;
int index; int index;
zone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low); zone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low);
if (zone && zone->v.sf_id != cur->v.sf_id) { if (zone && zone->v.sf_id != cur->v.sf_id) {
/* different instrument was already defined */ /* different instrument was already defined */
snd_sf_zone_t *p; struct snd_sf_zone *p;
/* compare the allocated time */ /* compare the allocated time */
for (p = zone; p; p = p->next_zone) { for (p = zone; p; p = p->next_zone) {
if (p->counter > cur->counter) if (p->counter > cur->counter)
...@@ -1174,10 +1193,10 @@ add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur) ...@@ -1174,10 +1193,10 @@ add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur)
* delete the given zones from preset_table * delete the given zones from preset_table
*/ */
static void static void
delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp) delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp)
{ {
int index; int index;
snd_sf_zone_t *p; struct snd_sf_zone *p;
if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0) if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0)
return; return;
...@@ -1200,10 +1219,10 @@ delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp) ...@@ -1200,10 +1219,10 @@ delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp)
* This function returns the number of found zones. 0 if not found. * This function returns the number of found zones. 0 if not found.
*/ */
int int
snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
int preset, int bank, int preset, int bank,
int def_preset, int def_bank, int def_preset, int def_bank,
snd_sf_zone_t **table, int max_layers) struct snd_sf_zone **table, int max_layers)
{ {
int nvoices; int nvoices;
unsigned long flags; unsigned long flags;
...@@ -1217,10 +1236,13 @@ snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, ...@@ -1217,10 +1236,13 @@ snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,
spin_unlock_irqrestore(&sflist->lock, flags); spin_unlock_irqrestore(&sflist->lock, flags);
return 0; return 0;
} }
nvoices = search_zones(sflist, notep, vel, preset, bank, table, max_layers, 0); nvoices = search_zones(sflist, notep, vel, preset, bank,
table, max_layers, 0);
if (! nvoices) { if (! nvoices) {
if (preset != def_preset || bank != def_bank) if (preset != def_preset || bank != def_bank)
nvoices = search_zones(sflist, notep, vel, def_preset, def_bank, table, max_layers, 0); nvoices = search_zones(sflist, notep, vel,
def_preset, def_bank,
table, max_layers, 0);
} }
spin_unlock_irqrestore(&sflist->lock, flags); spin_unlock_irqrestore(&sflist->lock, flags);
return nvoices; return nvoices;
...@@ -1230,11 +1252,11 @@ snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, ...@@ -1230,11 +1252,11 @@ snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,
/* /*
* search the first matching zone * search the first matching zone
*/ */
static snd_sf_zone_t * static struct snd_sf_zone *
search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key) search_first_zone(struct snd_sf_list *sflist, int bank, int preset, int key)
{ {
int index; int index;
snd_sf_zone_t *zp; struct snd_sf_zone *zp;
if ((index = get_index(bank, preset, key)) < 0) if ((index = get_index(bank, preset, key)) < 0)
return NULL; return NULL;
...@@ -1250,9 +1272,11 @@ search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key) ...@@ -1250,9 +1272,11 @@ search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key)
* search matching zones from sflist. can be called recursively. * search matching zones from sflist. can be called recursively.
*/ */
static int static int
search_zones(snd_sf_list_t *sflist, int *notep, int vel, int preset, int bank, snd_sf_zone_t **table, int max_layers, int level) search_zones(struct snd_sf_list *sflist, int *notep, int vel,
int preset, int bank, struct snd_sf_zone **table,
int max_layers, int level)
{ {
snd_sf_zone_t *zp; struct snd_sf_zone *zp;
int nvoices; int nvoices;
zp = search_first_zone(sflist, bank, preset, *notep); zp = search_first_zone(sflist, bank, preset, *notep);
...@@ -1310,7 +1334,7 @@ get_index(int bank, int instr, int key) ...@@ -1310,7 +1334,7 @@ get_index(int bank, int instr, int key)
* Initialise the sflist structure. * Initialise the sflist structure.
*/ */
static void static void
snd_sf_init(snd_sf_list_t *sflist) snd_sf_init(struct snd_sf_list *sflist)
{ {
memset(sflist->presets, 0, sizeof(sflist->presets)); memset(sflist->presets, 0, sizeof(sflist->presets));
...@@ -1329,11 +1353,11 @@ snd_sf_init(snd_sf_list_t *sflist) ...@@ -1329,11 +1353,11 @@ snd_sf_init(snd_sf_list_t *sflist)
* Release all list records * Release all list records
*/ */
static void static void
snd_sf_clear(snd_sf_list_t *sflist) snd_sf_clear(struct snd_sf_list *sflist)
{ {
snd_soundfont_t *sf, *nextsf; struct snd_soundfont *sf, *nextsf;
snd_sf_zone_t *zp, *nextzp; struct snd_sf_zone *zp, *nextzp;
snd_sf_sample_t *sp, *nextsp; struct snd_sf_sample *sp, *nextsp;
for (sf = sflist->fonts; sf; sf = nextsf) { for (sf = sflist->fonts; sf; sf = nextsf) {
nextsf = sf->next; nextsf = sf->next;
...@@ -1344,7 +1368,8 @@ snd_sf_clear(snd_sf_list_t *sflist) ...@@ -1344,7 +1368,8 @@ snd_sf_clear(snd_sf_list_t *sflist)
for (sp = sf->samples; sp; sp = nextsp) { for (sp = sf->samples; sp; sp = nextsp) {
nextsp = sp->next; nextsp = sp->next;
if (sflist->callback.sample_free) if (sflist->callback.sample_free)
sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr); sflist->callback.sample_free(sflist->callback.private_data,
sp, sflist->memhdr);
kfree(sp); kfree(sp);
} }
kfree(sf); kfree(sf);
...@@ -1357,10 +1382,10 @@ snd_sf_clear(snd_sf_list_t *sflist) ...@@ -1357,10 +1382,10 @@ snd_sf_clear(snd_sf_list_t *sflist)
/* /*
* Create a new sflist structure * Create a new sflist structure
*/ */
snd_sf_list_t * struct snd_sf_list *
snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr) snd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr)
{ {
snd_sf_list_t *sflist; struct snd_sf_list *sflist;
if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL) if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL)
return NULL; return NULL;
...@@ -1381,7 +1406,7 @@ snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr) ...@@ -1381,7 +1406,7 @@ snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr)
* Free everything allocated off the sflist structure. * Free everything allocated off the sflist structure.
*/ */
void void
snd_sf_free(snd_sf_list_t *sflist) snd_sf_free(struct snd_sf_list *sflist)
{ {
if (sflist == NULL) if (sflist == NULL)
return; return;
...@@ -1400,7 +1425,7 @@ snd_sf_free(snd_sf_list_t *sflist) ...@@ -1400,7 +1425,7 @@ snd_sf_free(snd_sf_list_t *sflist)
* The soundcard should be silet before calling this function. * The soundcard should be silet before calling this function.
*/ */
int int
snd_soundfont_remove_samples(snd_sf_list_t *sflist) snd_soundfont_remove_samples(struct snd_sf_list *sflist)
{ {
lock_preset(sflist); lock_preset(sflist);
if (sflist->callback.sample_reset) if (sflist->callback.sample_reset)
...@@ -1416,11 +1441,11 @@ snd_soundfont_remove_samples(snd_sf_list_t *sflist) ...@@ -1416,11 +1441,11 @@ snd_soundfont_remove_samples(snd_sf_list_t *sflist)
* The soundcard should be silent before calling this function. * The soundcard should be silent before calling this function.
*/ */
int int
snd_soundfont_remove_unlocked(snd_sf_list_t *sflist) snd_soundfont_remove_unlocked(struct snd_sf_list *sflist)
{ {
snd_soundfont_t *sf; struct snd_soundfont *sf;
snd_sf_zone_t *zp, *nextzp; struct snd_sf_zone *zp, *nextzp;
snd_sf_sample_t *sp, *nextsp; struct snd_sf_sample *sp, *nextsp;
lock_preset(sflist); lock_preset(sflist);
...@@ -1446,7 +1471,8 @@ snd_soundfont_remove_unlocked(snd_sf_list_t *sflist) ...@@ -1446,7 +1471,8 @@ snd_soundfont_remove_unlocked(snd_sf_list_t *sflist)
sf->samples = nextsp; sf->samples = nextsp;
sflist->mem_used -= sp->v.truesize; sflist->mem_used -= sp->v.truesize;
if (sflist->callback.sample_free) if (sflist->callback.sample_free)
sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr); sflist->callback.sample_free(sflist->callback.private_data,
sp, sflist->memhdr);
kfree(sp); kfree(sp);
} }
} }
......
...@@ -28,15 +28,15 @@ MODULE_AUTHOR("Takashi Iwai"); ...@@ -28,15 +28,15 @@ MODULE_AUTHOR("Takashi Iwai");
MODULE_DESCRIPTION("Generic memory management routines for soundcard memory allocation"); MODULE_DESCRIPTION("Generic memory management routines for soundcard memory allocation");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#define get_memblk(p) list_entry(p, snd_util_memblk_t, list) #define get_memblk(p) list_entry(p, struct snd_util_memblk, list)
/* /*
* create a new memory manager * create a new memory manager
*/ */
snd_util_memhdr_t * struct snd_util_memhdr *
snd_util_memhdr_new(int memsize) snd_util_memhdr_new(int memsize)
{ {
snd_util_memhdr_t *hdr; struct snd_util_memhdr *hdr;
hdr = kzalloc(sizeof(*hdr), GFP_KERNEL); hdr = kzalloc(sizeof(*hdr), GFP_KERNEL);
if (hdr == NULL) if (hdr == NULL)
...@@ -51,7 +51,7 @@ snd_util_memhdr_new(int memsize) ...@@ -51,7 +51,7 @@ snd_util_memhdr_new(int memsize)
/* /*
* free a memory manager * free a memory manager
*/ */
void snd_util_memhdr_free(snd_util_memhdr_t *hdr) void snd_util_memhdr_free(struct snd_util_memhdr *hdr)
{ {
struct list_head *p; struct list_head *p;
...@@ -67,11 +67,11 @@ void snd_util_memhdr_free(snd_util_memhdr_t *hdr) ...@@ -67,11 +67,11 @@ void snd_util_memhdr_free(snd_util_memhdr_t *hdr)
/* /*
* allocate a memory block (without mutex) * allocate a memory block (without mutex)
*/ */
snd_util_memblk_t * struct snd_util_memblk *
__snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) __snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size)
{ {
snd_util_memblk_t *blk; struct snd_util_memblk *blk;
snd_util_unit_t units, prev_offset; unsigned int units, prev_offset;
struct list_head *p; struct list_head *p;
snd_assert(hdr != NULL, return NULL); snd_assert(hdr != NULL, return NULL);
...@@ -104,20 +104,21 @@ __snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) ...@@ -104,20 +104,21 @@ __snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size)
* create a new memory block with the given size * create a new memory block with the given size
* the block is linked next to prev * the block is linked next to prev
*/ */
snd_util_memblk_t * struct snd_util_memblk *
__snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, __snd_util_memblk_new(struct snd_util_memhdr *hdr, unsigned int units,
struct list_head *prev) struct list_head *prev)
{ {
snd_util_memblk_t *blk; struct snd_util_memblk *blk;
blk = kmalloc(sizeof(snd_util_memblk_t) + hdr->block_extra_size, GFP_KERNEL); blk = kmalloc(sizeof(struct snd_util_memblk) + hdr->block_extra_size,
GFP_KERNEL);
if (blk == NULL) if (blk == NULL)
return NULL; return NULL;
if (! prev || prev == &hdr->block) if (! prev || prev == &hdr->block)
blk->offset = 0; blk->offset = 0;
else { else {
snd_util_memblk_t *p = get_memblk(prev); struct snd_util_memblk *p = get_memblk(prev);
blk->offset = p->offset + p->size; blk->offset = p->offset + p->size;
} }
blk->size = units; blk->size = units;
...@@ -131,10 +132,10 @@ __snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, ...@@ -131,10 +132,10 @@ __snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units,
/* /*
* allocate a memory block (with mutex) * allocate a memory block (with mutex)
*/ */
snd_util_memblk_t * struct snd_util_memblk *
snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size)
{ {
snd_util_memblk_t *blk; struct snd_util_memblk *blk;
down(&hdr->block_mutex); down(&hdr->block_mutex);
blk = __snd_util_mem_alloc(hdr, size); blk = __snd_util_mem_alloc(hdr, size);
up(&hdr->block_mutex); up(&hdr->block_mutex);
...@@ -147,7 +148,7 @@ snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) ...@@ -147,7 +148,7 @@ snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size)
* (without mutex) * (without mutex)
*/ */
void void
__snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
{ {
list_del(&blk->list); list_del(&blk->list);
hdr->nblocks--; hdr->nblocks--;
...@@ -158,7 +159,7 @@ __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) ...@@ -158,7 +159,7 @@ __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk)
/* /*
* free a memory block (with mutex) * free a memory block (with mutex)
*/ */
int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
{ {
snd_assert(hdr && blk, return -EINVAL); snd_assert(hdr && blk, return -EINVAL);
...@@ -171,7 +172,7 @@ int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) ...@@ -171,7 +172,7 @@ int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk)
/* /*
* return available memory size * return available memory size
*/ */
int snd_util_mem_avail(snd_util_memhdr_t *hdr) int snd_util_mem_avail(struct snd_util_memhdr *hdr)
{ {
unsigned int size; unsigned int size;
down(&hdr->block_mutex); down(&hdr->block_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment