|
|
1.1 ! root 1: /* @(#)ardef.h 1.1 86/02/03 SMI */ ! 2: ! 3: /* ! 4: * Copyright (c) 1984 by Sun Microsystems, Inc. ! 5: */ ! 6: ! 7: /* ! 8: * Standalone Driver for Archive Intelligent Streaming Tape ! 9: * ardef.h ! 10: */ ! 11: ! 12: /* ! 13: * Interesting tape commands ! 14: */ ! 15: #define AR_CLOSE 0 /* Close tape: WTM-if-writing, rewind */ ! 16: #define AR_REWIND 1 /* Rewind (overlapped) */ ! 17: #define AR_STATUS 2 /* Drive Status */ ! 18: #define AR_READ 3 /* Read to MB memory */ ! 19: #define AR_WRITE 4 /* Write to MB memory */ ! 20: #define AR_WEOF 5 /* Write file mark (EOF) */ ! 21: #define AR_ERASE 6 /* Erase entire tape */ ! 22: #define AR_SELECT 7 /* Select drive of interest */ ! 23: #define AR_DESELECT 8 /* Select no interesting drive */ ! 24: #define AR_TENSE 9 /* Retension tape */ ! 25: #define AR_SKIPFILE 10 /* Skip one file forward */ ! 26: #define AR_CMDOK 11 /* See if ok to do cmd */ ! 27: ! 28: /* ! 29: * States into which the tape drive can get. ! 30: */ ! 31: enum ARstates { ! 32: FINstate = 0x00, IDLEstate, CMDstate, /* Finished, Idle, Command */ ! 33: WFMinit, /* Write File Mark */ ! 34: RFMinit, /* Read to File Mark */ ! 35: REWinit, /* Rewind tape */ ! 36: TENSEinit, /* Retension tape */ ! 37: ERASEinit, /* Erase tape */ ! 38: SELinit, /* Select a drive */ ! 39: DESELinit, /* Deselect all drives */ ! 40: RDSTinit, /* Read status */ ! 41: CLOSEinit, /* Deassert aronline */ ! 42: READinit, READcmd, READburst, READfin, READidle, /* Read */ ! 43: WRinit, WRcmd, WRburst, WRfin, WRidle, /* Write */ ! 44: CMDOKinit, /* OK to issue commands? */ ! 45: }; ! 46: ! 47: /* ! 48: * Software state per tape controller. ! 49: */ ! 50: struct ar_softc { ! 51: enum ARstates sc_state; /* Current state of hard/software */ ! 52: enum ARstates sc_oldstate; /* Previous state of sc_state */ ! 53: struct arstatus sc_status; /* Status at last "Read status" cmd */ ! 54: int sc_size; /* Size of buffer to read/write */ ! 55: char *sc_bufptr; /* Pointer to buffer to read/write */ ! 56: char sc_initted; /* Is controller initialized yet? */ ! 57: char sc_opened; /* Is this drive open? */ ! 58: char sc_lastiow; /* last op was write */ ! 59: int sc_count; /* # times to repeat high-level op */ ! 60: u_char sc_drive; /* Drive # to select/deselect */ ! 61: u_char sc_histate; /* Higher level state than sc_state */ ! 62: struct ardevice *sc_addr;/* Address of I/O registers */ ! 63: u_char sc_qidle; /* =0 if buf in progress, =1 if not. */ ! 64: char sc_eoflag; /* raw eof flag */ ! 65: u_char sc_cmdok; /* 0 => can only issue read/RFM/write/WFM */ ! 66: char sc_selecteddev; /* currently selected drive */ ! 67: /* When adding new fields to ar_softc, also initialize them in arinit(). */ ! 68: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.