minimal changes to make hacked wd driver work under a different name.

It is configured (in config files) as 'awdc'/'awd', but shows up as
'wdc'/'wd', so that a minimal amount of code had to be modified to make
the name change work.  This is only intended to be temporary, anyway.
This commit is contained in:
cgd 1997-04-21 14:47:33 +00:00
parent dbb6d5170a
commit fc8625db4f
4 changed files with 39 additions and 19 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: ALPHA,v 1.50 1997/04/18 19:41:18 cgd Exp $
# $NetBSD: ALPHA,v 1.51 1997/04/21 14:47:33 cgd Exp $
#
# Alpha kernel with all the options you'd want, and more.
@ -184,6 +184,8 @@ com* at isa? port 0x2f8 irq 3
ep* at isa? port ? irq ? # 3COM 3c509 Ethernet (untested)
lpt* at isa? port 0x3bc irq 7 # standard parallel port
vga* at isa? # ISA (EISA: XXX) VGA
awdc0 at isa? port 0x1f0 irq 14 # ST506/ESDI/IDE controllers
awdc1 at isa? port 0x170 irq 15
#wss* at isa? port 0x530 irq 9 drq 0 # Windows Sound System
# EISA devices
@ -208,6 +210,9 @@ ss* at scsibus? target ? lun ? # SCSI scanners
st* at scsibus? target ? lun ? # SCSI tape drives
uk* at scsibus? target ? lun ? # SCSI unknown
# ST506/ESDI/IDE devices
awd* at awdc? drive ?
# Workstation Console attachments
#wscons* at cfb?
wscons* at vga?

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.50 1997/04/18 19:41:17 cgd Exp $
# $NetBSD: GENERIC,v 1.51 1997/04/21 14:47:36 cgd Exp $
#
# Generic Alpha kernel. Enough to get booted, etc., but not much more.
@ -149,6 +149,8 @@ com* at isa? port 0x2f8 irq 3
ep* at isa? port ? irq ? # 3COM 3c509 Ethernet (untested)
lpt* at isa? port 0x3bc irq 7 # standard parallel port
vga* at isa? # ISA (EISA: XXX) VGA
awdc0 at isa? port 0x1f0 irq 14 # ST506/ESDI/IDE controllers
awdc1 at isa? port 0x170 irq 15
#wss* at isa? port 0x530 irq 9 drq 0 # Windows Sound System
# EISA devices
@ -169,6 +171,9 @@ cd* at scsibus? target ? lun ? # SCSI CD-ROM drives
sd* at scsibus? target ? lun ? # SCSI disk drives
st* at scsibus? target ? lun ? # SCSI tape drives
# ST506/ESDI/IDE devices
awd* at awdc? drive ?
# Workstation Console attachments
#wscons* at cfb?
wscons* at vga?

View File

@ -1,4 +1,4 @@
# $NetBSD: files.alpha,v 1.45 1997/04/14 18:23:18 mjacob Exp $
# $NetBSD: files.alpha,v 1.46 1997/04/21 14:47:37 cgd Exp $
#
# alpha-specific configuration info
@ -159,7 +159,15 @@ file dev/tc/if_le_tc.c le_tc
include "dev/pci/files.pci" # XXX some ISA devs are 'at pci' too.
include "dev/isa/files.isa"
major { wd = 4 }
# Hacked version of ISA "wd" (ESDI/IDE/etc.) controller driver
device awdc {drive = -1}
attach awdc at isa
device awd: disk
attach awd at awdc
file arch/alpha/isa/awd.c awdc needs-flag
major { awd = 4 }
#file arch/alpha/isa/isafcns_jensen.c dec_2000_300

View File

@ -1,4 +1,4 @@
/* $NetBSD: awd.c,v 1.2 1997/04/21 13:38:38 cgd Exp $ */
/* $NetBSD: awd.c,v 1.3 1997/04/21 14:47:40 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@ -32,6 +32,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define NO_ISADMA_SUPPORT
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@ -148,11 +150,11 @@ int wdcprobe __P((struct device *, struct cfdata *, void *));
void wdcattach __P((struct device *, struct device *, void *));
int wdcintr __P((void *));
struct cfattach wdc_ca = {
struct cfattach awdc_ca = {
sizeof(struct wdc_softc), wdcprobe, wdcattach
};
struct cfdriver wdc_cd = {
struct cfdriver awdc_cd = {
NULL, "wdc", DV_DULL
};
@ -164,11 +166,11 @@ int wdprobe __P((struct device *, struct cfdata *, void *));
void wdattach __P((struct device *, struct device *, void *));
int wdprint __P((void *, const char *));
struct cfattach wd_ca = {
struct cfattach awd_ca = {
sizeof(struct wd_softc), wdprobe, wdattach
};
struct cfdriver wd_cd = {
struct cfdriver awd_cd = {
NULL, "wd", DV_DISK
};
@ -435,7 +437,7 @@ void
wdstrategy(bp)
struct buf *bp;
{
struct wd_softc *wd = wd_cd.cd_devs[WDUNIT(bp->b_dev)];
struct wd_softc *wd = awd_cd.cd_devs[WDUNIT(bp->b_dev)];
int s;
/* Valid request? */
@ -996,9 +998,9 @@ wdopen(dev, flag, fmt, p)
int error;
unit = WDUNIT(dev);
if (unit >= wd_cd.cd_ndevs)
if (unit >= awd_cd.cd_ndevs)
return ENXIO;
wd = wd_cd.cd_devs[unit];
wd = awd_cd.cd_devs[unit];
if (wd == 0)
return ENXIO;
@ -1071,7 +1073,7 @@ wdclose(dev, flag, fmt, p)
int flag, fmt;
struct proc *p;
{
struct wd_softc *wd = wd_cd.cd_devs[WDUNIT(dev)];
struct wd_softc *wd = awd_cd.cd_devs[WDUNIT(dev)];
int part = WDPART(dev);
int error;
@ -1421,7 +1423,7 @@ wdioctl(dev, cmd, addr, flag, p)
int flag;
struct proc *p;
{
struct wd_softc *wd = wd_cd.cd_devs[WDUNIT(dev)];
struct wd_softc *wd = awd_cd.cd_devs[WDUNIT(dev)];
int error;
if ((wd->sc_flags & WDF_LOADED) == 0)
@ -1537,7 +1539,7 @@ wdsize(dev)
if (wdopen(dev, 0, S_IFBLK, NULL) != 0)
return -1;
wd = wd_cd.cd_devs[WDUNIT(dev)];
wd = awd_cd.cd_devs[WDUNIT(dev)];
part = WDPART(dev);
if (wd->sc_dk.dk_label->d_partitions[part].p_fstype != FS_SWAP)
size = -1;
@ -1576,9 +1578,9 @@ wddump(dev, blkno, va, size)
wddoingadump = 1;
unit = WDUNIT(dev);
if (unit >= wd_cd.cd_ndevs)
if (unit >= awd_cd.cd_ndevs)
return ENXIO;
wd = wd_cd.cd_devs[unit];
wd = awd_cd.cd_devs[unit];
if (wd == 0)
return ENXIO;
@ -1792,8 +1794,8 @@ wdcunwedge(wdc)
(void) wdcreset(wdc);
/* Schedule recalibrate for all drives on this controller. */
for (unit = 0; unit < wd_cd.cd_ndevs; unit++) {
struct wd_softc *wd = wd_cd.cd_devs[unit];
for (unit = 0; unit < awd_cd.cd_ndevs; unit++) {
struct wd_softc *wd = awd_cd.cd_devs[unit];
if (!wd || (void *)wd->sc_dev.dv_parent != wdc)
continue;
if (wd->sc_state > RECAL)