diff options
author | julian <julian@FreeBSD.org> | 1998-07-04 22:30:26 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1998-07-04 22:30:26 +0000 |
commit | 0262543b5f83779b740399f4b8e107618d149997 (patch) | |
tree | 089ad4ebaec66b188dddc6918932d35b7dc8cb70 /sys/isa | |
parent | 29cbc265b1c33cbb4deb6416d04fc45ac6d03869 (diff) | |
download | FreeBSD-src-0262543b5f83779b740399f4b8e107618d149997.zip FreeBSD-src-0262543b5f83779b740399f4b8e107618d149997.tar.gz |
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.
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/fd.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 47947d1..472fe57 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -1,3 +1,4 @@ + /* * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -43,7 +44,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.113 1998/06/07 17:10:20 dfr Exp $ + * $Id: fd.c,v 1.114 1998/06/07 19:40:39 dfr Exp $ * */ @@ -299,6 +300,8 @@ struct isa_driver fdcdriver = { }; static d_open_t Fdopen; /* NOTE, not fdopen */ +static d_read_t fdread; +static d_write_t fdwrite; static d_close_t fdclose; static d_ioctl_t fdioctl; static d_strategy_t fdstrategy; @@ -306,10 +309,14 @@ static d_strategy_t fdstrategy; /* even if SLICE defined, these are needed for the ft support. */ #define CDEV_MAJOR 9 #define BDEV_MAJOR 2 -static struct cdevsw fd_cdevsw; -static struct bdevsw fd_bdevsw = - { Fdopen, fdclose, fdstrategy, fdioctl, /*2*/ - nodump, nopsize, D_DISK, "fd", &fd_cdevsw, -1 }; + + +static struct cdevsw fd_cdevsw = { + Fdopen, fdclose, fdread, fdwrite, + fdioctl, nostop, nullreset, nodevtotty, + seltrue, nommap, fdstrategy, "fd", + NULL, -1, nodump, nopsize, + D_DISK, 0, -1 }; static struct isa_device *fdcdevs[NFDC]; @@ -798,7 +805,7 @@ fdattach(struct isa_device *dev) config_intrhook_establish(&fd->ich); #else /* SLICE */ mynor = fdu << 6; - fd->bdevs[0] = devfs_add_devswf(&fd_bdevsw, mynor, DV_BLK, + fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK, UID_ROOT, GID_OPERATOR, 0640, "fd%d", fdu); fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR, @@ -863,7 +870,7 @@ fdattach(struct isa_device *dev) #else /* SLICE */ typemynor = mynor | i; fd->bdevs[i] = - devfs_add_devswf(&fd_bdevsw, typemynor, DV_BLK, + devfs_add_devswf(&fd_cdevsw, typemynor, DV_BLK, UID_ROOT, GID_OPERATOR, 0640, "fd%d.%d", fdu, typesize); fd->cdevs[i] = @@ -1210,6 +1217,18 @@ fdclose(dev_t dev, int flags, int mode, struct proc *p) return(0); } +static int +fdread(dev_t dev, struct uio *uio, int ioflag) +{ + return (physio(fdstrategy, NULL, dev, 1, minphys, uio)); +} + +static int +fdwrite(dev_t dev, struct uio *uio, int ioflag) +{ + return (physio(fdstrategy, NULL, dev, 0, minphys, uio)); +} + /****************************************************************************/ /* fdstrategy */ @@ -2180,7 +2199,7 @@ static void fd_drvinit(void *notused ) { if( ! fd_devsw_installed ) { - bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &fd_bdevsw); + cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &fd_cdevsw); fd_devsw_installed = 1; } } |