summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/matcd
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/i386/isa/matcd
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/i386/isa/matcd')
-rw-r--r--sys/i386/isa/matcd/matcd.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index af4da2b..bc2beb4 100644
--- a/sys/i386/isa/matcd/matcd.c
+++ b/sys/i386/isa/matcd/matcd.c
@@ -337,7 +337,7 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95";
static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV";
/* The proceeding strings may not be changed*/
-/* $Id: matcd.c,v 1.33 1998/06/07 17:11:16 dfr Exp $ */
+/* $Id: matcd.c,v 1.34 1998/06/17 13:54:58 bde Exp $ */
/*---------------------------------------------------------------------------
Include declarations
@@ -515,6 +515,7 @@ struct isa_driver matcddriver={matcd_probe, matcd_attach,
static d_open_t matcdopen;
+static d_read_t matcdread;
static d_close_t matcdclose;
static d_ioctl_t matcdioctl;
static d_psize_t matcdsize;
@@ -523,11 +524,12 @@ static d_strategy_t matcdstrategy;
#define CDEV_MAJOR 46
#define BDEV_MAJOR 17
-static struct cdevsw matcd_cdevsw;
-static struct bdevsw matcd_bdevsw =
- { matcdopen, matcdclose, matcdstrategy, matcdioctl, /*17*/
- nodump, matcdsize, D_DISK, "matcd",
- &matcd_cdevsw, -1 };
+static struct cdevsw matcd_cdevsw = {
+ matcdopen, matcdclose, matcdread, nowrite,
+ matcdioctl, nostop, nullreset, nodevtotty,
+ seltrue, nommap, matcdstrategy, "matcd",
+ NULL, -1, nodump, nopsize,
+ D_DISK, 0, -1 };
/*---------------------------------------------------------------------------
Internal function declarations
@@ -839,6 +841,12 @@ int matcdclose(dev_t dev, int flags, int fmt,
}
+static int
+matcdread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(matcdstrategy, NULL, dev, 1, minphys, uio));
+}
+
/*---------------------------------------------------------------------------
matcdstrategy - Accepts I/O requests from kernel for processing
@@ -1404,10 +1412,10 @@ matcd_attach(struct isa_device *dev)
cd->rc_devfs_token = devfs_add_devswf(&matcd_cdevsw,
dkmakeminor(i, 0, RAW_PART), DV_CHR,
UID_ROOT, GID_OPERATOR, 0640, "rmatcd%dc", i);
- cd->a_devfs_token = devfs_add_devswf(&matcd_bdevsw,
+ cd->a_devfs_token = devfs_add_devswf(&matcd_cdevsw,
dkmakeminor(i, 0, 0), DV_BLK,
UID_ROOT, GID_OPERATOR, 0640, "matcd%da", i);
- cd->c_devfs_token = devfs_add_devswf(&matcd_bdevsw,
+ cd->c_devfs_token = devfs_add_devswf(&matcd_cdevsw,
dkmakeminor(i, 0, RAW_PART), DV_BLK,
UID_ROOT, GID_OPERATOR, 0640, "matcd%dc", i);
cd->rla_devfs_token = devfs_add_devswf(&matcd_cdevsw,
@@ -1416,10 +1424,10 @@ matcd_attach(struct isa_device *dev)
cd->rlc_devfs_token = devfs_add_devswf(&matcd_cdevsw,
0x80 | dkmakeminor(i, 0, RAW_PART), DV_CHR,
UID_ROOT, GID_OPERATOR, 0640, "rmatcd%dc", i);
- cd->la_devfs_token = devfs_add_devswf(&matcd_bdevsw,
+ cd->la_devfs_token = devfs_add_devswf(&matcd_cdevsw,
0x80 | dkmakeminor(i, 0, 0), DV_BLK,
UID_ROOT, GID_OPERATOR, 0640, "matcd%dla", i);
- cd->lc_devfs_token = devfs_add_devswf(&matcd_bdevsw,
+ cd->lc_devfs_token = devfs_add_devswf(&matcd_cdevsw,
0x80 | dkmakeminor(i, 0, RAW_PART), DV_BLK,
UID_ROOT, GID_OPERATOR, 0640, "matcd%dlc", i);
#endif
@@ -2730,7 +2738,7 @@ matcd_drvinit(void *unused)
{
if( ! matcd_devsw_installed ) {
- bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &matcd_bdevsw);
+ cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &matcd_cdevsw);
matcd_devsw_installed = 1;
}
}
OpenPOWER on IntegriCloud