Fix dev_t/minor problems
This commit is contained in:
parent
83ae4407f5
commit
c7b52b866e
@ -323,13 +323,14 @@ mss_attach(struct isa_device *dev)
|
||||
}
|
||||
|
||||
int
|
||||
mss_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
mss_open(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
dev &= 0xf ;
|
||||
d = &pcm_info[unit] ;
|
||||
@ -395,13 +396,14 @@ mss_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
mss_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
mss_close(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
dev &= 0xf;
|
||||
d = &pcm_info[unit] ;
|
||||
@ -437,12 +439,13 @@ mss_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
mss_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
mss_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
/*
|
||||
@ -1897,12 +1900,13 @@ gus_mem_cfg(snddev_info *d)
|
||||
#endif /* gus mem cfg... */
|
||||
|
||||
static int
|
||||
ad1816_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
ad1816_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4;
|
||||
d = &pcm_info[unit];
|
||||
|
||||
|
@ -160,12 +160,13 @@ sb_attach(struct isa_device *dev)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_open(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit ;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -235,13 +236,14 @@ sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_close(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -257,12 +259,13 @@ sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
sb_dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
|
@ -323,13 +323,14 @@ mss_attach(struct isa_device *dev)
|
||||
}
|
||||
|
||||
int
|
||||
mss_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
mss_open(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
dev &= 0xf ;
|
||||
d = &pcm_info[unit] ;
|
||||
@ -395,13 +396,14 @@ mss_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
mss_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
mss_close(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
dev &= 0xf;
|
||||
d = &pcm_info[unit] ;
|
||||
@ -437,12 +439,13 @@ mss_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
mss_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
mss_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
/*
|
||||
@ -1897,12 +1900,13 @@ gus_mem_cfg(snddev_info *d)
|
||||
#endif /* gus mem cfg... */
|
||||
|
||||
static int
|
||||
ad1816_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
ad1816_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4;
|
||||
d = &pcm_info[unit];
|
||||
|
||||
|
@ -160,12 +160,13 @@ sb_attach(struct isa_device *dev)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_open(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit ;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -235,13 +236,14 @@ sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_close(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -257,12 +259,13 @@ sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
sb_dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
|
@ -160,12 +160,13 @@ sb_attach(struct isa_device *dev)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_open(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit ;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -235,13 +236,14 @@ sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_close(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -257,12 +259,13 @@ sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
sb_dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
|
@ -160,12 +160,13 @@ sb_attach(struct isa_device *dev)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_open(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit ;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -235,13 +236,14 @@ sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_close(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -257,12 +259,13 @@ sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
sb_dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
|
@ -323,13 +323,14 @@ mss_attach(struct isa_device *dev)
|
||||
}
|
||||
|
||||
int
|
||||
mss_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
mss_open(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
dev &= 0xf ;
|
||||
d = &pcm_info[unit] ;
|
||||
@ -395,13 +396,14 @@ mss_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
mss_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
mss_close(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
dev &= 0xf;
|
||||
d = &pcm_info[unit] ;
|
||||
@ -437,12 +439,13 @@ mss_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
mss_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
mss_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
/*
|
||||
@ -1897,12 +1900,13 @@ gus_mem_cfg(snddev_info *d)
|
||||
#endif /* gus mem cfg... */
|
||||
|
||||
static int
|
||||
ad1816_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
ad1816_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4;
|
||||
d = &pcm_info[unit];
|
||||
|
||||
|
@ -160,12 +160,13 @@ sb_attach(struct isa_device *dev)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_open(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
snddev_info *d;
|
||||
int unit ;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -235,13 +236,14 @@ sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
sb_dsp_close(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
u_long s;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
@ -257,12 +259,13 @@ sb_dsp_close(dev_t dev, int flags, int mode, struct proc * p)
|
||||
}
|
||||
|
||||
static int
|
||||
sb_dsp_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
sb_dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
{
|
||||
int unit;
|
||||
int dev;
|
||||
snddev_info *d;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
unit = dev >> 4 ;
|
||||
d = &pcm_info[unit] ;
|
||||
|
||||
|
@ -445,12 +445,13 @@ generic_snd_probe(struct isa_device * dev, snddev_info **p[], char *s)
|
||||
* number.
|
||||
*/
|
||||
static snddev_info *
|
||||
get_snddev_info(dev_t dev, int *unit)
|
||||
get_snddev_info(dev_t i_dev, int *unit)
|
||||
{
|
||||
int u;
|
||||
snddev_info *d = NULL ;
|
||||
int dev;
|
||||
|
||||
dev = minor(dev);
|
||||
dev = minor(i_dev);
|
||||
u = dev >> 4 ;
|
||||
if (unit)
|
||||
*unit = u ;
|
||||
@ -502,7 +503,7 @@ sndopen(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
snddev_info *d;
|
||||
|
||||
dev = minor(i_dev);
|
||||
d = get_snddev_info(dev, &unit);
|
||||
d = get_snddev_info(i_dev, &unit);
|
||||
|
||||
DEB(printf("open snd%d subdev %d flags 0x%08x mode 0x%08x\n",
|
||||
unit, dev & 0xf, flags, mode));
|
||||
@ -545,7 +546,7 @@ sndclose(dev_t i_dev, int flags, int mode, struct proc * p)
|
||||
snddev_info *d;
|
||||
|
||||
dev = minor(i_dev);
|
||||
d = get_snddev_info(dev, &unit);
|
||||
d = get_snddev_info(i_dev, &unit);
|
||||
|
||||
DEB(printf("close snd%d subdev %d\n", unit, dev & 0xf));
|
||||
|
||||
@ -579,7 +580,7 @@ sndread(dev_t i_dev, struct uio * buf, int flag)
|
||||
|
||||
dev = minor(i_dev);
|
||||
|
||||
d = get_snddev_info(dev, &unit);
|
||||
d = get_snddev_info(i_dev, &unit);
|
||||
DEB(printf("read snd%d subdev %d flag 0x%08x\n", unit, dev & 0xf, flag));
|
||||
|
||||
if (d == NULL)
|
||||
@ -666,7 +667,7 @@ sndwrite(dev_t i_dev, struct uio * buf, int flag)
|
||||
u_long s;
|
||||
|
||||
dev = minor(i_dev);
|
||||
d = get_snddev_info(dev, &unit);
|
||||
d = get_snddev_info(i_dev, &unit);
|
||||
|
||||
DEB(printf("write snd%d subdev %d flag 0x%08x\n", unit, dev & 0xf, flag));
|
||||
|
||||
@ -752,7 +753,7 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
u_long s;
|
||||
|
||||
dev = minor(i_dev);
|
||||
d = get_snddev_info(dev, &unit);
|
||||
d = get_snddev_info(i_dev, &unit);
|
||||
|
||||
if (d == NULL)
|
||||
return (ENXIO) ;
|
||||
@ -767,7 +768,7 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
|
||||
return ENXIO ;
|
||||
}
|
||||
if (d->ioctl)
|
||||
ret = d->ioctl(dev, cmd, arg, mode, p);
|
||||
ret = d->ioctl(i_dev, cmd, arg, mode, p);
|
||||
if (ret != ENOSYS)
|
||||
return ret ;
|
||||
|
||||
@ -1189,7 +1190,7 @@ sndselect(dev_t i_dev, int rw, struct proc * p)
|
||||
u_long flags;
|
||||
|
||||
dev = minor(i_dev);
|
||||
d = get_snddev_info(dev, &unit);
|
||||
d = get_snddev_info(i_dev, &unit);
|
||||
DEB(printf("sndselect dev 0x%04x rw 0x%08x\n",i_dev, rw));
|
||||
if (d == NULL ) /* should not happen! */
|
||||
return (ENXIO) ;
|
||||
|
Loading…
Reference in New Issue
Block a user