SUMMARY: Adding 4mm HP DAT on SunOS 4.x

From: David Gunn (gunn@lardav.com)
Date: Thu Feb 29 1996 - 14:54:55 CST


Sorry about taking so long to summarize this. Since it has been so long I
would even bother except to get it into the archives.

This summary is divided into these sections:

  o ORIGINAL QUERY
  o RESOLUTION
  o THANKS TO (summary of responses)
  o SWITCH SETTING INFO (helpful segments of Kevin Jones' memos)
  o FULL RESPONSES (except for Kevin Jones' memos)

ORIGINAL QUERY
--------------
While our Exabyte 8505 backup tape drive is being repaired we need to add a
4mm DAT (HP C1533A) drive to our SS10 running SunOS 4.1.3_U1 so we can do
backups. Unfortunately, the documentation for the DAT drive is nowhere to be
found.

Following the instructions in item 5.9 of the Sun Managers FAQ, we added the
entries in stdef.h and st_conf.c, rebuilt the kernel, and rebooted. The tape
drive is recognized, but after putting in the tape and waiting for the tape to
get positioned, "mt -f /dev/rst0 stat" results in "/dev/rst0: no tape loaded
or drive offline".

Does anybody know why?

RESOLUTION
----------
The problem was in the dip switches on the underside of the tape drive. The
documentation that we acquired from the vendor after my query indicates that
switches 6 and 7 should be off and the rest should be on. However, turning
2,3,6-8 OFF and the 1,4,5 ON allowed the tape drive to communicate correctly.

(See below for info on switch settings)

THANKS TO
---------
leclerc@austin.asc.slb.com (Francois)
  who was the first respondent and thinks there is a problem between SPARC10
  fast SCSI and some SCSI DAT and recommended disabling synchronous SCSI mode.
 
Dave Mitchell <D.Mitchell@dcs.shef.ac.uk>
  who suggested I set the switches to 1-5 on, 6,7 off, 8 on, and that I check
  the configuration of the kernel.

David Morgan edl/sx x4427 <etlddmn@etlxdmx.ericsson.se>
  who suggested making changes to the stdef.h and st_conf.c files and change
  some dip switches. He sent a rather lengthy and informative memo from a
  Kevin Jones of Hewlett Packard Ltd in England regarding DAT performance on
  Solaris 2.3 which you can either get from him or from me (I have omitted it
  from the summary because of its length).

cld@astro.caltech.edu (Cheryl L. Southard)
  who suggested I try the "mt" command again.

Wis Macomson <wis@sequent.com>
  who suggested I look at the switch settings on the drive, and who sent me
  another article by the same Kevin Jones which details what the switches
  should be set to and what they are for. Again, I have omitted it from his
  reply because of the length, but you can request it from either me or Wis.

Mr T Crummey (DIJ) <tom@sees.bangor.ac.uk>
  who suggested the switch settings: 1-5 ON and 6-8 OFF.

kozover@bimacs.cs.biu.ac.il (Kozover maxim)
  who suggested doing mt again.

SWITCH SETTING INFO
-------------------
Below is some info on the switch settings gleaned from memos that originated
from a Kevin Jones from within HP (sent by David Morgan and Wis Macomson).
There was a disclaimer in Kevin's memos that I put at the top:

  This response does not represent the official position of, or statement by,
  the Hewlett-Packard Company. The above data is provided for informational
  purposes only. It is supplied without warranty of any kind.

  10. Appendix A - Switch Settings
  ----------------------------------

  Switch 1 : DC Enable - When set to one, drive defaults mode
  is to write compressed data. If set to zero, default is
  uncompressed. (Not used on HP35470A)
  
  Switch 2 : DC Control - When set, host can control DC
  functions via Mode Select command, DC Characteristics page. If
  set to zero, host can not control nor change DC settings and
  changes the SCSI Inquiry data to call out model number HP35470A
  instead of HP35480A. (Not used on HP35470A)
  
  
  NOTE : The HP35480A will always decompress data when reading a
  compressed tape regardless of switch setting 1 and 2. The data
  decompression functionality can only be disabled by host control.
  
  Data Compression Inquiry Host Control Switch Switch
  Default String Of DC 1 2
  
  Compression On HP35480A Enabled 1 1
  
  Compression On HP35470A Disabled 0 1
  
  Compression Off HP35480A Enabled 1 0
  
  Compression Off HP35470A Disabled 0 0

  15. Controlling compression via a utility on SUN
  ---------------------------------------------------

  For drives with old firmware, compression cannot be controlled
  via device file names (see section 14).
  If you have a DC drive and you want explicit compression control
>from a host then the only option is to run the following utility
  prior to backup. Note that the switch settings should be the
  same as those in section 13.

  /****************************************************************
  *
  * SUN_dc_xtrl.c
  *
  * Hack to control DC in an HP DDS drive from a SUN
  *
  * Use: SUN_dc_xtrl device-file-name 1 Turns DC on
  * SUN_dc_xtrl device-file-name 0 Turns DC off
  *
  * Note: Switch 2 on the underside of the drive must be ON
  * in order for this utility to work.
  *
  ******************************************************************
  * Kevin Jones. | Hewlett Packard Ltd,
  * | Computer Peripherals Bristol,
  * kev%hpcpbla@hplb.hpl.hp.com | Filton Road,
  * | Stoke Gifford,
  * | Bristol. BS12 6QZ.
  * | ENGLAND.
  ******************************************************************
  *
  * This code is not official HP code.
  * It is provided for informational purposes only.
  * It is supplied without warranty of any kind.
  *
  ****************************************************************/
  
  #include <stdio.h>
  #include <fcntl.h>
  #include <errno.h>
  #include <sys/ioctl.h>
  #include <sys/scsi/impl/uscsi.h>
  
  int fd;
  unsigned char msel_data[] = {
        0,0,0x10,0,0xf,0xe,0x40,0x80,0,0,0,0x20,0,0,0,0,0,0,0,0 };
  
  main (argc, argv)
  int argc;
  char *argv[];
  
  { struct uscsi_cmd scsi_cmd, *cmd = &scsi_cmd;
    char cmd_cdb[6];
  
    if (argc != 3)
         printf ("Usage: SUN_dc_xtrl device-file-name [01]\n");
  
    if ((fd = open(argv[1], O_RDWR | O_NONBLOCK)) < 0)
     { if ((fd = open(argv[1], O_RDWR | O_NONBLOCK)) < 0)
          { printf ("Failed to open device %s\n", argv[1]);
            exit (1);
          }
     }
  
    if (*(argv[2]) == '1')
         msel_data[6] = 0xC0;
  
    cmd->uscsi_cdblen = 0x06;
    cmd->uscsi_timeout = 5000;
    cmd->uscsi_flags = USCSI_WRITE;
    cmd->uscsi_bufaddr = msel_data;
    cmd->uscsi_buflen = sizeof (msel_data);
    cmd->uscsi_cdb = cmd_cdb;
    cmd->uscsi_cdb[0] = 0x15;
    cmd->uscsi_cdb[1] = 0x10;
    cmd->uscsi_cdb[2] = 0x0;
    cmd->uscsi_cdb[3] = 0x0;
    cmd->uscsi_cdb[4] = 0x14;
    cmd->uscsi_cdb[5] = 0x0;
  
    if (ioctl (fd, USCSICMD ,cmd) < 0)
     { printf ("Mode Select command failed :-(\n");
         exit (1);
     }
  
    exit (0);
  }

  HP35470A, HP35480A, C1533A, C1553A DDS DRIVE CONFIGURATION SWITCHES
  -------------------------------------------------------
  Note: The data supplied applies to drives containing standard
        distributor product code. A drive with this code will report
        "09" in bytes 34 and 35 of its standard SCSI Inquiry data.
        Even if it does not report "09", it is possible (though not
        certain) that its switch configurations are very similar to
        the description below.
  
  There are 8 configuration switches on the underside of the drive.
  These are numbered 1 thru 8.
  
  SWITCHES 1+2
  -----------------
  These control data compression on the HP35480. (The 35470 does not
  have data compression circuitry. These switches should be left set to
  "1" in the 35470). When data compression is ENABLED the drive
  (HP35480) will write compressed data in DDS-DC format. When compression
  is disabled, the drive will write DDS format data. Note that the
  drive will read and de-compress DDS-DC written tapes irrespective
  of whether compression is ENABLED or DISABLED, ie. switching
  compression on/off only applies to WRITES.
  
  SWITCH1 = 1 means the drive defaults to writing DDS-DC format data.
          = 0 means the drive defaults to writing DDS format data.
     HP35470A drives cannot de-compress data from DDS-DC format tapes.
     The 35470A can return the compressed data via SCSI for a host to
     de-compress. The level of support for decompressing DAT data
     in host drivers is currently NIL, so for practical purposes,
     it is reasonable to say that you can't read a DDS-DC tape
     with a non compressing drive.
     (Note: Default compression may also be controlled via a pin
            on the rear of the drive. This enables some boxed drives to
            have a compression on/off selector switch).
  
  SWITCH2 = 1 means the host has the ability to turn compression on/off
            via the SCSI Mode Select command (data compression mode page).
            Thus the drive powers up with compression determined by
            switch1, but the host may subsequently use a Mode Select
            command to ENABLE/DISABLE compression.
            (Note: some UNIX systems, eg HP-UX have drivers which
                   select compression using Mode Select depending on
                   minor numbers in the device file.)
           = 0 means that the drive ignores host requests to change
             compression. Furthermore, a 35480 drive with this switch "0"
             will report that it is a 35470 drive in its Inquiry data.
  
  It is reccomended that both switches 1 and 2 be set "ON".
  
  
  SWITCHES 3 TO 8
  ---------------------
  These switches configure various SCSI "features".
  Note that there is no 1-1 mapping of features to switches.
  A specific pattern of switches will enable a SET OF FEATURES.
  There are 2 tables below which map switch settings to feature sets.
  The Left hand column of these tables specifies "host", and a 3rd
  table shows additional features that are configured depending on the
  host.
  
  eg. If you want "EWEOM on read error", "Switch Buffered" and
      "Caution Hard Error" features only, then switch setting 111100
      (for both tables) will do this. (111100 enables hosts of type
      "Other" which results in the "EWEOM on read error" feature
       being enabled).
  
  ------------------------------------------------------------------------------
  | Host | Switch | Perfor | Caution | Default | Parity | No Data || Switches|
  | | Buffered | mance | hard | Fixed | off | phase || |
  | | | | error | Mode | | discon || 345678 |
  |-----------------------------------------------------------------------------|
  | HP | 1 | | 1 | | | || 111111 |
  | HP | 1 | | | | | || 110111 |
  | HP | 1 | 1 | 1 | | | || 111011 |
  | DEC | 1 | | 1 | | | || 111110 |
  | DEC | 1 | 1 | 1 | | | || 111010 |
  | DEC | 1 | 1 | | | | || 110010 |
  | Other | 1 | | 1 | | | || 111100 |
  | Other | 1 | | 1 | | | 1 || 011100 |
  | Other | 1 | | 1 | | 1 | || 101100 |
  | Other | 1 | | 1 | | 1 | 1 || 001100 |
  | Other | 1 | | 1 | 1 | | || 110100 |
  | Other | 1 | | 1 | 1 | | 1 || 010100 |
  | Other | 1 | | 1 | 1 | 1 | || 100100 |
  | Other | 1 | | 1 | 1 | 1 | 1 || 000100 |
  | Other | 1 | 1 | 1 | | | || 111000 |
  | Other | 1 | 1 | | | | || 110001 |
  | Other | 1 | 1 | 1 | | | 1 || 011000 |
  | Other | 1 | 1 | | | | 1 || 010001 |
  | Other | 1 | 1 | 1 | | 1 | || 101000 |
  | Other | 1 | 1 | | | 1 | || 100001 |
  | Other | 1 | 1 | 1 | | 1 | 1 || 001000 |
  | Other | 1 | 1 | 1 | 1 | | || 110000 |
  | Other | 1 | 1 | 1 | 1 | | 1 || 010000 |
  | Other | 1 | 1 | 1 | 1 | 1 | || 100000 |
  | Other | 1 | 1 | 1 | 1 | 1 | 1 || 000000 |
  | Other | | | 1 | | | || 111101 |
  | Other | | 1 | 1 | | | || 111001 |
  ------------------------------------------------------------------------------
  
  Distributor Switch Selections -- until 35470A version 9.47
                                   until 35480A version 9.49 (inclusive)
  
  ------------------------------------------------------------------------------------||---------
  | Host | MRS | Perfor | Caution | Def | Parity | No Data | Inq | Fix | DC_ctrl || Switches|
  | | ON | mance | hard | Fixed | off | phase | 35480 | 512 | _by_ || |
  | | | | error | Mode | | discon | | | density || 345678 |
  |-----------------------------------------------------------------------------------||---------|
  | HP | | | 1 | | | | | | || 111111 |
  | HP | 1 | | 1 | | | | | | || 011111 |
  | HP | | | | | | | | | || 110111 |
  | HP | 1 | | | | | | | | || 010111 |
  | HP | | 1 | 1 | | | | | | || 111011 |
  | HP | 1 | 1 | 1 | | | | | | || 011011 |
  | HP | | | 1 | | | | 1 | | || 100011 |
  | DEC | | | 1 | | | | | | || 111110 |
  | DEC | 1 | | 1 | | | | | | || 011110 |
  | DEC | | 1 | 1 | | | | | | || 111010 |
  | DEC | 1 | 1 | 1 | | | | | | || 011010 |
  | DEC | | 1 | 1 | | | 1 | | | || 101010 |
  | DEC | 1 | 1 | 1 | | | 1 | | | || 001010 |
  | Other | 1 | | 1 | 1 | | | | | || 110101 |
  | Other | 1 | 1 | 1 | | | | | | || 111001 |
  | Other | 1 | 1 | 1 | | | 1 | | | || 011001 |
  | Other | 1 | 1 | 1 | | 1 | | | | || 101001 |
  | Other | 1 | 1 | 1 | | 1 | 1 | | | || 001001 |
  | Other | 1 | 1 | 1 | 1 | | 1 | | | || 010001 |
  | Other | 1 | 1 | 1 | 1 | 1 | 1 | | | || 000001 |
  | Other | | | 1 | | | | | | || 111100 |
  | Other | | 1 | 1 | | | | | | 1 || 001100 |
  | Other | | | 1 | 1 | | | | | || 110100 |
  | Other | | 1 | 1 | | | | | | || 111000 |
  | Other | | 1 | 1 | | | 1 | | | || 011000 |
  | Other | | 1 | 1 | | 1 | | | | || 101000 |
  | Other | | 1 | 1 | | 1 | 1 | | | || 001000 |
  | Other | | 1 | 1 | | | | | 1 | || 110000 |
  | Other | | 1 | 1 | 1 | | 1 | | | || 010000 |
  | Other | | 1 | 1 | 1 | 1 | 1 | | | || 000000 |
  ------------------------------------------------------------------------------------||---------|

FULL RESPONSES (except for Kevin Jones' memos)
----------------------------------------------
From: leclerc@austin.asc.slb.com

I think there is a problem between SPARC10 fast SCSI and some SCSI DAT
I have the same issue and disabling synchronous SCSI mode solved the issue
I found in previous Summaries how to do it for Solaris 2,
I do not know for Sunos

===============================================================================
From: Dave Mitchell <D.Mitchell@dcs.shef.ac.uk>

I'd check 2 things.

First, the DIP switches on the underside of the drive should be set as
follows:

1-5 on, 6,7 off, 8 on

Second, make sure that you get a message like the following on reboot:

st0: <HP C1533A 4mm DDS DAT>

If not, then the kernel reconfig probably went wrong somewhere.

===============================================================================
From: David Morgan edl/sx x4427 <etlddmn@etlxdmx.ericsson.se>

When we added a HP DAT to our system, not only did we have to add the
requisite entries in the STDEF.H and the ST_CONF.C but we also had to strip
the mechanism out of its cabinet and set some DIP switches on the underside.

I am fairly sure that is what you will have to do, as the HP comes ready to
use on a HP box and/or a PC?

Here's some notes I made at the time:-

Here is the summary of changes for the installation of the
<HP-C1553A 4mm DAT> tape stacker unit.

In the directory /usr/kvm/sys/scsi/targets
file: stdef.h
add/change 0x29 to read as in the following:
 
    #define ST_TYPE_REEL 0x27 /* Generic 1/2" Reel Tape */
    #define ST_TYPE_EX8500 0x28 /* Exabyte */
    #define ST_TYPE_HP1 0x29 /* HP */
    #define ST_TYPE_PYTHON 0x2c /* Archive Python DAT */

In the directory /usr/kvm/sys/scsi/targets
file: st_conf.c
add/change the Exabyte EXB8200 to read as in the following:

/* Exabyte 8mm 5GB cartridge */
/* {
    "Exabyte EXB-8500 8mm Helical Scan", 16, "EXABYTE EXB-8500",
    ST_TYPE_EXB8500, 1024,
    (ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE),
    5000, 5000,
    { 0x14, 0x00, 0x8C, 0x8C },
    { 0, 0, 0, 0 }
}, */
/* Hewlett Packard 4mm DAT DDS-2 Stacker */
{
    "HP-C1553A 4mm DAT", 2, "HP",
    ST_TYPE_HP1, 10240,
    (ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE | ST_AUTODEN_OVERRIDE),
    6000, 6000,
    { 0x00, 0x00, 0x00, 0x00 },
    { 0, 0, 0, 0 }
},

In the directory /usr/kvm/sys/sys
file: mtio.h
add/change 0x29 to read as in the following:-

    #define MT_ISEXB8500 0x28 /* sun: SCSI Exabyte 8mm cartridge */
    #define MT_ISHPC1553A 0x29 /* sun: SCSI Hewlett Packard 4mm Dat */
    #define MT_ISCCS27 0x2a /* sun: SCSI generic (unknown) CCS */

Thats the end of the changes; then just change directory to the conf subdir
and /etc/config <kernalname>; cd ../<kernalname>; make
put the new kernel in place and reboot.

Here's a note from another sun manager:-

Thanks to Kevin Jones who send me the following release, and everyone
who answered my question.

Here is a solution for the DAT performance on Solaris 2.3 (and other
platforms) :

  **** Omitted ****

===============================================================================
From: cld@astro.caltech.edu (Cheryl L. Southard)

Try the "mt" command again. I don't know why, but it seems that the first
command to any DAT drive after we pop in a new tape always fails with
"no tape loaded or drive offline". After that, the DAT works fine.

===============================================================================
From: Wis Macomson <wis@sequent.com>

This sounds like what happened to me when I put an HP 35470 on my
SS20 (4.1.3_U1B). It's been a while, but I think it was the switch
settings on the drive.

Attached below is a copy of som unofficial HP documentation. It
came off the 'Net and the formatting is kind of ugly, but maybe it
will help.

  **** Omitted ****

===============================================================================
From: Mr T Crummey (DIJ) <tom@sees.bangor.ac.uk>

It's the DIP switches in teh drive. You need to set them up for SUN. The only
problem is of course, I'm at home and the vital piece of paper is at work...

However this has worked for somone else....

1,2,3,4,5 on and 6,7,8 off.

If you email me on Monday I'll post the official HP version.

===============================================================================
From: kozover@bimacs.cs.biu.ac.il (Kozover maxim)
  Try to give that command twice :
I also have this bug : when you insert a cassette , use the mt -f /dev/nrst0
command twice to make it realize the tape .

  There is no such bug in Solaris .

-- 
David Gunn

Company: Larson-Davis, Inc E-mail : gunn@lardav.com



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:54 CDT