*#ident "$Revision: 1.9 $ * * SCSI * *FLAG PREFIX SOFT #DEV DEPENDENCIES ns scsi_ - - $$$ /* NOTE: the initialized array below that describes the various tpsc tape types, * etc., has been moved to this file from master.d/tpsc, to allow the * tpsc driver to be excluded, and possibly a loadable driver in the * future. The remainder of this file is tpsc specific. */ #include "sys/param.h" #include "sys/scsi.h" #include "sys/mtio.h" #include "sys/tpsc.h" #include "sys/invent.h" /* Used to set tape type from the inquiry cmd. * This allows SGI and users to add new tape drives of known types without * re-compiling the driver. The assumption is that the SCSI commands, * capabilities, and request sense info are constant within * a type. This is rarely completely true, but is often close enough * to allow a drive to work. Note that when no additional info (id_ailen * field) is returned on the inquiry, the driver sets the vendor id (id_vid) * to "CIPHER" and id_pid to "540S" before checking this table. * * See also sys/mtio.h for definitions of the MTCAN_* bits. * * Note that this does not quite allow arbitrary drives to be * connected, since interpretation of the request sense results, * and the modeselect that is done is based on the tp_type field. * That field must be set to match one of the known types, or a * drive must not appear in this table at all, in which case it is * treated as an unknown type, and the tpsc_generic structure (below) * is used. However, if a drive is of an unknown type, but the inquiry * command indicates SCSI 2 compliance, the error codes and additional * sense info are decoded according to SCSI 2. * * Also note that a similar list is built into the PROMs and standalone * drivers, so changes to this are only effective for use under unix. * Furthermore, miniroot kernels will not have any local changes made * to this file, which may be important to people attempting system * recover with "unknown" tape drives. If such drives are your only * tape device, it is best to make a backup using the fixed block * device with 512 byte blocks, of at least enough files to allow you * to boot a customized kernel. * * This structure is defined in sys/tpsc.h - read the comments there for * the meanings of fields, and their units, where applicable. * * NOTE: After adding (or changing) an entry for a drive that was * previously 'unknown', reconfiguring the kernel with /etc/autoconfig, * and rebooting, you should run the following commands to be sure * that you have the correct tape devices (you may wish to first note * the existing /dev/*tape* links, or rename them first): * su * cd /dev; rm *tape*; ./MAKEDEV tape */ struct tpsc_types tpsc_types[] = { { CIPHER540, TPQIC24, 6, 4, "CIPHER", "540S", 1, "", {0, 0, 0, 0}, MTCAN_PREV|MTCAN_SPEOD, 20, 150, 18*60, 5*60, 512, 400*512 }, /* the array avoids a compiler warning about not enough * room for the null. This is really just "TANDBERG" */ { TANDBERG3660, TPQIC150, 8, 8, {'T','A','N','D','B','E','R','G'}, " TDC 3660", /* set read/write thresholds and buffer size for better performance */ 12, "\0\20\20\200\0\0\10\10\0\4", {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_PREV|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_SEEK, 20, 150, 18*60, 5*60, 512, 400*512 }, { VIPER150, TPQIC150, 7, 9, "ARCHIVE", "VIPER 150", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_PREV|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_SEEK, 40, 150, 27*60, 5*60, 512, 400*512}, { VIPER60, TPQIC24, 7, 8, "ARCHIVE", "VIPER 60", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_PREV|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_SEEK, 40, 150, 27*60, 5*60, 512, 400*512}, /* use VIPER150 for internal type, for error decoding, etc. */ { VIPER150, TPQIC1000, 7, 10, "ARCHIVE", "ANCDA 2750", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_PREV|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_SEEK, 40, 150, 27*60, 5*60, 512, 400*512}, /* use VIPER150 for internal type, for error decoding, etc. */ { VIPER150, TPQIC1000, 7, 5, "WANGTEK", "51000", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_PREV|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_SEEK, 40, 150, 27*60, 5*60, 512, 400*512}, /* use TANDBERG3660, for error decoding, etc. */ { TANDBERG3660, TPQIC1000, 8, 9, {'T','A','N','D','B','E','R','G'}, " TDC 4100", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_PREV|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_SEEK, 40, 150, 27*60, 5*60, 512, 400*512}, { DATTAPE, TPDAT, 2, 8, "HP", "HP35470A", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_SETMK|MTCAN_PART|MTCAN_PREV| MTCAN_SYNC|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ| MTCAN_SILI|MTCAN_SEEK|MTCAN_CHTYPEANY, /* minimum delay on i/o is 4 minutes, because when a retry is * performed, the drive retries a number of times, and then * rewinds to BOT, repositions, and tries again. */ 40, 4*60, 4*60, 5*60, 512, 64*512 }, { DATTAPE, TPDAT, 2, 8, "HP", "HP35480A", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_SETMK|MTCAN_PART|MTCAN_PREV| MTCAN_SYNC|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ| MTCAN_SILI|MTCAN_SEEK|MTCAN_CHTYPEANY, /* minimum delay on i/o is 4 minutes, because when a retry is * performed, the drive retries a number of times, and then * rewinds to BOT, repositions, and tries again. */ 40, 4*60, 4*60, 5*60, 512, 64*512 }, { DATTAPE, TPDAT, 2, 6, "HP", "C1533A", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_SETMK|MTCAN_PART|MTCAN_PREV| MTCAN_SYNC|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ| MTCAN_SILI|MTCAN_SEEK|MTCAN_CHTYPEANY, /* minimum delay on i/o is 4 minutes, because when a retry is * performed, the drive retries a number of times, and then * rewinds to BOT, repositions, and tries again. */ 40, 4*60, 4*60, 5*60, 512, 64*512 }, { DATTAPE, TPDAT, 2, 6, "HP", "C1553A", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_SETMK|MTCAN_PART|MTCAN_PREV| MTCAN_SYNC|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ| MTCAN_SILI|MTCAN_SEEK|MTCAN_CHTYPEANY, /* minimum delay on i/o is 4 minutes, because when a retry is * performed, the drive retries a number of times, and then * rewinds to BOT, repositions, and tries again. */ 40, 4*60, 4*60, 5*60, 512, 64*512 }, { DATTAPE, TPDAT, 7, 6, "ARCHIVE", "Python", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_SETMK|MTCAN_PART|MTCAN_PREV| MTCAN_SYNC|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ| MTCAN_SILI|MTCAN_AUDIO|MTCAN_SEEK|MTCAN_CHTYPEANY, /* minimum delay on i/o is 4 minutes, because when a retry is * performed, the drive retries a number of times, and then * rewinds to BOT, repositions, and tries again. */ 40, 4*60, 4*60, 5*60, 512, 512*512 }, /* 016 is even byte disconnect and parity check enabled. * Even though erases can take up to 2.5 hours, the rewtimeo is still * fairly low. The driver recognizes this special case (for type * EXABYTE*) and uses 2.5 hours plus rewtimeo. Minimum delay is set * somewhat high because of the long startup time after idle, and * because FM's take a long time to write. */ { EXABYTE8200, TP8MM_8200, 7, 8, "EXABYTE", "EXB-8200", 1, "\16", {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_PREV|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ| MTCAN_SILI|MTCAN_CHTYPEANY, 80, 4*60, 25*60, 5*60, 1024, 128*1024}, /* There are only 2 densities, 8500 mode and 8200. Some customers * have used the other densities to support compression; SGI does not * support this use, although it may work. * The inventory string sets the drive up exactly like the 8200. */ { EXABYTE8500, TP8MM_8500, 7, 8, "EXABYTE", "EXB-8500", 6, "\40\4\16\0\200\7", {0x0, 0x14, 0x0, 0x0}, MTCAN_BSF|MTCAN_BSR|MTCAN_PREV|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ| MTCAN_SILI|MTCAN_CHTYPEANY|MTCAN_SETDEN|MTCAN_SPEOD|MTCAN_SYNC| MTCAN_SEEK, 80, 4*60, 25*60, 5*60, 1024, 128*1024}, /* NOTE: xfrtimeo is for the 800 bpi (slowest transfer rate) */ { KENNEDY96X2, TP9TRACK, 7, 9, "KENNEDY", "96X2 TAPE", 0, 0, {3, 6, 2, 1}, MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_LEOD | MTCAN_CHKRDY|MTCAN_VAR| MTCAN_SETSZ|MTCAN_SETSP|MTCAN_SETDEN| MTCAN_SYNC|MTCANT_RET|MTCANT_IMM, 20, 150, 20*60, 5*60, 512, 60*512 }, /* DEC THZxx DLT drive */ { DECDLT, TPDLT, 3, 7, "SGI", "DLT2000", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_LEOD | MTCAN_CHKRDY|MTCAN_VAR| MTCAN_SETSZ|MTCAN_SILI|MTCAN_SEEK| MTCAN_SYNC|MTCAN_CHTYPEANY, 20, 8*60, 20*60, 5*60, 4096, 64*1024 }, /* DEC THZxx DLT drive */ { DECDLT, TPDLTSTACKER, 3, 7, "SGI", "DLT2700", 0, 0, {0, 0, 0, 0}, MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_LEOD | MTCAN_CHKRDY|MTCAN_VAR| MTCAN_SETSZ|MTCAN_SILI|MTCAN_SEEK| MTCAN_SYNC|MTCAN_CHTYPEANY, 20, 8*60, 20*60, 5*60, 4096, 64*1024 } }; /* numtypes doesn't include the generic entry */ int tpsc_numtypes = sizeof(tpsc_types)/sizeof(tpsc_types[0]); /* this entry is used for all tapes not matching any of the entries * in tpsc_types. It basicly assumes a limited QIC set of capablities. */ struct tpsc_types tpsc_generic = { TPUNKNOWN, TPUNKNOWN, 0, 0, "", "", 0, 0, {0, 0, 0, 0}, MTCAN_SPEOD, 20, 150, 18*60, 5*60, 512, 400*512 }; /* if non-zero, rewinds are done with the immediate bit set, which * means that the rewind ioctl will return as soon as the drive * has accepted the command (rewinds are *always* immediate when * in AUDIO mode, so that programs may poll the drive as to the * current position, which works only in audio mode). If a drive * description has the MTCANT_IMM bit set, the setting of this variable * is ignored for that drive (for drives that do not handle immediate * mode rewinds, or do not return the correct "error" codes while an * immediate mode operation is in progress. * This variable also effects the MTRET ioctl with the exception * of drives which have the MTCANT_RET capability flag in their description, * since they need to have the retension command emulated; it partially * works for these drives, since the emulation is 'space to eom, unload' * NOTE: This doesn't affect the MTUNLOAD or MTOFFL ioctls. * * The value of 0 is the way releases previous to IRIX 5 worked, * where programs were unkillable until the rewind completed. * This variable also affects the rewind the driver does when * the rewind device is closed, so that the close of the rewind * and no-rewind devices will both return immediately if this variable * is set. * * If the drive is closed (e.g., when doing 'mt rewind'), subsequent opens * will block until the rewind has completed. If programs use the rewind * ioctl, and want to know when it is done, The MTIOCGET ioctl will block * until the rewind is completed; other tape commands will fail with EBUSY * until the rewind completes. */ int tpsc_immediate_rewind = 1; /* * The following table is used to ensure that all CD-ROM drives are * so identified in the hardware inventory. The SGI supplied CD-ROM * drives (and possibly those from some other vendors) identify themselves * as hard disk drives at poweron, and after SCSI bus resets, until * issued a vendor specific command (0xc9). This is done because older * systems would otherwise be unable to boot and load miniroots from CD, due * to their design (they attempted to protect the user from booting from * "ridiculous" devices, long before CD-ROM drives existed). The SGI drives * are sent a command to "revert" to CD-ROM inquiry information during boot * if on a SCSI bus handled by the PROM, but not all possible buses are * handled by all PROMs; additionally, a SCSI bus reset causes the CD-ROM * drives to revert to the poweron default, and this could happen before * the hardware inventory code in the kernel runs, if there are SCSI * problems. The table of strings below is used identify CD-ROM drives by * doing a strstr() with each the strings below on the vendor and product * fields of the data returned by the the inquiry command. A match on * any of them will cause the device to be added to the hardware inventory * as a CD-ROM, for the wd93, wd95, and jag SCSI drivers. */ char *cdrom_inq_strings[] = { "CDROM", "CD-ROM", "CD ROM", NULL };