diff options
author | jkh <jkh@FreeBSD.org> | 1995-08-01 07:07:42 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-08-01 07:07:42 +0000 |
commit | 510c48b3317bd9a884852325a42a2a7cab9922e6 (patch) | |
tree | 3f43af536fd6a284d3789d3a4a77a26396ee40aa | |
parent | 66eae772cda6a8a737642090cdc28ee0ca41278f (diff) | |
download | FreeBSD-src-510c48b3317bd9a884852325a42a2a7cab9922e6.zip FreeBSD-src-510c48b3317bd9a884852325a42a2a7cab9922e6.tar.gz |
Sync to author's Version 1.3.
Submitted by: james
-rw-r--r-- | sys/i386/isa/spigot.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index bd19edb..87f09b0 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -35,7 +35,7 @@ * We are working with the vendor so I can release the code, please don't * ask me for it. When/if I can release it, I will. * - * Version 1.1, Feb 1, 1995. + * Version 1.3, June 23, 1995. * */ @@ -74,6 +74,7 @@ struct spigot_softc { /* flags in softc */ #define OPEN 0x01 +#define ALIVE 0x02 #define UNIT(dev) minor(dev) @@ -118,13 +119,18 @@ int spigot_probe(struct isa_device *devp) { int status; +struct spigot_softc *ss=(struct spigot_softc *)&spigot_softc[devp->id_unit]; - spigot_registerdev(devp); - - if(devp->id_iobase != 0xad6 || inb(0xad9) == 0xff) /* ff if board isn't there??? */ - status = 0; - else - status = 1; + ss->flags = 0; + ss->maddr = (char *)0; + + if(devp->id_iobase != 0xad6 || inb(0xad9) == 0xff) + status = 0; /* not found */ + else { + status = 1; /* found */ + ss->flags |= ALIVE; + spigot_registerdev(devp); + } return(status); } @@ -132,10 +138,10 @@ int status; int spigot_attach(struct isa_device *devp) { - struct spigot_softc *ss=(struct spigot_softc *)&spigot_softc[devp->id_unit]; +struct spigot_softc *ss=(struct spigot_softc *)&spigot_softc[devp->id_unit]; + kdc_spigot[devp->id_unit].kdc_state = DC_UNKNOWN; - ss->flags = 0; ss->maddr = devp->id_maddr; return 1; @@ -146,9 +152,12 @@ spigot_open(dev_t dev, int flag) { struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; + if((ss->flags & ALIVE) == 0) + return ENXIO; if(ss->flags & OPEN) return EBUSY; + ss->flags |= OPEN; ss->p = 0; ss->signal_num = 0; @@ -244,8 +253,10 @@ spigot_mmap(dev_t dev, int offset, int nprot) { struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[0]; - if(offset != 0) + if(offset != 0) { + printf("spigot mmap offset = 0x%x\n", offset); return 0; + } if(nprot & PROT_EXEC) return 0; |