summaryrefslogtreecommitdiffstats
path: root/sys/dev/scd
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-07-04 22:30:26 +0000
committerjulian <julian@FreeBSD.org>1998-07-04 22:30:26 +0000
commit0262543b5f83779b740399f4b8e107618d149997 (patch)
tree089ad4ebaec66b188dddc6918932d35b7dc8cb70 /sys/dev/scd
parent29cbc265b1c33cbb4deb6416d04fc45ac6d03869 (diff)
downloadFreeBSD-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/dev/scd')
-rw-r--r--sys/dev/scd/scd.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index 0494a49..98d2341 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.37 1998/06/07 17:10:56 dfr Exp $ */
+/* $Id: scd.c,v 1.38 1998/06/08 09:47:36 bde Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -186,16 +186,20 @@ struct isa_driver scddriver = { scd_probe, scd_attach, "scd" };
static struct callout_handle tohandle = CALLOUT_HANDLE_INITIALIZER(&tohanle);
static d_open_t scdopen;
+static d_read_t scdread;
static d_close_t scdclose;
static d_ioctl_t scdioctl;
static d_strategy_t scdstrategy;
#define CDEV_MAJOR 45
#define BDEV_MAJOR 16
-static struct cdevsw scd_cdevsw;
-static struct bdevsw scd_bdevsw =
- { scdopen, scdclose, scdstrategy, scdioctl, /*16*/
- nodump, nopsize, D_DISK, "scd", &scd_cdevsw, -1 };
+static struct cdevsw scd_cdevsw = {
+ scdopen, scdclose, scdread, nowrite,
+ scdioctl, nostop, nullreset, nodevtotty,
+ seltrue, nommap, scdstrategy, "scd",
+ NULL, -1, nodump, nopsize,
+ D_DISK, 0, -1 };
+
int scd_attach(struct isa_device *dev)
{
@@ -223,11 +227,11 @@ int scd_attach(struct isa_device *dev)
DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
"rscd%dc", unit);
cd->a_devfs_token =
- devfs_add_devswf(&scd_bdevsw, dkmakeminor(unit, 0, 0),
+ devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, 0),
DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
"scd%da", unit);
cd->c_devfs_token =
- devfs_add_devswf(&scd_bdevsw, dkmakeminor(unit, 0, RAW_PART),
+ devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
"scd%dc", unit);
#endif
@@ -315,6 +319,12 @@ scdclose(dev_t dev, int flags, int fmt, struct proc *p)
return 0;
}
+static int
+scdread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(scdstrategy, NULL, dev, 1, minphys, uio));
+}
+
static void
scdstrategy(struct buf *bp)
{
@@ -1563,7 +1573,7 @@ static void scd_drvinit(void *unused)
{
if( ! scd_devsw_installed ) {
- bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &scd_bdevsw);
+ cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &scd_cdevsw);
scd_devsw_installed = 1;
}
}
OpenPOWER on IntegriCloud