summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/wt.c
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/wt.c
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/wt.c')
-rw-r--r--sys/i386/isa/wt.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index 9c317a6..481397e 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;
}
}
OpenPOWER on IntegriCloud