Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182695
b: refs/heads/master
c: 6b98515
h: refs/heads/master
i:
  182693: 3fd5d72
  182691: 0115a97
  182687: 291dcb8
v: v3
  • Loading branch information
Alan Cox authored and Takashi Iwai committed Jan 12, 2010
1 parent de0e33e commit 1457dce
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a29fb94ff48cba620e1ac1317f5eef5920ead3ff
refs/heads/master: 6b98515a620592636d2f8e0d3e2942d1cb4847ec
35 changes: 22 additions & 13 deletions trunk/sound/oss/soundcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ static int sound_mixer_ioctl(int mixdev, unsigned int cmd, void __user *arg)
return mixer_devs[mixdev]->ioctl(mixdev, cmd, arg);
}

static int sound_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
int len = 0, dtype;
int dev = iminor(inode);
int dev = iminor(file->f_dentry->d_inode);
long ret = -EINVAL;
void __user *p = (void __user *)arg;

if (_SIOC_DIR(cmd) != _SIOC_NONE && _SIOC_DIR(cmd) != 0) {
Expand All @@ -353,31 +353,39 @@ static int sound_ioctl(struct inode *inode, struct file *file,
if (cmd == OSS_GETVERSION)
return __put_user(SOUND_VERSION, (int __user *)p);

lock_kernel();
if (_IOC_TYPE(cmd) == 'M' && num_mixers > 0 && /* Mixer ioctl */
(dev & 0x0f) != SND_DEV_CTL) {
dtype = dev & 0x0f;
switch (dtype) {
case SND_DEV_DSP:
case SND_DEV_DSP16:
case SND_DEV_AUDIO:
return sound_mixer_ioctl(audio_devs[dev >> 4]->mixer_dev,
ret = sound_mixer_ioctl(audio_devs[dev >> 4]->mixer_dev,
cmd, p);

break;
default:
return sound_mixer_ioctl(dev >> 4, cmd, p);
ret = sound_mixer_ioctl(dev >> 4, cmd, p);
break;
}
unlock_kernel();
return ret;
}

switch (dev & 0x0f) {
case SND_DEV_CTL:
if (cmd == SOUND_MIXER_GETLEVELS)
return get_mixer_levels(p);
if (cmd == SOUND_MIXER_SETLEVELS)
return set_mixer_levels(p);
return sound_mixer_ioctl(dev >> 4, cmd, p);
ret = get_mixer_levels(p);
else if (cmd == SOUND_MIXER_SETLEVELS)
ret = set_mixer_levels(p);
else
ret = sound_mixer_ioctl(dev >> 4, cmd, p);
break;

case SND_DEV_SEQ:
case SND_DEV_SEQ2:
return sequencer_ioctl(dev, file, cmd, p);
ret = sequencer_ioctl(dev, file, cmd, p);
break;

case SND_DEV_DSP:
case SND_DEV_DSP16:
Expand All @@ -390,7 +398,8 @@ static int sound_ioctl(struct inode *inode, struct file *file,
break;

}
return -EINVAL;
unlock_kernel();
return ret;
}

static unsigned int sound_poll(struct file *file, poll_table * wait)
Expand Down Expand Up @@ -490,7 +499,7 @@ const struct file_operations oss_sound_fops = {
.read = sound_read,
.write = sound_write,
.poll = sound_poll,
.ioctl = sound_ioctl,
.unlocked_ioctl = sound_ioctl,
.mmap = sound_mmap,
.open = sound_open,
.release = sound_release,
Expand Down

0 comments on commit 1457dce

Please sign in to comment.