aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-05-31 18:56:58 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-05-31 18:56:58 +0000
commite64f402ff1de1681ea7a4ca183bcd3d15768b093 (patch)
tree61b08008fdd521aef8f5ff0babd019c02b6709ca
parentd6b602d4b2e6c06923354b87ac746116f733f030 (diff)
Notes
-rw-r--r--sys/i386/isa/wt.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index e29664d30a27c..f994a7ef47cb1 100644
--- a/sys/i386/isa/wt.c
+++ b/sys/i386/isa/wt.c
@@ -249,6 +249,7 @@ static int
wtattach (struct isa_device *id)
{
wtinfo_t *t = wttab + id->id_unit;
+ dev_t dev;
id->id_ointr = wtintr;
if (t->type == ARCHIVE) {
@@ -260,7 +261,9 @@ wtattach (struct isa_device *id)
t->dens = -1; /* unknown density */
isa_dmainit(t->chan, 1024);
- make_dev(&wt_cdevsw, id->id_unit, 0, 0, 0600, "rwt%d", id->id_unit);
+ dev = make_dev(&wt_cdevsw, id->id_unit,
+ UID_ROOT, GID_WHEEL, 0600, "rwt%d", id->id_unit);
+ dev->si_drv1 = t;
return (1);
}
@@ -279,10 +282,15 @@ static int
wtopen (dev_t dev, int flag, int fmt, struct thread *td)
{
int u = minor (dev) & WT_UNIT;
- wtinfo_t *t = wttab + u;
+ wtinfo_t *t;
int error;
- if (u >= NWT || t->type == UNKNOWN)
+ if (u >= NWT)
+ return (ENXIO);
+
+ t = dev->si_drv1;
+
+ if (t->type == UNKNOWN)
return (ENXIO);
/* Check that device is not in use */
@@ -361,7 +369,9 @@ static int
wtclose (dev_t dev, int flags, int fmt, struct thread *td)
{
int u = minor (dev) & WT_UNIT;
- wtinfo_t *t = wttab + u;
+ wtinfo_t *t;
+
+ t = dev->si_drv1;
if (u >= NWT || t->type == UNKNOWN)
return (ENXIO);
@@ -410,9 +420,10 @@ static int
wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct thread *td)
{
int u = minor (dev) & WT_UNIT;
- wtinfo_t *t = wttab + u;
+ wtinfo_t *t;
int error, count, op;
+ t = dev->si_drv1;
if (u >= NWT || t->type == UNKNOWN)
return (ENXIO);
@@ -508,9 +519,10 @@ static void
wtstrategy (struct bio *bp)
{
int u = minor (bp->bio_dev) & WT_UNIT;
- wtinfo_t *t = wttab + u;
+ wtinfo_t *t;
int s;
+ t = bp->bio_dev->si_drv1;
bp->bio_resid = bp->bio_bcount;
if (u >= NWT || t->type == UNKNOWN) {
bp->bio_error = ENXIO;