Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Iwai and committed by
Jaroslav Kysela
03da312a ee42381e

+550 -495
+53 -52
include/sound/emux_synth.h
··· 36 36 */ 37 37 #define SNDRV_EMUX_USE_RAW_EFFECT 38 38 39 - 40 - /* 41 - * typedefs 42 - */ 43 - typedef struct snd_emux_effect_table snd_emux_effect_table_t; 44 - typedef struct snd_emux_port snd_emux_port_t; 45 - typedef struct snd_emux_voice snd_emux_voice_t; 46 - typedef struct snd_emux snd_emux_t; 47 - 39 + struct snd_emux; 40 + struct snd_emux_port; 41 + struct snd_emux_voice; 42 + struct snd_emux_effect_table; 48 43 49 44 /* 50 45 * operators 51 46 */ 52 - typedef struct snd_emux_operators { 47 + struct snd_emux_operators { 53 48 struct module *owner; 54 - snd_emux_voice_t *(*get_voice)(snd_emux_t *emu, snd_emux_port_t *port); 55 - int (*prepare)(snd_emux_voice_t *vp); 56 - void (*trigger)(snd_emux_voice_t *vp); 57 - void (*release)(snd_emux_voice_t *vp); 58 - void (*update)(snd_emux_voice_t *vp, int update); 59 - void (*terminate)(snd_emux_voice_t *vp); 60 - void (*free_voice)(snd_emux_voice_t *vp); 61 - void (*reset)(snd_emux_t *emu, int ch); 62 - /* the first parameters are snd_emux_t */ 63 - int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count); 64 - int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr); 65 - void (*sample_reset)(snd_emux_t *emu); 66 - int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count); 67 - void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 49 + struct snd_emux_voice *(*get_voice)(struct snd_emux *emu, 50 + struct snd_emux_port *port); 51 + int (*prepare)(struct snd_emux_voice *vp); 52 + void (*trigger)(struct snd_emux_voice *vp); 53 + void (*release)(struct snd_emux_voice *vp); 54 + void (*update)(struct snd_emux_voice *vp, int update); 55 + void (*terminate)(struct snd_emux_voice *vp); 56 + void (*free_voice)(struct snd_emux_voice *vp); 57 + void (*reset)(struct snd_emux *emu, int ch); 58 + /* the first parameters are struct snd_emux */ 59 + int (*sample_new)(struct snd_emux *emu, struct snd_sf_sample *sp, 60 + struct snd_util_memhdr *hdr, 61 + const void __user *data, long count); 62 + int (*sample_free)(struct snd_emux *emu, struct snd_sf_sample *sp, 63 + struct snd_util_memhdr *hdr); 64 + void (*sample_reset)(struct snd_emux *emu); 65 + int (*load_fx)(struct snd_emux *emu, int type, int arg, 66 + const void __user *data, long count); 67 + void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed, 68 + struct snd_midi_channel_set *chset); 68 69 #ifdef CONFIG_SND_SEQUENCER_OSS 69 - int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2); 70 + int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2); 70 71 #endif 71 - } snd_emux_operators_t; 72 + }; 72 73 73 74 74 75 /* ··· 91 90 */ 92 91 struct snd_emux { 93 92 94 - snd_card_t *card; /* assigned card */ 93 + struct snd_card *card; /* assigned card */ 95 94 96 95 /* following should be initialized before registration */ 97 96 int max_voices; /* Number of voices */ 98 97 int mem_size; /* memory size (in byte) */ 99 98 int num_ports; /* number of ports to be created */ 100 99 int pitch_shift; /* pitch shift value (for Emu10k1) */ 101 - snd_emux_operators_t ops; /* operators */ 100 + struct snd_emux_operators ops; /* operators */ 102 101 void *hw; /* hardware */ 103 102 unsigned long flags; /* other conditions */ 104 103 int midi_ports; /* number of virtual midi devices */ 105 104 int midi_devidx; /* device offset of virtual midi */ 106 105 unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */ 107 106 int hwdep_idx; /* hwdep device index */ 108 - snd_hwdep_t *hwdep; /* hwdep device */ 107 + struct snd_hwdep *hwdep; /* hwdep device */ 109 108 110 109 /* private */ 111 110 int num_voices; /* current number of voices */ 112 - snd_sf_list_t *sflist; /* root of SoundFont list */ 113 - snd_emux_voice_t *voices; /* Voices (EMU 'channel') */ 111 + struct snd_sf_list *sflist; /* root of SoundFont list */ 112 + struct snd_emux_voice *voices; /* Voices (EMU 'channel') */ 114 113 int use_time; /* allocation counter */ 115 114 spinlock_t voice_lock; /* Lock for voice access */ 116 115 struct semaphore register_mutex; 117 116 int client; /* For the sequencer client */ 118 117 int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */ 119 - snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS]; 118 + struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS]; 120 119 int used; /* use counter */ 121 120 char *name; /* name of the device (internal) */ 122 - snd_rawmidi_t **vmidi; 121 + struct snd_rawmidi **vmidi; 123 122 struct timer_list tlist; /* for pending note-offs */ 124 123 int timer_active; 125 124 126 - snd_util_memhdr_t *memhdr; /* memory chunk information */ 125 + struct snd_util_memhdr *memhdr; /* memory chunk information */ 127 126 128 127 #ifdef CONFIG_PROC_FS 129 - snd_info_entry_t *proc; 128 + struct snd_info_entry *proc; 130 129 #endif 131 130 132 131 #ifdef CONFIG_SND_SEQUENCER_OSS 133 - snd_seq_device_t *oss_synth; 132 + struct snd_seq_device *oss_synth; 134 133 #endif 135 134 }; 136 135 ··· 140 139 */ 141 140 struct snd_emux_port { 142 141 143 - snd_midi_channel_set_t chset; 144 - snd_emux_t *emu; 142 + struct snd_midi_channel_set chset; 143 + struct snd_emux *emu; 145 144 146 145 char port_mode; /* operation mode */ 147 146 int volume_atten; /* emuX raw attenuation */ 148 147 unsigned long drum_flags; /* drum bitmaps */ 149 148 int ctrls[EMUX_MD_END]; /* control parameters */ 150 149 #ifdef SNDRV_EMUX_USE_RAW_EFFECT 151 - snd_emux_effect_table_t *effect; 150 + struct snd_emux_effect_table *effect; 152 151 #endif 153 152 #ifdef CONFIG_SND_SEQUENCER_OSS 154 - snd_seq_oss_arg_t *oss_arg; 153 + struct snd_seq_oss_arg *oss_arg; 155 154 #endif 156 155 }; 157 156 ··· 180 179 unsigned char key; 181 180 unsigned char velocity; /* Velocity of current note */ 182 181 183 - snd_sf_zone_t *zone; /* Zone assigned to this note */ 182 + struct snd_sf_zone *zone; /* Zone assigned to this note */ 184 183 void *block; /* sample block pointer (optional) */ 185 - snd_midi_channel_t *chan; /* Midi channel for this note */ 186 - snd_emux_port_t *port; /* associated port */ 187 - snd_emux_t *emu; /* assigned root info */ 188 - void *hw; /* hardware pointer (emu8000_t or emu10k1_t) */ 184 + struct snd_midi_channel *chan; /* Midi channel for this note */ 185 + struct snd_emux_port *port; /* associated port */ 186 + struct snd_emux *emu; /* assigned root info */ 187 + void *hw; /* hardware pointer (emu8000 or emu10k1) */ 189 188 unsigned long ontime; /* jiffies at note triggered */ 190 189 191 190 /* Emu8k/Emu10k1 registers */ 192 - soundfont_voice_info_t reg; 191 + struct soundfont_voice_info reg; 193 192 194 193 /* additional registers */ 195 194 int avol; /* volume attenuation */ ··· 230 229 /* 231 230 * prototypes - interface to Emu10k1 and Emu8k routines 232 231 */ 233 - int snd_emux_new(snd_emux_t **remu); 234 - int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name); 235 - int snd_emux_free(snd_emux_t *emu); 232 + int snd_emux_new(struct snd_emux **remu); 233 + int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name); 234 + int snd_emux_free(struct snd_emux *emu); 236 235 237 236 /* 238 237 * exported functions 239 238 */ 240 - void snd_emux_terminate_all(snd_emux_t *emu); 241 - void snd_emux_lock_voice(snd_emux_t *emu, int voice); 242 - void snd_emux_unlock_voice(snd_emux_t *emu, int voice); 239 + void snd_emux_terminate_all(struct snd_emux *emu); 240 + void snd_emux_lock_voice(struct snd_emux *emu, int voice); 241 + void snd_emux_unlock_voice(struct snd_emux *emu, int voice); 243 242 244 243 #endif /* __SOUND_EMUX_SYNTH_H */
+18 -18
include/sound/sfnt_info.h
··· 35 35 #endif 36 36 37 37 /* patch interface header: 16 bytes */ 38 - typedef struct soundfont_patch_info_t { 38 + struct soundfont_patch_info { 39 39 unsigned short key; /* use the key below */ 40 40 #define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07) 41 41 ··· 59 59 short reserved; /* word alignment data */ 60 60 61 61 /* the actual patch data begins after this */ 62 - } soundfont_patch_info_t; 62 + }; 63 63 64 64 65 65 /* ··· 68 68 69 69 #define SNDRV_SFNT_PATCH_NAME_LEN 32 70 70 71 - typedef struct soundfont_open_parm_t { 71 + struct soundfont_open_parm { 72 72 unsigned short type; /* sample type */ 73 73 #define SNDRV_SFNT_PAT_TYPE_MISC 0 74 74 #define SNDRV_SFNT_PAT_TYPE_GUS 6 ··· 78 78 79 79 short reserved; 80 80 char name[SNDRV_SFNT_PATCH_NAME_LEN]; 81 - } soundfont_open_parm_t; 81 + }; 82 82 83 83 84 84 /* ··· 86 86 */ 87 87 88 88 /* wave table envelope & effect parameters to control EMU8000 */ 89 - typedef struct soundfont_voice_parm_t { 89 + struct soundfont_voice_parm { 90 90 unsigned short moddelay; /* modulation delay (0x8000) */ 91 91 unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */ 92 92 unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */ ··· 108 108 unsigned char chorus; /* chorus send (0x00) */ 109 109 unsigned char reverb; /* reverb send (0x00) */ 110 110 unsigned short reserved[4]; /* not used */ 111 - } soundfont_voice_parm_t; 111 + }; 112 112 113 113 114 114 /* wave table parameters: 92 bytes */ 115 - typedef struct soundfont_voice_info_t { 115 + struct soundfont_voice_info { 116 116 unsigned short sf_id; /* file id (should be zero) */ 117 117 unsigned short sample; /* sample id */ 118 118 int start, end; /* sample offset correction */ ··· 135 135 unsigned char amplitude; /* sample volume (127 max) */ 136 136 unsigned char attenuation; /* attenuation (0.375dB) */ 137 137 short scaleTuning; /* pitch scale tuning(%), normally 100 */ 138 - soundfont_voice_parm_t parm; /* voice envelope parameters */ 138 + struct soundfont_voice_parm parm; /* voice envelope parameters */ 139 139 unsigned short sample_mode; /* sample mode_flag (set by driver) */ 140 - } soundfont_voice_info_t; 140 + }; 141 141 142 142 143 143 /* instrument info header: 4 bytes */ 144 - typedef struct soundfont_voice_rec_hdr_t { 144 + struct soundfont_voice_rec_hdr { 145 145 unsigned char bank; /* midi bank number */ 146 146 unsigned char instr; /* midi preset number */ 147 147 char nvoices; /* number of voices */ ··· 149 149 #define SNDRV_SFNT_WR_APPEND 0 /* append anyway */ 150 150 #define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */ 151 151 #define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */ 152 - } soundfont_voice_rec_hdr_t; 152 + }; 153 153 154 154 155 155 /* ··· 157 157 */ 158 158 159 159 /* wave table sample header: 32 bytes */ 160 - typedef struct soundfont_sample_info_t { 160 + struct soundfont_sample_info { 161 161 unsigned short sf_id; /* file id (should be zero) */ 162 162 unsigned short sample; /* sample id */ 163 163 int start, end; /* start & end offset */ ··· 174 174 #define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */ 175 175 #define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */ 176 176 unsigned int truesize; /* used memory size (set by driver) */ 177 - } soundfont_sample_info_t; 177 + }; 178 178 179 179 180 180 /* 181 181 * voice preset mapping (aliasing) 182 182 */ 183 183 184 - typedef struct soundfont_voice_map_t { 184 + struct soundfont_voice_map { 185 185 int map_bank, map_instr, map_key; /* key = -1 means all keys */ 186 186 int src_bank, src_instr, src_key; 187 - } soundfont_voice_map_t; 187 + }; 188 188 189 189 190 190 /* ··· 195 195 196 196 #define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */ 197 197 198 - struct sndrv_emux_misc_mode { 198 + struct snd_emux_misc_mode { 199 199 int port; /* -1 = all */ 200 200 int mode; 201 201 int value; ··· 204 204 205 205 enum { 206 206 SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int), 207 - SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, soundfont_patch_info_t), 207 + SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, struct soundfont_patch_info), 208 208 SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82), 209 209 SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83), 210 210 SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int), 211 - SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct sndrv_emux_misc_mode), 211 + SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct snd_emux_misc_mode), 212 212 }; 213 213 214 214 #endif /* __SOUND_SFNT_INFO_H */
+37 -38
include/sound/soundfont.h
··· 29 29 #define SF_MAX_PRESETS 256 /* drums are mapped from 128 to 256 */ 30 30 #define SF_IS_DRUM_BANK(z) ((z) == 128) 31 31 32 - typedef struct snd_sf_zone { 32 + struct snd_sf_zone { 33 33 struct snd_sf_zone *next; /* Link to next */ 34 34 unsigned char bank; /* Midi bank for this zone */ 35 35 unsigned char instr; /* Midi program for this zone */ 36 36 unsigned char mapped; /* True if mapped to something else */ 37 37 38 - soundfont_voice_info_t v; /* All the soundfont parameters */ 38 + struct soundfont_voice_info v; /* All the soundfont parameters */ 39 39 int counter; 40 40 struct snd_sf_sample *sample; /* Link to sample */ 41 41 42 42 /* The following deals with preset numbers (programs) */ 43 43 struct snd_sf_zone *next_instr; /* Next zone of this instrument */ 44 44 struct snd_sf_zone *next_zone; /* Next zone in play list */ 45 - } snd_sf_zone_t; 45 + }; 46 46 47 - typedef struct snd_sf_sample { 48 - soundfont_sample_info_t v; 47 + struct snd_sf_sample { 48 + struct soundfont_sample_info v; 49 49 int counter; 50 - snd_util_memblk_t *block; /* allocated data block */ 50 + struct snd_util_memblk *block; /* allocated data block */ 51 51 struct snd_sf_sample *next; 52 - } snd_sf_sample_t; 52 + }; 53 53 54 54 /* 55 55 * This represents all the information relating to a soundfont. 56 56 */ 57 - typedef struct snd_soundfont { 57 + struct snd_soundfont { 58 58 struct snd_soundfont *next; /* Link to next */ 59 59 /*struct snd_soundfont *prev;*/ /* Link to previous */ 60 60 short id; /* file id */ 61 61 short type; /* font type */ 62 62 unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN]; /* identifier */ 63 - snd_sf_zone_t *zones; /* Font information */ 64 - snd_sf_sample_t *samples; /* The sample headers */ 65 - } snd_soundfont_t; 63 + struct snd_sf_zone *zones; /* Font information */ 64 + struct snd_sf_sample *samples; /* The sample headers */ 65 + }; 66 66 67 67 /* 68 68 * Type of the sample access callback 69 69 */ 70 - typedef int (*snd_sf_sample_new_t)(void *private_data, snd_sf_sample_t *sp, 71 - snd_util_memhdr_t *hdr, const void __user *buf, long count); 72 - typedef int (*snd_sf_sample_free_t)(void *private_data, snd_sf_sample_t *sp, 73 - snd_util_memhdr_t *hdr); 74 - typedef void (*snd_sf_sample_reset_t)(void *private); 75 - 76 - typedef struct snd_sf_callback { 70 + struct snd_sf_callback { 77 71 void *private_data; 78 - snd_sf_sample_new_t sample_new; 79 - snd_sf_sample_free_t sample_free; 80 - snd_sf_sample_reset_t sample_reset; 81 - } snd_sf_callback_t; 72 + int (*sample_new)(void *private_data, struct snd_sf_sample *sp, 73 + struct snd_util_memhdr *hdr, 74 + const void __user *buf, long count); 75 + int (*sample_free)(void *private_data, struct snd_sf_sample *sp, 76 + struct snd_util_memhdr *hdr); 77 + void (*sample_reset)(void *private); 78 + }; 82 79 83 80 /* 84 81 * List of soundfonts. 85 82 */ 86 - typedef struct snd_sf_list { 87 - snd_soundfont_t *currsf; /* The currently open soundfont */ 83 + struct snd_sf_list { 84 + struct snd_soundfont *currsf; /* The currently open soundfont */ 88 85 int open_client; /* client pointer for lock */ 89 86 int mem_used; /* used memory size */ 90 - snd_sf_zone_t *presets[SF_MAX_PRESETS]; 91 - snd_soundfont_t *fonts; /* The list of soundfonts */ 87 + struct snd_sf_zone *presets[SF_MAX_PRESETS]; 88 + struct snd_soundfont *fonts; /* The list of soundfonts */ 92 89 int fonts_size; /* number of fonts allocated */ 93 90 int zone_counter; /* last allocated time for zone */ 94 91 int sample_counter; /* last allocated time for sample */ 95 92 int zone_locked; /* locked time for zone */ 96 93 int sample_locked; /* locked time for sample */ 97 - snd_sf_callback_t callback; /* callback functions */ 94 + struct snd_sf_callback callback; /* callback functions */ 98 95 int presets_locked; 99 96 struct semaphore presets_mutex; 100 97 spinlock_t lock; 101 - snd_util_memhdr_t *memhdr; 102 - } snd_sf_list_t; 98 + struct snd_util_memhdr *memhdr; 99 + }; 103 100 104 101 /* Prototypes for soundfont.c */ 105 - int snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client); 106 - int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data, 102 + int snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data, 103 + long count, int client); 104 + int snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data, 107 105 long count, int client); 108 - int snd_soundfont_close_check(snd_sf_list_t *sflist, int client); 106 + int snd_soundfont_close_check(struct snd_sf_list *sflist, int client); 109 107 110 - snd_sf_list_t *snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr); 111 - void snd_sf_free(snd_sf_list_t *sflist); 108 + struct snd_sf_list *snd_sf_new(struct snd_sf_callback *callback, 109 + struct snd_util_memhdr *hdr); 110 + void snd_sf_free(struct snd_sf_list *sflist); 112 111 113 - int snd_soundfont_remove_samples(snd_sf_list_t *sflist); 114 - int snd_soundfont_remove_unlocked(snd_sf_list_t *sflist); 112 + int snd_soundfont_remove_samples(struct snd_sf_list *sflist); 113 + int snd_soundfont_remove_unlocked(struct snd_sf_list *sflist); 115 114 116 - int snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, 115 + int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel, 117 116 int preset, int bank, 118 117 int def_preset, int def_bank, 119 - snd_sf_zone_t **table, int max_layers); 118 + struct snd_sf_zone **table, int max_layers); 120 119 121 120 /* Parameter conversions */ 122 121 int snd_sf_calc_parm_hold(int msec);
+15 -17
include/sound/util_mem.h
··· 20 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 21 */ 22 22 23 - typedef struct snd_util_memblk snd_util_memblk_t; 24 - typedef struct snd_util_memhdr snd_util_memhdr_t; 25 - typedef unsigned int snd_util_unit_t; 26 - 27 23 /* 28 24 * memory block 29 25 */ 30 26 struct snd_util_memblk { 31 - snd_util_unit_t size; /* size of this block */ 32 - snd_util_unit_t offset; /* zero-offset of this block */ 27 + unsigned int size; /* size of this block */ 28 + unsigned int offset; /* zero-offset of this block */ 33 29 struct list_head list; /* link */ 34 30 }; 35 31 36 - #define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(snd_util_memblk_t)) 32 + #define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(struct snd_util_memblk)) 37 33 38 34 /* 39 35 * memory management information 40 36 */ 41 37 struct snd_util_memhdr { 42 - snd_util_unit_t size; /* size of whole data */ 38 + unsigned int size; /* size of whole data */ 43 39 struct list_head block; /* block linked-list header */ 44 40 int nblocks; /* # of allocated blocks */ 45 - snd_util_unit_t used; /* used memory size */ 41 + unsigned int used; /* used memory size */ 46 42 int block_extra_size; /* extra data size of chunk */ 47 43 struct semaphore block_mutex; /* lock */ 48 44 }; ··· 46 50 /* 47 51 * prototypes 48 52 */ 49 - snd_util_memhdr_t *snd_util_memhdr_new(int memsize); 50 - void snd_util_memhdr_free(snd_util_memhdr_t *hdr); 51 - snd_util_memblk_t *snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size); 52 - int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk); 53 - int snd_util_mem_avail(snd_util_memhdr_t *hdr); 53 + struct snd_util_memhdr *snd_util_memhdr_new(int memsize); 54 + void snd_util_memhdr_free(struct snd_util_memhdr *hdr); 55 + struct snd_util_memblk *snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size); 56 + int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk); 57 + int snd_util_mem_avail(struct snd_util_memhdr *hdr); 54 58 55 59 /* functions without mutex */ 56 - snd_util_memblk_t *__snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size); 57 - void __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk); 58 - snd_util_memblk_t *__snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, struct list_head *prev); 60 + struct snd_util_memblk *__snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size); 61 + void __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk); 62 + struct snd_util_memblk *__snd_util_memblk_new(struct snd_util_memhdr *hdr, 63 + unsigned int units, 64 + struct list_head *prev); 59 65 60 66 #endif /* __SOUND_UTIL_MEM_H */
+15 -14
sound/synth/emux/emux.c
··· 35 35 /* 36 36 * create a new hardware dependent device for Emu8000/Emu10k1 37 37 */ 38 - int snd_emux_new(snd_emux_t **remu) 38 + int snd_emux_new(struct snd_emux **remu) 39 39 { 40 - snd_emux_t *emu; 40 + struct snd_emux *emu; 41 41 42 42 *remu = NULL; 43 43 emu = kzalloc(sizeof(*emu), GFP_KERNEL); ··· 66 66 67 67 /* 68 68 */ 69 - static int sf_sample_new(void *private_data, snd_sf_sample_t *sp, 70 - snd_util_memhdr_t *hdr, 71 - const void __user *buf, long count) 69 + static int sf_sample_new(void *private_data, struct snd_sf_sample *sp, 70 + struct snd_util_memhdr *hdr, 71 + const void __user *buf, long count) 72 72 { 73 - snd_emux_t *emu = private_data; 73 + struct snd_emux *emu = private_data; 74 74 return emu->ops.sample_new(emu, sp, hdr, buf, count); 75 75 76 76 } 77 77 78 - static int sf_sample_free(void *private_data, snd_sf_sample_t *sp, 79 - snd_util_memhdr_t *hdr) 78 + static int sf_sample_free(void *private_data, struct snd_sf_sample *sp, 79 + struct snd_util_memhdr *hdr) 80 80 { 81 - snd_emux_t *emu = private_data; 81 + struct snd_emux *emu = private_data; 82 82 return emu->ops.sample_free(emu, sp, hdr); 83 83 84 84 } 85 85 86 86 static void sf_sample_reset(void *private_data) 87 87 { 88 - snd_emux_t *emu = private_data; 88 + struct snd_emux *emu = private_data; 89 89 emu->ops.sample_reset(emu); 90 90 } 91 91 92 - int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) 92 + int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name) 93 93 { 94 94 int err; 95 - snd_sf_callback_t sf_cb; 95 + struct snd_sf_callback sf_cb; 96 96 97 97 snd_assert(emu->hw != NULL, return -EINVAL); 98 98 snd_assert(emu->max_voices > 0, return -EINVAL); ··· 101 101 102 102 emu->card = card; 103 103 emu->name = kstrdup(name, GFP_KERNEL); 104 - emu->voices = kcalloc(emu->max_voices, sizeof(snd_emux_voice_t), GFP_KERNEL); 104 + emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice), 105 + GFP_KERNEL); 105 106 if (emu->voices == NULL) 106 107 return -ENOMEM; 107 108 ··· 139 138 140 139 /* 141 140 */ 142 - int snd_emux_free(snd_emux_t *emu) 141 + int snd_emux_free(struct snd_emux *emu) 143 142 { 144 143 unsigned long flags; 145 144
+24 -20
sound/synth/emux/emux_effect.c
··· 32 32 33 33 #define xoffsetof(type,tag) ((long)(&((type)NULL)->tag) - (long)(NULL)) 34 34 35 - #define parm_offset(tag) xoffsetof(soundfont_voice_parm_t*, tag) 35 + #define parm_offset(tag) xoffsetof(struct soundfont_voice_parm *, tag) 36 36 37 37 #define PARM_IS_BYTE (1 << 0) 38 38 #define PARM_IS_WORD (1 << 1) ··· 97 97 98 98 /* set byte effect value */ 99 99 static void 100 - effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type) 100 + effect_set_byte(unsigned char *valp, struct snd_midi_channel *chan, int type) 101 101 { 102 102 short effect; 103 - snd_emux_effect_table_t *fx = chan->private; 103 + struct snd_emux_effect_table *fx = chan->private; 104 104 105 105 effect = fx->val[type]; 106 106 if (fx->flag[type] == EMUX_FX_FLAG_ADD) { ··· 118 118 119 119 /* set word effect value */ 120 120 static void 121 - effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type) 121 + effect_set_word(unsigned short *valp, struct snd_midi_channel *chan, int type) 122 122 { 123 123 int effect; 124 - snd_emux_effect_table_t *fx = chan->private; 124 + struct snd_emux_effect_table *fx = chan->private; 125 125 126 126 effect = *(unsigned short*)&fx->val[type]; 127 127 if (fx->flag[type] == EMUX_FX_FLAG_ADD) ··· 135 135 136 136 /* address offset */ 137 137 static int 138 - effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode) 138 + effect_get_offset(struct snd_midi_channel *chan, int lo, int hi, int mode) 139 139 { 140 140 int addr = 0; 141 - snd_emux_effect_table_t *fx = chan->private; 141 + struct snd_emux_effect_table *fx = chan->private; 142 142 143 143 if (fx->flag[hi]) 144 144 addr = (short)fx->val[hi]; ··· 153 153 #ifdef CONFIG_SND_SEQUENCER_OSS 154 154 /* change effects - for OSS sequencer compatibility */ 155 155 void 156 - snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val) 156 + snd_emux_send_effect_oss(struct snd_emux_port *port, 157 + struct snd_midi_channel *chan, int type, int val) 157 158 { 158 159 int mode; 159 160 ··· 174 173 * if update is necessary, call emu8000_control 175 174 */ 176 175 void 177 - snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode) 176 + snd_emux_send_effect(struct snd_emux_port *port, struct snd_midi_channel *chan, 177 + int type, int val, int mode) 178 178 { 179 179 int i; 180 180 int offset; 181 181 unsigned char *srcp, *origp; 182 - snd_emux_t *emu; 183 - snd_emux_effect_table_t *fx; 182 + struct snd_emux *emu; 183 + struct snd_emux_effect_table *fx; 184 184 unsigned long flags; 185 185 186 186 emu = port->emu; ··· 208 206 /* modify the register values */ 209 207 spin_lock_irqsave(&emu->voice_lock, flags); 210 208 for (i = 0; i < emu->max_voices; i++) { 211 - snd_emux_voice_t *vp = &emu->voices[i]; 209 + struct snd_emux_voice *vp = &emu->voices[i]; 212 210 if (!STATE_IS_PLAYING(vp->state) || vp->chan != chan) 213 211 continue; 214 212 srcp = (unsigned char*)&vp->reg.parm + offset; ··· 230 228 231 229 /* copy wavetable registers to voice table */ 232 230 void 233 - snd_emux_setup_effect(snd_emux_voice_t *vp) 231 + snd_emux_setup_effect(struct snd_emux_voice *vp) 234 232 { 235 - snd_midi_channel_t *chan = vp->chan; 236 - snd_emux_effect_table_t *fx; 233 + struct snd_midi_channel *chan = vp->chan; 234 + struct snd_emux_effect_table *fx; 237 235 unsigned char *srcp; 238 236 int i; 239 237 ··· 277 275 * effect table 278 276 */ 279 277 void 280 - snd_emux_create_effect(snd_emux_port_t *p) 278 + snd_emux_create_effect(struct snd_emux_port *p) 281 279 { 282 280 int i; 283 - p->effect = kcalloc(p->chset.max_channels, sizeof(snd_emux_effect_table_t), GFP_KERNEL); 281 + p->effect = kcalloc(p->chset.max_channels, 282 + sizeof(struct snd_emux_effect_table), GFP_KERNEL); 284 283 if (p->effect) { 285 284 for (i = 0; i < p->chset.max_channels; i++) 286 285 p->chset.channels[i].private = p->effect + i; ··· 292 289 } 293 290 294 291 void 295 - snd_emux_delete_effect(snd_emux_port_t *p) 292 + snd_emux_delete_effect(struct snd_emux_port *p) 296 293 { 297 294 kfree(p->effect); 298 295 p->effect = NULL; 299 296 } 300 297 301 298 void 302 - snd_emux_clear_effect(snd_emux_port_t *p) 299 + snd_emux_clear_effect(struct snd_emux_port *p) 303 300 { 304 301 if (p->effect) { 305 - memset(p->effect, 0, sizeof(snd_emux_effect_table_t) * p->chset.max_channels); 302 + memset(p->effect, 0, sizeof(struct snd_emux_effect_table) * 303 + p->chset.max_channels); 306 304 } 307 305 } 308 306
+12 -11
sound/synth/emux/emux_hwdep.c
··· 29 29 * open the hwdep device 30 30 */ 31 31 static int 32 - snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file) 32 + snd_emux_hwdep_open(struct snd_hwdep *hw, struct file *file) 33 33 { 34 34 return 0; 35 35 } ··· 39 39 * close the device 40 40 */ 41 41 static int 42 - snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file) 42 + snd_emux_hwdep_release(struct snd_hwdep *hw, struct file *file) 43 43 { 44 44 return 0; 45 45 } ··· 51 51 * load patch 52 52 */ 53 53 static int 54 - snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg) 54 + snd_emux_hwdep_load_patch(struct snd_emux *emu, void __user *arg) 55 55 { 56 56 int err; 57 - soundfont_patch_info_t patch; 57 + struct soundfont_patch_info patch; 58 58 59 59 if (copy_from_user(&patch, arg, sizeof(patch))) 60 60 return -EFAULT; ··· 77 77 * set misc mode 78 78 */ 79 79 static int 80 - snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg) 80 + snd_emux_hwdep_misc_mode(struct snd_emux *emu, void __user *arg) 81 81 { 82 - struct sndrv_emux_misc_mode info; 82 + struct snd_emux_misc_mode info; 83 83 int i; 84 84 85 85 if (copy_from_user(&info, arg, sizeof(info))) ··· 102 102 * ioctl 103 103 */ 104 104 static int 105 - snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg) 105 + snd_emux_hwdep_ioctl(struct snd_hwdep * hw, struct file *file, 106 + unsigned int cmd, unsigned long arg) 106 107 { 107 - snd_emux_t *emu = hw->private_data; 108 + struct snd_emux *emu = hw->private_data; 108 109 109 110 switch (cmd) { 110 111 case SNDRV_EMUX_IOCTL_VERSION: ··· 137 136 */ 138 137 139 138 int 140 - snd_emux_init_hwdep(snd_emux_t *emu) 139 + snd_emux_init_hwdep(struct snd_emux *emu) 141 140 { 142 - snd_hwdep_t *hw; 141 + struct snd_hwdep *hw; 143 142 int err; 144 143 145 144 if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0) ··· 163 162 * unregister 164 163 */ 165 164 void 166 - snd_emux_delete_hwdep(snd_emux_t *emu) 165 + snd_emux_delete_hwdep(struct snd_emux *emu) 167 166 { 168 167 if (emu->hwdep) { 169 168 snd_device_free(emu->card, emu->hwdep);
+17 -13
sound/synth/emux/emux_nrpn.c
··· 27 27 */ 28 28 29 29 /* NRPN / CC -> Emu8000 parameter converter */ 30 - typedef struct { 30 + struct nrpn_conv_table { 31 31 int control; 32 32 int effect; 33 33 int (*convert)(int val); 34 - } nrpn_conv_table; 34 + }; 35 35 36 36 /* effect sensitivity */ 37 37 ··· 48 48 * convert NRPN/control values 49 49 */ 50 50 51 - static int send_converted_effect(nrpn_conv_table *table, int num_tables, 52 - snd_emux_port_t *port, snd_midi_channel_t *chan, 51 + static int send_converted_effect(struct nrpn_conv_table *table, int num_tables, 52 + struct snd_emux_port *port, 53 + struct snd_midi_channel *chan, 53 54 int type, int val, int mode) 54 55 { 55 56 int i, cval; ··· 179 178 } 180 179 181 180 182 - static nrpn_conv_table awe_effects[] = 181 + static struct nrpn_conv_table awe_effects[] = 183 182 { 184 183 { 0, EMUX_FX_LFO1_DELAY, fx_lfo1_delay}, 185 184 { 1, EMUX_FX_LFO1_FREQ, fx_lfo1_freq}, ··· 266 265 return -(val - 64) * gs_sense[FX_VIBDELAY] / 50; 267 266 } 268 267 269 - static nrpn_conv_table gs_effects[] = 268 + static struct nrpn_conv_table gs_effects[] = 270 269 { 271 270 {32, EMUX_FX_CUTOFF, gs_cutoff}, 272 271 {33, EMUX_FX_FILTERQ, gs_filterQ}, ··· 283 282 * NRPN events 284 283 */ 285 284 void 286 - snd_emux_nrpn(void *p, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset) 285 + snd_emux_nrpn(void *p, struct snd_midi_channel *chan, 286 + struct snd_midi_channel_set *chset) 287 287 { 288 - snd_emux_port_t *port; 288 + struct snd_emux_port *port; 289 289 290 290 port = p; 291 291 snd_assert(port != NULL, return); ··· 350 348 return -(val - 64) * xg_sense[FX_RELEASE] / 64; 351 349 } 352 350 353 - static nrpn_conv_table xg_effects[] = 351 + static struct nrpn_conv_table xg_effects[] = 354 352 { 355 353 {71, EMUX_FX_CUTOFF, xg_cutoff}, 356 354 {74, EMUX_FX_FILTERQ, xg_filterQ}, ··· 359 357 }; 360 358 361 359 int 362 - snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param) 360 + snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan, 361 + int param) 363 362 { 364 363 return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects), 365 364 port, chan, param, ··· 372 369 * receive sysex 373 370 */ 374 371 void 375 - snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset) 372 + snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed, 373 + struct snd_midi_channel_set *chset) 376 374 { 377 - snd_emux_port_t *port; 378 - snd_emux_t *emu; 375 + struct snd_emux_port *port; 376 + struct snd_emux *emu; 379 377 380 378 port = p; 381 379 snd_assert(port != NULL, return);
+48 -42
sound/synth/emux/emux_oss.c
··· 31 31 #include "emux_voice.h" 32 32 #include <sound/asoundef.h> 33 33 34 - static int snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure); 35 - static int snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg); 36 - static int snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg); 37 - static int snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count); 38 - static int snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg); 39 - static int snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop); 40 - static void reset_port_mode(snd_emux_port_t *port, int midi_mode); 41 - static void emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop); 42 - static void gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop); 43 - static void fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop); 34 + static int snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure); 35 + static int snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg); 36 + static int snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, 37 + unsigned long ioarg); 38 + static int snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format, 39 + const char __user *buf, int offs, int count); 40 + static int snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg); 41 + static int snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, 42 + void *private, int atomic, int hop); 43 + static void reset_port_mode(struct snd_emux_port *port, int midi_mode); 44 + static void emuspec_control(struct snd_emux *emu, struct snd_emux_port *port, 45 + int cmd, unsigned char *event, int atomic, int hop); 46 + static void gusspec_control(struct snd_emux *emu, struct snd_emux_port *port, 47 + int cmd, unsigned char *event, int atomic, int hop); 48 + static void fake_event(struct snd_emux *emu, struct snd_emux_port *port, 49 + int ch, int param, int val, int atomic, int hop); 44 50 45 51 /* operators */ 46 - static snd_seq_oss_callback_t oss_callback = { 52 + static struct snd_seq_oss_callback oss_callback = { 47 53 .owner = THIS_MODULE, 48 54 .open = snd_emux_open_seq_oss, 49 55 .close = snd_emux_close_seq_oss, ··· 64 58 */ 65 59 66 60 void 67 - snd_emux_init_seq_oss(snd_emux_t *emu) 61 + snd_emux_init_seq_oss(struct snd_emux *emu) 68 62 { 69 - snd_seq_oss_reg_t *arg; 70 - snd_seq_device_t *dev; 63 + struct snd_seq_oss_reg *arg; 64 + struct snd_seq_device *dev; 71 65 72 66 if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS, 73 - sizeof(snd_seq_oss_reg_t), &dev) < 0) 67 + sizeof(struct snd_seq_oss_reg), &dev) < 0) 74 68 return; 75 69 76 70 emu->oss_synth = dev; ··· 91 85 * unregister 92 86 */ 93 87 void 94 - snd_emux_detach_seq_oss(snd_emux_t *emu) 88 + snd_emux_detach_seq_oss(struct snd_emux *emu) 95 89 { 96 90 if (emu->oss_synth) { 97 91 snd_device_free(emu->card, emu->oss_synth); ··· 107 101 * open port for OSS sequencer 108 102 */ 109 103 static int 110 - snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure) 104 + snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure) 111 105 { 112 - snd_emux_t *emu; 113 - snd_emux_port_t *p; 114 - snd_seq_port_callback_t callback; 106 + struct snd_emux *emu; 107 + struct snd_emux_port *p; 108 + struct snd_seq_port_callback callback; 115 109 char tmpname[64]; 116 110 117 111 emu = closure; ··· 159 153 * reset port mode 160 154 */ 161 155 static void 162 - reset_port_mode(snd_emux_port_t *port, int midi_mode) 156 + reset_port_mode(struct snd_emux_port *port, int midi_mode) 163 157 { 164 158 if (midi_mode) { 165 159 port->port_mode = SNDRV_EMUX_PORT_MODE_OSS_MIDI; ··· 179 173 * close port 180 174 */ 181 175 static int 182 - snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg) 176 + snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg) 183 177 { 184 - snd_emux_t *emu; 185 - snd_emux_port_t *p; 178 + struct snd_emux *emu; 179 + struct snd_emux_port *p; 186 180 187 181 snd_assert(arg != NULL, return -ENXIO); 188 182 p = arg->private_data; ··· 206 200 * load patch 207 201 */ 208 202 static int 209 - snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, 203 + snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format, 210 204 const char __user *buf, int offs, int count) 211 205 { 212 - snd_emux_t *emu; 213 - snd_emux_port_t *p; 206 + struct snd_emux *emu; 207 + struct snd_emux_port *p; 214 208 int rc; 215 209 216 210 snd_assert(arg != NULL, return -ENXIO); ··· 224 218 rc = snd_soundfont_load_guspatch(emu->sflist, buf, count, 225 219 SF_CLIENT_NO(p->chset.port)); 226 220 else if (format == SNDRV_OSS_SOUNDFONT_PATCH) { 227 - soundfont_patch_info_t patch; 221 + struct soundfont_patch_info patch; 228 222 if (count < (int)sizeof(patch)) 229 223 rc = -EINVAL; 230 224 if (copy_from_user(&patch, buf, sizeof(patch))) ··· 248 242 * ioctl 249 243 */ 250 244 static int 251 - snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg) 245 + snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, unsigned long ioarg) 252 246 { 253 - snd_emux_port_t *p; 254 - snd_emux_t *emu; 247 + struct snd_emux_port *p; 248 + struct snd_emux *emu; 255 249 256 250 snd_assert(arg != NULL, return -ENXIO); 257 251 p = arg->private_data; ··· 279 273 * reset device 280 274 */ 281 275 static int 282 - snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg) 276 + snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg) 283 277 { 284 - snd_emux_port_t *p; 278 + struct snd_emux_port *p; 285 279 286 280 snd_assert(arg != NULL, return -ENXIO); 287 281 p = arg->private_data; ··· 295 289 * receive raw events: only SEQ_PRIVATE is accepted. 296 290 */ 297 291 static int 298 - snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data, 292 + snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, void *private_data, 299 293 int atomic, int hop) 300 294 { 301 - snd_emux_t *emu; 302 - snd_emux_port_t *p; 295 + struct snd_emux *emu; 296 + struct snd_emux_port *p; 303 297 unsigned char cmd, *data; 304 298 305 299 p = private_data; ··· 326 320 * OSS/AWE driver specific h/w controls 327 321 */ 328 322 static void 329 - emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, 323 + emuspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd, 330 324 unsigned char *event, int atomic, int hop) 331 325 { 332 326 int voice; 333 327 unsigned short p1; 334 328 short p2; 335 329 int i; 336 - snd_midi_channel_t *chan; 330 + struct snd_midi_channel *chan; 337 331 338 332 voice = event[3]; 339 333 if (voice < 0 || voice >= port->chset.max_channels) ··· 421 415 #include <linux/ultrasound.h> 422 416 423 417 static void 424 - gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, 418 + gusspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd, 425 419 unsigned char *event, int atomic, int hop) 426 420 { 427 421 int voice; 428 422 unsigned short p1; 429 423 short p2; 430 424 int plong; 431 - snd_midi_channel_t *chan; 425 + struct snd_midi_channel *chan; 432 426 433 427 if (port->port_mode != SNDRV_EMUX_PORT_MODE_OSS_SYNTH) 434 428 return; ··· 489 483 * send an event to midi emulation 490 484 */ 491 485 static void 492 - fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop) 486 + fake_event(struct snd_emux *emu, struct snd_emux_port *port, int ch, int param, int val, int atomic, int hop) 493 487 { 494 - snd_seq_event_t ev; 488 + struct snd_seq_event ev; 495 489 memset(&ev, 0, sizeof(ev)); 496 490 ev.type = SNDRV_SEQ_EVENT_CONTROLLER; 497 491 ev.data.control.channel = ch;
+7 -7
sound/synth/emux/emux_proc.c
··· 30 30 #ifdef CONFIG_PROC_FS 31 31 32 32 static void 33 - snd_emux_proc_info_read(snd_info_entry_t *entry, 34 - snd_info_buffer_t *buf) 33 + snd_emux_proc_info_read(struct snd_info_entry *entry, 34 + struct snd_info_buffer *buf) 35 35 { 36 - snd_emux_t *emu; 36 + struct snd_emux *emu; 37 37 int i; 38 38 39 39 emu = entry->private_data; ··· 66 66 } 67 67 #if 0 /* debug */ 68 68 if (emu->voices[0].state != SNDRV_EMUX_ST_OFF && emu->voices[0].ch >= 0) { 69 - snd_emux_voice_t *vp = &emu->voices[0]; 69 + struct snd_emux_voice *vp = &emu->voices[0]; 70 70 snd_iprintf(buf, "voice 0: on\n"); 71 71 snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n", 72 72 vp->reg.parm.moddelay, ··· 107 107 } 108 108 109 109 110 - void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device) 110 + void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device) 111 111 { 112 - snd_info_entry_t *entry; 112 + struct snd_info_entry *entry; 113 113 char name[64]; 114 114 115 115 sprintf(name, "wavetableD%d", device); ··· 127 127 emu->proc = entry; 128 128 } 129 129 130 - void snd_emux_proc_free(snd_emux_t *emu) 130 + void snd_emux_proc_free(struct snd_emux *emu) 131 131 { 132 132 if (emu->proc) { 133 133 snd_info_unregister(emu->proc);
+37 -37
sound/synth/emux/emux_seq.c
··· 25 25 26 26 /* Prototypes for static functions */ 27 27 static void free_port(void *private); 28 - static void snd_emux_init_port(snd_emux_port_t *p); 29 - static int snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info); 30 - static int snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info); 31 - static int get_client(snd_card_t *card, int index, char *name); 28 + static void snd_emux_init_port(struct snd_emux_port *p); 29 + static int snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info); 30 + static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info); 31 + static int get_client(struct snd_card *card, int index, char *name); 32 32 33 33 /* 34 34 * MIDI emulation operators 35 35 */ 36 - static snd_midi_op_t emux_ops = { 36 + static struct snd_midi_op emux_ops = { 37 37 snd_emux_note_on, 38 38 snd_emux_note_off, 39 39 snd_emux_key_press, ··· 65 65 * can connect to these ports to play midi data. 66 66 */ 67 67 int 68 - snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index) 68 + snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index) 69 69 { 70 70 int i; 71 - snd_seq_port_callback_t pinfo; 71 + struct snd_seq_port_callback pinfo; 72 72 char tmpname[64]; 73 73 74 74 sprintf(tmpname, "%s WaveTable", emu->name); ··· 94 94 pinfo.event_input = snd_emux_event_input; 95 95 96 96 for (i = 0; i < emu->num_ports; i++) { 97 - snd_emux_port_t *p; 97 + struct snd_emux_port *p; 98 98 99 99 sprintf(tmpname, "%s Port %d", emu->name, i); 100 100 p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS, ··· 119 119 * destroy the kernel client. 120 120 */ 121 121 void 122 - snd_emux_detach_seq(snd_emux_t *emu) 122 + snd_emux_detach_seq(struct snd_emux *emu) 123 123 { 124 124 if (emu->voices) 125 125 snd_emux_terminate_all(emu); ··· 137 137 * create a sequencer port and channel_set 138 138 */ 139 139 140 - snd_emux_port_t * 141 - snd_emux_create_port(snd_emux_t *emu, char *name, 142 - int max_channels, int oss_port, 143 - snd_seq_port_callback_t *callback) 140 + struct snd_emux_port * 141 + snd_emux_create_port(struct snd_emux *emu, char *name, 142 + int max_channels, int oss_port, 143 + struct snd_seq_port_callback *callback) 144 144 { 145 - snd_emux_port_t *p; 145 + struct snd_emux_port *p; 146 146 int i, type, cap; 147 147 148 148 /* Allocate structures for this channel */ ··· 150 150 snd_printk("no memory\n"); 151 151 return NULL; 152 152 } 153 - p->chset.channels = kcalloc(max_channels, sizeof(snd_midi_channel_t), GFP_KERNEL); 153 + p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL); 154 154 if (p->chset.channels == NULL) { 155 155 snd_printk("no memory\n"); 156 156 kfree(p); ··· 190 190 static void 191 191 free_port(void *private_data) 192 192 { 193 - snd_emux_port_t *p; 193 + struct snd_emux_port *p; 194 194 195 195 p = private_data; 196 196 if (p) { ··· 209 209 * initialize the port specific parameters 210 210 */ 211 211 static void 212 - snd_emux_init_port(snd_emux_port_t *p) 212 + snd_emux_init_port(struct snd_emux_port *p) 213 213 { 214 214 p->drum_flags = DEFAULT_DRUM_FLAGS; 215 215 p->volume_atten = 0; ··· 222 222 * reset port 223 223 */ 224 224 void 225 - snd_emux_reset_port(snd_emux_port_t *port) 225 + snd_emux_reset_port(struct snd_emux_port *port) 226 226 { 227 227 int i; 228 228 ··· 241 241 port->ctrls[EMUX_MD_REALTIME_PAN] = 1; 242 242 243 243 for (i = 0; i < port->chset.max_channels; i++) { 244 - snd_midi_channel_t *chan = port->chset.channels + i; 244 + struct snd_midi_channel *chan = port->chset.channels + i; 245 245 chan->drum_channel = ((port->drum_flags >> i) & 1) ? 1 : 0; 246 246 } 247 247 } ··· 251 251 * input sequencer event 252 252 */ 253 253 int 254 - snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data, 254 + snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data, 255 255 int atomic, int hop) 256 256 { 257 - snd_emux_port_t *port; 257 + struct snd_emux_port *port; 258 258 259 259 port = private_data; 260 260 snd_assert(port != NULL && ev != NULL, return -EINVAL); ··· 269 269 * increment usage count 270 270 */ 271 271 int 272 - snd_emux_inc_count(snd_emux_t *emu) 272 + snd_emux_inc_count(struct snd_emux *emu) 273 273 { 274 274 emu->used++; 275 275 if (!try_module_get(emu->ops.owner)) ··· 288 288 * decrease usage count 289 289 */ 290 290 void 291 - snd_emux_dec_count(snd_emux_t *emu) 291 + snd_emux_dec_count(struct snd_emux *emu) 292 292 { 293 293 module_put(emu->card->module); 294 294 emu->used--; ··· 302 302 * Routine that is called upon a first use of a particular port 303 303 */ 304 304 static int 305 - snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info) 305 + snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info) 306 306 { 307 - snd_emux_port_t *p; 308 - snd_emux_t *emu; 307 + struct snd_emux_port *p; 308 + struct snd_emux *emu; 309 309 310 310 p = private_data; 311 311 snd_assert(p != NULL, return -EINVAL); ··· 323 323 * Routine that is called upon the last unuse() of a particular port. 324 324 */ 325 325 static int 326 - snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info) 326 + snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info) 327 327 { 328 - snd_emux_port_t *p; 329 - snd_emux_t *emu; 328 + struct snd_emux_port *p; 329 + struct snd_emux *emu; 330 330 331 331 p = private_data; 332 332 snd_assert(p != NULL, return -EINVAL); ··· 345 345 * Create a sequencer client 346 346 */ 347 347 static int 348 - get_client(snd_card_t *card, int index, char *name) 348 + get_client(struct snd_card *card, int index, char *name) 349 349 { 350 - snd_seq_client_callback_t callbacks; 351 - snd_seq_client_info_t cinfo; 350 + struct snd_seq_client_callback callbacks; 351 + struct snd_seq_client_info cinfo; 352 352 int client; 353 353 354 354 memset(&callbacks, 0, sizeof(callbacks)); ··· 374 374 /* 375 375 * attach virtual rawmidi devices 376 376 */ 377 - int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card) 377 + int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card) 378 378 { 379 379 int i; 380 380 ··· 382 382 if (emu->midi_ports <= 0) 383 383 return 0; 384 384 385 - emu->vmidi = kcalloc(emu->midi_ports, sizeof(snd_rawmidi_t*), GFP_KERNEL); 385 + emu->vmidi = kcalloc(emu->midi_ports, sizeof(struct snd_rawmidi *), GFP_KERNEL); 386 386 if (emu->vmidi == NULL) 387 387 return -ENOMEM; 388 388 389 389 for (i = 0; i < emu->midi_ports; i++) { 390 - snd_rawmidi_t *rmidi; 391 - snd_virmidi_dev_t *rdev; 390 + struct snd_rawmidi *rmidi; 391 + struct snd_virmidi_dev *rdev; 392 392 if (snd_virmidi_new(card, emu->midi_devidx + i, &rmidi) < 0) 393 393 goto __error; 394 394 rdev = rmidi->private_data; ··· 411 411 return -ENOMEM; 412 412 } 413 413 414 - int snd_emux_delete_virmidi(snd_emux_t *emu) 414 + int snd_emux_delete_virmidi(struct snd_emux *emu) 415 415 { 416 416 int i; 417 417
+72 -67
sound/synth/emux/emux_synth.c
··· 36 36 #define LIMITVALUE(x, a, b) do { if ((x) < (a)) (x) = (a); else if ((x) > (b)) (x) = (b); } while (0) 37 37 #define LIMITMAX(x, a) do {if ((x) > (a)) (x) = (a); } while (0) 38 38 39 - 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); 40 - static int get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan); 41 - static void terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free); 42 - static void exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass); 43 - static void terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free); 44 - static void update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update); 45 - static void setup_voice(snd_emux_voice_t *vp); 46 - static int calc_pan(snd_emux_voice_t *vp); 47 - static int calc_volume(snd_emux_voice_t *vp); 48 - static int calc_pitch(snd_emux_voice_t *vp); 39 + static int get_zone(struct snd_emux *emu, struct snd_emux_port *port, 40 + int *notep, int vel, struct snd_midi_channel *chan, 41 + struct snd_sf_zone **table); 42 + static int get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan); 43 + static void terminate_note1(struct snd_emux *emu, int note, 44 + struct snd_midi_channel *chan, int free); 45 + static void exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port, 46 + int exclass); 47 + static void terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free); 48 + static void update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update); 49 + static void setup_voice(struct snd_emux_voice *vp); 50 + static int calc_pan(struct snd_emux_voice *vp); 51 + static int calc_volume(struct snd_emux_voice *vp); 52 + static int calc_pitch(struct snd_emux_voice *vp); 49 53 50 54 51 55 /* 52 56 * Start a note. 53 57 */ 54 58 void 55 - snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) 59 + snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan) 56 60 { 57 - snd_emux_t *emu; 61 + struct snd_emux *emu; 58 62 int i, key, nvoices; 59 - snd_emux_voice_t *vp; 60 - snd_sf_zone_t *table[SNDRV_EMUX_MAX_MULTI_VOICES]; 63 + struct snd_emux_voice *vp; 64 + struct snd_sf_zone *table[SNDRV_EMUX_MAX_MULTI_VOICES]; 61 65 unsigned long flags; 62 - snd_emux_port_t *port; 66 + struct snd_emux_port *port; 63 67 64 68 port = p; 65 69 snd_assert(port != NULL && chan != NULL, return); ··· 80 76 81 77 /* exclusive note off */ 82 78 for (i = 0; i < nvoices; i++) { 83 - snd_sf_zone_t *zp = table[i]; 79 + struct snd_sf_zone *zp = table[i]; 84 80 if (zp && zp->v.exclusiveClass) 85 81 exclusive_note_off(emu, port, zp->v.exclusiveClass); 86 82 } ··· 142 138 #ifdef SNDRV_EMUX_USE_RAW_EFFECT 143 139 if (port->port_mode == SNDRV_EMUX_PORT_MODE_OSS_SYNTH) { 144 140 /* clear voice position for the next note on this channel */ 145 - snd_emux_effect_table_t *fx = chan->private; 141 + struct snd_emux_effect_table *fx = chan->private; 146 142 if (fx) { 147 143 fx->flag[EMUX_FX_SAMPLE_START] = 0; 148 144 fx->flag[EMUX_FX_COARSE_SAMPLE_START] = 0; ··· 155 151 * Release a note in response to a midi note off. 156 152 */ 157 153 void 158 - snd_emux_note_off(void *p, int note, int vel, snd_midi_channel_t *chan) 154 + snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan) 159 155 { 160 156 int ch; 161 - snd_emux_t *emu; 162 - snd_emux_voice_t *vp; 157 + struct snd_emux *emu; 158 + struct snd_emux_voice *vp; 163 159 unsigned long flags; 164 - snd_emux_port_t *port; 160 + struct snd_emux_port *port; 165 161 166 162 port = p; 167 163 snd_assert(port != NULL && chan != NULL, return); ··· 203 199 */ 204 200 void snd_emux_timer_callback(unsigned long data) 205 201 { 206 - snd_emux_t *emu = (snd_emux_t*) data; 207 - snd_emux_voice_t *vp; 202 + struct snd_emux *emu = (struct snd_emux *) data; 203 + struct snd_emux_voice *vp; 208 204 int ch, do_again = 0; 209 205 210 206 spin_lock(&emu->voice_lock); ··· 232 228 * key pressure change 233 229 */ 234 230 void 235 - snd_emux_key_press(void *p, int note, int vel, snd_midi_channel_t *chan) 231 + snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan) 236 232 { 237 233 int ch; 238 - snd_emux_t *emu; 239 - snd_emux_voice_t *vp; 234 + struct snd_emux *emu; 235 + struct snd_emux_voice *vp; 240 236 unsigned long flags; 241 - snd_emux_port_t *port; 237 + struct snd_emux_port *port; 242 238 243 239 port = p; 244 240 snd_assert(port != NULL && chan != NULL, return); ··· 264 260 * Modulate the voices which belong to the channel 265 261 */ 266 262 void 267 - snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update) 263 + snd_emux_update_channel(struct snd_emux_port *port, struct snd_midi_channel *chan, int update) 268 264 { 269 - snd_emux_t *emu; 270 - snd_emux_voice_t *vp; 265 + struct snd_emux *emu; 266 + struct snd_emux_voice *vp; 271 267 int i; 272 268 unsigned long flags; 273 269 ··· 291 287 * Modulate all the voices which belong to the port. 292 288 */ 293 289 void 294 - snd_emux_update_port(snd_emux_port_t *port, int update) 290 + snd_emux_update_port(struct snd_emux_port *port, int update) 295 291 { 296 - snd_emux_t *emu; 297 - snd_emux_voice_t *vp; 292 + struct snd_emux *emu; 293 + struct snd_emux_voice *vp; 298 294 int i; 299 295 unsigned long flags; 300 296 ··· 320 316 * control events, not just the midi controllers 321 317 */ 322 318 void 323 - snd_emux_control(void *p, int type, snd_midi_channel_t *chan) 319 + snd_emux_control(void *p, int type, struct snd_midi_channel *chan) 324 320 { 325 - snd_emux_port_t *port; 321 + struct snd_emux_port *port; 326 322 327 323 port = p; 328 324 snd_assert(port != NULL && chan != NULL, return); ··· 368 364 * terminate note - if free flag is true, free the terminated voice 369 365 */ 370 366 static void 371 - terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free) 367 + terminate_note1(struct snd_emux *emu, int note, struct snd_midi_channel *chan, int free) 372 368 { 373 369 int i; 374 - snd_emux_voice_t *vp; 370 + struct snd_emux_voice *vp; 375 371 unsigned long flags; 376 372 377 373 spin_lock_irqsave(&emu->voice_lock, flags); ··· 389 385 * terminate note - exported for midi emulation 390 386 */ 391 387 void 392 - snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan) 388 + snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan) 393 389 { 394 - snd_emux_t *emu; 395 - snd_emux_port_t *port; 390 + struct snd_emux *emu; 391 + struct snd_emux_port *port; 396 392 397 393 port = p; 398 394 snd_assert(port != NULL && chan != NULL, return); ··· 409 405 * Terminate all the notes 410 406 */ 411 407 void 412 - snd_emux_terminate_all(snd_emux_t *emu) 408 + snd_emux_terminate_all(struct snd_emux *emu) 413 409 { 414 410 int i; 415 - snd_emux_voice_t *vp; 411 + struct snd_emux_voice *vp; 416 412 unsigned long flags; 417 413 418 414 spin_lock_irqsave(&emu->voice_lock, flags); ··· 438 434 * Terminate all voices associated with the given port 439 435 */ 440 436 void 441 - snd_emux_sounds_off_all(snd_emux_port_t *port) 437 + snd_emux_sounds_off_all(struct snd_emux_port *port) 442 438 { 443 439 int i; 444 - snd_emux_t *emu; 445 - snd_emux_voice_t *vp; 440 + struct snd_emux *emu; 441 + struct snd_emux_voice *vp; 446 442 unsigned long flags; 447 443 448 444 snd_assert(port != NULL, return); ··· 472 468 * is mainly for drums. 473 469 */ 474 470 static void 475 - exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass) 471 + exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port, int exclass) 476 472 { 477 - snd_emux_voice_t *vp; 473 + struct snd_emux_voice *vp; 478 474 int i; 479 475 unsigned long flags; 480 476 ··· 494 490 * if free flag is true, call free_voice after termination 495 491 */ 496 492 static void 497 - terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free) 493 + terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free) 498 494 { 499 495 emu->ops.terminate(vp); 500 496 vp->time = emu->use_time++; ··· 512 508 * Modulate the voice 513 509 */ 514 510 static void 515 - update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update) 511 + update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update) 516 512 { 517 513 if (!STATE_IS_PLAYING(vp->state)) 518 514 return; ··· 547 543 * will be needed later. 548 544 */ 549 545 static void 550 - setup_voice(snd_emux_voice_t *vp) 546 + setup_voice(struct snd_emux_voice *vp) 551 547 { 552 - soundfont_voice_parm_t *parm; 548 + struct soundfont_voice_parm *parm; 553 549 int pitch; 554 550 555 551 /* copy the original register values */ ··· 640 636 }; 641 637 642 638 static int 643 - calc_pan(snd_emux_voice_t *vp) 639 + calc_pan(struct snd_emux_voice *vp) 644 640 { 645 - snd_midi_channel_t *chan = vp->chan; 641 + struct snd_midi_channel *chan = vp->chan; 646 642 int pan; 647 643 648 644 /* pan & loop start (pan 8bit, MSB, 0:right, 0xff:left) */ ··· 741 737 * voice and channels parameters. 742 738 */ 743 739 static int 744 - calc_volume(snd_emux_voice_t *vp) 740 + calc_volume(struct snd_emux_voice *vp) 745 741 { 746 742 int vol; 747 743 int main_vol, expression_vol, master_vol; 748 - snd_midi_channel_t *chan = vp->chan; 749 - snd_emux_port_t *port = vp->port; 744 + struct snd_midi_channel *chan = vp->chan; 745 + struct snd_emux_port *port = vp->port; 750 746 751 747 expression_vol = chan->control[MIDI_CTL_MSB_EXPRESSION]; 752 748 LIMITMAX(vp->velocity, 127); ··· 779 775 780 776 #ifdef SNDRV_EMUX_USE_RAW_EFFECT 781 777 if (chan->private) { 782 - snd_emux_effect_table_t *fx = chan->private; 778 + struct snd_emux_effect_table *fx = chan->private; 783 779 vol += fx->val[EMUX_FX_ATTEN]; 784 780 } 785 781 #endif ··· 812 808 */ 813 809 814 810 static int 815 - calc_pitch(snd_emux_voice_t *vp) 811 + calc_pitch(struct snd_emux_voice *vp) 816 812 { 817 - snd_midi_channel_t *chan = vp->chan; 813 + struct snd_midi_channel *chan = vp->chan; 818 814 int offset; 819 815 820 816 /* calculate offset */ ··· 841 837 #ifdef SNDRV_EMUX_USE_RAW_EFFECT 842 838 /* add initial pitch correction */ 843 839 if (chan->private) { 844 - snd_emux_effect_table_t *fx = chan->private; 840 + struct snd_emux_effect_table *fx = chan->private; 845 841 if (fx->flag[EMUX_FX_INIT_PITCH]) 846 842 offset += fx->val[EMUX_FX_INIT_PITCH]; 847 843 } ··· 861 857 * Get the bank number assigned to the channel 862 858 */ 863 859 static int 864 - get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan) 860 + get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan) 865 861 { 866 862 int val; 867 863 ··· 890 886 * The resultant zones are stored on table. 891 887 */ 892 888 static int 893 - get_zone(snd_emux_t *emu, snd_emux_port_t *port, 894 - int *notep, int vel, snd_midi_channel_t *chan, snd_sf_zone_t **table) 889 + get_zone(struct snd_emux *emu, struct snd_emux_port *port, 890 + int *notep, int vel, struct snd_midi_channel *chan, 891 + struct snd_sf_zone **table) 895 892 { 896 893 int preset, bank, def_preset, def_bank; 897 894 ··· 915 910 /* 916 911 */ 917 912 void 918 - snd_emux_init_voices(snd_emux_t *emu) 913 + snd_emux_init_voices(struct snd_emux *emu) 919 914 { 920 - snd_emux_voice_t *vp; 915 + struct snd_emux_voice *vp; 921 916 int i; 922 917 unsigned long flags; 923 918 ··· 937 932 938 933 /* 939 934 */ 940 - void snd_emux_lock_voice(snd_emux_t *emu, int voice) 935 + void snd_emux_lock_voice(struct snd_emux *emu, int voice) 941 936 { 942 937 unsigned long flags; 943 938 ··· 952 947 953 948 /* 954 949 */ 955 - void snd_emux_unlock_voice(snd_emux_t *emu, int voice) 950 + void snd_emux_unlock_voice(struct snd_emux *emu, int voice) 956 951 { 957 952 unsigned long flags; 958 953
+38 -29
sound/synth/emux/emux_voice.h
··· 29 29 #include <sound/emux_synth.h> 30 30 31 31 /* Prototypes for emux_seq.c */ 32 - int snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index); 33 - void snd_emux_detach_seq(snd_emux_t *emu); 34 - 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); 35 - void snd_emux_reset_port(snd_emux_port_t *port); 36 - int snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop); 37 - int snd_emux_inc_count(snd_emux_t *emu); 38 - void snd_emux_dec_count(snd_emux_t *emu); 39 - int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card); 40 - int snd_emux_delete_virmidi(snd_emux_t *emu); 32 + int snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index); 33 + void snd_emux_detach_seq(struct snd_emux *emu); 34 + struct snd_emux_port *snd_emux_create_port(struct snd_emux *emu, char *name, 35 + int max_channels, int type, 36 + struct snd_seq_port_callback *callback); 37 + void snd_emux_reset_port(struct snd_emux_port *port); 38 + int snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private, 39 + int atomic, int hop); 40 + int snd_emux_inc_count(struct snd_emux *emu); 41 + void snd_emux_dec_count(struct snd_emux *emu); 42 + int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card); 43 + int snd_emux_delete_virmidi(struct snd_emux *emu); 41 44 42 45 /* Prototypes for emux_synth.c */ 43 - void snd_emux_init_voices(snd_emux_t *emu); 46 + void snd_emux_init_voices(struct snd_emux *emu); 44 47 45 48 void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan); 46 49 void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan); 47 50 void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan); 48 - void snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan); 51 + void snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan); 49 52 void snd_emux_control(void *p, int type, struct snd_midi_channel *chan); 50 53 51 - void snd_emux_sounds_off_all(snd_emux_port_t *port); 52 - void snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update); 53 - void snd_emux_update_port(snd_emux_port_t *port, int update); 54 + void snd_emux_sounds_off_all(struct snd_emux_port *port); 55 + void snd_emux_update_channel(struct snd_emux_port *port, 56 + struct snd_midi_channel *chan, int update); 57 + void snd_emux_update_port(struct snd_emux_port *port, int update); 54 58 55 59 void snd_emux_timer_callback(unsigned long data); 56 60 57 61 /* emux_effect.c */ 58 62 #ifdef SNDRV_EMUX_USE_RAW_EFFECT 59 - void snd_emux_create_effect(snd_emux_port_t *p); 60 - void snd_emux_delete_effect(snd_emux_port_t *p); 61 - void snd_emux_clear_effect(snd_emux_port_t *p); 62 - void snd_emux_setup_effect(snd_emux_voice_t *vp); 63 - void snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val); 64 - void snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode); 63 + void snd_emux_create_effect(struct snd_emux_port *p); 64 + void snd_emux_delete_effect(struct snd_emux_port *p); 65 + void snd_emux_clear_effect(struct snd_emux_port *p); 66 + void snd_emux_setup_effect(struct snd_emux_voice *vp); 67 + void snd_emux_send_effect_oss(struct snd_emux_port *port, 68 + struct snd_midi_channel *chan, int type, int val); 69 + void snd_emux_send_effect(struct snd_emux_port *port, 70 + struct snd_midi_channel *chan, int type, int val, int mode); 65 71 #endif 66 72 67 73 /* emux_nrpn.c */ 68 - void snd_emux_sysex(void *private_data, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 69 - int snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param); 70 - void snd_emux_nrpn(void *private_data, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); 74 + void snd_emux_sysex(void *private_data, unsigned char *buf, int len, 75 + int parsed, struct snd_midi_channel_set *chset); 76 + int snd_emux_xg_control(struct snd_emux_port *port, 77 + struct snd_midi_channel *chan, int param); 78 + void snd_emux_nrpn(void *private_data, struct snd_midi_channel *chan, 79 + struct snd_midi_channel_set *chset); 71 80 72 81 /* emux_oss.c */ 73 - void snd_emux_init_seq_oss(snd_emux_t *emu); 74 - void snd_emux_detach_seq_oss(snd_emux_t *emu); 82 + void snd_emux_init_seq_oss(struct snd_emux *emu); 83 + void snd_emux_detach_seq_oss(struct snd_emux *emu); 75 84 76 85 /* emux_proc.c */ 77 86 #ifdef CONFIG_PROC_FS 78 - void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device); 79 - void snd_emux_proc_free(snd_emux_t *emu); 87 + void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device); 88 + void snd_emux_proc_free(struct snd_emux *emu); 80 89 #endif 81 90 82 91 #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON) 83 92 84 93 /* emux_hwdep.c */ 85 - int snd_emux_init_hwdep(snd_emux_t *emu); 86 - void snd_emux_delete_hwdep(snd_emux_t *emu); 94 + int snd_emux_init_hwdep(struct snd_emux *emu); 95 + void snd_emux_delete_hwdep(struct snd_emux *emu); 87 96 88 97 #endif
+137 -111
sound/synth/emux/soundfont.c
··· 34 34 35 35 /* Prototypes for static functions */ 36 36 37 - static int open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client); 38 - static snd_soundfont_t *newsf(snd_sf_list_t *sflist, int type, char *name); 39 - static int is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name); 40 - static int close_patch(snd_sf_list_t *sflist); 41 - static int probe_data(snd_sf_list_t *sflist, int sample_id); 42 - static void set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp); 43 - static snd_sf_zone_t *sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf); 44 - static void set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp); 45 - static snd_sf_sample_t *sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf); 46 - static void sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp); 47 - static int load_map(snd_sf_list_t *sflist, const void __user *data, int count); 48 - static int load_info(snd_sf_list_t *sflist, const void __user *data, long count); 49 - static int remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr); 50 - static void init_voice_info(soundfont_voice_info_t *avp); 51 - static void init_voice_parm(soundfont_voice_parm_t *pp); 52 - static snd_sf_sample_t *set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp); 53 - static snd_sf_sample_t *find_sample(snd_soundfont_t *sf, int sample_id); 54 - static int load_data(snd_sf_list_t *sflist, const void __user *data, long count); 55 - static void rebuild_presets(snd_sf_list_t *sflist); 56 - static void add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur); 57 - static void delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp); 58 - static snd_sf_zone_t *search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key); 59 - 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); 37 + static int open_patch(struct snd_sf_list *sflist, const char __user *data, 38 + int count, int client); 39 + static struct snd_soundfont *newsf(struct snd_sf_list *sflist, int type, char *name); 40 + static int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name); 41 + static int close_patch(struct snd_sf_list *sflist); 42 + static int probe_data(struct snd_sf_list *sflist, int sample_id); 43 + static void set_zone_counter(struct snd_sf_list *sflist, 44 + struct snd_soundfont *sf, struct snd_sf_zone *zp); 45 + static struct snd_sf_zone *sf_zone_new(struct snd_sf_list *sflist, 46 + struct snd_soundfont *sf); 47 + static void set_sample_counter(struct snd_sf_list *sflist, 48 + struct snd_soundfont *sf, struct snd_sf_sample *sp); 49 + static struct snd_sf_sample *sf_sample_new(struct snd_sf_list *sflist, 50 + struct snd_soundfont *sf); 51 + static void sf_sample_delete(struct snd_sf_list *sflist, 52 + struct snd_soundfont *sf, struct snd_sf_sample *sp); 53 + static int load_map(struct snd_sf_list *sflist, const void __user *data, int count); 54 + static int load_info(struct snd_sf_list *sflist, const void __user *data, long count); 55 + static int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf, 56 + int bank, int instr); 57 + static void init_voice_info(struct soundfont_voice_info *avp); 58 + static void init_voice_parm(struct soundfont_voice_parm *pp); 59 + static struct snd_sf_sample *set_sample(struct snd_soundfont *sf, 60 + struct soundfont_voice_info *avp); 61 + static struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id); 62 + static int load_data(struct snd_sf_list *sflist, const void __user *data, long count); 63 + static void rebuild_presets(struct snd_sf_list *sflist); 64 + static void add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur); 65 + static void delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp); 66 + static struct snd_sf_zone *search_first_zone(struct snd_sf_list *sflist, 67 + int bank, int preset, int key); 68 + static int search_zones(struct snd_sf_list *sflist, int *notep, int vel, 69 + int preset, int bank, struct snd_sf_zone **table, 70 + int max_layers, int level); 60 71 static int get_index(int bank, int instr, int key); 61 - static void snd_sf_init(snd_sf_list_t *sflist); 62 - static void snd_sf_clear(snd_sf_list_t *sflist); 72 + static void snd_sf_init(struct snd_sf_list *sflist); 73 + static void snd_sf_clear(struct snd_sf_list *sflist); 63 74 64 75 /* 65 76 * lock access to sflist 66 77 */ 67 78 static void 68 - lock_preset(snd_sf_list_t *sflist) 79 + lock_preset(struct snd_sf_list *sflist) 69 80 { 70 81 unsigned long flags; 71 82 down(&sflist->presets_mutex); ··· 90 79 * remove lock 91 80 */ 92 81 static void 93 - unlock_preset(snd_sf_list_t *sflist) 82 + unlock_preset(struct snd_sf_list *sflist) 94 83 { 95 84 unsigned long flags; 96 85 spin_lock_irqsave(&sflist->lock, flags); ··· 104 93 * close the patch if the patch was opened by this client. 105 94 */ 106 95 int 107 - snd_soundfont_close_check(snd_sf_list_t *sflist, int client) 96 + snd_soundfont_close_check(struct snd_sf_list *sflist, int client) 108 97 { 109 98 unsigned long flags; 110 99 spin_lock_irqsave(&sflist->lock, flags); ··· 126 115 * it wants to do with it. 127 116 */ 128 117 int 129 - snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client) 118 + snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data, 119 + long count, int client) 130 120 { 131 - soundfont_patch_info_t patch; 121 + struct soundfont_patch_info patch; 132 122 unsigned long flags; 133 123 int rc; 134 124 ··· 227 215 228 216 /* open patch; create sf list */ 229 217 static int 230 - open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client) 218 + open_patch(struct snd_sf_list *sflist, const char __user *data, 219 + int count, int client) 231 220 { 232 - soundfont_open_parm_t parm; 233 - snd_soundfont_t *sf; 221 + struct soundfont_open_parm parm; 222 + struct snd_soundfont *sf; 234 223 unsigned long flags; 235 224 236 225 spin_lock_irqsave(&sflist->lock, flags); ··· 264 251 /* 265 252 * Allocate a new soundfont structure. 266 253 */ 267 - static snd_soundfont_t * 268 - newsf(snd_sf_list_t *sflist, int type, char *name) 254 + static struct snd_soundfont * 255 + newsf(struct snd_sf_list *sflist, int type, char *name) 269 256 { 270 - snd_soundfont_t *sf; 257 + struct snd_soundfont *sf; 271 258 272 259 /* check the shared fonts */ 273 260 if (type & SNDRV_SFNT_PAT_SHARED) { ··· 300 287 301 288 /* check if the given name matches to the existing list */ 302 289 static int 303 - is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name) 290 + is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name) 304 291 { 305 292 return ((sf->type & SNDRV_SFNT_PAT_SHARED) && 306 293 (sf->type & 0x0f) == (type & 0x0f) && ··· 312 299 * Close the current patch. 313 300 */ 314 301 static int 315 - close_patch(snd_sf_list_t *sflist) 302 + close_patch(struct snd_sf_list *sflist) 316 303 { 317 304 unsigned long flags; 318 305 ··· 329 316 330 317 /* probe sample in the current list -- nothing to be loaded */ 331 318 static int 332 - probe_data(snd_sf_list_t *sflist, int sample_id) 319 + probe_data(struct snd_sf_list *sflist, int sample_id) 333 320 { 334 321 /* patch must be opened */ 335 322 if (sflist->currsf) { ··· 344 331 * increment zone counter 345 332 */ 346 333 static void 347 - set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp) 334 + set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, 335 + struct snd_sf_zone *zp) 348 336 { 349 337 zp->counter = sflist->zone_counter++; 350 338 if (sf->type & SNDRV_SFNT_PAT_LOCKED) ··· 355 341 /* 356 342 * allocate a new zone record 357 343 */ 358 - static snd_sf_zone_t * 359 - sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) 344 + static struct snd_sf_zone * 345 + sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) 360 346 { 361 - snd_sf_zone_t *zp; 347 + struct snd_sf_zone *zp; 362 348 363 349 if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL) 364 350 return NULL; ··· 376 362 * increment sample couter 377 363 */ 378 364 static void 379 - set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp) 365 + set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, 366 + struct snd_sf_sample *sp) 380 367 { 381 368 sp->counter = sflist->sample_counter++; 382 369 if (sf->type & SNDRV_SFNT_PAT_LOCKED) ··· 387 372 /* 388 373 * allocate a new sample list record 389 374 */ 390 - static snd_sf_sample_t * 391 - sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) 375 + static struct snd_sf_sample * 376 + sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) 392 377 { 393 - snd_sf_sample_t *sp; 378 + struct snd_sf_sample *sp; 394 379 395 380 if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL) 396 381 return NULL; ··· 407 392 * only the last allocated sample can be deleted. 408 393 */ 409 394 static void 410 - sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp) 395 + sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf, 396 + struct snd_sf_sample *sp) 411 397 { 412 398 /* only last sample is accepted */ 413 399 if (sp == sf->samples) { ··· 420 404 421 405 /* load voice map */ 422 406 static int 423 - load_map(snd_sf_list_t *sflist, const void __user *data, int count) 407 + load_map(struct snd_sf_list *sflist, const void __user *data, int count) 424 408 { 425 - snd_sf_zone_t *zp, *prevp; 426 - snd_soundfont_t *sf; 427 - soundfont_voice_map_t map; 409 + struct snd_sf_zone *zp, *prevp; 410 + struct snd_soundfont *sf; 411 + struct soundfont_voice_map map; 428 412 429 413 /* get the link info */ 430 414 if (count < (int)sizeof(map)) ··· 485 469 486 470 /* remove the present instrument layers */ 487 471 static int 488 - remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr) 472 + remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf, 473 + int bank, int instr) 489 474 { 490 - snd_sf_zone_t *prev, *next, *p; 475 + struct snd_sf_zone *prev, *next, *p; 491 476 int removed = 0; 492 477 493 478 prev = NULL; ··· 517 500 * open soundfont. 518 501 */ 519 502 static int 520 - load_info(snd_sf_list_t *sflist, const void __user *data, long count) 503 + load_info(struct snd_sf_list *sflist, const void __user *data, long count) 521 504 { 522 - snd_soundfont_t *sf; 523 - snd_sf_zone_t *zone; 524 - soundfont_voice_rec_hdr_t hdr; 505 + struct snd_soundfont *sf; 506 + struct snd_sf_zone *zone; 507 + struct soundfont_voice_rec_hdr hdr; 525 508 int i; 526 509 527 510 /* patch must be opened */ ··· 546 529 return -EINVAL; 547 530 } 548 531 549 - if (count < (long)sizeof(soundfont_voice_info_t)*hdr.nvoices) { 532 + if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) { 550 533 printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n", 551 534 count, hdr.nvoices); 552 535 return -EINVAL; ··· 570 553 } 571 554 572 555 for (i = 0; i < hdr.nvoices; i++) { 573 - snd_sf_zone_t tmpzone; 556 + struct snd_sf_zone tmpzone; 574 557 575 558 /* copy awe_voice_info parameters */ 576 559 if (copy_from_user(&tmpzone.v, data, sizeof(tmpzone.v))) { ··· 607 590 608 591 /* initialize voice_info record */ 609 592 static void 610 - init_voice_info(soundfont_voice_info_t *avp) 593 + init_voice_info(struct soundfont_voice_info *avp) 611 594 { 612 595 memset(avp, 0, sizeof(*avp)); 613 596 ··· 631 614 * Chorus and Reverb effects are zero. 632 615 */ 633 616 static void 634 - init_voice_parm(soundfont_voice_parm_t *pp) 617 + init_voice_parm(struct soundfont_voice_parm *pp) 635 618 { 636 619 memset(pp, 0, sizeof(*pp)); 637 620 ··· 652 635 } 653 636 654 637 /* search the specified sample */ 655 - static snd_sf_sample_t * 656 - set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp) 638 + static struct snd_sf_sample * 639 + set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp) 657 640 { 658 - snd_sf_sample_t *sample; 641 + struct snd_sf_sample *sample; 659 642 660 643 sample = find_sample(sf, avp->sample); 661 644 if (sample == NULL) ··· 678 661 } 679 662 680 663 /* find the sample pointer with the given id in the soundfont */ 681 - static snd_sf_sample_t * 682 - find_sample(snd_soundfont_t *sf, int sample_id) 664 + static struct snd_sf_sample * 665 + find_sample(struct snd_soundfont *sf, int sample_id) 683 666 { 684 - snd_sf_sample_t *p; 667 + struct snd_sf_sample *p; 685 668 686 669 if (sf == NULL) 687 670 return NULL; ··· 701 684 * routine. 702 685 */ 703 686 static int 704 - load_data(snd_sf_list_t *sflist, const void __user *data, long count) 687 + load_data(struct snd_sf_list *sflist, const void __user *data, long count) 705 688 { 706 - snd_soundfont_t *sf; 707 - soundfont_sample_info_t sample_info; 708 - snd_sf_sample_t *sp; 689 + struct snd_soundfont *sf; 690 + struct soundfont_sample_info sample_info; 691 + struct snd_sf_sample *sp; 709 692 long off; 710 693 711 694 /* patch must be opened */ ··· 939 922 940 923 /* load GUS patch */ 941 924 static int 942 - load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int client) 925 + load_guspatch(struct snd_sf_list *sflist, const char __user *data, 926 + long count, int client) 943 927 { 944 928 struct patch_info patch; 945 - snd_soundfont_t *sf; 946 - snd_sf_zone_t *zone; 947 - snd_sf_sample_t *smp; 929 + struct snd_soundfont *sf; 930 + struct snd_sf_zone *zone; 931 + struct snd_sf_sample *smp; 948 932 int note, sample_id; 949 933 int rc; 950 934 ··· 1010 992 */ 1011 993 if (sflist->callback.sample_new) { 1012 994 rc = sflist->callback.sample_new 1013 - (sflist->callback.private_data, smp, sflist->memhdr, data, count); 995 + (sflist->callback.private_data, smp, sflist->memhdr, 996 + data, count); 1014 997 if (rc < 0) { 1015 998 sf_sample_delete(sflist, sf, smp); 1016 999 return rc; ··· 1114 1095 1115 1096 /* load GUS patch */ 1116 1097 int 1117 - snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data, 1098 + snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data, 1118 1099 long count, int client) 1119 1100 { 1120 1101 int rc; ··· 1133 1114 * bank/key combination). 1134 1115 */ 1135 1116 static void 1136 - rebuild_presets(snd_sf_list_t *sflist) 1117 + rebuild_presets(struct snd_sf_list *sflist) 1137 1118 { 1138 - snd_soundfont_t *sf; 1139 - snd_sf_zone_t *cur; 1119 + struct snd_soundfont *sf; 1120 + struct snd_sf_zone *cur; 1140 1121 1141 1122 /* clear preset table */ 1142 1123 memset(sflist->presets, 0, sizeof(sflist->presets)); ··· 1161 1142 * add the given zone to preset table 1162 1143 */ 1163 1144 static void 1164 - add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur) 1145 + add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur) 1165 1146 { 1166 - snd_sf_zone_t *zone; 1147 + struct snd_sf_zone *zone; 1167 1148 int index; 1168 1149 1169 1150 zone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low); 1170 1151 if (zone && zone->v.sf_id != cur->v.sf_id) { 1171 1152 /* different instrument was already defined */ 1172 - snd_sf_zone_t *p; 1153 + struct snd_sf_zone *p; 1173 1154 /* compare the allocated time */ 1174 1155 for (p = zone; p; p = p->next_zone) { 1175 1156 if (p->counter > cur->counter) ··· 1193 1174 * delete the given zones from preset_table 1194 1175 */ 1195 1176 static void 1196 - delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp) 1177 + delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp) 1197 1178 { 1198 1179 int index; 1199 - snd_sf_zone_t *p; 1180 + struct snd_sf_zone *p; 1200 1181 1201 1182 if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0) 1202 1183 return; ··· 1219 1200 * This function returns the number of found zones. 0 if not found. 1220 1201 */ 1221 1202 int 1222 - snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, 1203 + snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel, 1223 1204 int preset, int bank, 1224 1205 int def_preset, int def_bank, 1225 - snd_sf_zone_t **table, int max_layers) 1206 + struct snd_sf_zone **table, int max_layers) 1226 1207 { 1227 1208 int nvoices; 1228 1209 unsigned long flags; ··· 1236 1217 spin_unlock_irqrestore(&sflist->lock, flags); 1237 1218 return 0; 1238 1219 } 1239 - nvoices = search_zones(sflist, notep, vel, preset, bank, table, max_layers, 0); 1220 + nvoices = search_zones(sflist, notep, vel, preset, bank, 1221 + table, max_layers, 0); 1240 1222 if (! nvoices) { 1241 1223 if (preset != def_preset || bank != def_bank) 1242 - nvoices = search_zones(sflist, notep, vel, def_preset, def_bank, table, max_layers, 0); 1224 + nvoices = search_zones(sflist, notep, vel, 1225 + def_preset, def_bank, 1226 + table, max_layers, 0); 1243 1227 } 1244 1228 spin_unlock_irqrestore(&sflist->lock, flags); 1245 1229 return nvoices; ··· 1252 1230 /* 1253 1231 * search the first matching zone 1254 1232 */ 1255 - static snd_sf_zone_t * 1256 - search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key) 1233 + static struct snd_sf_zone * 1234 + search_first_zone(struct snd_sf_list *sflist, int bank, int preset, int key) 1257 1235 { 1258 1236 int index; 1259 - snd_sf_zone_t *zp; 1237 + struct snd_sf_zone *zp; 1260 1238 1261 1239 if ((index = get_index(bank, preset, key)) < 0) 1262 1240 return NULL; ··· 1272 1250 * search matching zones from sflist. can be called recursively. 1273 1251 */ 1274 1252 static int 1275 - 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) 1253 + search_zones(struct snd_sf_list *sflist, int *notep, int vel, 1254 + int preset, int bank, struct snd_sf_zone **table, 1255 + int max_layers, int level) 1276 1256 { 1277 - snd_sf_zone_t *zp; 1257 + struct snd_sf_zone *zp; 1278 1258 int nvoices; 1279 1259 1280 1260 zp = search_first_zone(sflist, bank, preset, *notep); ··· 1334 1310 * Initialise the sflist structure. 1335 1311 */ 1336 1312 static void 1337 - snd_sf_init(snd_sf_list_t *sflist) 1313 + snd_sf_init(struct snd_sf_list *sflist) 1338 1314 { 1339 1315 memset(sflist->presets, 0, sizeof(sflist->presets)); 1340 1316 ··· 1353 1329 * Release all list records 1354 1330 */ 1355 1331 static void 1356 - snd_sf_clear(snd_sf_list_t *sflist) 1332 + snd_sf_clear(struct snd_sf_list *sflist) 1357 1333 { 1358 - snd_soundfont_t *sf, *nextsf; 1359 - snd_sf_zone_t *zp, *nextzp; 1360 - snd_sf_sample_t *sp, *nextsp; 1334 + struct snd_soundfont *sf, *nextsf; 1335 + struct snd_sf_zone *zp, *nextzp; 1336 + struct snd_sf_sample *sp, *nextsp; 1361 1337 1362 1338 for (sf = sflist->fonts; sf; sf = nextsf) { 1363 1339 nextsf = sf->next; ··· 1368 1344 for (sp = sf->samples; sp; sp = nextsp) { 1369 1345 nextsp = sp->next; 1370 1346 if (sflist->callback.sample_free) 1371 - sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr); 1347 + sflist->callback.sample_free(sflist->callback.private_data, 1348 + sp, sflist->memhdr); 1372 1349 kfree(sp); 1373 1350 } 1374 1351 kfree(sf); ··· 1382 1357 /* 1383 1358 * Create a new sflist structure 1384 1359 */ 1385 - snd_sf_list_t * 1386 - snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr) 1360 + struct snd_sf_list * 1361 + snd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr) 1387 1362 { 1388 - snd_sf_list_t *sflist; 1363 + struct snd_sf_list *sflist; 1389 1364 1390 1365 if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL) 1391 1366 return NULL; ··· 1406 1381 * Free everything allocated off the sflist structure. 1407 1382 */ 1408 1383 void 1409 - snd_sf_free(snd_sf_list_t *sflist) 1384 + snd_sf_free(struct snd_sf_list *sflist) 1410 1385 { 1411 1386 if (sflist == NULL) 1412 1387 return; ··· 1425 1400 * The soundcard should be silet before calling this function. 1426 1401 */ 1427 1402 int 1428 - snd_soundfont_remove_samples(snd_sf_list_t *sflist) 1403 + snd_soundfont_remove_samples(struct snd_sf_list *sflist) 1429 1404 { 1430 1405 lock_preset(sflist); 1431 1406 if (sflist->callback.sample_reset) ··· 1441 1416 * The soundcard should be silent before calling this function. 1442 1417 */ 1443 1418 int 1444 - snd_soundfont_remove_unlocked(snd_sf_list_t *sflist) 1419 + snd_soundfont_remove_unlocked(struct snd_sf_list *sflist) 1445 1420 { 1446 - snd_soundfont_t *sf; 1447 - snd_sf_zone_t *zp, *nextzp; 1448 - snd_sf_sample_t *sp, *nextsp; 1421 + struct snd_soundfont *sf; 1422 + struct snd_sf_zone *zp, *nextzp; 1423 + struct snd_sf_sample *sp, *nextsp; 1449 1424 1450 1425 lock_preset(sflist); 1451 1426 ··· 1471 1446 sf->samples = nextsp; 1472 1447 sflist->mem_used -= sp->v.truesize; 1473 1448 if (sflist->callback.sample_free) 1474 - sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr); 1449 + sflist->callback.sample_free(sflist->callback.private_data, 1450 + sp, sflist->memhdr); 1475 1451 kfree(sp); 1476 1452 } 1477 1453 }
+20 -19
sound/synth/util_mem.c
··· 28 28 MODULE_DESCRIPTION("Generic memory management routines for soundcard memory allocation"); 29 29 MODULE_LICENSE("GPL"); 30 30 31 - #define get_memblk(p) list_entry(p, snd_util_memblk_t, list) 31 + #define get_memblk(p) list_entry(p, struct snd_util_memblk, list) 32 32 33 33 /* 34 34 * create a new memory manager 35 35 */ 36 - snd_util_memhdr_t * 36 + struct snd_util_memhdr * 37 37 snd_util_memhdr_new(int memsize) 38 38 { 39 - snd_util_memhdr_t *hdr; 39 + struct snd_util_memhdr *hdr; 40 40 41 41 hdr = kzalloc(sizeof(*hdr), GFP_KERNEL); 42 42 if (hdr == NULL) ··· 51 51 /* 52 52 * free a memory manager 53 53 */ 54 - void snd_util_memhdr_free(snd_util_memhdr_t *hdr) 54 + void snd_util_memhdr_free(struct snd_util_memhdr *hdr) 55 55 { 56 56 struct list_head *p; 57 57 ··· 67 67 /* 68 68 * allocate a memory block (without mutex) 69 69 */ 70 - snd_util_memblk_t * 71 - __snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) 70 + struct snd_util_memblk * 71 + __snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size) 72 72 { 73 - snd_util_memblk_t *blk; 74 - snd_util_unit_t units, prev_offset; 73 + struct snd_util_memblk *blk; 74 + unsigned int units, prev_offset; 75 75 struct list_head *p; 76 76 77 77 snd_assert(hdr != NULL, return NULL); ··· 104 104 * create a new memory block with the given size 105 105 * the block is linked next to prev 106 106 */ 107 - snd_util_memblk_t * 108 - __snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, 107 + struct snd_util_memblk * 108 + __snd_util_memblk_new(struct snd_util_memhdr *hdr, unsigned int units, 109 109 struct list_head *prev) 110 110 { 111 - snd_util_memblk_t *blk; 111 + struct snd_util_memblk *blk; 112 112 113 - blk = kmalloc(sizeof(snd_util_memblk_t) + hdr->block_extra_size, GFP_KERNEL); 113 + blk = kmalloc(sizeof(struct snd_util_memblk) + hdr->block_extra_size, 114 + GFP_KERNEL); 114 115 if (blk == NULL) 115 116 return NULL; 116 117 117 118 if (! prev || prev == &hdr->block) 118 119 blk->offset = 0; 119 120 else { 120 - snd_util_memblk_t *p = get_memblk(prev); 121 + struct snd_util_memblk *p = get_memblk(prev); 121 122 blk->offset = p->offset + p->size; 122 123 } 123 124 blk->size = units; ··· 132 131 /* 133 132 * allocate a memory block (with mutex) 134 133 */ 135 - snd_util_memblk_t * 136 - snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) 134 + struct snd_util_memblk * 135 + snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size) 137 136 { 138 - snd_util_memblk_t *blk; 137 + struct snd_util_memblk *blk; 139 138 down(&hdr->block_mutex); 140 139 blk = __snd_util_mem_alloc(hdr, size); 141 140 up(&hdr->block_mutex); ··· 148 147 * (without mutex) 149 148 */ 150 149 void 151 - __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) 150 + __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk) 152 151 { 153 152 list_del(&blk->list); 154 153 hdr->nblocks--; ··· 159 158 /* 160 159 * free a memory block (with mutex) 161 160 */ 162 - int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) 161 + int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk) 163 162 { 164 163 snd_assert(hdr && blk, return -EINVAL); 165 164 ··· 172 171 /* 173 172 * return available memory size 174 173 */ 175 - int snd_util_mem_avail(snd_util_memhdr_t *hdr) 174 + int snd_util_mem_avail(struct snd_util_memhdr *hdr) 176 175 { 177 176 unsigned int size; 178 177 down(&hdr->block_mutex);