diff options
author | kato <kato@FreeBSD.org> | 1998-07-06 10:09:42 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1998-07-06 10:09:42 +0000 |
commit | 59e51e381385f1bfa6ffd5160e52329bfc99e4d8 (patch) | |
tree | e2be170e94b6702825d5878c2f20cc3f41326f6a /sys | |
parent | 1c2b90ea312119c7fa79d079b71dc037f7b084cc (diff) | |
download | FreeBSD-src-59e51e381385f1bfa6ffd5160e52329bfc99e4d8.zip FreeBSD-src-59e51e381385f1bfa6ffd5160e52329bfc99e4d8.tar.gz |
Sync with sys/i386/isa/fd.c and wd.c revisions 1.115 and 1.170,
respectively.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/pc98/cbus/fdc.c | 34 | ||||
-rw-r--r-- | sys/pc98/pc98/fd.c | 34 | ||||
-rw-r--r-- | sys/pc98/pc98/wd.c | 40 |
3 files changed, 82 insertions, 26 deletions
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index 2500a0d..1e28658 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.31 1998/05/07 08:36:48 kato Exp $ + * $Id: fd.c,v 1.32 1998/06/08 08:55:43 kato Exp $ * */ @@ -394,6 +394,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; @@ -401,10 +403,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]; @@ -1060,7 +1066,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, @@ -1148,7 +1154,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] = @@ -1532,6 +1538,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 */ @@ -2613,7 +2631,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; } } diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index 2500a0d..1e28658 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.31 1998/05/07 08:36:48 kato Exp $ + * $Id: fd.c,v 1.32 1998/06/08 08:55:43 kato Exp $ * */ @@ -394,6 +394,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; @@ -401,10 +403,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]; @@ -1060,7 +1066,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, @@ -1148,7 +1154,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] = @@ -1532,6 +1538,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 */ @@ -2613,7 +2631,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; } } diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c index c545fe7..ee1e6e0 100644 --- a/sys/pc98/pc98/wd.c +++ b/sys/pc98/pc98/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.55 1998/05/12 09:32:19 kato Exp $ + * $Id: wd.c,v 1.56 1998/06/08 08:55:47 kato Exp $ */ /* TODO: @@ -315,6 +315,8 @@ static struct slice_handler slicetype = { #ifndef SLICE static d_open_t wdopen; +static d_read_t wdread; +static d_write_t wdwrite; static d_close_t wdclose; static d_strategy_t wdstrategy; static d_ioctl_t wdioctl; @@ -323,10 +325,15 @@ static d_psize_t wdsize; #define CDEV_MAJOR 3 #define BDEV_MAJOR 0 -static struct cdevsw wd_cdevsw; -static struct bdevsw wd_bdevsw = - { wdopen, wdclose, wdstrategy, wdioctl, /*0*/ - wddump, wdsize, D_DISK, "wd", &wd_cdevsw, -1 }; + + +static struct cdevsw wd_cdevsw = { + wdopen, wdclose, wdread, wdwrite, + wdioctl, nostop, nullreset, nodevtotty, + seltrue, nommap, wdstrategy, "wd", + NULL, -1, wddump, wdsize, + D_DISK, 0, -1 }; + #endif /* !SLICE */ #ifdef CMD640 @@ -675,7 +682,7 @@ wdattach(struct isa_device *dvp) config_intrhook_establish(&du->ich); #else mynor = dkmakeminor(lunit, WHOLE_DISK_SLICE, RAW_PART); - du->dk_bdev = devfs_add_devswf(&wd_bdevsw, mynor, + du->dk_bdev = devfs_add_devswf(&wd_cdevsw, mynor, DV_BLK, UID_ROOT, GID_OPERATOR, 0640, "wd%d", lunit); @@ -794,6 +801,19 @@ wds_init(void *arg) #endif #ifndef SLICE + +static int +wdread(dev_t dev, struct uio *uio, int ioflag) +{ + return (physio(wdstrategy, NULL, dev, 1, minphys, uio)); +} + +static int +wdwrite(dev_t dev, struct uio *uio, int ioflag) +{ + return (physio(wdstrategy, NULL, dev, 0, minphys, uio)); +} + /* Read/write routine for a buffer. Finds the proper unit, range checks * arguments, and schedules the transfer. Does not wait for the transfer * to complete. Multi-page transfers are supported. All I/O requests must @@ -1601,7 +1621,7 @@ wdopen(dev_t dev, int flags, int fmt, struct proc *p) label.d_secpercyl = du->dk_dd.d_secpercyl; label.d_secperunit = du->dk_dd.d_secperunit; error = dsopen("wd", dev, fmt, &du->dk_slices, &label, wdstrategy1, - (ds_setgeom_t *)NULL, &wd_bdevsw, &wd_cdevsw); + (ds_setgeom_t *)NULL, &wd_cdevsw, &wd_cdevsw); } du->dk_flags &= ~DKFL_LABELLING; wdsleep(du->dk_ctrlr, "wdopn2"); @@ -2942,9 +2962,9 @@ static void wd_drvinit(void *unused) { if( ! wd_devsw_installed ) { - if (wd_bdevsw.d_maxio == 0) - wd_bdevsw.d_maxio = 248 * 512; - bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &wd_bdevsw); + if (wd_cdevsw.d_maxio == 0) + wd_cdevsw.d_maxio = 248 * 512; + cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &wd_cdevsw); wd_devsw_installed = 1; } } |