diff options
author | Julian Elischer <julian@FreeBSD.org> | 1998-07-04 22:30:26 +0000 |
---|---|---|
committer | Julian Elischer <julian@FreeBSD.org> | 1998-07-04 22:30:26 +0000 |
commit | f7ea2f55d11712e31e448896b4d1bda81be24e35 (patch) | |
tree | 5b1d39937f11bc9995acb310c60d52bc73d652f8 /sys/i386/isa/wt.c | |
parent | 2c5174cba2eb6fd3fd2a06bc9dcff33c44649ed6 (diff) | |
download | src-f7ea2f55d11712e31e448896b4d1bda81be24e35.tar.gz src-f7ea2f55d11712e31e448896b4d1bda81be24e35.zip |
There is no such thing any more as "struct bdevsw".
There is only cdevsw (which should be renamed in a later edit to deventry
or something). cdevsw contains the union of what were in both bdevsw an
cdevsw entries. The bdevsw[] table stiff exists and is a second pointer
to the cdevsw entry of the device. it's major is in d_bmaj rather than
d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers
to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw).
rawread()/rawwrite() went away as part of this though it's not strictly
the same patch, just that it involves all the same lines in the drivers.
cdroms no longer have write() entries (they did have rawwrite (?)).
tapes no longer have support for bdev operations.
Reviewed by: Eivind Eklund and Mike Smith
Changes suggested by eivind.
Notes
Notes:
svn path=/head/; revision=37389
Diffstat (limited to 'sys/i386/isa/wt.c')
-rw-r--r-- | sys/i386/isa/wt.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c index 9c317a63a7eb..481397e39abb 100644 --- a/sys/i386/isa/wt.c +++ b/sys/i386/isa/wt.c @@ -20,7 +20,7 @@ * the original CMU copyright notice. * * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 - * $Id: wt.c,v 1.43 1998/01/24 02:54:28 eivind Exp $ + * $Id: wt.c,v 1.44 1998/06/07 17:11:07 dfr Exp $ * */ @@ -163,7 +163,6 @@ typedef struct { unsigned char BUSY, NOEXCEP, RESETMASK, RESETVAL; unsigned char ONLINE, RESET, REQUEST, IEN; #ifdef DEVFS - void *devfs_token; void *devfs_token_r; #endif } wtinfo_t; @@ -185,6 +184,8 @@ static int wtwritefm (wtinfo_t *t); static int wtpoll (wtinfo_t *t, int mask, int bits); static d_open_t wtopen; +static d_read_t wtread; +static d_write_t wtwrite; static d_close_t wtclose; static d_ioctl_t wtioctl; static d_dump_t wtdump; @@ -194,10 +195,12 @@ static d_strategy_t wtstrategy; #define CDEV_MAJOR 10 #define BDEV_MAJOR 3 -static struct cdevsw wt_cdevsw; -static struct bdevsw wt_bdevsw = - { wtopen, wtclose, wtstrategy, wtioctl, /*3*/ - wtdump, wtsize, B_TAPE, "wt", &wt_cdevsw, -1 }; + +static struct cdevsw wt_cdevsw = { + wtopen, wtclose, wtread, wtwrite, + wtioctl, nostop, nullreset, nodevtotty, + seltrue, nommap, wtstrategy, "wt", + NULL, -1 }; /* @@ -266,9 +269,6 @@ wtattach (struct isa_device *id) t->devfs_token_r = devfs_add_devswf(&wt_cdevsw, id->id_unit, DV_CHR, 0, 0, 0600, "rwt%d", id->id_unit); - t->devfs_token = - devfs_add_devswf(&wt_bdevsw, id->id_unit, DV_BLK, 0, 0, - 0600, "wt%d", id->id_unit); #endif return (1); } @@ -510,6 +510,18 @@ wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct proc *p) return (EINVAL); } +static int +wtread(dev_t dev, struct uio *uio, int ioflag) +{ + return (physio(wtstrategy, NULL, dev, 1, minphys, uio)); +} + +static int +wtwrite(dev_t dev, struct uio *uio, int ioflag) +{ + return (physio(wtstrategy, NULL, dev, 0, minphys, uio)); +} + /* * Strategy routine. */ @@ -991,7 +1003,10 @@ wt_drvinit(void *unused) { if( ! wt_devsw_installed ) { - bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &wt_bdevsw); + dev_t dev; + + dev = makedev(CDEV_MAJOR, 0); + cdevsw_add(&dev, &wt_cdevsw, NULL); wt_devsw_installed = 1; } } |