|
|
1.1 ! root 1: /* rsp.h 6.1 83/07/29 */ ! 2: ! 3: /* ! 4: * TU58 transfer protocol constants and data structures ! 5: */ ! 6: ! 7: /* ! 8: * Structure of a command packet ! 9: */ ! 10: struct packet { ! 11: u_char pk_flag; /* indicates packet type (cmd, data, etc.) */ ! 12: u_char pk_mcount; /* length of packet (bytes) */ ! 13: u_char pk_op; /* operation to perform (read, write, etc.) */ ! 14: u_char pk_mod; /* modifier for op or returned status */ ! 15: u_char pk_unit; /* unit number */ ! 16: u_char pk_sw; /* switches */ ! 17: u_short pk_seq; /* sequence number, always zero */ ! 18: u_short pk_count; /* requested byte count for read or write */ ! 19: u_short pk_block; /* block number for read, write, or seek */ ! 20: u_short pk_chksum; /* checksum, by words with end around carry */ ! 21: }; ! 22: ! 23: /* ! 24: * States ! 25: */ ! 26: #define TUS_INIT1 0 /* sending nulls */ ! 27: #define TUS_INIT2 1 /* sending inits */ ! 28: #define TUS_IDLE 2 /* initialized, no transfer in progress */ ! 29: #define TUS_SENDH 3 /* sending header */ ! 30: #define TUS_SENDD 4 /* sending data */ ! 31: #define TUS_SENDC 5 /* sending checksum */ ! 32: #define TUS_SENDR 6 /* sending read command packet */ ! 33: #define TUS_SENDW 7 /* sending write command packet */ ! 34: #define TUS_GETH 8 /* reading header */ ! 35: #define TUS_GETD 9 /* reading data */ ! 36: #define TUS_GETC 10 /* reading checksum */ ! 37: #define TUS_GET 11 /* reading an entire packet */ ! 38: #define TUS_WAIT 12 /* waiting for continue */ ! 39: #define TUS_RCVERR 13 /* receiver error in pseudo DMA routine */ ! 40: #define TUS_CHKERR 14 /* checksum error in pseudo DMA routine */ ! 41: ! 42: #define TUS_NSTATES 15 ! 43: ! 44: #define printstate(state) \ ! 45: if ((state) < TUS_NSTATES) \ ! 46: printf("%s", tustates[(state)]); \ ! 47: else \ ! 48: printf("%d", (state)); ! 49: ! 50: /* ! 51: * Packet Flags ! 52: */ ! 53: #define TUF_DATA 1 /* data packet */ ! 54: #define TUF_CMD 2 /* command packet */ ! 55: #define TUF_INITF 4 /* initialize */ ! 56: #define TUF_CONT 020 /* continue */ ! 57: #define TUF_XOFF 023 /* flow control */ ! 58: ! 59: /* ! 60: * Op Codes ! 61: */ ! 62: #define TUOP_NOOP 0 /* no operation */ ! 63: #define TUOP_INIT 1 /* initialize */ ! 64: #define TUOP_READ 2 /* read block */ ! 65: #define TUOP_WRITE 3 /* write block */ ! 66: #define TUOP_SEEK 5 /* seek to block */ ! 67: #define TUOP_DIAGNOSE 7 /* run micro-diagnostics */ ! 68: #define TUOP_END 0100 /* end packet */ ! 69: ! 70: /* ! 71: * Mod Flags ! 72: */ ! 73: #define TUMD_WRV 1 /* write with read verify */ ! 74: ! 75: /* ! 76: * Switches ! 77: */ ! 78: #define TUSW_MRSP 010 /* use Modified RSP */ ! 79:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.