*BSD News Article 79494


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!newspump.sol.net!uwm.edu!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!howland.erols.net!EU.net!usenet2.news.uk.psi.net!uknet!usenet1.news.uk.psi.net!uknet!uknet!newsfeed.ed.ac.uk!edcogsci!richard
From: richard@cogsci.ed.ac.uk (Richard Tobin)
Subject: HP (Colorado) T4000s SCSI Travan 4GB tape drive
X-Nntp-Posting-Host: pitcairn
Message-ID: <DyI6s1.F88@cogsci.ed.ac.uk>
Sender: cnews@cogsci.ed.ac.uk (C News Software)
Organization: HCRC, University of Edinburgh
Date: Sun, 29 Sep 1996 16:50:24 GMT
Lines: 120

Here are patches to the SCSI tape driver for FreeBSD 2.1.0 to support
the HP T4000s tape drive.  The changes are small and adapting them to
other (newer) releases should be easy, though apparently the SCSI
code has been substantially reorganised.

The main change is to add a "quirk" for the T4000s which forces the
PF bit to be set in the SCSI mode select command.  Why the drive cares
about this is a bit of a mystery since it merely describes the format
of some optional data that isn't being sent - you'd think that zero
bytes could be in any format you liked :-)  The other changes are to
define the density code for QIC 3095, remove the out-of-date limit
on density codes, and stop the driver from complaining that the tape
can't be locked in the drive.

Despite HP's pointless refusal to release any documentation for this
drive, my experience of it so far is such that I recommend it: it's
reasonably priced, has a large capacity, is a fairly standard SCSI
device, and is fast (about 30MB / minute when streaming).  The only
problem is the high price of tapes.  To get it to stream reasonably
with dump I specified a blocksize of 128K:

  dump 0ufBb /dev/rst0 4000000 128 /

(Incidentally, the tape size given by the B option appears to be in
kilobytes rather than dump records as stated in the 2.1.0 man page.)

-- Richard

*** scsi_tape.h.orig	Tue May 30 09:13:43 1995
--- scsi_tape.h	Fri Sep 13 21:56:19 1996
***************
*** 307,312 ****
--- 307,314 ----
  #define QIC_1320	0x12
  #define DDS		0x13
  #define DAT_1		0x13
+ #define QIC_3095	0x45
+ 
  #endif /* NEW_SCSICONF */
  
  #endif /*SCSI_SCSI_TAPE_H*/
*** st.c.orig	Sat Jul 22 05:25:10 1995
--- st.c	Sun Sep 29 16:52:06 1996
***************
*** 62,69 ****
  
  #define IS_CTLMODE(DEV) (MODE(DEV) == CTLMODE)
  
! #define SCSI_2_MAX_DENSITY_CODE	0x17	/* maximum density code specified
! 					 * in SCSI II spec. */
  #ifndef NEW_SCSICONF
  /*
   * Define various devices that we know mis-behave in some way,
--- 62,69 ----
  
  #define IS_CTLMODE(DEV) (MODE(DEV) == CTLMODE)
  
! #define SCSI_2_MAX_DENSITY_CODE	0xff	/* SCSI 2 spec is out of date! */
! 
  #ifndef NEW_SCSICONF
  /*
   * Define various devices that we know mis-behave in some way,
***************
*** 92,97 ****
--- 92,98 ----
  #define	ST_Q_SNS_HLP		0x00008		/* must do READ for good MODE SENSE */
  #define	ST_Q_IGNORE_LOADS	0x00010
  #define	ST_Q_BLKSIZ		0x00020		/* variable-block media_blksiz > 0 */
+ #define ST_Q_SCSI2_PF		0x00040		/* set PF in mode select */
  
  static struct rogues gallery[] =	/* ends with an all-null entry */
  {
***************
*** 149,154 ****
--- 150,164 ----
  	    {0, ST_Q_FORCE_VAR_MODE, 0x13}		/* minor  12,13,14,15 */
  	}
      },
+     {"HP T4000s", "HP      ", "T4000s", "????",
+ 	 ST_Q_SCSI2_PF,
+          {
+ 	     {0, 0, 0},
+ 	     {0, 0, 0},
+ 	     {0, 0, 0},
+ 	     {0, 0, 0}
+ 	 }
+     },
      {(char *) 0}
  };
  #endif /* NEW_SCSICONF */
***************
*** 722,728 ****
  		printf("st%ld: Cannot set selected mode", unit);
  		return errno;
  	}
! 	scsi_prevent(sc_link, PR_PREVENT, 0);	/* who cares if it fails? */
  	st->flags &= ~ST_NEW_MOUNT;
  	st->flags |= ST_MOUNTED;
  	sc_link->flags |= SDEV_MEDIA_LOADED;
--- 732,738 ----
  		printf("st%ld: Cannot set selected mode", unit);
  		return errno;
  	}
! 	scsi_prevent(sc_link, PR_PREVENT, SCSI_SILENT);
  	st->flags &= ~ST_NEW_MOUNT;
  	st->flags |= ST_MOUNTED;
  	sc_link->flags |= SDEV_MEDIA_LOADED;
***************
*** 1531,1536 ****
--- 1541,1548 ----
  	dat.header.blk_desc_len = sizeof(struct blk_desc);
  	dat.header.dev_spec |= SMH_DSP_BUFF_MODE_ON;
  	dat.blk_desc.density = st->density;
+ 	if(st->quirks & ST_Q_SCSI2_PF)
+ 	    scsi_cmd.byte2 |= SMS_PF;
  	if (st->flags & ST_FIXEDBLOCKS) {
  		scsi_uto3b(st->blksiz, dat.blk_desc.blklen);
  	}
--
:wq