mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 00:02:44 +00:00
First part of importing the Japanese `od' driver.
Claim the major numbers (before sombedoy else jumps in again and claims the slots for his foocd driver :-), install all the hooks that are required. While i've been at this, i've cleaned up some of the routines at the end of i386/conf.c; all the importers of the latest CDROM drivers forgot to fill in the appropriate information. The `ata' driver (vapourware?) does only occupy a slot in the bdevsw[] array, btw. The actual import of the code does require a minor change in the SCSI subsystem, and i want to have this reviewed by Peter first, so it will be deferred for some days. The driver is already working for me though. Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
This commit is contained in:
parent
d96ce489cc
commit
ea76f9453e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10109
@ -291,6 +291,7 @@ pci/pdq.c optional fpa device-driver
|
||||
pci/meteor.c optional meteor device-driver
|
||||
scsi/cd.c optional cd
|
||||
scsi/ch.c optional ch
|
||||
scsi/od.c optional od
|
||||
scsi/scsi_base.c optional scbus
|
||||
scsi/scsi_sense.c optional scbus
|
||||
scsi/scsi_ioctl.c optional scbus
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile,v 1.30 1995/04/20 23:15:03 joerg Exp $
|
||||
# $Id: Makefile,v 1.31 1995/07/25 00:35:40 bde Exp $
|
||||
#
|
||||
|
||||
PROG= boot
|
||||
@ -62,7 +62,7 @@ install:
|
||||
boot1 ${DESTDIR}${BINDIR}/boot1
|
||||
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
|
||||
boot2 ${DESTDIR}${BINDIR}/boot2
|
||||
for i in sd fd wd ; do \
|
||||
for i in sd fd wd od ; do \
|
||||
( cd ${DESTDIR}${BINDIR} ; \
|
||||
rm -f boot$${i} $${i}boot ; \
|
||||
ln -s boot1 $${i}boot ; \
|
||||
|
@ -1,6 +1,6 @@
|
||||
# This file tells what major numbers the various possible swap devices have.
|
||||
#
|
||||
# $Id: devices.i386,v 1.7 1994/12/04 22:36:50 phk Exp $
|
||||
# $Id: devices.i386,v 1.8 1994/12/26 01:06:39 ats Exp $
|
||||
#
|
||||
wd 0
|
||||
dk 1
|
||||
@ -13,3 +13,5 @@ mcd 7
|
||||
vn 15
|
||||
scd 16
|
||||
pcd 17
|
||||
wcd 19
|
||||
od 20
|
||||
|
@ -42,7 +42,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)conf.c 5.8 (Berkeley) 5/12/91
|
||||
* $Id: conf.c,v 1.91 1995/08/05 21:33:04 peter Exp $
|
||||
* $Id: conf.c,v 1.92 1995/08/18 11:26:26 jkh Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -208,6 +208,23 @@ d_ioctl_t stioctl;
|
||||
#define stsize zerosize
|
||||
#endif
|
||||
|
||||
#include "od.h"
|
||||
#if NOD > 0
|
||||
d_open_t odopen;
|
||||
d_close_t odclose;
|
||||
d_strategy_t odstrategy;
|
||||
d_ioctl_t odioctl;
|
||||
d_psize_t odsize;
|
||||
#define oddump nxdump
|
||||
#else
|
||||
#define odopen nxopen
|
||||
#define odclose nxclose
|
||||
#define odstrategy nxstrategy
|
||||
#define odioctl nxioctl
|
||||
#define oddump nxdump
|
||||
#define odsize zerosize
|
||||
#endif
|
||||
|
||||
#include "cd.h"
|
||||
#if NCD > 0
|
||||
d_open_t cdopen;
|
||||
@ -438,6 +455,8 @@ struct bdevsw bdevsw[] =
|
||||
atadump, atasize, 0 },
|
||||
{ wcdopen, wcdclose, wcdstrategy, wcdioctl, /*19*/
|
||||
nxdump, zerosize, 0 },
|
||||
{ odopen, odclose, odstrategy, odioctl, /*20*/
|
||||
oddump, odsize, 0 },
|
||||
|
||||
/*
|
||||
* If you need a bdev major number for a driver that you intend to donate
|
||||
@ -1294,6 +1313,9 @@ struct cdevsw cdevsw[] =
|
||||
{ wcdopen, wcdclose, rawread, nowrite, /*69*/
|
||||
wcdioctl, nostop, nullreset, nodevtotty,/* atapi */
|
||||
seltrue, nommap, wcdstrategy },
|
||||
{ odopen, odclose, rawread, rawwrite, /*70*/
|
||||
odioctl, nostop, nullreset, nodevtotty,/* od */
|
||||
seltrue, nommap, odstrategy }
|
||||
};
|
||||
int nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
|
||||
|
||||
@ -1346,21 +1368,30 @@ isdisk(dev, type)
|
||||
{
|
||||
|
||||
switch (major(dev)) {
|
||||
case 15:
|
||||
case 15: /* VBLK: vn, VCHR: cd */
|
||||
return (1);
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 0: /* wd */
|
||||
case 2: /* fd */
|
||||
case 4: /* sd */
|
||||
case 6: /* cd */
|
||||
case 7: /* mcd */
|
||||
case 16: /* scd */
|
||||
case 17: /* matcd */
|
||||
case 18: /* ata */
|
||||
case 19: /* wcd */
|
||||
case 20: /* od */
|
||||
if (type == VBLK)
|
||||
return (1);
|
||||
return (0);
|
||||
case 3:
|
||||
case 9:
|
||||
case 13:
|
||||
case 29:
|
||||
case 43:
|
||||
case 3: /* wd */
|
||||
case 9: /* fd */
|
||||
case 13: /* sd */
|
||||
case 29: /* mcd */
|
||||
case 43: /* vn */
|
||||
case 45: /* scd */
|
||||
case 46: /* matcd */
|
||||
case 69: /* wcd */
|
||||
case 70: /* od */
|
||||
if (type == VCHR)
|
||||
return (1);
|
||||
/* fall through */
|
||||
@ -1382,14 +1413,18 @@ chrtoblk(dev)
|
||||
int blkmaj;
|
||||
|
||||
switch (major(dev)) {
|
||||
case 3: blkmaj = 0; break;
|
||||
case 9: blkmaj = 2; break;
|
||||
case 10: blkmaj = 3; break;
|
||||
case 13: blkmaj = 4; break;
|
||||
case 14: blkmaj = 5; break;
|
||||
case 15: blkmaj = 6; break;
|
||||
case 29: blkmaj = 7; break;
|
||||
case 43: blkmaj = 15; break;
|
||||
case 3: blkmaj = 0; break; /* wd */
|
||||
case 9: blkmaj = 2; break; /* fd */
|
||||
case 10: blkmaj = 3; break; /* wt */
|
||||
case 13: blkmaj = 4; break; /* sd */
|
||||
case 14: blkmaj = 5; break; /* st */
|
||||
case 15: blkmaj = 6; break; /* cd */
|
||||
case 29: blkmaj = 7; break; /* mcd */
|
||||
case 43: blkmaj = 15; break; /* vn */
|
||||
case 45: blkmaj = 16; break; /* scd */
|
||||
case 46: blkmaj = 17; break; /* matcd */
|
||||
case 69: blkmaj = 19; break; /* wcd */
|
||||
case 70: blkmaj = 20; break; /* od */
|
||||
default:
|
||||
return (NODEV);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)swapgeneric.c 5.5 (Berkeley) 5/9/91
|
||||
* $Id: swapgeneric.c,v 1.9 1995/04/03 00:25:06 wpaul Exp $
|
||||
* $Id: swapgeneric.c,v 1.10 1995/05/12 16:11:07 wpaul Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -56,6 +56,7 @@
|
||||
#include "mcd.h"
|
||||
#include "scd.h"
|
||||
#include "matcd.h"
|
||||
#include "od.h"
|
||||
|
||||
/*
|
||||
* Generic configuration; all in one
|
||||
@ -106,6 +107,9 @@ struct genericconf {
|
||||
#endif
|
||||
#if NMATCD > 0
|
||||
{ "matcd", makedev(17,0x00000000), },
|
||||
#endif
|
||||
#if NOD > 0
|
||||
{ "od", makedev(19,0x00000000), },
|
||||
#endif
|
||||
{ 0 },
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user