1*49431Sbostic /*- 2*49431Sbostic * Copyright (c) 1991 The Regents of the University of California. 3*49431Sbostic * All rights reserved. 4*49431Sbostic * 5*49431Sbostic * This code is derived from software contributed to Berkeley by 6*49431Sbostic * Computer Consoles Inc. 7*49431Sbostic * 8*49431Sbostic * %sccs.include.proprietary.c% 9*49431Sbostic * 10*49431Sbostic * @(#)cyvar.h 1.3 (Berkeley) 05/08/91 11*49431Sbostic */ 1225862Ssam 1325862Ssam #define TM_ATTENTION(addr,x) movob(addr,x) /* also known as: GO */ 1425862Ssam 1525862Ssam #define TM_RESET(addr,x) TM_ATTENTION((addr+1),x) /* reset controller */ 1625862Ssam #define TM_SHORT(x) (short)((((x) >> 8) & 0xff) + (((x) << 8) & 0xff00)) 1725862Ssam 1825862Ssam #define GATE_OPEN (char)(0x00) 1925862Ssam #define GATE_CLOSED (char)(0xFF) 2025862Ssam 2125862Ssam #define b_repcnt b_bcount 2225862Ssam #define b_command b_resid 2325862Ssam 2425862Ssam /* Group. I Control status/commands */ 2525862Ssam #define CONFIG (0x00000000L) /* configure */ 2625862Ssam #define SET_PA (0x08000000L) /* set page */ 2725862Ssam #define NO_OP (0x20000000L) /* no operation */ 2825862Ssam #define DRIVE_S (0x28000000L) /* drive status */ 2925862Ssam #define TAPE_AS (0x74000000L) /* tape assign */ 3025862Ssam #define DRIVE_R (0x90000000L) /* drive reset */ 3125862Ssam 3225862Ssam /* Group. II Tape position commands */ 3325862Ssam #define REWD_OV (0x04000000L) /* rewind overlapped */ 3425862Ssam #define READ_FO (0x1C000000L) /* read foreign tape */ 3525862Ssam #define REWD_TA (0x34000000L) /* rewind tape */ 3625862Ssam #define OFF_UNL (0x38000000L) /* off_line and unload */ 3725862Ssam #define WRIT_FM (0x40000000L) /* write filemark */ 3825862Ssam #define SERH_FM (0x44000000L) /* search filemark */ 3925862Ssam #define SRFM_FD (0x44000000L) /* search filemark forward */ 4025862Ssam #define SRFM_BK (0xC4000000L) /* search filemark backward */ 4125862Ssam #define SPACE (0x48000000L) /* skip record */ 4225862Ssam #define SP_FORW (0x48000000L) /* space forward */ 4325862Ssam #define SP_BACK (0xC8000000L) /* space backwords */ 4425862Ssam #define ERASE_F (0x4C000000L) /* erase fixed length */ 4525862Ssam #define ERASE_T (0x50000000L) /* erase to end of tape */ 4625862Ssam #define SPAC_FM (0x70000000L) /* space filemark */ 4725862Ssam #define SERH_MU (0x94000000L) /* search multiple filemarks */ 4825862Ssam 4925862Ssam /* Group. III Data transfer commands */ 5025862Ssam #define READ_BU (0x10000000L) /* read buffered */ 5125862Ssam #define WRIT_BU (0x14000000L) /* write buffered */ 5225862Ssam #define EDIT_BU (0x18000000L) /* edit buffered */ 5325862Ssam #define READ_TA (0x2C000000L) /* read tape */ 5425862Ssam #define WRIT_TA (0x30000000L) /* write tape */ 5525862Ssam #define EDIT_TA (0x3C000000L) /* edit tape */ 5625862Ssam #define READ_ST (0x60000000L) /* read streaming */ 5725862Ssam #define WRIT_ST (0x64000000L) /* write streaming */ 5825862Ssam 5925862Ssam /* Group. IV Special commands */ 6025862Ssam #define EXCHANG (0x0C000000L) /* exchange system and tapemaster RAM */ 6125862Ssam #define BLOCK_M (0x80000000L) /* block move */ 6225862Ssam 6325862Ssam /* Group. V Diagnostic commands */ 6425862Ssam #define TEST_SH (0x54000000L) /* short memory test */ 6525862Ssam #define TEST_LG (0x58000000L) /* long memory test */ 6625862Ssam #define TEST_CN (0x5C000000L) /* controller confidence test */ 6725862Ssam #define TEST_RW (0x68000000L) /* test read/write timeing */ 6825862Ssam /* Control byte[0] bit assignments */ 6925862Ssam #define CW_TSm (0x0C) /* tape select mask, 2 bit field */ 7025862Ssam #define CW_TSs (2) /* tape select shift, 2 bit field <<shift */ 7125862Ssam #define CW_M (0x10) /* mailbox flag */ 7225862Ssam #define CW_I (0x20) /* interrupt flag */ 7325862Ssam #define CW_L (0x40) /* link flag */ 7425862Ssam #define CW_BL (0x80) /* bus lock flag */ 7525862Ssam 7625862Ssam /* Control byte[1] bit assignments */ 7725862Ssam #define CW_BS (0x01) /* bank select */ 7825862Ssam #define CW_R (0x04) /* reverse flag */ 7925862Ssam #define CW_SD (0x08) /* speed/density */ 8025862Ssam #define CW_25ips (0x00) /* 25 inches per second speed */ 8125862Ssam #define CW_100ips (0x08) /* 100 inches per second speed */ 8225862Ssam #define CW_C (0x10) /* continuous */ 8325862Ssam #define CW_W (0x80) /* width */ 8425862Ssam #define CW_8bits (0x00) /* width 8 bits */ 8525862Ssam #define CW_16bits (0x80) /* width 16 bits */ 8625862Ssam 8725862Ssam /* status byte[0] bit assignements */ 8825862Ssam #define CS_P (0x02) /* Protected, no write ring */ 8925862Ssam #define CS_FB (0x04) /* formatter busy */ 9025862Ssam #define CS_DR (0x08) /* drive ready */ 9125862Ssam #define CS_EOT (0x10) /* end of tape detected */ 9225862Ssam #define CS_LP (0x20) /* tape is at load point */ 9325862Ssam #define CS_OL (0x40) /* drive on_line */ 9425862Ssam #define CS_FM (0x80) /* Filemark detected */ 9525862Ssam 9625862Ssam /* status byte[1] bit assignements */ 9725862Ssam #define CS_ERm (0x1F) /* Command (Error) mask */ 9825862Ssam #define CS_CR (0x20) /* Command (Retry) */ 9925862Ssam #define CS_CC (0x40) /* Command (Complete) */ 10025862Ssam #define CS_CE (0x80) /* Command (Entered) */ 10125862Ssam 10225862Ssam /* block move control byte[0] bit assignments */ 10325862Ssam #define BM_SI (0x01) /* increment source address */ 10425862Ssam #define BM_SW (0x02) /* source width */ 10525862Ssam #define BM_DI (0x04) /* increment destination address */ 10625862Ssam #define BM_DW (0x08) /* destination width */ 10725862Ssam #define BM_M (0x10) /* mailbox flag */ 10825862Ssam #define BM_I (0x20) /* interrupt flag */ 10925862Ssam #define BM_L (0x40) /* link flag */ 11025862Ssam #define BM_BL (0x80) /* bus lock flag */ 11125862Ssam 11225862Ssam /* block move control byte[1] bit assignments */ 11325862Ssam #define BM_T (0x01) /* translate flag */ 11425862Ssam #define BM_S (0x02) /* search flag */ 11525862Ssam #define BM_NC (0x04) /* non_compare flag */ 11625862Ssam #define BM_TH (0x08) /* throttle flag */ 11725862Ssam #define BM_SL (0x10) /* source local flag */ 11825862Ssam #define BM_DL (0x20) /* destination local flag */ 11925862Ssam 12025862Ssam /* block move status bit assignments */ 12125862Ssam #define BS_ERm (0x1F) /* Command (Error) mask */ 12225862Ssam #define BS_HIT (0x20) /* found match during search */ 12325862Ssam #define BS_CC (0x40) /* Command (Complete) */ 12425862Ssam #define BS_CE (0x80) /* Command (Entered) */ 12525862Ssam /* SC_ERROR & BM_ERROR codes */ 12625862Ssam #define ER_NONE (0x00) /* no error */ 12725862Ssam #define ER_TO1 (0x01) /* timed out data busy false */ 12825862Ssam #define ER_TO2 (0x02) /* data busy false,formatter,ready */ 12925862Ssam #define ER_TO3 (0x03) /* time out ready busy false */ 13025862Ssam #define ER_TO4 (0x04) /* time out ready busy true */ 13125862Ssam #define ER_TO5 (0x05) /* time out data busy true */ 13225862Ssam #define ER_TO6 (0x06) /* time out memory */ 13325862Ssam #define ER_BLAN (0X07) /* blank tape */ 13425862Ssam #define ER_DIAG (0x08) /* micro-diagnostic */ 13525862Ssam #define ER_END (0x09) /* EOT forward, BOT rev. */ 13625862Ssam #define ER_HARD (0x0A) /* retry unsuccessful */ 13725862Ssam #define ER_FIFO (0x0B) /* FIFO over/under flow */ 13825862Ssam /* (0x0C) /* Not used */ 13925862Ssam #define ER_PARI (0x0D) /* drive to tapemaster parity error */ 14025862Ssam #define ER_PSUM (0x0E) /* prom checksum */ 14125862Ssam #define ER_TOF (0x0F) /* time out tape strobe */ 14225862Ssam #define ER_TRN (0x10) /* tape not ready */ 14325862Ssam #define ER_PRO (0x11) /* write, no enable ring */ 14425862Ssam /* (0x12) /* Not used */ 14525862Ssam #define ER_JUMP (0x13) /* missing diagnostic jumper */ 14625862Ssam #define ER_BLIN (0x14) /* bad link, link inappropriate */ 14725862Ssam #define ER_FMAR (0x15) /* unexpected filemark */ 14825862Ssam #define ER_PARA (0x16) /* bad parameter, byte count ? */ 14925862Ssam /* (0x17) /* Not used */ 15025862Ssam #define ER_ER (0x18) /* unidentified hardware error */ 15125862Ssam #define ER_STER (0x19) /* streaming terminated */ 152