提交 53d2f744 编写于 作者: T Takashi Iwai 提交者: Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: Timer

Modules: RTC timer driver,Timer Midlevel

Remove xxx_t typedefs from the core timer.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 82e9bae6
...@@ -26,20 +26,6 @@ ...@@ -26,20 +26,6 @@
#include <sound/asound.h> #include <sound/asound.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
typedef enum sndrv_timer_class snd_timer_class_t;
typedef enum sndrv_timer_slave_class snd_timer_slave_class_t;
typedef enum sndrv_timer_global snd_timer_global_t;
typedef struct sndrv_timer_id snd_timer_id_t;
typedef struct sndrv_timer_ginfo snd_timer_ginfo_t;
typedef struct sndrv_timer_gparams snd_timer_gparams_t;
typedef struct sndrv_timer_gstatus snd_timer_gstatus_t;
typedef struct sndrv_timer_select snd_timer_select_t;
typedef struct sndrv_timer_info snd_timer_info_t;
typedef struct sndrv_timer_params snd_timer_params_t;
typedef struct sndrv_timer_status snd_timer_status_t;
typedef struct sndrv_timer_read snd_timer_read_t;
typedef struct sndrv_timer_tread snd_timer_tread_t;
#define snd_timer_chip(timer) ((timer)->private_data) #define snd_timer_chip(timer) ((timer)->private_data)
#define SNDRV_TIMER_DEVICES 16 #define SNDRV_TIMER_DEVICES 16
...@@ -64,11 +50,9 @@ typedef struct sndrv_timer_tread snd_timer_tread_t; ...@@ -64,11 +50,9 @@ typedef struct sndrv_timer_tread snd_timer_tread_t;
#define SNDRV_TIMER_FLG_CHANGE 0x00000001 #define SNDRV_TIMER_FLG_CHANGE 0x00000001
#define SNDRV_TIMER_FLG_RESCHED 0x00000002 /* need reschedule */ #define SNDRV_TIMER_FLG_RESCHED 0x00000002 /* need reschedule */
typedef void (*snd_timer_callback_t) (snd_timer_instance_t * timeri, unsigned long ticks, unsigned long resolution); struct snd_timer;
typedef void (*snd_timer_ccallback_t) (snd_timer_instance_t * timeri, enum sndrv_timer_event event,
struct timespec * tstamp, unsigned long resolution);
struct _snd_timer_hardware { struct snd_timer_hardware {
/* -- must be filled with low-level driver */ /* -- must be filled with low-level driver */
unsigned int flags; /* various flags */ unsigned int flags; /* various flags */
unsigned long resolution; /* average timer resolution for one tick in nsec */ unsigned long resolution; /* average timer resolution for one tick in nsec */
...@@ -76,18 +60,18 @@ struct _snd_timer_hardware { ...@@ -76,18 +60,18 @@ struct _snd_timer_hardware {
unsigned long resolution_max; /* maximal resolution */ unsigned long resolution_max; /* maximal resolution */
unsigned long ticks; /* max timer ticks per interrupt */ unsigned long ticks; /* max timer ticks per interrupt */
/* -- low-level functions -- */ /* -- low-level functions -- */
int (*open) (snd_timer_t * timer); int (*open) (struct snd_timer * timer);
int (*close) (snd_timer_t * timer); int (*close) (struct snd_timer * timer);
unsigned long (*c_resolution) (snd_timer_t * timer); unsigned long (*c_resolution) (struct snd_timer * timer);
int (*start) (snd_timer_t * timer); int (*start) (struct snd_timer * timer);
int (*stop) (snd_timer_t * timer); int (*stop) (struct snd_timer * timer);
int (*set_period) (snd_timer_t * timer, unsigned long period_num, unsigned long period_den); int (*set_period) (struct snd_timer * timer, unsigned long period_num, unsigned long period_den);
int (*precise_resolution) (snd_timer_t * timer, unsigned long *num, unsigned long *den); int (*precise_resolution) (struct snd_timer * timer, unsigned long *num, unsigned long *den);
}; };
struct _snd_timer { struct snd_timer {
snd_timer_class_t tmr_class; int tmr_class;
snd_card_t *card; struct snd_card *card;
struct module *module; struct module *module;
int tmr_device; int tmr_device;
int tmr_subdevice; int tmr_subdevice;
...@@ -97,8 +81,8 @@ struct _snd_timer { ...@@ -97,8 +81,8 @@ struct _snd_timer {
int running; /* running instances */ int running; /* running instances */
unsigned long sticks; /* schedule ticks */ unsigned long sticks; /* schedule ticks */
void *private_data; void *private_data;
void (*private_free) (snd_timer_t *timer); void (*private_free) (struct snd_timer *timer);
struct _snd_timer_hardware hw; struct snd_timer_hardware hw;
spinlock_t lock; spinlock_t lock;
struct list_head device_list; struct list_head device_list;
struct list_head open_list_head; struct list_head open_list_head;
...@@ -108,49 +92,53 @@ struct _snd_timer { ...@@ -108,49 +92,53 @@ struct _snd_timer {
struct tasklet_struct task_queue; struct tasklet_struct task_queue;
}; };
struct _snd_timer_instance { struct snd_timer_instance {
snd_timer_t * timer; struct snd_timer *timer;
char *owner; char *owner;
unsigned int flags; unsigned int flags;
void *private_data; void *private_data;
void (*private_free) (snd_timer_instance_t *ti); void (*private_free) (struct snd_timer_instance *ti);
snd_timer_callback_t callback; void (*callback) (struct snd_timer_instance *timeri,
snd_timer_ccallback_t ccallback; unsigned long ticks, unsigned long resolution);
void (*ccallback) (struct snd_timer_instance * timeri,
int event,
struct timespec * tstamp,
unsigned long resolution);
void *callback_data; void *callback_data;
unsigned long ticks; /* auto-load ticks when expired */ unsigned long ticks; /* auto-load ticks when expired */
unsigned long cticks; /* current ticks */ unsigned long cticks; /* current ticks */
unsigned long pticks; /* accumulated ticks for callback */ unsigned long pticks; /* accumulated ticks for callback */
unsigned long resolution; /* current resolution for tasklet */ unsigned long resolution; /* current resolution for tasklet */
unsigned long lost; /* lost ticks */ unsigned long lost; /* lost ticks */
snd_timer_slave_class_t slave_class; int slave_class;
unsigned int slave_id; unsigned int slave_id;
struct list_head open_list; struct list_head open_list;
struct list_head active_list; struct list_head active_list;
struct list_head ack_list; struct list_head ack_list;
struct list_head slave_list_head; struct list_head slave_list_head;
struct list_head slave_active_head; struct list_head slave_active_head;
snd_timer_instance_t *master; struct snd_timer_instance *master;
}; };
/* /*
* Registering * Registering
*/ */
extern int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid, snd_timer_t ** rtimer); int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, struct snd_timer **rtimer);
extern void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, struct timespec *tstamp); void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp);
extern int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer); int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer);
extern int snd_timer_global_free(snd_timer_t *timer); int snd_timer_global_free(struct snd_timer *timer);
extern int snd_timer_global_register(snd_timer_t *timer); int snd_timer_global_register(struct snd_timer *timer);
extern int snd_timer_global_unregister(snd_timer_t *timer); int snd_timer_global_unregister(struct snd_timer *timer);
extern int snd_timer_open(snd_timer_instance_t ** ti, char *owner, snd_timer_id_t *tid, unsigned int slave_id); int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
extern int snd_timer_close(snd_timer_instance_t * timeri); int snd_timer_close(struct snd_timer_instance *timeri);
extern unsigned long snd_timer_resolution(snd_timer_instance_t * timeri); unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
extern int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks); int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
extern int snd_timer_stop(snd_timer_instance_t * timeri); int snd_timer_stop(struct snd_timer_instance *timeri);
extern int snd_timer_continue(snd_timer_instance_t * timeri); int snd_timer_continue(struct snd_timer_instance *timeri);
extern int snd_timer_pause(snd_timer_instance_t * timeri); int snd_timer_pause(struct snd_timer_instance *timeri);
extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left); void snd_timer_interrupt(struct snd_timer *timer, unsigned long ticks_left);
#endif /* __SOUND_TIMER_H */ #endif /* __SOUND_TIMER_H */
...@@ -40,16 +40,16 @@ ...@@ -40,16 +40,16 @@
/* /*
* prototypes * prototypes
*/ */
static int rtctimer_open(snd_timer_t *t); static int rtctimer_open(struct snd_timer *t);
static int rtctimer_close(snd_timer_t *t); static int rtctimer_close(struct snd_timer *t);
static int rtctimer_start(snd_timer_t *t); static int rtctimer_start(struct snd_timer *t);
static int rtctimer_stop(snd_timer_t *t); static int rtctimer_stop(struct snd_timer *t);
/* /*
* The hardware dependent description for this timer. * The hardware dependent description for this timer.
*/ */
static struct _snd_timer_hardware rtc_hw = { static struct snd_timer_hardware rtc_hw = {
.flags = SNDRV_TIMER_HW_FIRST|SNDRV_TIMER_HW_AUTO, .flags = SNDRV_TIMER_HW_FIRST|SNDRV_TIMER_HW_AUTO,
.ticks = 100000000L, /* FIXME: XXX */ .ticks = 100000000L, /* FIXME: XXX */
.open = rtctimer_open, .open = rtctimer_open,
...@@ -59,12 +59,12 @@ static struct _snd_timer_hardware rtc_hw = { ...@@ -59,12 +59,12 @@ static struct _snd_timer_hardware rtc_hw = {
}; };
static int rtctimer_freq = RTC_FREQ; /* frequency */ static int rtctimer_freq = RTC_FREQ; /* frequency */
static snd_timer_t *rtctimer; static struct snd_timer *rtctimer;
static rtc_task_t rtc_task; static rtc_task_t rtc_task;
static int static int
rtctimer_open(snd_timer_t *t) rtctimer_open(struct snd_timer *t)
{ {
int err; int err;
...@@ -76,7 +76,7 @@ rtctimer_open(snd_timer_t *t) ...@@ -76,7 +76,7 @@ rtctimer_open(snd_timer_t *t)
} }
static int static int
rtctimer_close(snd_timer_t *t) rtctimer_close(struct snd_timer *t)
{ {
rtc_task_t *rtc = t->private_data; rtc_task_t *rtc = t->private_data;
if (rtc) { if (rtc) {
...@@ -87,7 +87,7 @@ rtctimer_close(snd_timer_t *t) ...@@ -87,7 +87,7 @@ rtctimer_close(snd_timer_t *t)
} }
static int static int
rtctimer_start(snd_timer_t *timer) rtctimer_start(struct snd_timer *timer)
{ {
rtc_task_t *rtc = timer->private_data; rtc_task_t *rtc = timer->private_data;
snd_assert(rtc != NULL, return -EINVAL); snd_assert(rtc != NULL, return -EINVAL);
...@@ -97,7 +97,7 @@ rtctimer_start(snd_timer_t *timer) ...@@ -97,7 +97,7 @@ rtctimer_start(snd_timer_t *timer)
} }
static int static int
rtctimer_stop(snd_timer_t *timer) rtctimer_stop(struct snd_timer *timer)
{ {
rtc_task_t *rtc = timer->private_data; rtc_task_t *rtc = timer->private_data;
snd_assert(rtc != NULL, return -EINVAL); snd_assert(rtc != NULL, return -EINVAL);
...@@ -120,7 +120,7 @@ static void rtctimer_interrupt(void *private_data) ...@@ -120,7 +120,7 @@ static void rtctimer_interrupt(void *private_data)
static int __init rtctimer_init(void) static int __init rtctimer_init(void)
{ {
int err; int err;
snd_timer_t *timer; struct snd_timer *timer;
if (rtctimer_freq < 2 || rtctimer_freq > 8192 || if (rtctimer_freq < 2 || rtctimer_freq > 8192 ||
(rtctimer_freq & (rtctimer_freq - 1)) != 0) { (rtctimer_freq & (rtctimer_freq - 1)) != 0) {
......
...@@ -53,8 +53,8 @@ MODULE_LICENSE("GPL"); ...@@ -53,8 +53,8 @@ MODULE_LICENSE("GPL");
module_param(timer_limit, int, 0444); module_param(timer_limit, int, 0444);
MODULE_PARM_DESC(timer_limit, "Maximum global timers in system."); MODULE_PARM_DESC(timer_limit, "Maximum global timers in system.");
typedef struct { struct snd_timer_user {
snd_timer_instance_t *timeri; struct snd_timer_instance *timeri;
int tread; /* enhanced read with timestamps and events */ int tread; /* enhanced read with timestamps and events */
unsigned long ticks; unsigned long ticks;
unsigned long overrun; unsigned long overrun;
...@@ -62,8 +62,8 @@ typedef struct { ...@@ -62,8 +62,8 @@ typedef struct {
int qtail; int qtail;
int qused; int qused;
int queue_size; int queue_size;
snd_timer_read_t *queue; struct snd_timer_read *queue;
snd_timer_tread_t *tqueue; struct snd_timer_tread *tqueue;
spinlock_t qlock; spinlock_t qlock;
unsigned long last_resolution; unsigned long last_resolution;
unsigned int filter; unsigned int filter;
...@@ -71,7 +71,7 @@ typedef struct { ...@@ -71,7 +71,7 @@ typedef struct {
wait_queue_head_t qchange_sleep; wait_queue_head_t qchange_sleep;
struct fasync_struct *fasync; struct fasync_struct *fasync;
struct semaphore tread_sem; struct semaphore tread_sem;
} snd_timer_user_t; };
/* list of timers */ /* list of timers */
static LIST_HEAD(snd_timer_list); static LIST_HEAD(snd_timer_list);
...@@ -84,21 +84,21 @@ static DEFINE_SPINLOCK(slave_active_lock); ...@@ -84,21 +84,21 @@ static DEFINE_SPINLOCK(slave_active_lock);
static DECLARE_MUTEX(register_mutex); static DECLARE_MUTEX(register_mutex);
static int snd_timer_free(snd_timer_t *timer); static int snd_timer_free(struct snd_timer *timer);
static int snd_timer_dev_free(snd_device_t *device); static int snd_timer_dev_free(struct snd_device *device);
static int snd_timer_dev_register(snd_device_t *device); static int snd_timer_dev_register(struct snd_device *device);
static int snd_timer_dev_unregister(snd_device_t *device); static int snd_timer_dev_unregister(struct snd_device *device);
static void snd_timer_reschedule(snd_timer_t * timer, unsigned long ticks_left); static void snd_timer_reschedule(struct snd_timer * timer, unsigned long ticks_left);
/* /*
* create a timer instance with the given owner string. * create a timer instance with the given owner string.
* when timer is not NULL, increments the module counter * when timer is not NULL, increments the module counter
*/ */
static snd_timer_instance_t *snd_timer_instance_new(char *owner, static struct snd_timer_instance *snd_timer_instance_new(char *owner,
snd_timer_t *timer) struct snd_timer *timer)
{ {
snd_timer_instance_t *timeri; struct snd_timer_instance *timeri;
timeri = kzalloc(sizeof(*timeri), GFP_KERNEL); timeri = kzalloc(sizeof(*timeri), GFP_KERNEL);
if (timeri == NULL) if (timeri == NULL)
return NULL; return NULL;
...@@ -126,13 +126,13 @@ static snd_timer_instance_t *snd_timer_instance_new(char *owner, ...@@ -126,13 +126,13 @@ static snd_timer_instance_t *snd_timer_instance_new(char *owner,
/* /*
* find a timer instance from the given timer id * find a timer instance from the given timer id
*/ */
static snd_timer_t *snd_timer_find(snd_timer_id_t *tid) static struct snd_timer *snd_timer_find(struct snd_timer_id *tid)
{ {
snd_timer_t *timer = NULL; struct snd_timer *timer = NULL;
struct list_head *p; struct list_head *p;
list_for_each(p, &snd_timer_list) { list_for_each(p, &snd_timer_list) {
timer = list_entry(p, snd_timer_t, device_list); timer = list_entry(p, struct snd_timer, device_list);
if (timer->tmr_class != tid->dev_class) if (timer->tmr_class != tid->dev_class)
continue; continue;
...@@ -152,7 +152,7 @@ static snd_timer_t *snd_timer_find(snd_timer_id_t *tid) ...@@ -152,7 +152,7 @@ static snd_timer_t *snd_timer_find(snd_timer_id_t *tid)
#ifdef CONFIG_KMOD #ifdef CONFIG_KMOD
static void snd_timer_request(snd_timer_id_t *tid) static void snd_timer_request(struct snd_timer_id *tid)
{ {
if (! current->fs->root) if (! current->fs->root)
return; return;
...@@ -179,17 +179,17 @@ static void snd_timer_request(snd_timer_id_t *tid) ...@@ -179,17 +179,17 @@ static void snd_timer_request(snd_timer_id_t *tid)
* *
* call this with register_mutex down. * call this with register_mutex down.
*/ */
static void snd_timer_check_slave(snd_timer_instance_t *slave) static void snd_timer_check_slave(struct snd_timer_instance *slave)
{ {
snd_timer_t *timer; struct snd_timer *timer;
snd_timer_instance_t *master; struct snd_timer_instance *master;
struct list_head *p, *q; struct list_head *p, *q;
/* FIXME: it's really dumb to look up all entries.. */ /* FIXME: it's really dumb to look up all entries.. */
list_for_each(p, &snd_timer_list) { list_for_each(p, &snd_timer_list) {
timer = list_entry(p, snd_timer_t, device_list); timer = list_entry(p, struct snd_timer, device_list);
list_for_each(q, &timer->open_list_head) { list_for_each(q, &timer->open_list_head) {
master = list_entry(q, snd_timer_instance_t, open_list); master = list_entry(q, struct snd_timer_instance, open_list);
if (slave->slave_class == master->slave_class && if (slave->slave_class == master->slave_class &&
slave->slave_id == master->slave_id) { slave->slave_id == master->slave_id) {
list_del(&slave->open_list); list_del(&slave->open_list);
...@@ -211,14 +211,14 @@ static void snd_timer_check_slave(snd_timer_instance_t *slave) ...@@ -211,14 +211,14 @@ static void snd_timer_check_slave(snd_timer_instance_t *slave)
* *
* call this with register_mutex down. * call this with register_mutex down.
*/ */
static void snd_timer_check_master(snd_timer_instance_t *master) static void snd_timer_check_master(struct snd_timer_instance *master)
{ {
snd_timer_instance_t *slave; struct snd_timer_instance *slave;
struct list_head *p, *n; struct list_head *p, *n;
/* check all pending slaves */ /* check all pending slaves */
list_for_each_safe(p, n, &snd_timer_slave_list) { list_for_each_safe(p, n, &snd_timer_slave_list) {
slave = list_entry(p, snd_timer_instance_t, open_list); slave = list_entry(p, struct snd_timer_instance, open_list);
if (slave->slave_class == master->slave_class && if (slave->slave_class == master->slave_class &&
slave->slave_id == master->slave_id) { slave->slave_id == master->slave_id) {
list_del(p); list_del(p);
...@@ -238,12 +238,12 @@ static void snd_timer_check_master(snd_timer_instance_t *master) ...@@ -238,12 +238,12 @@ static void snd_timer_check_master(snd_timer_instance_t *master)
* open a timer instance * open a timer instance
* when opening a master, the slave id must be here given. * when opening a master, the slave id must be here given.
*/ */
int snd_timer_open(snd_timer_instance_t **ti, int snd_timer_open(struct snd_timer_instance **ti,
char *owner, snd_timer_id_t *tid, char *owner, struct snd_timer_id *tid,
unsigned int slave_id) unsigned int slave_id)
{ {
snd_timer_t *timer; struct snd_timer *timer;
snd_timer_instance_t *timeri = NULL; struct snd_timer_instance *timeri = NULL;
if (tid->dev_class == SNDRV_TIMER_CLASS_SLAVE) { if (tid->dev_class == SNDRV_TIMER_CLASS_SLAVE) {
/* open a slave instance */ /* open a slave instance */
...@@ -285,7 +285,7 @@ int snd_timer_open(snd_timer_instance_t **ti, ...@@ -285,7 +285,7 @@ int snd_timer_open(snd_timer_instance_t **ti,
} }
if (!list_empty(&timer->open_list_head)) { if (!list_empty(&timer->open_list_head)) {
timeri = list_entry(timer->open_list_head.next, timeri = list_entry(timer->open_list_head.next,
snd_timer_instance_t, open_list); struct snd_timer_instance, open_list);
if (timeri->flags & SNDRV_TIMER_IFLG_EXCLUSIVE) { if (timeri->flags & SNDRV_TIMER_IFLG_EXCLUSIVE) {
up(&register_mutex); up(&register_mutex);
return -EBUSY; return -EBUSY;
...@@ -307,17 +307,17 @@ int snd_timer_open(snd_timer_instance_t **ti, ...@@ -307,17 +307,17 @@ int snd_timer_open(snd_timer_instance_t **ti,
return 0; return 0;
} }
static int _snd_timer_stop(snd_timer_instance_t * timeri, static int _snd_timer_stop(struct snd_timer_instance *timeri,
int keep_flag, enum sndrv_timer_event event); int keep_flag, int event);
/* /*
* close a timer instance * close a timer instance
*/ */
int snd_timer_close(snd_timer_instance_t * timeri) int snd_timer_close(struct snd_timer_instance *timeri)
{ {
snd_timer_t *timer = NULL; struct snd_timer *timer = NULL;
struct list_head *p, *n; struct list_head *p, *n;
snd_timer_instance_t *slave; struct snd_timer_instance *slave;
snd_assert(timeri != NULL, return -ENXIO); snd_assert(timeri != NULL, return -ENXIO);
...@@ -353,7 +353,7 @@ int snd_timer_close(snd_timer_instance_t * timeri) ...@@ -353,7 +353,7 @@ int snd_timer_close(snd_timer_instance_t * timeri)
timer->hw.close(timer); timer->hw.close(timer);
/* remove slave links */ /* remove slave links */
list_for_each_safe(p, n, &timeri->slave_list_head) { list_for_each_safe(p, n, &timeri->slave_list_head) {
slave = list_entry(p, snd_timer_instance_t, open_list); slave = list_entry(p, struct snd_timer_instance, open_list);
spin_lock_irq(&slave_active_lock); spin_lock_irq(&slave_active_lock);
_snd_timer_stop(slave, 1, SNDRV_TIMER_EVENT_RESOLUTION); _snd_timer_stop(slave, 1, SNDRV_TIMER_EVENT_RESOLUTION);
list_del(p); list_del(p);
...@@ -373,9 +373,9 @@ int snd_timer_close(snd_timer_instance_t * timeri) ...@@ -373,9 +373,9 @@ int snd_timer_close(snd_timer_instance_t * timeri)
return 0; return 0;
} }
unsigned long snd_timer_resolution(snd_timer_instance_t * timeri) unsigned long snd_timer_resolution(struct snd_timer_instance *timeri)
{ {
snd_timer_t * timer; struct snd_timer * timer;
if (timeri == NULL) if (timeri == NULL)
return 0; return 0;
...@@ -387,13 +387,12 @@ unsigned long snd_timer_resolution(snd_timer_instance_t * timeri) ...@@ -387,13 +387,12 @@ unsigned long snd_timer_resolution(snd_timer_instance_t * timeri)
return 0; return 0;
} }
static void snd_timer_notify1(snd_timer_instance_t *ti, static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
enum sndrv_timer_event event)
{ {
snd_timer_t *timer; struct snd_timer *timer;
unsigned long flags; unsigned long flags;
unsigned long resolution = 0; unsigned long resolution = 0;
snd_timer_instance_t *ts; struct snd_timer_instance *ts;
struct list_head *n; struct list_head *n;
struct timespec tstamp; struct timespec tstamp;
...@@ -414,14 +413,14 @@ static void snd_timer_notify1(snd_timer_instance_t *ti, ...@@ -414,14 +413,14 @@ static void snd_timer_notify1(snd_timer_instance_t *ti,
return; return;
spin_lock_irqsave(&timer->lock, flags); spin_lock_irqsave(&timer->lock, flags);
list_for_each(n, &ti->slave_active_head) { list_for_each(n, &ti->slave_active_head) {
ts = list_entry(n, snd_timer_instance_t, active_list); ts = list_entry(n, struct snd_timer_instance, active_list);
if (ts->ccallback) if (ts->ccallback)
ts->ccallback(ti, event + 100, &tstamp, resolution); ts->ccallback(ti, event + 100, &tstamp, resolution);
} }
spin_unlock_irqrestore(&timer->lock, flags); spin_unlock_irqrestore(&timer->lock, flags);
} }
static int snd_timer_start1(snd_timer_t *timer, snd_timer_instance_t *timeri, static int snd_timer_start1(struct snd_timer *timer, struct snd_timer_instance *timeri,
unsigned long sticks) unsigned long sticks)
{ {
list_del(&timeri->active_list); list_del(&timeri->active_list);
...@@ -442,7 +441,7 @@ static int snd_timer_start1(snd_timer_t *timer, snd_timer_instance_t *timeri, ...@@ -442,7 +441,7 @@ static int snd_timer_start1(snd_timer_t *timer, snd_timer_instance_t *timeri,
} }
} }
static int snd_timer_start_slave(snd_timer_instance_t *timeri) static int snd_timer_start_slave(struct snd_timer_instance *timeri)
{ {
unsigned long flags; unsigned long flags;
...@@ -458,9 +457,9 @@ static int snd_timer_start_slave(snd_timer_instance_t *timeri) ...@@ -458,9 +457,9 @@ static int snd_timer_start_slave(snd_timer_instance_t *timeri)
/* /*
* start the timer instance * start the timer instance
*/ */
int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks) int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks)
{ {
snd_timer_t *timer; struct snd_timer *timer;
int result = -EINVAL; int result = -EINVAL;
unsigned long flags; unsigned long flags;
...@@ -483,10 +482,10 @@ int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks) ...@@ -483,10 +482,10 @@ int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks)
return result; return result;
} }
static int _snd_timer_stop(snd_timer_instance_t * timeri, static int _snd_timer_stop(struct snd_timer_instance * timeri,
int keep_flag, enum sndrv_timer_event event) int keep_flag, int event)
{ {
snd_timer_t *timer; struct snd_timer *timer;
unsigned long flags; unsigned long flags;
snd_assert(timeri != NULL, return -ENXIO); snd_assert(timeri != NULL, return -ENXIO);
...@@ -532,9 +531,9 @@ static int _snd_timer_stop(snd_timer_instance_t * timeri, ...@@ -532,9 +531,9 @@ static int _snd_timer_stop(snd_timer_instance_t * timeri,
* *
* do not call this from the timer callback! * do not call this from the timer callback!
*/ */
int snd_timer_stop(snd_timer_instance_t * timeri) int snd_timer_stop(struct snd_timer_instance *timeri)
{ {
snd_timer_t *timer; struct snd_timer *timer;
unsigned long flags; unsigned long flags;
int err; int err;
...@@ -552,9 +551,9 @@ int snd_timer_stop(snd_timer_instance_t * timeri) ...@@ -552,9 +551,9 @@ int snd_timer_stop(snd_timer_instance_t * timeri)
/* /*
* start again.. the tick is kept. * start again.. the tick is kept.
*/ */
int snd_timer_continue(snd_timer_instance_t * timeri) int snd_timer_continue(struct snd_timer_instance *timeri)
{ {
snd_timer_t *timer; struct snd_timer *timer;
int result = -EINVAL; int result = -EINVAL;
unsigned long flags; unsigned long flags;
...@@ -578,7 +577,7 @@ int snd_timer_continue(snd_timer_instance_t * timeri) ...@@ -578,7 +577,7 @@ int snd_timer_continue(snd_timer_instance_t * timeri)
/* /*
* pause.. remember the ticks left * pause.. remember the ticks left
*/ */
int snd_timer_pause(snd_timer_instance_t * timeri) int snd_timer_pause(struct snd_timer_instance * timeri)
{ {
return _snd_timer_stop(timeri, 0, SNDRV_TIMER_EVENT_PAUSE); return _snd_timer_stop(timeri, 0, SNDRV_TIMER_EVENT_PAUSE);
} }
...@@ -589,14 +588,14 @@ int snd_timer_pause(snd_timer_instance_t * timeri) ...@@ -589,14 +588,14 @@ int snd_timer_pause(snd_timer_instance_t * timeri)
* start pending instances and check the scheduling ticks. * start pending instances and check the scheduling ticks.
* when the scheduling ticks is changed set CHANGE flag to reprogram the timer. * when the scheduling ticks is changed set CHANGE flag to reprogram the timer.
*/ */
static void snd_timer_reschedule(snd_timer_t * timer, unsigned long ticks_left) static void snd_timer_reschedule(struct snd_timer * timer, unsigned long ticks_left)
{ {
snd_timer_instance_t *ti; struct snd_timer_instance *ti;
unsigned long ticks = ~0UL; unsigned long ticks = ~0UL;
struct list_head *p; struct list_head *p;
list_for_each(p, &timer->active_list_head) { list_for_each(p, &timer->active_list_head) {
ti = list_entry(p, snd_timer_instance_t, active_list); ti = list_entry(p, struct snd_timer_instance, active_list);
if (ti->flags & SNDRV_TIMER_IFLG_START) { if (ti->flags & SNDRV_TIMER_IFLG_START) {
ti->flags &= ~SNDRV_TIMER_IFLG_START; ti->flags &= ~SNDRV_TIMER_IFLG_START;
ti->flags |= SNDRV_TIMER_IFLG_RUNNING; ti->flags |= SNDRV_TIMER_IFLG_RUNNING;
...@@ -624,8 +623,8 @@ static void snd_timer_reschedule(snd_timer_t * timer, unsigned long ticks_left) ...@@ -624,8 +623,8 @@ static void snd_timer_reschedule(snd_timer_t * timer, unsigned long ticks_left)
*/ */
static void snd_timer_tasklet(unsigned long arg) static void snd_timer_tasklet(unsigned long arg)
{ {
snd_timer_t *timer = (snd_timer_t *) arg; struct snd_timer *timer = (struct snd_timer *) arg;
snd_timer_instance_t *ti; struct snd_timer_instance *ti;
struct list_head *p; struct list_head *p;
unsigned long resolution, ticks; unsigned long resolution, ticks;
...@@ -633,7 +632,7 @@ static void snd_timer_tasklet(unsigned long arg) ...@@ -633,7 +632,7 @@ static void snd_timer_tasklet(unsigned long arg)
/* now process all callbacks */ /* now process all callbacks */
while (!list_empty(&timer->sack_list_head)) { while (!list_empty(&timer->sack_list_head)) {
p = timer->sack_list_head.next; /* get first item */ p = timer->sack_list_head.next; /* get first item */
ti = list_entry(p, snd_timer_instance_t, ack_list); ti = list_entry(p, struct snd_timer_instance, ack_list);
/* remove from ack_list and make empty */ /* remove from ack_list and make empty */
list_del_init(p); list_del_init(p);
...@@ -658,9 +657,9 @@ static void snd_timer_tasklet(unsigned long arg) ...@@ -658,9 +657,9 @@ static void snd_timer_tasklet(unsigned long arg)
* ticks_left is usually equal to timer->sticks. * ticks_left is usually equal to timer->sticks.
* *
*/ */
void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left) void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
{ {
snd_timer_instance_t *ti, *ts; struct snd_timer_instance *ti, *ts;
unsigned long resolution, ticks; unsigned long resolution, ticks;
struct list_head *p, *q, *n, *ack_list_head; struct list_head *p, *q, *n, *ack_list_head;
int use_tasklet = 0; int use_tasklet = 0;
...@@ -682,7 +681,7 @@ void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left) ...@@ -682,7 +681,7 @@ void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left)
* is called. * is called.
*/ */
list_for_each_safe(p, n, &timer->active_list_head) { list_for_each_safe(p, n, &timer->active_list_head) {
ti = list_entry(p, snd_timer_instance_t, active_list); ti = list_entry(p, struct snd_timer_instance, active_list);
if (!(ti->flags & SNDRV_TIMER_IFLG_RUNNING)) if (!(ti->flags & SNDRV_TIMER_IFLG_RUNNING))
continue; continue;
ti->pticks += ticks_left; ti->pticks += ticks_left;
...@@ -708,7 +707,7 @@ void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left) ...@@ -708,7 +707,7 @@ void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left)
if (list_empty(&ti->ack_list)) if (list_empty(&ti->ack_list))
list_add_tail(&ti->ack_list, ack_list_head); list_add_tail(&ti->ack_list, ack_list_head);
list_for_each(q, &ti->slave_active_head) { list_for_each(q, &ti->slave_active_head) {
ts = list_entry(q, snd_timer_instance_t, active_list); ts = list_entry(q, struct snd_timer_instance, active_list);
ts->pticks = ti->pticks; ts->pticks = ti->pticks;
ts->resolution = resolution; ts->resolution = resolution;
if (list_empty(&ts->ack_list)) if (list_empty(&ts->ack_list))
...@@ -735,7 +734,7 @@ void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left) ...@@ -735,7 +734,7 @@ void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left)
/* now process all fast callbacks */ /* now process all fast callbacks */
while (!list_empty(&timer->ack_list_head)) { while (!list_empty(&timer->ack_list_head)) {
p = timer->ack_list_head.next; /* get first item */ p = timer->ack_list_head.next; /* get first item */
ti = list_entry(p, snd_timer_instance_t, ack_list); ti = list_entry(p, struct snd_timer_instance, ack_list);
/* remove from ack_list and make empty */ /* remove from ack_list and make empty */
list_del_init(p); list_del_init(p);
...@@ -763,12 +762,12 @@ void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left) ...@@ -763,12 +762,12 @@ void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left)
*/ */
int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid, int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid,
snd_timer_t **rtimer) struct snd_timer **rtimer)
{ {
snd_timer_t *timer; struct snd_timer *timer;
int err; int err;
static snd_device_ops_t ops = { static struct snd_device_ops ops = {
.dev_free = snd_timer_dev_free, .dev_free = snd_timer_dev_free,
.dev_register = snd_timer_dev_register, .dev_register = snd_timer_dev_register,
.dev_unregister = snd_timer_dev_unregister .dev_unregister = snd_timer_dev_unregister
...@@ -806,7 +805,7 @@ int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid, ...@@ -806,7 +805,7 @@ int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid,
return 0; return 0;
} }
static int snd_timer_free(snd_timer_t *timer) static int snd_timer_free(struct snd_timer *timer)
{ {
snd_assert(timer != NULL, return -ENXIO); snd_assert(timer != NULL, return -ENXIO);
if (timer->private_free) if (timer->private_free)
...@@ -815,16 +814,16 @@ static int snd_timer_free(snd_timer_t *timer) ...@@ -815,16 +814,16 @@ static int snd_timer_free(snd_timer_t *timer)
return 0; return 0;
} }
static int snd_timer_dev_free(snd_device_t *device) static int snd_timer_dev_free(struct snd_device *device)
{ {
snd_timer_t *timer = device->device_data; struct snd_timer *timer = device->device_data;
return snd_timer_free(timer); return snd_timer_free(timer);
} }
static int snd_timer_dev_register(snd_device_t *dev) static int snd_timer_dev_register(struct snd_device *dev)
{ {
snd_timer_t *timer = dev->device_data; struct snd_timer *timer = dev->device_data;
snd_timer_t *timer1; struct snd_timer *timer1;
struct list_head *p; struct list_head *p;
snd_assert(timer != NULL && timer->hw.start != NULL && snd_assert(timer != NULL && timer->hw.start != NULL &&
...@@ -835,7 +834,7 @@ static int snd_timer_dev_register(snd_device_t *dev) ...@@ -835,7 +834,7 @@ static int snd_timer_dev_register(snd_device_t *dev)
down(&register_mutex); down(&register_mutex);
list_for_each(p, &snd_timer_list) { list_for_each(p, &snd_timer_list) {
timer1 = list_entry(p, snd_timer_t, device_list); timer1 = list_entry(p, struct snd_timer, device_list);
if (timer1->tmr_class > timer->tmr_class) if (timer1->tmr_class > timer->tmr_class)
break; break;
if (timer1->tmr_class < timer->tmr_class) if (timer1->tmr_class < timer->tmr_class)
...@@ -863,10 +862,10 @@ static int snd_timer_dev_register(snd_device_t *dev) ...@@ -863,10 +862,10 @@ static int snd_timer_dev_register(snd_device_t *dev)
return 0; return 0;
} }
static int snd_timer_unregister(snd_timer_t *timer) static int snd_timer_unregister(struct snd_timer *timer)
{ {
struct list_head *p, *n; struct list_head *p, *n;
snd_timer_instance_t *ti; struct snd_timer_instance *ti;
snd_assert(timer != NULL, return -ENXIO); snd_assert(timer != NULL, return -ENXIO);
down(&register_mutex); down(&register_mutex);
...@@ -874,7 +873,7 @@ static int snd_timer_unregister(snd_timer_t *timer) ...@@ -874,7 +873,7 @@ static int snd_timer_unregister(snd_timer_t *timer)
snd_printk(KERN_WARNING "timer 0x%lx is busy?\n", (long)timer); snd_printk(KERN_WARNING "timer 0x%lx is busy?\n", (long)timer);
list_for_each_safe(p, n, &timer->open_list_head) { list_for_each_safe(p, n, &timer->open_list_head) {
list_del_init(p); list_del_init(p);
ti = list_entry(p, snd_timer_instance_t, open_list); ti = list_entry(p, struct snd_timer_instance, open_list);
ti->timer = NULL; ti->timer = NULL;
} }
} }
...@@ -883,18 +882,17 @@ static int snd_timer_unregister(snd_timer_t *timer) ...@@ -883,18 +882,17 @@ static int snd_timer_unregister(snd_timer_t *timer)
return snd_timer_free(timer); return snd_timer_free(timer);
} }
static int snd_timer_dev_unregister(snd_device_t *device) static int snd_timer_dev_unregister(struct snd_device *device)
{ {
snd_timer_t *timer = device->device_data; struct snd_timer *timer = device->device_data;
return snd_timer_unregister(timer); return snd_timer_unregister(timer);
} }
void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp)
struct timespec *tstamp)
{ {
unsigned long flags; unsigned long flags;
unsigned long resolution = 0; unsigned long resolution = 0;
snd_timer_instance_t *ti, *ts; struct snd_timer_instance *ti, *ts;
struct list_head *p, *n; struct list_head *p, *n;
if (! (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)) if (! (timer->hw.flags & SNDRV_TIMER_HW_SLAVE))
...@@ -911,11 +909,11 @@ void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, ...@@ -911,11 +909,11 @@ void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event,
resolution = timer->hw.resolution; resolution = timer->hw.resolution;
} }
list_for_each(p, &timer->active_list_head) { list_for_each(p, &timer->active_list_head) {
ti = list_entry(p, snd_timer_instance_t, active_list); ti = list_entry(p, struct snd_timer_instance, active_list);
if (ti->ccallback) if (ti->ccallback)
ti->ccallback(ti, event, tstamp, resolution); ti->ccallback(ti, event, tstamp, resolution);
list_for_each(n, &ti->slave_active_head) { list_for_each(n, &ti->slave_active_head) {
ts = list_entry(n, snd_timer_instance_t, active_list); ts = list_entry(n, struct snd_timer_instance, active_list);
if (ts->ccallback) if (ts->ccallback)
ts->ccallback(ts, event, tstamp, resolution); ts->ccallback(ts, event, tstamp, resolution);
} }
...@@ -926,9 +924,9 @@ void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, ...@@ -926,9 +924,9 @@ void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event,
/* /*
* exported functions for global timers * exported functions for global timers
*/ */
int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer) int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer)
{ {
snd_timer_id_t tid; struct snd_timer_id tid;
tid.dev_class = SNDRV_TIMER_CLASS_GLOBAL; tid.dev_class = SNDRV_TIMER_CLASS_GLOBAL;
tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE; tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE;
...@@ -938,21 +936,21 @@ int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer) ...@@ -938,21 +936,21 @@ int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer)
return snd_timer_new(NULL, id, &tid, rtimer); return snd_timer_new(NULL, id, &tid, rtimer);
} }
int snd_timer_global_free(snd_timer_t *timer) int snd_timer_global_free(struct snd_timer *timer)
{ {
return snd_timer_free(timer); return snd_timer_free(timer);
} }
int snd_timer_global_register(snd_timer_t *timer) int snd_timer_global_register(struct snd_timer *timer)
{ {
snd_device_t dev; struct snd_device dev;
memset(&dev, 0, sizeof(dev)); memset(&dev, 0, sizeof(dev));
dev.device_data = timer; dev.device_data = timer;
return snd_timer_dev_register(&dev); return snd_timer_dev_register(&dev);
} }
int snd_timer_global_unregister(snd_timer_t *timer) int snd_timer_global_unregister(struct snd_timer *timer)
{ {
return snd_timer_unregister(timer); return snd_timer_unregister(timer);
} }
...@@ -971,7 +969,7 @@ struct snd_timer_system_private { ...@@ -971,7 +969,7 @@ struct snd_timer_system_private {
static void snd_timer_s_function(unsigned long data) static void snd_timer_s_function(unsigned long data)
{ {
snd_timer_t *timer = (snd_timer_t *)data; struct snd_timer *timer = (struct snd_timer *)data;
struct snd_timer_system_private *priv = timer->private_data; struct snd_timer_system_private *priv = timer->private_data;
unsigned long jiff = jiffies; unsigned long jiff = jiffies;
if (time_after(jiff, priv->last_expires)) if (time_after(jiff, priv->last_expires))
...@@ -979,7 +977,7 @@ static void snd_timer_s_function(unsigned long data) ...@@ -979,7 +977,7 @@ static void snd_timer_s_function(unsigned long data)
snd_timer_interrupt(timer, (long)jiff - (long)priv->last_jiffies); snd_timer_interrupt(timer, (long)jiff - (long)priv->last_jiffies);
} }
static int snd_timer_s_start(snd_timer_t * timer) static int snd_timer_s_start(struct snd_timer * timer)
{ {
struct snd_timer_system_private *priv; struct snd_timer_system_private *priv;
unsigned long njiff; unsigned long njiff;
...@@ -998,7 +996,7 @@ static int snd_timer_s_start(snd_timer_t * timer) ...@@ -998,7 +996,7 @@ static int snd_timer_s_start(snd_timer_t * timer)
return 0; return 0;
} }
static int snd_timer_s_stop(snd_timer_t * timer) static int snd_timer_s_stop(struct snd_timer * timer)
{ {
struct snd_timer_system_private *priv; struct snd_timer_system_private *priv;
unsigned long jiff; unsigned long jiff;
...@@ -1013,7 +1011,7 @@ static int snd_timer_s_stop(snd_timer_t * timer) ...@@ -1013,7 +1011,7 @@ static int snd_timer_s_stop(snd_timer_t * timer)
return 0; return 0;
} }
static struct _snd_timer_hardware snd_timer_system = static struct snd_timer_hardware snd_timer_system =
{ {
.flags = SNDRV_TIMER_HW_FIRST | SNDRV_TIMER_HW_TASKLET, .flags = SNDRV_TIMER_HW_FIRST | SNDRV_TIMER_HW_TASKLET,
.resolution = 1000000000L / HZ, .resolution = 1000000000L / HZ,
...@@ -1022,14 +1020,14 @@ static struct _snd_timer_hardware snd_timer_system = ...@@ -1022,14 +1020,14 @@ static struct _snd_timer_hardware snd_timer_system =
.stop = snd_timer_s_stop .stop = snd_timer_s_stop
}; };
static void snd_timer_free_system(snd_timer_t *timer) static void snd_timer_free_system(struct snd_timer *timer)
{ {
kfree(timer->private_data); kfree(timer->private_data);
} }
static int snd_timer_register_system(void) static int snd_timer_register_system(void)
{ {
snd_timer_t *timer; struct snd_timer *timer;
struct snd_timer_system_private *priv; struct snd_timer_system_private *priv;
int err; int err;
...@@ -1055,17 +1053,17 @@ static int snd_timer_register_system(void) ...@@ -1055,17 +1053,17 @@ static int snd_timer_register_system(void)
* Info interface * Info interface
*/ */
static void snd_timer_proc_read(snd_info_entry_t *entry, static void snd_timer_proc_read(struct snd_info_entry *entry,
snd_info_buffer_t * buffer) struct snd_info_buffer *buffer)
{ {
unsigned long flags; unsigned long flags;
snd_timer_t *timer; struct snd_timer *timer;
snd_timer_instance_t *ti; struct snd_timer_instance *ti;
struct list_head *p, *q; struct list_head *p, *q;
down(&register_mutex); down(&register_mutex);
list_for_each(p, &snd_timer_list) { list_for_each(p, &snd_timer_list) {
timer = list_entry(p, snd_timer_t, device_list); timer = list_entry(p, struct snd_timer, device_list);
switch (timer->tmr_class) { switch (timer->tmr_class) {
case SNDRV_TIMER_CLASS_GLOBAL: case SNDRV_TIMER_CLASS_GLOBAL:
snd_iprintf(buffer, "G%i: ", timer->tmr_device); snd_iprintf(buffer, "G%i: ", timer->tmr_device);
...@@ -1094,7 +1092,7 @@ static void snd_timer_proc_read(snd_info_entry_t *entry, ...@@ -1094,7 +1092,7 @@ static void snd_timer_proc_read(snd_info_entry_t *entry,
snd_iprintf(buffer, "\n"); snd_iprintf(buffer, "\n");
spin_lock_irqsave(&timer->lock, flags); spin_lock_irqsave(&timer->lock, flags);
list_for_each(q, &timer->open_list_head) { list_for_each(q, &timer->open_list_head) {
ti = list_entry(q, snd_timer_instance_t, open_list); ti = list_entry(q, struct snd_timer_instance, open_list);
snd_iprintf(buffer, " Client %s : %s\n", snd_iprintf(buffer, " Client %s : %s\n",
ti->owner ? ti->owner : "unknown", ti->owner ? ti->owner : "unknown",
ti->flags & (SNDRV_TIMER_IFLG_START | ti->flags & (SNDRV_TIMER_IFLG_START |
...@@ -1110,12 +1108,12 @@ static void snd_timer_proc_read(snd_info_entry_t *entry, ...@@ -1110,12 +1108,12 @@ static void snd_timer_proc_read(snd_info_entry_t *entry,
* USER SPACE interface * USER SPACE interface
*/ */
static void snd_timer_user_interrupt(snd_timer_instance_t *timeri, static void snd_timer_user_interrupt(struct snd_timer_instance *timeri,
unsigned long resolution, unsigned long resolution,
unsigned long ticks) unsigned long ticks)
{ {
snd_timer_user_t *tu = timeri->callback_data; struct snd_timer_user *tu = timeri->callback_data;
snd_timer_read_t *r; struct snd_timer_read *r;
int prev; int prev;
spin_lock(&tu->qlock); spin_lock(&tu->qlock);
...@@ -1142,8 +1140,8 @@ static void snd_timer_user_interrupt(snd_timer_instance_t *timeri, ...@@ -1142,8 +1140,8 @@ static void snd_timer_user_interrupt(snd_timer_instance_t *timeri,
wake_up(&tu->qchange_sleep); wake_up(&tu->qchange_sleep);
} }
static void snd_timer_user_append_to_tqueue(snd_timer_user_t *tu, static void snd_timer_user_append_to_tqueue(struct snd_timer_user *tu,
snd_timer_tread_t *tread) struct snd_timer_tread *tread)
{ {
if (tu->qused >= tu->queue_size) { if (tu->qused >= tu->queue_size) {
tu->overrun++; tu->overrun++;
...@@ -1154,13 +1152,13 @@ static void snd_timer_user_append_to_tqueue(snd_timer_user_t *tu, ...@@ -1154,13 +1152,13 @@ static void snd_timer_user_append_to_tqueue(snd_timer_user_t *tu,
} }
} }
static void snd_timer_user_ccallback(snd_timer_instance_t *timeri, static void snd_timer_user_ccallback(struct snd_timer_instance *timeri,
enum sndrv_timer_event event, int event,
struct timespec *tstamp, struct timespec *tstamp,
unsigned long resolution) unsigned long resolution)
{ {
snd_timer_user_t *tu = timeri->callback_data; struct snd_timer_user *tu = timeri->callback_data;
snd_timer_tread_t r1; struct snd_timer_tread r1;
if (event >= SNDRV_TIMER_EVENT_START && if (event >= SNDRV_TIMER_EVENT_START &&
event <= SNDRV_TIMER_EVENT_PAUSE) event <= SNDRV_TIMER_EVENT_PAUSE)
...@@ -1177,12 +1175,12 @@ static void snd_timer_user_ccallback(snd_timer_instance_t *timeri, ...@@ -1177,12 +1175,12 @@ static void snd_timer_user_ccallback(snd_timer_instance_t *timeri,
wake_up(&tu->qchange_sleep); wake_up(&tu->qchange_sleep);
} }
static void snd_timer_user_tinterrupt(snd_timer_instance_t *timeri, static void snd_timer_user_tinterrupt(struct snd_timer_instance *timeri,
unsigned long resolution, unsigned long resolution,
unsigned long ticks) unsigned long ticks)
{ {
snd_timer_user_t *tu = timeri->callback_data; struct snd_timer_user *tu = timeri->callback_data;
snd_timer_tread_t *r, r1; struct snd_timer_tread *r, r1;
struct timespec tstamp; struct timespec tstamp;
int prev, append = 0; int prev, append = 0;
...@@ -1233,7 +1231,7 @@ static void snd_timer_user_tinterrupt(snd_timer_instance_t *timeri, ...@@ -1233,7 +1231,7 @@ static void snd_timer_user_tinterrupt(snd_timer_instance_t *timeri,
static int snd_timer_user_open(struct inode *inode, struct file *file) static int snd_timer_user_open(struct inode *inode, struct file *file)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
tu = kzalloc(sizeof(*tu), GFP_KERNEL); tu = kzalloc(sizeof(*tu), GFP_KERNEL);
if (tu == NULL) if (tu == NULL)
...@@ -1243,7 +1241,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file) ...@@ -1243,7 +1241,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file)
init_MUTEX(&tu->tread_sem); init_MUTEX(&tu->tread_sem);
tu->ticks = 1; tu->ticks = 1;
tu->queue_size = 128; tu->queue_size = 128;
tu->queue = kmalloc(tu->queue_size * sizeof(snd_timer_read_t), tu->queue = kmalloc(tu->queue_size * sizeof(struct snd_timer_read),
GFP_KERNEL); GFP_KERNEL);
if (tu->queue == NULL) { if (tu->queue == NULL) {
kfree(tu); kfree(tu);
...@@ -1255,7 +1253,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file) ...@@ -1255,7 +1253,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file)
static int snd_timer_user_release(struct inode *inode, struct file *file) static int snd_timer_user_release(struct inode *inode, struct file *file)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
if (file->private_data) { if (file->private_data) {
tu = file->private_data; tu = file->private_data;
...@@ -1270,7 +1268,7 @@ static int snd_timer_user_release(struct inode *inode, struct file *file) ...@@ -1270,7 +1268,7 @@ static int snd_timer_user_release(struct inode *inode, struct file *file)
return 0; return 0;
} }
static void snd_timer_user_zero_id(snd_timer_id_t *id) static void snd_timer_user_zero_id(struct snd_timer_id *id)
{ {
id->dev_class = SNDRV_TIMER_CLASS_NONE; id->dev_class = SNDRV_TIMER_CLASS_NONE;
id->dev_sclass = SNDRV_TIMER_SCLASS_NONE; id->dev_sclass = SNDRV_TIMER_SCLASS_NONE;
...@@ -1279,7 +1277,7 @@ static void snd_timer_user_zero_id(snd_timer_id_t *id) ...@@ -1279,7 +1277,7 @@ static void snd_timer_user_zero_id(snd_timer_id_t *id)
id->subdevice = -1; id->subdevice = -1;
} }
static void snd_timer_user_copy_id(snd_timer_id_t *id, snd_timer_t *timer) static void snd_timer_user_copy_id(struct snd_timer_id *id, struct snd_timer *timer)
{ {
id->dev_class = timer->tmr_class; id->dev_class = timer->tmr_class;
id->dev_sclass = SNDRV_TIMER_SCLASS_NONE; id->dev_sclass = SNDRV_TIMER_SCLASS_NONE;
...@@ -1288,10 +1286,10 @@ static void snd_timer_user_copy_id(snd_timer_id_t *id, snd_timer_t *timer) ...@@ -1288,10 +1286,10 @@ static void snd_timer_user_copy_id(snd_timer_id_t *id, snd_timer_t *timer)
id->subdevice = timer->tmr_subdevice; id->subdevice = timer->tmr_subdevice;
} }
static int snd_timer_user_next_device(snd_timer_id_t __user *_tid) static int snd_timer_user_next_device(struct snd_timer_id __user *_tid)
{ {
snd_timer_id_t id; struct snd_timer_id id;
snd_timer_t *timer; struct snd_timer *timer;
struct list_head *p; struct list_head *p;
if (copy_from_user(&id, _tid, sizeof(id))) if (copy_from_user(&id, _tid, sizeof(id)))
...@@ -1302,7 +1300,7 @@ static int snd_timer_user_next_device(snd_timer_id_t __user *_tid) ...@@ -1302,7 +1300,7 @@ static int snd_timer_user_next_device(snd_timer_id_t __user *_tid)
snd_timer_user_zero_id(&id); snd_timer_user_zero_id(&id);
else { else {
timer = list_entry(snd_timer_list.next, timer = list_entry(snd_timer_list.next,
snd_timer_t, device_list); struct snd_timer, device_list);
snd_timer_user_copy_id(&id, timer); snd_timer_user_copy_id(&id, timer);
} }
} else { } else {
...@@ -1310,7 +1308,7 @@ static int snd_timer_user_next_device(snd_timer_id_t __user *_tid) ...@@ -1310,7 +1308,7 @@ static int snd_timer_user_next_device(snd_timer_id_t __user *_tid)
case SNDRV_TIMER_CLASS_GLOBAL: case SNDRV_TIMER_CLASS_GLOBAL:
id.device = id.device < 0 ? 0 : id.device + 1; id.device = id.device < 0 ? 0 : id.device + 1;
list_for_each(p, &snd_timer_list) { list_for_each(p, &snd_timer_list) {
timer = list_entry(p, snd_timer_t, device_list); timer = list_entry(p, struct snd_timer, device_list);
if (timer->tmr_class > SNDRV_TIMER_CLASS_GLOBAL) { if (timer->tmr_class > SNDRV_TIMER_CLASS_GLOBAL) {
snd_timer_user_copy_id(&id, timer); snd_timer_user_copy_id(&id, timer);
break; break;
...@@ -1343,7 +1341,7 @@ static int snd_timer_user_next_device(snd_timer_id_t __user *_tid) ...@@ -1343,7 +1341,7 @@ static int snd_timer_user_next_device(snd_timer_id_t __user *_tid)
} }
} }
list_for_each(p, &snd_timer_list) { list_for_each(p, &snd_timer_list) {
timer = list_entry(p, snd_timer_t, device_list); timer = list_entry(p, struct snd_timer, device_list);
if (timer->tmr_class > id.dev_class) { if (timer->tmr_class > id.dev_class) {
snd_timer_user_copy_id(&id, timer); snd_timer_user_copy_id(&id, timer);
break; break;
...@@ -1385,11 +1383,11 @@ static int snd_timer_user_next_device(snd_timer_id_t __user *_tid) ...@@ -1385,11 +1383,11 @@ static int snd_timer_user_next_device(snd_timer_id_t __user *_tid)
} }
static int snd_timer_user_ginfo(struct file *file, static int snd_timer_user_ginfo(struct file *file,
snd_timer_ginfo_t __user *_ginfo) struct snd_timer_ginfo __user *_ginfo)
{ {
snd_timer_ginfo_t *ginfo; struct snd_timer_ginfo *ginfo;
snd_timer_id_t tid; struct snd_timer_id tid;
snd_timer_t *t; struct snd_timer *t;
struct list_head *p; struct list_head *p;
int err = 0; int err = 0;
...@@ -1430,10 +1428,10 @@ static int snd_timer_user_ginfo(struct file *file, ...@@ -1430,10 +1428,10 @@ static int snd_timer_user_ginfo(struct file *file,
} }
static int snd_timer_user_gparams(struct file *file, static int snd_timer_user_gparams(struct file *file,
snd_timer_gparams_t __user *_gparams) struct snd_timer_gparams __user *_gparams)
{ {
snd_timer_gparams_t gparams; struct snd_timer_gparams gparams;
snd_timer_t *t; struct snd_timer *t;
int err; int err;
if (copy_from_user(&gparams, _gparams, sizeof(gparams))) if (copy_from_user(&gparams, _gparams, sizeof(gparams)))
...@@ -1459,11 +1457,11 @@ static int snd_timer_user_gparams(struct file *file, ...@@ -1459,11 +1457,11 @@ static int snd_timer_user_gparams(struct file *file,
} }
static int snd_timer_user_gstatus(struct file *file, static int snd_timer_user_gstatus(struct file *file,
snd_timer_gstatus_t __user *_gstatus) struct snd_timer_gstatus __user *_gstatus)
{ {
snd_timer_gstatus_t gstatus; struct snd_timer_gstatus gstatus;
snd_timer_id_t tid; struct snd_timer_id tid;
snd_timer_t *t; struct snd_timer *t;
int err = 0; int err = 0;
if (copy_from_user(&gstatus, _gstatus, sizeof(gstatus))) if (copy_from_user(&gstatus, _gstatus, sizeof(gstatus)))
...@@ -1495,10 +1493,10 @@ static int snd_timer_user_gstatus(struct file *file, ...@@ -1495,10 +1493,10 @@ static int snd_timer_user_gstatus(struct file *file,
} }
static int snd_timer_user_tselect(struct file *file, static int snd_timer_user_tselect(struct file *file,
snd_timer_select_t __user *_tselect) struct snd_timer_select __user *_tselect)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
snd_timer_select_t tselect; struct snd_timer_select tselect;
char str[32]; char str[32];
int err = 0; int err = 0;
...@@ -1524,12 +1522,12 @@ static int snd_timer_user_tselect(struct file *file, ...@@ -1524,12 +1522,12 @@ static int snd_timer_user_tselect(struct file *file,
kfree(tu->tqueue); kfree(tu->tqueue);
tu->tqueue = NULL; tu->tqueue = NULL;
if (tu->tread) { if (tu->tread) {
tu->tqueue = kmalloc(tu->queue_size * sizeof(snd_timer_tread_t), tu->tqueue = kmalloc(tu->queue_size * sizeof(struct snd_timer_tread),
GFP_KERNEL); GFP_KERNEL);
if (tu->tqueue == NULL) if (tu->tqueue == NULL)
err = -ENOMEM; err = -ENOMEM;
} else { } else {
tu->queue = kmalloc(tu->queue_size * sizeof(snd_timer_read_t), tu->queue = kmalloc(tu->queue_size * sizeof(struct snd_timer_read),
GFP_KERNEL); GFP_KERNEL);
if (tu->queue == NULL) if (tu->queue == NULL)
err = -ENOMEM; err = -ENOMEM;
...@@ -1552,11 +1550,11 @@ static int snd_timer_user_tselect(struct file *file, ...@@ -1552,11 +1550,11 @@ static int snd_timer_user_tselect(struct file *file,
} }
static int snd_timer_user_info(struct file *file, static int snd_timer_user_info(struct file *file,
snd_timer_info_t __user *_info) struct snd_timer_info __user *_info)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
snd_timer_info_t *info; struct snd_timer_info *info;
snd_timer_t *t; struct snd_timer *t;
int err = 0; int err = 0;
tu = file->private_data; tu = file->private_data;
...@@ -1580,13 +1578,13 @@ static int snd_timer_user_info(struct file *file, ...@@ -1580,13 +1578,13 @@ static int snd_timer_user_info(struct file *file,
} }
static int snd_timer_user_params(struct file *file, static int snd_timer_user_params(struct file *file,
snd_timer_params_t __user *_params) struct snd_timer_params __user *_params)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
snd_timer_params_t params; struct snd_timer_params params;
snd_timer_t *t; struct snd_timer *t;
snd_timer_read_t *tr; struct snd_timer_read *tr;
snd_timer_tread_t *ttr; struct snd_timer_tread *ttr;
int err; int err;
tu = file->private_data; tu = file->private_data;
...@@ -1656,14 +1654,14 @@ static int snd_timer_user_params(struct file *file, ...@@ -1656,14 +1654,14 @@ static int snd_timer_user_params(struct file *file,
tu->qhead = tu->qtail = tu->qused = 0; tu->qhead = tu->qtail = tu->qused = 0;
if (tu->timeri->flags & SNDRV_TIMER_IFLG_EARLY_EVENT) { if (tu->timeri->flags & SNDRV_TIMER_IFLG_EARLY_EVENT) {
if (tu->tread) { if (tu->tread) {
snd_timer_tread_t tread; struct snd_timer_tread tread;
tread.event = SNDRV_TIMER_EVENT_EARLY; tread.event = SNDRV_TIMER_EVENT_EARLY;
tread.tstamp.tv_sec = 0; tread.tstamp.tv_sec = 0;
tread.tstamp.tv_nsec = 0; tread.tstamp.tv_nsec = 0;
tread.val = 0; tread.val = 0;
snd_timer_user_append_to_tqueue(tu, &tread); snd_timer_user_append_to_tqueue(tu, &tread);
} else { } else {
snd_timer_read_t *r = &tu->queue[0]; struct snd_timer_read *r = &tu->queue[0];
r->resolution = 0; r->resolution = 0;
r->ticks = 0; r->ticks = 0;
tu->qused++; tu->qused++;
...@@ -1680,10 +1678,10 @@ static int snd_timer_user_params(struct file *file, ...@@ -1680,10 +1678,10 @@ static int snd_timer_user_params(struct file *file,
} }
static int snd_timer_user_status(struct file *file, static int snd_timer_user_status(struct file *file,
snd_timer_status_t __user *_status) struct snd_timer_status __user *_status)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
snd_timer_status_t status; struct snd_timer_status status;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -1703,7 +1701,7 @@ static int snd_timer_user_status(struct file *file, ...@@ -1703,7 +1701,7 @@ static int snd_timer_user_status(struct file *file,
static int snd_timer_user_start(struct file *file) static int snd_timer_user_start(struct file *file)
{ {
int err; int err;
snd_timer_user_t *tu; struct snd_timer_user *tu;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -1716,7 +1714,7 @@ static int snd_timer_user_start(struct file *file) ...@@ -1716,7 +1714,7 @@ static int snd_timer_user_start(struct file *file)
static int snd_timer_user_stop(struct file *file) static int snd_timer_user_stop(struct file *file)
{ {
int err; int err;
snd_timer_user_t *tu; struct snd_timer_user *tu;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -1726,7 +1724,7 @@ static int snd_timer_user_stop(struct file *file) ...@@ -1726,7 +1724,7 @@ static int snd_timer_user_stop(struct file *file)
static int snd_timer_user_continue(struct file *file) static int snd_timer_user_continue(struct file *file)
{ {
int err; int err;
snd_timer_user_t *tu; struct snd_timer_user *tu;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -1737,7 +1735,7 @@ static int snd_timer_user_continue(struct file *file) ...@@ -1737,7 +1735,7 @@ static int snd_timer_user_continue(struct file *file)
static int snd_timer_user_pause(struct file *file) static int snd_timer_user_pause(struct file *file)
{ {
int err; int err;
snd_timer_user_t *tu; struct snd_timer_user *tu;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -1754,7 +1752,7 @@ enum { ...@@ -1754,7 +1752,7 @@ enum {
static long snd_timer_user_ioctl(struct file *file, unsigned int cmd, static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int __user *p = argp; int __user *p = argp;
...@@ -1813,7 +1811,7 @@ static long snd_timer_user_ioctl(struct file *file, unsigned int cmd, ...@@ -1813,7 +1811,7 @@ static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
static int snd_timer_user_fasync(int fd, struct file * file, int on) static int snd_timer_user_fasync(int fd, struct file * file, int on)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
int err; int err;
tu = file->private_data; tu = file->private_data;
...@@ -1826,12 +1824,12 @@ static int snd_timer_user_fasync(int fd, struct file * file, int on) ...@@ -1826,12 +1824,12 @@ static int snd_timer_user_fasync(int fd, struct file * file, int on)
static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, static ssize_t snd_timer_user_read(struct file *file, char __user *buffer,
size_t count, loff_t *offset) size_t count, loff_t *offset)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
long result = 0, unit; long result = 0, unit;
int err = 0; int err = 0;
tu = file->private_data; tu = file->private_data;
unit = tu->tread ? sizeof(snd_timer_tread_t) : sizeof(snd_timer_read_t); unit = tu->tread ? sizeof(struct snd_timer_tread) : sizeof(struct snd_timer_read);
spin_lock_irq(&tu->qlock); spin_lock_irq(&tu->qlock);
while ((long)count - result >= unit) { while ((long)count - result >= unit) {
while (!tu->qused) { while (!tu->qused) {
...@@ -1864,13 +1862,13 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, ...@@ -1864,13 +1862,13 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer,
if (tu->tread) { if (tu->tread) {
if (copy_to_user(buffer, &tu->tqueue[tu->qhead++], if (copy_to_user(buffer, &tu->tqueue[tu->qhead++],
sizeof(snd_timer_tread_t))) { sizeof(struct snd_timer_tread))) {
err = -EFAULT; err = -EFAULT;
goto _error; goto _error;
} }
} else { } else {
if (copy_to_user(buffer, &tu->queue[tu->qhead++], if (copy_to_user(buffer, &tu->queue[tu->qhead++],
sizeof(snd_timer_read_t))) { sizeof(struct snd_timer_read))) {
err = -EFAULT; err = -EFAULT;
goto _error; goto _error;
} }
...@@ -1892,7 +1890,7 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, ...@@ -1892,7 +1890,7 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer,
static unsigned int snd_timer_user_poll(struct file *file, poll_table * wait) static unsigned int snd_timer_user_poll(struct file *file, poll_table * wait)
{ {
unsigned int mask; unsigned int mask;
snd_timer_user_t *tu; struct snd_timer_user *tu;
tu = file->private_data; tu = file->private_data;
...@@ -1923,7 +1921,7 @@ static struct file_operations snd_timer_f_ops = ...@@ -1923,7 +1921,7 @@ static struct file_operations snd_timer_f_ops =
.fasync = snd_timer_user_fasync, .fasync = snd_timer_user_fasync,
}; };
static snd_minor_t snd_timer_reg = static struct snd_minor snd_timer_reg =
{ {
.comment = "timer", .comment = "timer",
.f_ops = &snd_timer_f_ops, .f_ops = &snd_timer_f_ops,
...@@ -1933,12 +1931,12 @@ static snd_minor_t snd_timer_reg = ...@@ -1933,12 +1931,12 @@ static snd_minor_t snd_timer_reg =
* ENTRY functions * ENTRY functions
*/ */
static snd_info_entry_t *snd_timer_proc_entry = NULL; static struct snd_info_entry *snd_timer_proc_entry = NULL;
static int __init alsa_timer_init(void) static int __init alsa_timer_init(void)
{ {
int err; int err;
snd_info_entry_t *entry; struct snd_info_entry *entry;
#ifdef SNDRV_OSS_INFO_DEV_TIMERS #ifdef SNDRV_OSS_INFO_DEV_TIMERS
snd_oss_info_register(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1, snd_oss_info_register(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1,
...@@ -1971,7 +1969,7 @@ static void __exit alsa_timer_exit(void) ...@@ -1971,7 +1969,7 @@ static void __exit alsa_timer_exit(void)
snd_unregister_device(SNDRV_DEVICE_TYPE_TIMER, NULL, 0); snd_unregister_device(SNDRV_DEVICE_TYPE_TIMER, NULL, 0);
/* unregister the system timer */ /* unregister the system timer */
list_for_each_safe(p, n, &snd_timer_list) { list_for_each_safe(p, n, &snd_timer_list) {
snd_timer_t *timer = list_entry(p, snd_timer_t, device_list); struct snd_timer *timer = list_entry(p, struct snd_timer, device_list);
snd_timer_unregister(timer); snd_timer_unregister(timer);
} }
if (snd_timer_proc_entry) { if (snd_timer_proc_entry) {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <linux/compat.h> #include <linux/compat.h>
struct sndrv_timer_info32 { struct snd_timer_info32 {
u32 flags; u32 flags;
s32 card; s32 card;
unsigned char id[64]; unsigned char id[64];
...@@ -33,11 +33,11 @@ struct sndrv_timer_info32 { ...@@ -33,11 +33,11 @@ struct sndrv_timer_info32 {
}; };
static int snd_timer_user_info_compat(struct file *file, static int snd_timer_user_info_compat(struct file *file,
struct sndrv_timer_info32 __user *_info) struct snd_timer_info32 __user *_info)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
struct sndrv_timer_info32 info; struct snd_timer_info32 info;
snd_timer_t *t; struct snd_timer *t;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -55,7 +55,7 @@ static int snd_timer_user_info_compat(struct file *file, ...@@ -55,7 +55,7 @@ static int snd_timer_user_info_compat(struct file *file,
return 0; return 0;
} }
struct sndrv_timer_status32 { struct snd_timer_status32 {
struct compat_timespec tstamp; struct compat_timespec tstamp;
u32 resolution; u32 resolution;
u32 lost; u32 lost;
...@@ -65,10 +65,10 @@ struct sndrv_timer_status32 { ...@@ -65,10 +65,10 @@ struct sndrv_timer_status32 {
}; };
static int snd_timer_user_status_compat(struct file *file, static int snd_timer_user_status_compat(struct file *file,
struct sndrv_timer_status32 __user *_status) struct snd_timer_status32 __user *_status)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
snd_timer_status_t status; struct snd_timer_status status;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -89,8 +89,8 @@ static int snd_timer_user_status_compat(struct file *file, ...@@ -89,8 +89,8 @@ static int snd_timer_user_status_compat(struct file *file,
*/ */
enum { enum {
SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct sndrv_timer_info32), SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct snd_timer_info32),
SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct sndrv_timer_status32), SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct snd_timer_status32),
}; };
static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册