]> err.no Git - linux-2.6/commitdiff
[ALSA] Change some timer ioctls due to confliction
authorTakashi Iwai <tiwai@suse.de>
Sun, 15 May 2005 13:43:54 +0000 (15:43 +0200)
committerJaroslav Kysela <perex@suse.cz>
Sun, 29 May 2005 08:10:53 +0000 (10:10 +0200)
Timer Midlevel,ALSA Core
Change values of some timer ioctls to avoid confliction with FIO* ioctls.
The protocol version is increased to indicate this change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/asound.h
sound/core/timer.c
sound/core/timer_compat.c

index 4321e92a7f8be9cc9abecd49ae02ca21b989656d..9974f83cca440a88e6e9af4f30e0b7cc2bad767b 100644 (file)
@@ -560,7 +560,7 @@ enum {
  *  Timer section - /dev/snd/timer
  */
 
-#define SNDRV_TIMER_VERSION            SNDRV_PROTOCOL_VERSION(2, 0, 3)
+#define SNDRV_TIMER_VERSION            SNDRV_PROTOCOL_VERSION(2, 0, 4)
 
 enum sndrv_timer_class {
        SNDRV_TIMER_CLASS_NONE = -1,
@@ -673,10 +673,11 @@ enum {
        SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info),
        SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params),
        SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status),
-       SNDRV_TIMER_IOCTL_START = _IO('T', 0x20),
-       SNDRV_TIMER_IOCTL_STOP = _IO('T', 0x21),
-       SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0x22),
-       SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0x23),
+       /* The following four ioctls are changed since 1.0.9 due to confliction */
+       SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0),
+       SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1),
+       SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0xa2),
+       SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3),
 };
 
 struct sndrv_timer_read {
index 48aebdf6550b81f4efdeb0a79fd7e5fe27060ef6..305e39d74092e41942c974b0353d9b987eac2896 100644 (file)
@@ -1690,6 +1690,13 @@ static int snd_timer_user_pause(struct file *file)
        return (err = snd_timer_continue(tu->timeri)) < 0 ? err : 0;
 }
 
+enum {
+       SNDRV_TIMER_IOCTL_START_OLD = _IO('T', 0x20),
+       SNDRV_TIMER_IOCTL_STOP_OLD = _IO('T', 0x21),
+       SNDRV_TIMER_IOCTL_CONTINUE_OLD = _IO('T', 0x22),
+       SNDRV_TIMER_IOCTL_PAUSE_OLD = _IO('T', 0x23),
+};
+
 static long snd_timer_user_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        snd_timer_user_t *tu;
@@ -1734,12 +1741,16 @@ static long snd_timer_user_ioctl(struct file *file, unsigned int cmd, unsigned l
        case SNDRV_TIMER_IOCTL_STATUS:
                return snd_timer_user_status(file, argp);
        case SNDRV_TIMER_IOCTL_START:
+       case SNDRV_TIMER_IOCTL_START_OLD:
                return snd_timer_user_start(file);
        case SNDRV_TIMER_IOCTL_STOP:
+       case SNDRV_TIMER_IOCTL_STOP_OLD:
                return snd_timer_user_stop(file);
        case SNDRV_TIMER_IOCTL_CONTINUE:
+       case SNDRV_TIMER_IOCTL_CONTINUE_OLD:
                return snd_timer_user_continue(file);
        case SNDRV_TIMER_IOCTL_PAUSE:
+       case SNDRV_TIMER_IOCTL_PAUSE_OLD:
                return snd_timer_user_pause(file);
        }
        return -ENOTTY;
index 420817d10b7c0c9a8579c45ccdb5029f52c6acb8..3de552dfe80f2dcb8a9644acb9824fbd9f1cba5d 100644 (file)
@@ -106,9 +106,13 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, uns
        case SNDRV_TIMER_IOCTL_SELECT:
        case SNDRV_TIMER_IOCTL_PARAMS:
        case SNDRV_TIMER_IOCTL_START:
+       case SNDRV_TIMER_IOCTL_START_OLD:
        case SNDRV_TIMER_IOCTL_STOP:
+       case SNDRV_TIMER_IOCTL_STOP_OLD:
        case SNDRV_TIMER_IOCTL_CONTINUE:
+       case SNDRV_TIMER_IOCTL_CONTINUE_OLD:
        case SNDRV_TIMER_IOCTL_PAUSE:
+       case SNDRV_TIMER_IOCTL_PAUSE_OLD:
        case SNDRV_TIMER_IOCTL_NEXT_DEVICE:
                return snd_timer_user_ioctl(file, cmd, (unsigned long)argp);
        case SNDRV_TIMER_IOCTL_INFO32: