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

Defined struct's

packet defined in line 16; used 16 times

Defined macros

TUF_CMD defined in line 60; used 4 times
TUF_CONT defined in line 62; used 5 times
TUF_DATA defined in line 59; used 8 times
TUF_INITF defined in line 61; used 8 times
TUF_XOFF defined in line 63; never used
TUMD_WRV defined in line 79; used 2 times
TUOP_DIAGNOSE defined in line 73; never used
TUOP_END defined in line 74; used 2 times
TUOP_INIT defined in line 69; never used
TUOP_NOOP defined in line 68; never used
TUOP_READ defined in line 70; used 2 times
TUOP_SEEK defined in line 72; never used
TUOP_WRITE defined in line 71; used 2 times
TUSW_MRSP defined in line 84; used 2 times
TUS_CHKERR defined in line 46; never used
TUS_GET defined in line 43; used 4 times
TUS_GETC defined in line 42; used 2 times
TUS_GETD defined in line 41; used 2 times
TUS_GETH defined in line 40; used 4 times
TUS_IDLE defined in line 34; used 12 times
TUS_INIT1 defined in line 32; used 11 times
TUS_INIT2 defined in line 33; used 2 times
TUS_NSTATES defined in line 48; used 3 times
TUS_RCVERR defined in line 45; used 1 times
TUS_SENDC defined in line 37; used 2 times
TUS_SENDD defined in line 36; used 2 times
TUS_SENDH defined in line 35; used 2 times
TUS_SENDR defined in line 38; used 2 times
TUS_SENDW defined in line 39; used 2 times
TUS_WAIT defined in line 44; used 4 times
printstate defined in line 50; used 6 times

Usage of this include

Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1012
Valid CSS Valid XHTML 1.0 Strict