[comp.sources.amiga] v91i080: BTNTape 2.0 - SCSI tape drive handler, Part01/02

amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator) (04/05/91)

Submitted-by: DrBob@cup.portal.com
Posting-number: Volume 91, Issue 080
Archive-name: devices/btntape-2.0/part01

[ includes uuencoded executables  ...tad ]

BTNTape is a "Better Than Nothing" device handler for SCSI tape drives.
It allows DOS application programs to access the tape medium as a
sequential AmigaDOS file using simple calls to Read() and Write().
The handler can also be used with the Amiga TAR program for backing up
and restoring hard drives.  This is an update to version 1.0.
It now works with most standard SCSI tape drives, and includes
new features and bug fixes.


#!/bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 2)."
# Contents:  MakeFile changes.doc lmkfile mountlist pktstuff.c
#   tape-handle.uu tape.h tapeio.c tapemon.c tapemon.doc tapemon.lmk
#   tapemon.uu tplink.h
# Wrapped by tadguy@ab20 on Fri Apr  5 10:06:39 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'MakeFile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'MakeFile'\"
else
echo shar: Extracting \"'MakeFile'\" \(212 characters\)
sed "s/^X//" >'MakeFile' <<'END_OF_FILE'
X# Manx/Aztec C makefile  BTN-TAPE v2.0
XOBJECT   = tape.o  tapeio.o  pktstuff.o
X
Xtape-handler: $(OBJECT)
X   ln +Q -o tape-handler -w +a -g +s $(OBJECT) -lc
X
X$(OBJECT):   tape.h
X   cc -m0b -so -sb -we -bs $*.c
X
X
X
X
END_OF_FILE
if test 212 -ne `wc -c <'MakeFile'`; then
    echo shar: \"'MakeFile'\" unpacked with wrong size!
fi
# end of 'MakeFile'
fi
if test -f 'changes.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'changes.doc'\"
else
echo shar: Extracting \"'changes.doc'\" \(1194 characters\)
sed "s/^X//" >'changes.doc' <<'END_OF_FILE'
XA brief history of BTNtape:
X
Xv2.0  Mar. 29, 1991
X       Added support for sequential tape drives (the most common type).
X       Revised/improved the format of the mountlist Startup string.
X       Added Startup parameter FM (number of filemarks).
X       Added Startup parameter DF (device flags).
X       Added Startup parameter OV (overlapped I/O control).
X       Added Startup parameter VB (variable block mode).
X       No longer works with ARP version of MOUNT (this is ARP's fault).
X       Removed dollar signs from RAWCMD reference (because shells hate them).
X       Removed requirement for upper case letters in RAWCMD reference.
X       Added user-specified mode select feature using TAPE:MODESEL.
X       Fixed brain-damaged asynchronous I/O code.
X       Fixed wrong command length for READ_CAPACITY, caused HardFrame guru.
X       Tapemon prints sense keys and SCSI errors in english.
X       Tapemon arg1 now tolerates upper or lower case and ending colon.
X       When Tapemon arg2 != blank, complete sense data is printed.
X       Code cleaned up a little (but probably not enough).
X
Xv1.0  Sept. 10, 1990  Initial release.
X       Unfortunately, this version worked only with the 3M drive.
X
END_OF_FILE
if test 1194 -ne `wc -c <'changes.doc'`; then
    echo shar: \"'changes.doc'\" unpacked with wrong size!
fi
# end of 'changes.doc'
fi
if test -f 'lmkfile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'lmkfile'\"
else
echo shar: Extracting \"'lmkfile'\" \(447 characters\)
sed "s/^X//" >'lmkfile' <<'END_OF_FILE'
X# SAS/LATTICE MAKEFILE FOR BTN-TAPE v2.0
X
X# (-j132i is necessary with 5.10 and 1.3 includes. Why?)
XCFLAGS= -v -y -b1 -mat -cakfsu -j132i
X
XLIBS=LIB:lc.lib+LIB:amiga.lib
X
Xtape-handler: tape.o tapeio.o pktstuff.o
X   blink FROM tape.o+tapeio.o+pktstuff.o TO $@ SC SD LIB $(LIBS)
X
Xtape.o : tape.c tape.h tplink.h
X    LC $(CFLAGS) tape.c
X
Xtapeio.o : tapeio.c tape.h
X    LC $(CFLAGS) tapeio.c
X
Xpktstuff.o : pktstuff.c tape.h
X    LC $(CFLAGS) pktstuff.c
X
END_OF_FILE
if test 447 -ne `wc -c <'lmkfile'`; then
    echo shar: \"'lmkfile'\" unpacked with wrong size!
fi
# end of 'lmkfile'
fi
if test -f 'mountlist' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mountlist'\"
else
echo shar: Extracting \"'mountlist'\" \(290 characters\)
sed "s/^X//" >'mountlist' <<'END_OF_FILE'
X/* Example mountlist.  Modify it for your specific system setup. */
XTAPE:   Handler   = L:tape-handler
X        Startup   = "yourscsi.device/UN-0/BS-512/NB-64/BT-4"
X        Stacksize = 4000
X        Priority  = 5      /* use 11 for Supra 4x4 */
X        GlobVec   = -1
X        Mount     = 1
X#
END_OF_FILE
if test 290 -ne `wc -c <'mountlist'`; then
    echo shar: \"'mountlist'\" unpacked with wrong size!
fi
# end of 'mountlist'
fi
if test -f 'pktstuff.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pktstuff.c'\"
else
echo shar: Extracting \"'pktstuff.c'\" \(1768 characters\)
sed "s/^X//" >'pktstuff.c' <<'END_OF_FILE'
X/* misc.c  - support routines - Phillip Lindsay (C) Commodore 1986
X *  You may freely distribute this source and use it for Amiga Development -
X *  as long as the Copyright notice is left intact.
X *
X * 30-SEP-86
X */
X
X#include <exec/types.h>
X#include <exec/nodes.h>
X#include <exec/lists.h>
X#include <exec/ports.h>
X#include <libraries/dos.h>
X#include <libraries/dosextens.h>
X#include "tape.h"
X
X#if defined AZTEC_C
X  #include <functions.h>
X#elif defined LATTICE
X  #include <proto/exec.h>
X#endif
X
X
X/* returnpkt() - packet support routine
X * here is the guy who sends the packet back to the sender...
X * (I modeled this just like the BCPL routine [so its a little redundant] )
X */
X
Xvoid returnpkt(
X   struct DosPacket *packet,
X   ULONG  res1,
X   ULONG  res2)
X{
X struct Message *mess;
X struct MsgPort *replyport;
X struct Process *myproc;
X
X packet->dp_Res1          = res1;
X packet->dp_Res2          = res2;
X replyport                = packet->dp_Port;
X mess                     = packet->dp_Link;
X myproc                   = (struct Process *) FindTask(0L);
X packet->dp_Port          = &myproc->pr_MsgPort;
X mess->mn_Node.ln_Name    = (char *) packet;
X mess->mn_Node.ln_Succ    = NULL;
X mess->mn_Node.ln_Pred    = NULL;
X
X PutMsg(replyport,mess);
X}
X
X
X/*
X * taskwait() ... Waits for a message to arrive at your port and
X *   extracts the packet address which is returned to you.
X */
X
Xstruct DosPacket *taskwait(void)
X{
X struct Process *myproc;
X struct MsgPort *myport;
X struct Message *mymess;
X
X myproc = (struct Process *) FindTask(0L);
X myport = &myproc->pr_MsgPort;
X
X WaitPort(myport); /* wait for packet */
X mymess = (struct Message *) GetMsg(myport);
X
X/* give them the pointer to the packet */
Xreturn((struct DosPacket *) mymess->mn_Node.ln_Name);
X}
X
X/* end of misc.c */
END_OF_FILE
if test 1768 -ne `wc -c <'pktstuff.c'`; then
    echo shar: \"'pktstuff.c'\" unpacked with wrong size!
fi
# end of 'pktstuff.c'
fi
if test -f 'tape-handle.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tape-handle.uu'\"
else
echo shar: Extracting \"'tape-handle.uu'\" \(14542 characters\)
sed "s/^X//" >'tape-handle.uu' <<'END_OF_FILE'
Xbegin 666 tape-handler
XM```#\P`````````"``````````$```D>````M0```^D```D>3E7_9$CG)SI)'
XM^0`````K?``!AI__L'P`>@!P`'(!*T'_:$(M_V8K0/]L*T#_="M`_W@K0/^$Y
XM*T#_G$/Z#,8L>``$3J[]V"E``AR3R4ZN_MHF0$ZZ&R@D0"`J`!PB`.6!+@!!W
XM^@RP*TC_R$'Z#+0K2/_,*T'_U$'L`G@K2/_D0>W_L"M(_]Q![``@*TC_X$'M=
XM_\@I2`(T)T@`6"`J`!CE@"!`0^@``2E)`E`0$2M!_[QR(K`!9B!2K`)0(&P"]
XM4$H89OQ3B)'L`E`@"")L`E`L2=W`0B[__R!L`E`K2/_0*TC_I"!L`E`0$'(O;
XML`%G!E*L`E!@[B!L`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K$AX`-%"IR\*3KH.0BZJ)
XM``A(>@$N2&P">$ZZ%7!A``6*3^\`%&``]H1,[5SD_T1.74YU:6YT=6ET:6]N=
XM+FQI8G)A<GD`5&%P94AA;F1L97(`+4)43E1!4$4@5C(N,"!205(M36%R(#(Y)
XM(#$Y.3$`0V%N)W0@9V5T(&UE;6]R>2!F;W(@=&%P92!B=69F97)S"@``4D%7L
XM0TU$``!-3T1%4T5,`"H`0V%P86-I='DZ("5U(&)L;V-K<PH``"5S($]P96YE`
XM9"!A="!B;&]C:R`E=0H``$5R<F]R('=R:71I;F<@9FEN86P@8FQO8VL*``!#8
XM;&]S960@870@8FQO8VL@)74*`$9U;F-T:6]N+VUO9&4@97)R;W(*``!%<G)O!
XM<B!D=7)I;F<@<F5A9`H``$5R<F]R(&1U<FEN9R!W<FET90H`56YS=7!P;W)T)
XM961?4&MT/25D"@!.3TY%``!214-/5D52140@15)23U(`3D]4(%)%0419`$U%X
XM1$E532!%4E)/4@``2$%21%=!4D4@15)23U(``$E,3$5'04P@4D5154535`!5I
XM3DE4($%45$5.5$E/3@``1$%402!04D]414-4``!"3$%.2R!#2$5#2P!+15D]H
XM.0!#3U!9($%"3U)4140``$%"3U)4140@0T]-34%.1`!+15D]0P!63TQ5344@6
XM3U9%4D9,3U<`2T59/44`2T59/48`1DE,14U!4DL``$5.1"U/1BU-141)54T`=
XM24Y#3U)214-4($),3T-+($Q%3D=42```4T5,1BU53DE4`$1-00!02$%310!0`
XM05))5%D``%-%3$5#5"U424U%3U54``!396YS93H@)7,L(&]T:&5R/2`E,#)8W
XM+"4P,E@*``!30U-)("5S($524D]2"@``54X``$Q5``!"4P``3D(``%)"``!"R
XM5```1DT``%9"``!/5@``1$8``%-5``!#.0``0V]N=&EN=64``$%B;W)T`%1I,
XM;64@=&\@:6YS97)T('1A<&4C("5D"@``($EN<V5R="!T87!E("5D(&9O<B`E>
XM<P``2.<C*$GY`````"XO`!C@AV<(<"V^@&8``-IP`"\`+P`O`$ZZ`Z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&
XM&'``(&W_S!`8+P`K2/_,(&T`$$Z06$]@XE.M__9M2'``$"W_^R\`(&T`$$Z04
XM6$]@Z%.M__9M$G``$"W_^R\`(&T`$$Z06$]@Z%.M_^1M&'``(&W_S!`8+P`K5
XM2/_,(&T`$$Z06$]@XB`+3-\,Y$Y=3G4``$Y5__1(YP$P)FT`""1M``PK;0`0!
XM__8>&DH'9S1P);X`9B*P$F8$4HI@&B\+2&W_]B\*80#\%$_O``PK0/_Z9P0D!
XM0&#2<``0!R\`3I-83V#&3-\,@$Y=3G4O/`````!(YW@P(&\`(")O`"0@+P`H8
XM*7P``````M`D2`P0`"!F!%)(8/8F2`P```!M#`P``"1N!@P```%F!G``8```9
XMY@P0`"UF#%(O`!A2+P`94DA@"`P0`"MF`E)(#````&8><`H,$``P9CAP"%)(E
XM#!``6&<&#!``>&8H<!!22&`B#```$&8<#!``,&86#"@`>``!9@142&`*#"@`6
XM6``!9@)42$*!0H(,$```9P``6A00#`(`,&U0#`(`.6X&!`(`,&`."((`!0P"<
XM`$%M.@0"`#>T`&XR*`%G'B8!QL!(1,C`2$0,1```9@C6A&4$(@-@!A]\``$`<
XM&=*"9```"!]\``$`&5)(8*`(+P```!AG`D2!""\````99P``#B/\````(@``K
XM`M!R_[/\`````&<,M\AF```&(HI@`B*((`%,WPP>6(].=0``````````<&%(!
XMYR`P)F\`$"1+$!)G)'(`$@!![`#Q"#```1@`9PIR`!(`=""2@F`$<@`2`!2!%
XM4HI@V"`+3-\,!$YU``````````!P82`O``@@;P`$3E7_]")/<@I.N@&D!D$`O
XM,!+!2H!F\"`)$.&_R6;Z0A"0CTY=3G4``"`O``@@;P`$3E7_]")/(@`"00`'A
XM!D$`,!+!YHAF\"`)$.&_R6;Z0A"0CTY=3G4``#`Q,C,T-38W.#EA8F-D968@Q
XM+P`((&\`!$/O``0R``)!``\2^Q#<Z(AF\B`)(@]8@1#ALHEF^D(0D(%.=2!OY
XM``0B2'(`<``O`@P0`"MG!@P0`"UF`E)($!@$```P;1(,```);@PD`>6!TH+2;
XM@=*`8.8,$0`M9@)$@20?(`A3@"!O``@@@9")3G4O!RXO``A2K`+,(`<@;`+(&
XM$,`I2`+(+A].=4Y5``!(YP`P)FT`""1M``Q"K`+,*4L"R$AM`!`O"DAZ_\9.B
XMNOSN(&P"R$(0("P"S$SM#`#_^$Y=3G4@;P`$(F\`""`O``QO%K/(90S1P-/`L
XM$R!3@&;Z3G42V%.`9OI.=0``2.<P`"0`)@%(0DA#Q,'&P,#!U$-(0D)"T(),7
XMWP`,3G5*@&H``!Y$@$J!:@``#$2!80``($2!3G5A```81(!$@4YU2H%J```,9
XM1(%A```&1(!.=2\"2$$T`68``")(0$A!2$(T`&<```:$P3`"2$`T`(3!,`)(8
XM0C(")!].=2\#=A`,00"`9```!N&944,,00@`9```!NF964,,02``9```!N69K
XM54-*06L```;CF5-#-`#FJ$A"0D+FJDA#@,$V`#`"-`-(0<3!D()D```(4T/0C
XM@63^<@`R`TA#Y[A(0,%!)A\D'TYU2.<#,B9O`!@N+P`<</\L>``$3J[^MGP`6
XM'`!P_[R`9@1P`&!F<"(B/``!``%.KO\Z)$`@"F8((`9.KOZP8$HE2P`*(`<5Z
XM0``)%7P`!``(0BH`#B`&%4``#Y/)3J[^VB5``!`@"V<((DI.KOZ>8!I!Z@`8J
XM)4@`%$'J`!0E2``<0JH`&!5\``(`("`*3-],P$YU2.<!,B9O`!0N+P`8(`MFU
XM!'``8"P@!R(\``$``2QX``1.KO\Z)$`@"F<4%7P`!0`(0BH`"25+``X@!S5`:
XM`!(@"DS?3(!.=0`````#[`````P````!```@Y@``&X8``!LF```3L@``$O@`I
XM`!+2```2?@``$=(``!&(```1`@``#^0````*`````````_(```/J````M0``7
XM```````````"``````$``````````0````````````````XD```.*@``#CH`V
XM``Y$```.4@``#F(```YR```.@@``#I````Z<```.H@``#K````[````.Q@``*
XM#M8```[<```.X@``#NP```[Z```/$@``#QP```\@```/)@``#RX```]L```/W
XM<```#W0```]X```/?```#X````^$```/B```#XP```^0```/E```#Y@``0$`$
XM``8``P````````'T```````!`0``!@`#````````#YP```````$!```&``,`_
XM```````/I@`````````@("`@("`@("`H*"@H*"`@("`@("`@("`@("`@("`@]
XM($@0$!`0$!`0$!`0$!`0$!"$A(2$A(2$A(2$$!`0$!`0$(&!@8&!@0$!`0$![
XM`0$!`0$!`0$!`0$!`0$!$!`0$!`0@H*"@H*"`@("`@("`@("`@("`@("`@("?
XM`@(0$!`0("`@("`@("`@("@H*"@H("`@("`@("`@("`@("`@("`@2!`0$!`0D
XM$!`0$!`0$!`0$(2$A(2$A(2$A(00$!`0$!`0@8&!@8&!`0$!`0$!`0$!`0$!*
XM`0$!`0$!`0$0$!`0$!""@H*"@H("`@("`@("`@("`@("`@("`@("`A`0$!`@\
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````````````````
XM``````/L````)@````````#F````T@```*X```"J````I@```*(```">````+
XMF@```)8```"2````C@```(H```"&````@@```'X```!Z````=@```'(```!NP
XM````:@```&8```!B````7@```%H```!6````4@```$X```!*````1@```$(`R
XM```^````.@```#8````R````+@```"H````F````(@````$````!````O@```
X&``````/RU
X``
Xend
Xsize 10356
END_OF_FILE
if test 14542 -ne `wc -c <'tape-handle.uu'`; then
    echo shar: \"'tape-handle.uu'\" unpacked with wrong size!
fi
# end of 'tape-handle.uu'
fi
if test -f 'tape.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tape.h'\"
else
echo shar: Extracting \"'tape.h'\" \(1664 characters\)
sed "s/^X//" >'tape.h' <<'END_OF_FILE'
X/* BTNtape include file, version 2.0 */
X
X/* Operations supported by TapeIO */
X#define TSENSE  0    /* request sense */
X#define TREADY  1    /* test unit ready */
X#define TREAD   2    /* read blocks */
X#define TWRITE  3    /* write blocks */
X#define TREWIND 4    /* rewind tape */
X#define WFMARK  5    /* write file mark */
X#define TSKIP   6    /* skip over files */
X#define INQUIRY 7    /* read device info */
X#define MDSET   8    /* mode-set */
X#define MDSNS   9    /* mode-sense */
X#define USRMODE 10   /* user mode-set */
X#define RDCAP   11   /* read capacity */
X#define RAWCMD  12   /* send user scsi command to tape */
X#define TFINISH 13   /* wait for last operation to finish */
X
X/* these control how fast TapeIO returns to the caller */
X#define CTLWAIT 0    /* return when operation is done */
X#define CTLIMM  1    /* return immediately */
X
X/* Supported device types (from INQUIRY) */
X#define SEQ    (inq[0]==0x01) /* sequential */
X#define DAC    (inq[0]==0x10) /* direct-access */
X#define BADLUN (inq[0]==0x7f) /* oops */
X
X/* inline message print functions */
X#define MPR0(XYZ)           sprintf(dbb,XYZ);           MonPrint()
X#define MPR1(XYZ,V1)        sprintf(dbb,XYZ,V1);        MonPrint()
X#define MPR2(XYZ,V1,V2)     sprintf(dbb,XYZ,V1,V2);     MonPrint()
X#define MPR3(XYZ,V1,V2,V3)  sprintf(dbb,XYZ,V1,V2,V3);  MonPrint()
X
X/* function prototypes */
Xvoid _main(void);
Xlong   TapeIO(int,int,int);
Xint    DoSense(long);
Xlong   wrteot(int,int,long);
Xvoid   freestuff(void);
Xint    getstart(long *);
Xvoid   MonPrint(void);
Xvoid   toUPPER(char *);
Xlong   NewTape(void);
Xvoid   returnpkt(struct DosPacket *, ULONG, ULONG);
Xstruct DosPacket *taskwait(void);
END_OF_FILE
if test 1664 -ne `wc -c <'tape.h'`; then
    echo shar: \"'tape.h'\" unpacked with wrong size!
fi
# end of 'tape.h'
fi
if test -f 'tapeio.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tapeio.c'\"
else
echo shar: Extracting \"'tapeio.c'\" \(6548 characters\)
sed "s/^X//" >'tapeio.c' <<'END_OF_FILE'
X/*
X**  TapeIO: performs operations to the tape unit via SCSI-direct for BTNtape
X**     Version 2.0  03/29/91
X**
X**   (c) Copyright 1990, 1991  Robert Rethemeyer.
X**     This code is freely distributable and redistributable,
X**     for non-commercial purposes, provided this notice is included.
X**
X**   This code was derived from programs written by Robert Mitchell.
X*/
X
X#include <exec/types.h>
X#include <exec/io.h>
X#include <libraries/dos.h>
X#include <libraries/dosextens.h>
X#include <devices/scsidisk.h>
X#include <stdio.h>
X#include <string.h>
X
X#define DBUG 0
X
X#if defined AZTEC_C
X  #include <functions.h>
X/*#define strtoul strtol */
X#elif defined LATTICE
X  #include <proto/exec.h>
X#endif
X
X#include "tape.h"
X#include "tplink.h"
X
X/* SCSI commands used by handler */
X#define CMD_TEST_UNIT_READY   0x00
X#define CMD_REWIND            0x01
X#define CMD_REQUEST_SENSE     0x03
X#define CMD_SCSI_READ         0x08
X#define CMD_SCSI_WRITE        0x0a
X#define CMD_FILEMARK          0x10
X#define CMD_SPACE             0x11
X#define CMD_INQUIRY           0x12
X#define CMD_MODE_SELECT       0x15
X#define CMD_MODE_SENSE        0x1a
X#define CMD_READ_CAPACITY     0x25
X
Xextern UBYTE  *cdb;
Xextern UBYTE  *sns;
Xextern UBYTE  *inq;
Xextern struct SCSICmd  *cmd;
Xextern UBYTE  *TapeBuff[2];
Xextern struct IOStdReq *ior;
Xextern ULONG  blknum;
Xextern ULONG  blksize;
Xextern ULONG  numblks;
Xextern ULONG  TBSize;
Xextern ULONG  rwlen;
Xextern ULONG  tranlen;
Xextern ULONG  bugmask;
Xextern ULONG  fmarks;
Xextern long   reserved;
Xextern long   tpsize;
Xextern struct tplink  *linktp;
Xextern int    inprog;
Xextern char   dbb[80];
Xextern UBYTE  Lun;
Xextern UBYTE  fixedbit;
Xextern long   NewTape();
X
Xlong TapeIO(int toper, int bn, int ctl)
X{
X char *z;  int i;
X
X if(inprog) {
X    WaitIO((struct IORequest *)ior);
X    inprog = FALSE;
X    if(ior->io_Error)
X         return((long)((ior->io_Error << 8) + cmd->scsi_Status));
X }
X if(toper == TFINISH) return(0L);
X cmd->scsi_Command = cdb;
X cmd->scsi_CmdLength = 6;
X cmd->scsi_Status = 0;
X ior->io_Command = HD_SCSICMD;
X ior->io_Data = (APTR) cmd;
X ior->io_Length = sizeof(struct SCSICmd);
X ior->io_Error = 0;
X for (i=0 ; i<10; i++) cdb[i] = 0x00;
X
X switch(toper) {
X
X  case TWRITE:
X    if(DAC && ((blknum+numblks)>=tpsize)) NewTape();
X    cdb[0] = CMD_SCSI_WRITE;
X    cdb[1] = Lun | fixedbit;
X    *((UWORD *)&cdb[2]) = (SEQ) ? (UWORD)(tranlen>>8) : (UWORD) blknum;
X    cdb[4] = (UBYTE) tranlen & 0xff;
X /* cmd->scsi_Data = (UWORD *) TapeBuff[bn]; */      /* 2090A bug fix */
X    cmd->scsi_Data = (UWORD *) ((ULONG) TapeBuff[bn] | bugmask);
X    cmd->scsi_Length = rwlen;
X    cmd->scsi_Flags = SCSIF_WRITE;
X    MPR2("Writing block %u * %d\n",blknum,tranlen);
X    break;
X
X  case TREAD:
X    if(DAC && ((blknum+numblks)>=tpsize)) NewTape();
X    cdb[0] = CMD_SCSI_READ;
X    cdb[1] = Lun | fixedbit;
X    *((UWORD *)&cdb[2]) = (SEQ) ? (UWORD)(tranlen>>8) : (UWORD) blknum;
X    cdb[4] = (UBYTE) tranlen & 0xff;
X    cmd->scsi_Data = (UWORD *) TapeBuff[bn];
X    cmd->scsi_Length = rwlen;
X    cmd->scsi_Flags = SCSIF_READ;
X    MPR2("Reading block %u * %d\n",blknum,tranlen);
X    break;
X
X  case TSENSE:
X    for (i=0 ; i<32; i++) sns[i] = 0;
X    cdb[0] = CMD_REQUEST_SENSE;
X    cdb[1] = Lun;
X    cdb[4] = 32;  /* extended sense */
X    cmd->scsi_Length = 32;
X    cmd->scsi_Data = (UWORD *) sns;
X    cmd->scsi_Flags = SCSIF_READ;
X    break;
X
X  case TREWIND:
X    cdb[0] = CMD_REWIND;
X    cdb[1] = Lun;
X    cmd->scsi_Length = 0;
X    cmd->scsi_Flags  = 0;
X    MPR0("Rewinding\n");
X    break;
X
X  case INQUIRY:  /* read drive information */
X    cdb[0] = CMD_INQUIRY;
X    cdb[1] = Lun;
X    cdb[4] = 36;
X    cmd->scsi_Length = 36;
X    cmd->scsi_Data = (UWORD *) inq;
X    cmd->scsi_Flags = SCSIF_READ;
X    break;
X
X  case TREADY:  /* test unit ready */
X    cdb[0] = CMD_TEST_UNIT_READY;
X    cdb[1] = Lun;
X    cmd->scsi_Length = 0;
X    cmd->scsi_Flags = 0;
X    break;
X
X  case MDSNS:
X    for (i=0 ; i<12; i++) sns[i] = 0;
X    cdb[0] = CMD_MODE_SENSE;
X    cdb[1] = Lun;
X    cdb[4] = 12;
X    cmd->scsi_Length = 12;
X    cmd->scsi_Data = (UWORD *) sns;
X    cmd->scsi_Flags = SCSIF_READ;
X    break;
X
X  case WFMARK:  /* write file mark */
X    cdb[0] = CMD_FILEMARK;
X    cdb[1] = Lun;
X    cdb[4] = (UBYTE) fmarks;
X    cmd->scsi_Length = 0;
X    cmd->scsi_Flags = 0;
X    MPR0("Writing filemark\n");
X    break;
X
X  case TSKIP:   /* skip over files */
X    cdb[0] = CMD_SPACE;
X    cdb[1] = Lun | 0x01;  /* space file marks */
X    i = fmarks * bn;
X    cdb[3] = (UBYTE) i >> 8;
X    cdb[4] = (UBYTE) i & 0xff;
X    cmd->scsi_Length = 0;
X    cmd->scsi_Flags = 0;
X    MPR1("Skipping %d file(s)\n",bn);
X    break;
X
X  case RDCAP:  /* read tape capacity.  3M drive only */
X    cdb[0] = CMD_READ_CAPACITY;
X    cdb[1] = Lun;
X    cmd->scsi_CmdLength = 10;
X    cmd->scsi_Length = 8;
X    cmd->scsi_Data = (UWORD *) sns;
X    cmd->scsi_Flags = SCSIF_READ;
X    break;
X
X  case RAWCMD:  /* write user-provided control command */
X    i = 0;
X    z = (char *)TapeBuff[bn];
X    while(*z!='\n' && i<10)  cdb[i++] = (UBYTE) 0xff & strtoul (z,&z,16);
X    cdb[1] |= Lun;
X    if(cdb[0]==CMD_REWIND) blknum = reserved;
X    cmd->scsi_Data = (UWORD *) sns;
X    cmd->scsi_Length = 0;
X    cmd->scsi_Flags  = 0;
X    MPR0("Raw command\n");
X    break;
X
X  case MDSET:  /* set fixed-mode block length */
X    cdb[0] = CMD_MODE_SELECT;
X    cdb[1] = Lun;
X    cdb[4] = 12;
X    for (i=0 ; i<12; i++) sns[i] = 0x00;
X    sns[2] = 0x10;  /* buffered mode */
X    sns[3] = 8;
X    if(!bn) *((ULONG *)&sns[8]) = blksize & 0x00ffffff; /* block length */
X    cmd->scsi_Length = 12;
X    cmd->scsi_Data = (UWORD *) sns;
X    cmd->scsi_Flags = SCSIF_WRITE;
X    MPR1("Mode Select block size %d\n",blksize);
X    break;
X
X  case USRMODE:  /* write user-provided mode-select data */
X    for (i=0 ; i<64; i++) sns[i] = 0x00;
X    i = 0;
X    z = (char *)TapeBuff[bn];
X    while(*z!='\n' && i<64)  sns[i++] = (UBYTE) 0xff & strtoul (z,&z,16);
X    cdb[0] = CMD_MODE_SELECT;
X    cdb[1] = Lun;
X    cdb[4] = i;
X    cmd->scsi_Length = i;
X    cmd->scsi_Data = (UWORD *) sns;
X    cmd->scsi_Flags  = SCSIF_WRITE;
X    MPR0("User Mode-Select\n");
X    break;
X
X  }
X
X#if DBUG
X  MPR3("CDB = %02x %02x %02x",cdb[0],cdb[1],cdb[2]);
X  MPR3("%02x %02x %02x\n",cdb[3],cdb[4],cdb[5]);
X  MPR1("ADDR = %X\n", cmd->scsi_Data );
X  MPR1("LENG = %X\n\n", cmd->scsi_Length );
X  return(0L);
X#endif
X
X  if(ctl == CTLWAIT) {
X       DoIO ((struct IORequest *)ior);    /* start sync io */
X       return((long)((ior->io_Error << 8) + cmd->scsi_Status));
X  }
X  else {
X       SendIO((struct IORequest *)ior);  /* start async io */
X       inprog = TRUE;
X       return(0L);
X  }
X}
X
END_OF_FILE
if test 6548 -ne `wc -c <'tapeio.c'`; then
    echo shar: \"'tapeio.c'\" unpacked with wrong size!
fi
# end of 'tapeio.c'
fi
if test -f 'tapemon.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tapemon.c'\"
else
echo shar: Extracting \"'tapemon.c'\" \(5030 characters\)
sed "s/^X//" >'tapemon.c' <<'END_OF_FILE'
X/**
X *  TapeMon:  a monitor program for the BTNtape handler.
X */
X#define MVERSION  "TapeMon V2.0"
X/*
X *  (c) Copyright 1990, 1991  Robert Rethemeyer
X *   This software may be freely distributed and redistributed,
X *   for non-commercial purposes, provided this notice is included.
X *------------------------------------------------------------
X *   Run TapeMon from a CLI to receive informational messages
X *   from the BTN-Tape handler process.  To terminate the
X *   monitor program, break the CLI using control-C or BREAK.
X */
X#include <exec/types.h>
X#include <exec/nodes.h>
X#include <exec/lists.h>
X#include <exec/ports.h>
X#include <exec/tasks.h>
X#include <exec/execbase.h>
X#include <libraries/dos.h>
X#include <stdlib.h>
X#include <stdio.h>
X#include <string.h>
X#include "/tplink.h"
X
X#if defined AZTEC_C
X  #include <functions.h>
X#elif defined LATTICE
X  #include <proto/exec.h>
X  #include <proto/dos.h>
X#endif
X
Xextern struct DosLibrary *DOSBase;
X
Xvoid main(int,char *[]);
Xvoid toUPPER(char *);
X
Xvoid main(int argc, char *argv[])
X{
X struct Task    *tapeproc;
X struct tplink  *linktp;
X char *tapename;
X char *xx;
X ULONG x;
X int   run = 1;
X int   fullsense = 0;
X int   ii;
X BYTE  signum;
X BYTE  oldpri;
X
X   printf("*** BTN-Tape Handler & Monitor ***\n(c) Copyright 1990,1991 Robert Rethemeyer\n");
X
X   if(argc > 1) {
X      tapename = argv[1];
X      toUPPER(tapename);
X      xx = &tapename[strlen(tapename)-1];
X      if(*xx == ':') *xx = '\0';
X   }
X   else tapename = "TAPE";
X
X   if(argc > 2) fullsense = 1;
X
X   if (!(tapeproc = FindTask(tapename)))  {
X         printf("Process %s not found.\n",tapename);
X         exit(30);
X   }
X   if (!(linktp = (struct tplink *) tapeproc->tc_UserData))  {
X         printf("No linkage structure...\n wrong process, or\n handler not active yet?\n");
X         exit(31);
X   }
X   printf("%s: Proc %X DevNode %X\n",tapename,tapeproc,linktp->devnode);
X
X   if (strcmp(linktp->keyword,"TapeHandler"))  {
X         printf("Process %s doesn't look like BTN-Tape\n",tapename);
X         exit(32);
X   }
X
X   if (linktp->montask)  {
X         printf("There is already a TapeMon running\n");
X         exit(33);
X   }
X
X   if (!linktp->handsig) {
X          printf("Handler has no signal\n");
X          exit(34);
X   }
X
X   signum = AllocSignal(-1);
X   if (signum == -1)  {
X         printf("Unable to allocate signal for TapeMon\n");
X         exit(35);
X   }
X   linktp->monsig  = 1UL << signum;      /* give mask to tape handler */
X   linktp->montask = FindTask(0);        /* tell it where I am also   */
X
X   printf("%s  Unit-%X  LU-%X\n",linktp->driver,*(linktp->unit),
X                                                *(linktp->Lun)>>5);
X
X   if(linktp->inquiry[8] != '\0')  printf("Drive: %s\n",linktp->inquiry+8);
X   if(linktp->inquiry[0] == 0x01)
X        printf("Sequential Access\n");
X   else if (linktp->inquiry[0] == 0x10)
X        printf("Direct Access\n");
X   else if (linktp->inquiry[0] == 0x7f)
X        printf("BAD LOGICAL UNIT NUMBER\n");
X   else printf("Device type = %X\n",linktp->inquiry[0]);
X
X   if(linktp->badparm) printf("ERROR(S) IN STARTUP\n");
X
X   if(linktp->sense)
X       printf("Last sense= %s, other=%02X,%02X\n",linktp->sense,linktp->xsns1,
X         linktp->xsns2);
X   printf("Use ^C to terminate TapeMon\n%s\n",linktp->version);
X
X   /* Set the monitor priority to the same as that of the handler */
X   oldpri = SetTaskPri (linktp->montask, (long)tapeproc->tc_Node.ln_Pri);
X
X   /* The main loop.  Wait for a signal from the handler, then print the
X      contents of dbb.  Some extra handshaking must then be done to sync
X      the two processes and prevent races.  If a control-C occurs during
X      a Wait, then finish whatever was in progress before ending the loop.
X   */
X
X   while(run)  {
X     x=Wait(linktp->monsig | SIGBREAKF_CTRL_C);   /* Wait for req from hndlr */
X     if  (x & SIGBREAKF_CTRL_C) run = 0;
X     if(!(x & linktp->monsig) ) continue;
X
X     printf(" %s",linktp->dbb);                   /* print handler's message */
X     if(fullsense && linktp->sns) {               /* If sense info           */
X        for(ii=0; ii<32; ii++)                    /*   print all sense info  */
X            printf(" %02X",linktp->sns[ii]);
X        printf("\n");
X     }
X
X     Signal(tapeproc, linktp->handsig);           /* tell it we are 'done'   */
X
X     x=Wait(linktp->monsig | SIGBREAKF_CTRL_C);   /* Wait for ack of 'done'  */
X     if  (x & SIGBREAKF_CTRL_C) run = 0;
X     if(!(x & linktp->monsig) ) Wait(linktp->monsig);
X
X     Signal(tapeproc, linktp->handsig);           /* Ack his ack */
X   }
X
X   /* Clean up and exit */
X
X   SetTaskPri(linktp->montask, (long) oldpri);   /* restore priority */
X   linktp->montask = NULL;                      /* break link with handler */
X   linktp->monsig  = 0;
X   FreeSignal((ULONG)signum);
X   printf("TapeMon terminated\n");
X   exit(0);
X}
X
X/**************************************************************************/
X/* toUPPER: convert string to upper case */
X
Xvoid toUPPER(char *zz)
X{
X  for(; *zz != '\0'; zz++)  if(*zz >= 'a') *zz -= 0x20;
X  return;
X}
END_OF_FILE
if test 5030 -ne `wc -c <'tapemon.c'`; then
    echo shar: \"'tapemon.c'\" unpacked with wrong size!
fi
# end of 'tapemon.c'
fi
if test -f 'tapemon.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tapemon.doc'\"
else
echo shar: Extracting \"'tapemon.doc'\" \(6589 characters\)
sed "s/^X//" >'tapemon.doc' <<'END_OF_FILE'
X****    TapeMon:  a monitor program for BTNtape handler           ****
X****       Version 2.0   03/29/91                                 ****
X****       Freeware by Bob Rethemeyer   (DrBob@cup.portal.com)    ****
X****      (c) Copyright 1990,1991 Robert Rethemeyer               ****
X
XTapeMon is an optional companion program to the BTNtape SCSIdirect
Xtape handler.  Since the handler cannot directly inform you of what
Xit is doing,  TapeMon, running in a separate CLI, communicates with
Xthe handler and prints information for you.  Think of it as a window
Xinto the handler.
X
XTo run TapeMon, bring up a separate CLI window.  Enter "TapeMon" or
X"TapeMon [name]", where [name] is the name of the handler device process.
XIf you do not enter the name, the monitor will default to using "TAPE:".
X
XThe handler must be loaded and running for TapeMon to work, otherwise
Xit prints a message and immediately quits.  If you have mounted the
Xtape handler but not accessed the tape yet, the handler is not yet loaded,
Xand TapeMon will give up.  To avoid this, invoke TapeMon after starting
Xtape access, or use "Mount = 1" in your mountlist entry.
X
XOnce the handler is loaded and running, you may invoke or terminate
Xthe monitor at any time (but only one TapeMon may run at a time).
XTo terminate the monitor, enter control-C from the TapeMon CLI window,
Xor send a BREAK command from another CLI.
X
XIf the handler encounters a tape error, it remembers the data returned
Xby SENSE.  When TapeMon is started, it prints the retained sense data.
XSo if you weren't running TapeMon at the time an error occurs, you can
Xstill see the sense data by starting TapeMon after the fact.
X
XTapeMon accepts a second command line argument as a flag to print all
Xthe sense information when a sense occurs.  The value of the second
Xargument is ignored, but if it is present, complete sense is printed.
XExample:  TAPEMON TAPE: XYZ
XThe presense of the XYZ will cause the sense message to also print
X32 bytes of hex sense information as it is returned from the drive.
X
XTapeMon output is to stdout, so you may redirect it if you like.
XExample:   TAPEMON >filename
X
X
XMESSAGES
X
XThe following summarizes the messages from the handler/monitor:
X
X  Drive: ............       shows the manufacturer, model, and ROM version
X                            of the drive.  This is the data returned by the
X                            drive with the SCSI INQUIRY command.
X
X  Sequential Access         One of the first two messages is printed to show
X  Direct Access             which type of drive you have.  The third message
X  BAD LOGICAL UNIT NUMBER   is printed if you use the wrong LU number.
X
X  TAPE: Opened at block x   printed when the TAPE: file is opened by DOS.
X                            x is the first block number of the file.
X                            For sequential tapes, block numbers are relative
X                            to the beginning of the file (not necessarily
X                            the beginning of the tape).
X
X  Closed at block x         printed when the TAPE: file is closed by DOS.
X                            x is the next available block.
X
X  Writing block x * n       printed when a tape write is started by the
X                            handler. x = block number. n = number of blocks
X                            (fixed block mode, VB-0), or number of bytes
X                            (variable block mode, VB-1).
X
X  Reading block x * n       printed when a tape read is started by the handler.
X
X  Writing filemark          printed when TAPE: is closed in write mode,
X                            sequential drives only.
X
X  Unsupported_pkt= x        printed when DOS sends a packet which the handler
X                            rejects.  Example: 25 for the INFO command.
X
X  Function/mode error       the application attempted a Read() while opened
X                            in write mode, or a Write() while in read mode.
X
X  Rewinding                 printed when handler starts a tape rewind
X
X  Skipping n file(s)        printed when TAPE:num form is used to skip over
X                            filemarks (sequential drives only).
X
X  Raw command               printed when handler receives a raw command request
X
X  Mode Select block size x  printed when handler detects that drive block size
X                            is not equal to BS, and a Mode Select is issued
X                            to correct it.
X
X  User Mode-Select          printed when handler passes the user mode-select
X                            request on to the drive.
X
X  Sense: ????? other=yy,zz  printed when the handler issues SENSE to the tape
X                            drive due to a "check condition" (error).
X                            ????? is the sense key meaning.  Filemark and
X                            end-of-tape are identified separately. yy,zz is the
X                            additional sense code from bytes 12 and 13 of the
X                            sense data (some drives provide this). If complete
X                            sense was selected by TapeMon arg2, 32 additional
X                            bytes will be printed representing the exact data
X                            returned by the drive for the sense.
X
X  Last sense= ?????, yy,zz  retained sense data printed at TapeMon startup
X
X  ERROR(S) IN STARTUP       printed when the handler detects an unrecognized
X                            parameter in the mountlist Startup statement.
X
X  SCSI ????? ERROR          printed when the scsidirect driver detects an
X                            error (io_Error != 0). ????? is the error meaning.
X
X  Capacity: xxxx blocks     (for the 3M drive only) printed at Open() time
X                            to show the number of blocks available on the
X                            tape volume.  If this number is huge, your
X                            3M drive may not support the READ_CAPACITY
X                            command- don't worry about it.
X
X  Time to insert tape# x    printed when EOT requester is displayed
X
X  Can't get memory for tape buffers   printed for Open() attempts when not
X                                      enough memory is available for buffers.
X                                      Try a smaller number for NB.
X
X
XHOW IT WORKS
X
XTapeMon finds the tape handler process and locates a common
Xdata structure attached to it.  The monitor waits for signals from the
Xhandler.  The handler detects the presence of the monitor and signals
Xit when a message needs to be printed.  A break signal causes the monitor
Xto disconnect itself from the handler and terminate.
X
END_OF_FILE
if test 6589 -ne `wc -c <'tapemon.doc'`; then
    echo shar: \"'tapemon.doc'\" unpacked with wrong size!
fi
# end of 'tapemon.doc'
fi
if test -f 'tapemon.lmk' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tapemon.lmk'\"
else
echo shar: Extracting \"'tapemon.lmk'\" \(247 characters\)
sed "s/^X//" >'tapemon.lmk' <<'END_OF_FILE'
X# SAS/LATTICE MAKEFILE FOR TAPE MONITOR v2.0
X
XCFLAGS= -b1 -mat -cakfsu -j132i
X
XLIBS=LIB:lc.lib+LIB:amiga.lib
X
Xtapemon : tapemon.o
X   blink FROM LIB:c.o+tapemon.o TO $@ SC SD LIB $(LIBS)
X
Xtapemon.o : tapemon.c /tplink.h
X    LC $(CFLAGS) tapemon.c
X
END_OF_FILE
if test 247 -ne `wc -c <'tapemon.lmk'`; then
    echo shar: \"'tapemon.lmk'\" unpacked with wrong size!
fi
# end of 'tapemon.lmk'
fi
if test -f 'tapemon.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tapemon.uu'\"
else
echo shar: Extracting \"'tapemon.uu'\" \(11690 characters\)
sed "s/^X//" >'tapemon.uu' <<'END_OF_FILE'
Xbegin 666 tapemon
XM```#\P`````````"``````````$```=X```!(P```^D```=X2.=^_B1()`!)+
XM^0`````L>``$1_D```(<<@`@/````)Q@`B;!4<C__"E/`EPI3@)40JP"6'``A
XM(CP``#``3J[^SD/Z`:AP`$ZN_=@I0`2(9@9P9&```2PF;@$4*6L`F`)02JL`;
XMK&<``)(@#Y"O`#@&@````(`I0`(@(&L`K-'(T<@B:``0T\G3R2`"<@`2&2E)(
XM`F30@5Z``D#__"E``FQ(YT!`(CP``0`!3J[_.DS?`@)*@&8,(#P```/H+P!GU
XM``$<($`I0`)H(`)3@-2!$;(``"`"4X)1R/_V$;P`("`"4X(1O``B(`(1L2``Y
XM(`%1RO_X$+P`(B\(8'@I:P`Z`B!P?U*`T:P"($'K`%Q.KOZ`0>L`7$ZN_HPIY
XM0`)8+P`D0"`J`"1G&"QL!(@@0"(H``!.KO^@*4`"4"(`3J[_@B(J`"!G&B0\J
XM```#[4ZN_^(I0`)@9PKEB"!`)V@`"`"D(&P"6"\(2&P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!9/YR`#(#2$/GN$A`P4$F'R0?3G5.T
XM5?^82.<S,GX`(&P"9!XH__]P3[Z`;P(N`"`'0^W_KV`"$MA3@&3Z0C5XKY/),
XM+'@`!$ZN_MHF0"`K`*QG2.6`)$`L*@`X2H9F!"PK`*!*AF<T(@9!^@"V)`AVV
XM"RQL!(A.KO_0($=2AR`(&[P`"@BO(@9![?^O)`@F!RQL!(A.KO_0</]@4D/ZD
XM`)!P`"QX``1.KOW8*T#_FF8$</]@.D'M_Z\I2`#D+RW_FDAX`#Q(>`#Z<``OK
XM`"\`2&P!`$AL`.Q(;`#80J=.NNJP3^\`)%.`9P1P_V`"<`!,WTS,3EU.=2HJ!
XM(%5S97(@06)O<G0@4F5Q=65S=&5D("HJ``!#3TY424Y510``04)/4E0`*BHJX
XM($)R96%K.B``:6YT=6ET:6]N+FQI8G)A<GD````O!RXO``AP`"E``C1*AVLBM
XMOJP``&P<(`?G@$'L`G!*L`@`9PX@!^>`0>P"<-'`(`A@"'`)*4`$A'``+A].9
XM=0``2.<!`G``(CP``#``+'@`!$ZN_LXN``*'```P`$J'9R!*K`),9QH@;`),S
XM3I!*@&8"8`Y"K`),2'@`%$ZZ]8!83TS?0(!.=6&X3G4``````^P````"````M
XM`0```!0````*`````````_(```/J````AP```"@`````````````````````P
XM`````````#H```````````````````````````````````````````!<````6
XM`````````````````````````````````````````````````````````````
XM``````````````````````````"`````!`#__P````X`#@``````````````>
XM`/__````!``$````````&PX```"(__\````$``0````````;)`````#__P``Z
XM``X`#@```````!T(`````/__````!``$``````````````#$__\````$``0`1
XM```````=)`````#__P````0`!````````!TN```````@("`@("`@("`H*"@H2
XM*"`@("`@("`@("`@("`@("`@($@0$!`0$!`0$!`0$!`0$!"$A(2$A(2$A(2$(
XM$!`0$!`0$(&!@8&!@0$!`0$!`0$!`0$!`0$!`0$!`0$!$!`0$!`0@H*"@H*"V
XM`@("`@("`@("`@("`@("`@("`@(0$!`0("`@("`@("`@("@H*"@H("`@("`@P
XM("`@("`@("`@("`@2!`0$!`0$!`0$!`0$!`0$(2$A(2$A(2$A(00$!`0$!`00
XM@8&!@8&!`0$!`0$!`0$!`0$!`0$!`0$!`0$0$!`0$!""@H*"@H("`@("`@("4
XM`@("`@("`@("`@("`A`0$!`@```````"`````^P````%`````````0P```#XU
XL````T````+P```"H````!`````$```#H````K````#H````8`````````_+X,
X``
Xend
Xsize 8324
END_OF_FILE
if test 11690 -ne `wc -c <'tapemon.uu'`; then
    echo shar: \"'tapemon.uu'\" unpacked with wrong size!
fi
# end of 'tapemon.uu'
fi
if test -f 'tplink.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tplink.h'\"
else
echo shar: Extracting \"'tplink.h'\" \(870 characters\)
sed "s/^X//" >'tplink.h' <<'END_OF_FILE'
X/* Structure shared by BTNtape and TapeMon.  Version 2.0 */
X
Xstruct tplink {
X   char   *keyword;     /* name "TapeHandler" */
X   char   *version;     /* version string     */
X   char   *driver;      /* scsi driver name   */
X   void   *devnode;     /* device node address*/
X   UBYTE  *sns;         /* sense data address */
X   ULONG  *unit;        /* scsi unit number   */
X   UBYTE  *Lun;         /* logical unit << 5  */
X   char   *dbb;         /* message from handler */
X   ULONG   handsig;     /* handler sig mask   */
X   ULONG   monsig;      /* monitor sig mask   */
X   struct Task *montask;  /* monitor task ptr   */
X   UBYTE  *inquiry;     /* inquiry data       */
X   char   *sense;       /* last sense text    */
X   UBYTE  xsns1;        /*   additional byte1 */
X   UBYTE  xsns2;        /*   additional byte2 */
X   UBYTE  badparm;      /* flag for bad startup */
X};
END_OF_FILE
if test 870 -ne `wc -c <'tplink.h'`; then
    echo shar: \"'tplink.h'\" unpacked with wrong size!
fi
# end of 'tplink.h'
fi
echo shar: End of archive 1 \(of 2\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked both archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
Mail comments to the moderator at <amiga-request@uunet.uu.net>.
Post requests for sources, and general discussion to comp.sys.amiga.misc.