Removed PATCHKIT headers and updated our sources to Julian's with
our patches back in. Major changes to the Bustek driver and the Tape driver, the rest are minor.
This commit is contained in:
parent
c0307f56ea
commit
d97875d4b0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=205
@ -1,10 +1,3 @@
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 1 00098
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
This release consists of the following files
|
||||
(relative to the base of the kernel tree)
|
||||
|
||||
|
@ -18,13 +18,6 @@ static char rev[] = "$Revision: 1.3 $";
|
||||
/*
|
||||
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 2 00149
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
* 20 Apr 93 Julian Elishcer Fixed error reporting
|
||||
*/
|
||||
|
||||
#define SPLCD splbio
|
||||
|
@ -1,16 +1,5 @@
|
||||
/*
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
*
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 1 00098
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
*
|
||||
* Written by Julian Elischer (julian@tfs.com)
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -1,6 +1,9 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: scsi_all.h,v $
|
||||
* $Log: scsi_all.h,v $
|
||||
* Revision 1.1.1.1 1993/06/12 14:57:27 rgrimes
|
||||
* Initial import, 0.1 + pk 0.2.4-B1
|
||||
*
|
||||
* Revision 1.2 1992/11/20 23:07:13 julian
|
||||
* add a definition for device type T_NODEVICE
|
||||
*
|
||||
@ -8,13 +11,6 @@
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 1 00098
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -12,13 +12,6 @@
|
||||
* on the understanding that TFS is not responsible for the correct
|
||||
* functioning of this software in any circumstances.
|
||||
*
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 1 00098
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
*/
|
||||
|
||||
|
||||
|
@ -1,15 +1,3 @@
|
||||
/*
|
||||
* HISTORY
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 1 00098
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* SCSI changer interface description
|
||||
*/
|
||||
|
@ -1,20 +1,16 @@
|
||||
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: scsi_disk.h,v $
|
||||
* $Log: scsi_disk.h,v $
|
||||
* Revision 1.1.1.1 1993/06/12 14:57:27 rgrimes
|
||||
* Initial import, 0.1 + pk 0.2.4-B1
|
||||
*
|
||||
* Revision 1.2 1992/10/13 03:14:21 julian
|
||||
* added the load-eject field in 'start/stop' for removable devices.
|
||||
*
|
||||
* Revision 1.1 1992/09/26 22:11:29 julian
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 1 00098
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -1,20 +1,20 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: scsi_tape.h,v $
|
||||
* $Log: scsi_tape.h,v $
|
||||
*
|
||||
* julian - added some special stuff for some OLD scsi tapes (CIPHER
|
||||
* ST150S)
|
||||
*
|
||||
* Revision 1.1.1.1 1993/06/12 14:57:27 rgrimes
|
||||
* Initial import, 0.1 + pk 0.2.4-B1
|
||||
*
|
||||
*
|
||||
* Revision 1.2 1993/01/26 18:39:08 julian
|
||||
* add the 'write protected' bit in the device status struct.
|
||||
*
|
||||
* Revision 1.1 1992/09/26 22:10:21 julian
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 1 00098
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -159,11 +159,76 @@ struct scsi_mode_header_tape
|
||||
u_char blk_desc_len;
|
||||
};
|
||||
|
||||
|
||||
#define QIC_120 0x0f
|
||||
#define QIC_150 0x10
|
||||
#define QIC_320 0x11
|
||||
#define QIC_525 0x11
|
||||
#define QIC_1320 0x12
|
||||
/* A special for the CIPHER ST150S(old drive) */
|
||||
struct blk_desc_cipher
|
||||
{
|
||||
u_char density;
|
||||
u_char nblocks[3];
|
||||
u_char reserved;
|
||||
u_char blklen[3];
|
||||
u_char sec:1; /* soft error count */
|
||||
u_char aui:1; /* autoload inhibit */
|
||||
u_char :6;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
from the scsi2 spec
|
||||
Value Tracks Density(bpi) Code Type Reference Note
|
||||
0x1 9 800 NRZI R X3.22-1983 2
|
||||
0x2 9 1600 PE R X3.39-1986 2
|
||||
0x3 9 6250 GCR R X3.54-1986 2
|
||||
0x5 4/9 8000 GCR C X3.136-1986 1
|
||||
0x6 9 3200 PE R X3.157-1987 2
|
||||
0x7 4 6400 IMFM C X3.116-1986 1
|
||||
0x8 4 8000 GCR CS X3.158-1986 1
|
||||
0x9 18 37871 GCR C X3B5/87-099 2
|
||||
0xA 22 6667 MFM C X3B5/86-199 1
|
||||
0xB 4 1600 PE C X3.56-1986 1
|
||||
0xC 24 12690 GCR C HI-TC1 1,5
|
||||
0xD 24 25380 GCR C HI-TC2 1,5
|
||||
0xF 15 10000 GCR C QIC-120 1,5
|
||||
0x10 18 10000 GCR C QIC-150 1,5
|
||||
0x11 26 16000 GCR C QIC-320(525?) 1,5
|
||||
0x12 30 51667 RLL C QIC-1350 1,5
|
||||
0x13 1 61000 DDS CS X3B5/88-185A 4
|
||||
0x14 1 43245 RLL CS X3.202-1991 4
|
||||
0x15 1 45434 RLL CS ECMA TC17 4
|
||||
0x16 48 10000 MFM C X3.193-1990 1
|
||||
0x17 48 42500 MFM C X3B5/91-174 1
|
||||
|
||||
where Code means:
|
||||
NRZI Non Return to Zero, change on ones
|
||||
GCR Group Code Recording
|
||||
PE Phase Encoded
|
||||
IMFM Inverted Modified Frequency Modulation
|
||||
MFM Modified Frequency Modulation
|
||||
DDS Dat Data Storage
|
||||
RLL Run Length Encoding
|
||||
|
||||
where Type means:
|
||||
R Real-to-Real
|
||||
C Cartridge
|
||||
CS cassette
|
||||
|
||||
where Notes means:
|
||||
1 Serial Recorded
|
||||
2 Parallel Recorded
|
||||
3 Old format know as QIC-11
|
||||
4 Helical Scan
|
||||
5 Not ANSI standard, rather industry standard.
|
||||
|
||||
********************************************************************/
|
||||
|
||||
#define HALFINCH_800 0x01
|
||||
#define HALFINCH_1600 0x02
|
||||
#define HALFINCH_6250 0x03
|
||||
#define QIC_24 0x05 /* may be bad, works for CIPHER ST150S XXX */
|
||||
#define QIC_120 0x0f
|
||||
#define QIC_150 0x10
|
||||
#define QIC_320 0x11
|
||||
#define QIC_525 0x11
|
||||
#define QIC_1320 0x12
|
||||
|
||||
|
||||
|
@ -12,14 +12,6 @@
|
||||
* on the understanding that TFS is not responsible for the correct
|
||||
* functioning of this software in any circumstances.
|
||||
*
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 2 00149
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
* 23 May 93 Rodney W. Grimes ADDED Pioneer DRM-600 cd changer
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -27,9 +19,11 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
$Log:
|
||||
*
|
||||
*/
|
||||
* $Log:
|
||||
* 23 May 93 Rodney W. Grimes ADDED Pioneer DRM-600 cd changer
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "st.h"
|
||||
#include "sd.h"
|
||||
|
@ -12,13 +12,6 @@
|
||||
* on the understanding that TFS is not responsible for the correct
|
||||
* functioning of this software in any circumstances.
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 1 00098
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
|
150
sys/scsi/sd.c
150
sys/scsi/sd.c
@ -12,14 +12,6 @@
|
||||
* on the understanding that TFS is not responsible for the correct
|
||||
* functioning of this software in any circumstances.
|
||||
*
|
||||
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
|
||||
* -------------------- ----- ----------------------
|
||||
* CURRENT PATCH LEVEL: 2 00149
|
||||
* -------------------- ----- ----------------------
|
||||
*
|
||||
* 16 Feb 93 Julian Elischer ADDED for SCSI system
|
||||
* 20 Apr 93 Julian Elischer Fixed error reporting
|
||||
*
|
||||
*/
|
||||
|
||||
static char rev[] = "$Revision: 1.3 $";
|
||||
@ -1454,13 +1446,143 @@ sdsize(dev_t dev)
|
||||
return((int)sd->disklabel.d_partitions[part].p_size);
|
||||
}
|
||||
|
||||
#ifdef SCSIDUMP
|
||||
#include <vm/vm.h>
|
||||
/***********************************************************************\
|
||||
* dump all of physical memory into the partition specified, starting *
|
||||
* at offset 'dumplo' into the partition. *
|
||||
\***********************************************************************/
|
||||
static struct scsi_xfer sx;
|
||||
#define MAXTRANSFER 8 /* 1 page at a time */
|
||||
int
|
||||
sddump(dev_t dev) /* dump core after a system crash */
|
||||
{
|
||||
register struct sd_data *sd; /* disk unit to do the IO */
|
||||
long num; /* number of sectors to write */
|
||||
int unit, part, sdc;
|
||||
long blkoff, blknum, blkcnt;
|
||||
long nblocks;
|
||||
char *addr;
|
||||
struct scsi_rw_big cmd;
|
||||
extern int Maxmem;
|
||||
static sddoingadump = 0 ;
|
||||
extern caddr_t CADDR1; /* map the page we are about to write, here*/
|
||||
struct scsi_xfer *xs = &sx;
|
||||
int retval;
|
||||
|
||||
addr = (char *) 0; /* starting address */
|
||||
|
||||
/* toss any characters present prior to dump */
|
||||
while (sgetc(1))
|
||||
;
|
||||
|
||||
/* size of memory to dump */
|
||||
num = Maxmem;
|
||||
unit = UNIT(dev); /* eventually support floppies? */
|
||||
part = PARTITION(dev); /* file system */
|
||||
/* check for acceptable drive number */
|
||||
if (unit >= NSD) return(ENXIO); /* 31 Jul 92*/
|
||||
|
||||
sd = sd_data+unit;
|
||||
/* was it ever initialized etc. ? */
|
||||
if (!(sd->flags & SDINIT)) return (ENXIO);
|
||||
if (sd->flags & SDVALID != SDVALID) return (ENXIO) ;
|
||||
if (sd->flags & SDWRITEPROT) return (ENXIO);
|
||||
|
||||
/* Convert to disk sectors */
|
||||
num = (u_long) num * NBPG / sd->disklabel.d_secsize;
|
||||
|
||||
/* check if controller active */
|
||||
if (sddoingadump) return(EFAULT);
|
||||
|
||||
nblocks = sd->disklabel.d_partitions[part].p_size;
|
||||
blkoff = sd->disklabel.d_partitions[part].p_offset;
|
||||
|
||||
/* check transfer bounds against partition size */
|
||||
if ((dumplo < 0) || ((dumplo + num) > nblocks))
|
||||
return(EINVAL);
|
||||
|
||||
sddoingadump = 1 ;
|
||||
|
||||
blknum = dumplo + blkoff;
|
||||
while (num > 0)
|
||||
{
|
||||
if (blkcnt > MAXTRANSFER) blkcnt = MAXTRANSFER;
|
||||
pmap_enter( kernel_pmap,
|
||||
CADDR1,
|
||||
trunc_page(addr),
|
||||
VM_PROT_READ,
|
||||
TRUE);
|
||||
#ifndef NOT_TRUSTED
|
||||
/*******************************************************\
|
||||
* Fill out the scsi command *
|
||||
\*******************************************************/
|
||||
bzero(&cmd, sizeof(cmd));
|
||||
cmd.op_code = WRITE_BIG;
|
||||
cmd.addr_3 = (blknum & 0xff000000) >> 24;
|
||||
cmd.addr_2 = (blknum & 0xff0000) >> 16;
|
||||
cmd.addr_1 = (blknum & 0xff00) >> 8;
|
||||
cmd.addr_0 = blknum & 0xff;
|
||||
cmd.length2 = (blkcnt & 0xff00) >> 8;
|
||||
cmd.length1 = (blkcnt & 0xff);
|
||||
/*******************************************************\
|
||||
* Fill out the scsi_xfer structure *
|
||||
* Note: we cannot sleep as we may be an interrupt *
|
||||
\*******************************************************/
|
||||
bzero(xs, sizeof(sx));
|
||||
xs->flags |= SCSI_NOMASK|SCSI_NOSLEEP|INUSE;
|
||||
xs->adapter = sd->ctlr;
|
||||
xs->targ = sd->targ;
|
||||
xs->lu = sd->lu;
|
||||
xs->retries = SD_RETRIES;
|
||||
xs->timeout = 10000;/* 10000 millisecs for a disk !*/
|
||||
xs->cmd = (struct scsi_generic *)&cmd;
|
||||
xs->cmdlen = sizeof(cmd);
|
||||
xs->resid = blkcnt * 512;
|
||||
xs->when_done = 0;
|
||||
xs->done_arg = unit;
|
||||
xs->done_arg2 = (int)xs;
|
||||
xs->error = XS_NOERROR;
|
||||
xs->bp = 0;
|
||||
xs->data = (u_char *)CADDR1;
|
||||
xs->datalen = blkcnt * 512;
|
||||
|
||||
/*******************************************************\
|
||||
* Pass all this info to the scsi driver. *
|
||||
\*******************************************************/
|
||||
retval = (*(sd->sc_sw->scsi_cmd))(xs);
|
||||
switch(retval)
|
||||
{
|
||||
case SUCCESSFULLY_QUEUED:
|
||||
case HAD_ERROR:
|
||||
return(ENXIO); /* we said not to sleep! */
|
||||
case COMPLETE:
|
||||
break;
|
||||
default:
|
||||
return(ENXIO); /* we said not to sleep! */
|
||||
}
|
||||
#else NOT_TRUSTED
|
||||
printf ("sd%d addr 0x%x, blk %d\n",unit,addr,blknum);
|
||||
#endif
|
||||
|
||||
if ((unsigned)addr % (1024*1024) == 0) printf("%d ", num/2048) ;
|
||||
/* update block count */
|
||||
num -= MAXTRANSFER;
|
||||
blknum += MAXTRANSFER ;
|
||||
(int) addr += 512 * MAXTRANSFER;
|
||||
|
||||
/* operator aborting dump? */
|
||||
if (sgetc(1))
|
||||
return(EINTR);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
#else /* No SCSIDUMP CODE */
|
||||
sddump()
|
||||
{
|
||||
printf("sddump() -- not implemented\n");
|
||||
return(-1);
|
||||
printf("\nsddump() -- not implemented\n");
|
||||
DELAY(100000000); /* 100 seconds */
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
705
sys/scsi/st.c
705
sys/scsi/st.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user