diff options
author | wollman <wollman@FreeBSD.org> | 1995-04-12 20:48:13 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-04-12 20:48:13 +0000 |
commit | 6a8d3a357d2d39cf1274d89e9ee73459574e038d (patch) | |
tree | 3733f361a8298b0f38c2e4586c976a9240816ec2 /sys/i386/isa/ft.c | |
parent | 669ed5b46ea62e3997fc8495702ddc9078fa7031 (diff) | |
download | FreeBSD-src-6a8d3a357d2d39cf1274d89e9ee73459574e038d.zip FreeBSD-src-6a8d3a357d2d39cf1274d89e9ee73459574e038d.tar.gz |
Add a class field to devconf and mst drivers.
For those where it was easy, drivers were also fixed to call
dev_attach() during probe rather than attach (in keeping with the
new design articulated in a mail message five months ago). For
a few that were really easy, correct state tracking was added as well.
The `fd' driver was fixed to correctly fill in the description.
The CPU identify code was fixed to attach a `cpu' device. The code
was also massively reordered to fill in cpu_model with somethingremotely
resembling what identifycpu() prints out. A few bytes saved by using
%b to format the features list rather than lots of ifs.
Diffstat (limited to 'sys/i386/isa/ft.c')
-rw-r--r-- | sys/i386/isa/ft.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/sys/i386/isa/ft.c b/sys/i386/isa/ft.c index b6aa35b..9470fb9 100644 --- a/sys/i386/isa/ft.c +++ b/sys/i386/isa/ft.c @@ -17,7 +17,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * ft.c - QIC-40/80 floppy tape driver - * $Id: ft.c,v 1.18 1995/04/06 07:20:16 rgrimes Exp $ + * $Id: ft.c,v 1.19 1995/04/09 06:23:12 rgrimes Exp $ * * 01/19/95 ++sg * Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x. @@ -408,8 +408,9 @@ static struct kern_devconf kdc_ft[NFT] = { { ft_externalize, 0, 0, DISK_EXTERNALLEN, 0, /* parent */ 0, /* parentdata */ - DC_UNKNOWN, /* state */ - "floppy tape" + DC_IDLE, /* state */ + "floppy tape", + DC_CLS_TAPE /* class */ } }; static inline void @@ -512,43 +513,55 @@ out: tape_end(ftu); if (ft->type != NO_TYPE) { fdc->flags |= FDC_HASFTAPE; + ft_registerdev(fdcu, ftu); switch(hw.hw_make) { case 0x0000: - if (ft->type == FT_COLORADO) + if (ft->type == FT_COLORADO) { manu = "Colorado"; - else if (ft->type == FT_INSIGHT) + kdc_ft[ftu].kdc_description = "Colorado floppy tape"; + } else if (ft->type == FT_INSIGHT) { manu = "Insight"; - else if (ft->type == FT_MOUNTAIN && hw.hw_model == 0x05) + kdc_ft[ftu].kdc_description = "Insight floppy tape"; + } else if (ft->type == FT_MOUNTAIN && hw.hw_model == 0x05) { manu = "Archive"; - else if (ft->type == FT_MOUNTAIN) + kdc_ft[ftu].kdc_description = "Archive floppy tape"; + } else if (ft->type == FT_MOUNTAIN) { manu = "Mountain"; - else + kdc_ft[ftu].kdc_description = "Mountain floppy tape"; + } else { manu = "Unknown"; + } break; case 0x0001: manu = "Colorado"; + kdc_ft[ftu].kdc_description = "Colorado floppy tape"; break; case 0x0005: - if (hw.hw_model >= 0x09) + if (hw.hw_model >= 0x09) { manu = "Conner"; - else + kdc_ft[ftu].kdc_description = "Conner floppy tape"; + } else { manu = "Archive"; + kdc_ft[ftu].kdc_description = "Archive floppy tape"; + } break; case 0x0006: manu = "Mountain"; + kdc_ft[ftu].kdc_description = "Mountain floppy tape"; break; case 0x0007: manu = "Wangtek"; + kdc_ft[ftu].kdc_description = "Wangtek floppy tape"; break; case 0x0222: manu = "IOMega"; + kdc_ft[ftu].kdc_description = "IOMega floppy tape"; break; default: manu = "Unknown"; break; } printf("ft%d: %s tape\n", fdup->id_unit, manu); - ft_registerdev(fdcu, ftu); } ft->attaching = 0; return(ft->type); @@ -2078,6 +2091,7 @@ ftopen(dev_t dev, int arg2) { return(ENODEV); fdc->fdu = ftu; fdc->flags |= FDC_TAPE_BUSY; + kdc_ft[ftu].kdc_state = DC_BUSY; return(set_fdcmode(dev, FDC_TAPE_MODE)); /* try to switch to tape */ } @@ -2099,6 +2113,7 @@ ftclose(dev_t dev, int flags) tape_cmd(ftu, QC_PRIMARY); tape_state(ftu, 0, QS_READY, 60); ftreq_rewind(ftu); + kdc_ft[ftu].kdc_state = DC_IDLE; return(set_fdcmode(dev, FDC_DISK_MODE)); /* Otherwise, close tape */ } |