summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/mcd.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/mcd.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/mcd.c')
-rw-r--r--sys/i386/isa/mcd.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c
index 1129d94..582198f 100644
--- a/sys/i386/isa/mcd.c
+++ b/sys/i386/isa/mcd.c
@@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mcd.c,v 1.97 1998/01/24 02:54:22 eivind Exp $
+ * $Id: mcd.c,v 1.98 1998/06/07 17:10:46 dfr Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -209,6 +209,7 @@ static int mcd_attach(struct isa_device *dev);
struct isa_driver mcddriver = { mcd_probe, mcd_attach, "mcd" };
static d_open_t mcdopen;
+static d_read_t mcdread;
static d_close_t mcdclose;
static d_ioctl_t mcdioctl;
static d_psize_t mcdsize;
@@ -216,10 +217,15 @@ static d_strategy_t mcdstrategy;
#define CDEV_MAJOR 29
#define BDEV_MAJOR 7
-static struct cdevsw mcd_cdevsw;
-static struct bdevsw mcd_bdevsw =
- { mcdopen, mcdclose, mcdstrategy, mcdioctl, /*7*/
- nodump, mcdsize, D_DISK, "mcd", &mcd_cdevsw, -1 };
+
+
+
+static struct cdevsw mcd_cdevsw = {
+ mcdopen, mcdclose, mcdread, nowrite,
+ mcdioctl, nostop, nullreset, nodevtotty,
+ seltrue, nommap, mcdstrategy, "mcd",
+ NULL, -1, nodump, nopsize,
+ D_DISK, 0, NODEV };
#define mcd_put(port,byte) outb(port,byte)
@@ -263,11 +269,11 @@ int mcd_attach(struct isa_device *dev)
DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
"rmcd%dc", unit);
cd->a_devfs_token =
- devfs_add_devswf(&mcd_bdevsw, dkmakeminor(unit, 0, 0),
+ devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
"mcd%da", unit);
cd->c_devfs_token =
- devfs_add_devswf(&mcd_bdevsw, dkmakeminor(unit, 0, RAW_PART),
+ devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
"mcd%dc", unit);
#endif
@@ -388,6 +394,12 @@ int mcdclose(dev_t dev, int flags, int fmt, struct proc *p)
return 0;
}
+static int
+mcdread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(mcdstrategy, NULL, dev, 1, minphys, uio));
+}
+
void
mcdstrategy(struct buf *bp)
{
@@ -1841,7 +1853,7 @@ static void mcd_drvinit(void *unused)
{
if( ! mcd_devsw_installed ) {
- bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &mcd_bdevsw);
+ cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &mcd_cdevsw);
mcd_devsw_installed = 1;
}
}
OpenPOWER on IntegriCloud