1: /*
   2:  * Copyright (c) 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:  *	@(#)dhvreg.h	1.2 (2.11BSD) 1997/5/1
   7:  */
   8: 
   9: /*
  10:  * DHV-11 device register definitions.
  11:  */
  12: struct dhvdevice {
  13:     union {
  14:         u_short csr;        /* control-status register */
  15:         struct {
  16:             char    csrl;   /* low byte for line select */
  17:             char    csrh;   /* high byte for tx line */
  18:         } cb;
  19:     } un1;
  20: #define dhvcsr  un1.csr
  21: #define dhvcsrl un1.cb.csrl
  22: #define dhvcsrh un1.cb.csrh
  23:     union {
  24:         u_short rbuf;       /* recv.char/ds.change register (R) */
  25:         u_short timo;       /* delay between recv -> intr (W) */
  26:     } un2;
  27: #define dhvrbuf un2.rbuf
  28: #define dhvtimo un2.timo
  29:     u_short dhvlpr;         /* line parameter register */
  30:     union {
  31:         char    fbyte[1];   /* fifo data byte (low byte only) (W) */
  32:         u_short fdata;      /* fifo data word (W) */
  33:         char    sbyte[2];   /* line status/fifo size (R) */
  34:     } un3;
  35: #define dhvbyte un3.fbyte[0]
  36: #define dhvfifo un3.fdata
  37: #define dhvsize un3.sbyte[0]
  38: #define dhvstat un3.sbyte[1]
  39:     u_short dhvlcr;         /* line control register */
  40:     u_short dhvbar1;        /* buffer address register 1 */
  41:     char    dhvbar2;        /* buffer address register 2 */
  42:     char    dhvlcr2;        /* xmit enable bit */
  43:     short   dhvbcr;         /* buffer count register */
  44: };
  45: 
  46: /* Bits in dhvcsr */
  47: #define DHV_CS_TIE  0x4000      /* transmit interrupt enable */
  48: #define DHV_CS_DFAIL    0x2000      /* diagnostic fail */
  49: #define DHV_CS_RI   0x0080      /* receiver interrupt */
  50: #define DHV_CS_RIE  0x0040      /* receiver interrupt enable */
  51: #define DHV_CS_MCLR 0x0020      /* master clear */
  52: #define DHV_CS_IAP  0x0007      /* indirect address pointer */
  53: 
  54: #define DHV_IE  (DHV_CS_TIE|DHV_CS_RIE)
  55: 
  56: /* map unit into iap register select */
  57: #define DHV_SELECT(unit)    ((unit) & DHV_CS_IAP)
  58: 
  59: /* Transmitter bits in high byte of dhvcsr */
  60: #define DHV_CSH_TI  0x80        /* transmit interrupt */
  61: #define DHV_CSH_NXM 0x10        /* transmit dma err: non-exist-mem */
  62: #define DHV_CSH_TLN 0x0f        /* transmit line number */
  63: 
  64: /* map csrh line bits into line */
  65: #define DHV_TX_LINE(csrh)   ((csrh) & DHV_CSH_TLN)
  66: 
  67: /* Bits in dhvrbuf */
  68: #define DHV_RB_VALID    0x8000      /* data valid */
  69: #define DHV_RB_STAT 0x7000      /* status bits */
  70: #define DHV_RB_DO   0x4000      /* data overrun */
  71: #define DHV_RB_FE   0x2000      /* framing error */
  72: #define DHV_RB_PE   0x1000      /* parity error */
  73: #define DHV_RB_RLN  0x0f00      /* receive line number */
  74: #define DHV_RB_RDS  0x00ff      /* receive data/status */
  75: #define DHV_RB_DIAG 0x0001      /* if DHV_RB_STAT -> diag vs modem */
  76: 
  77: /* map rbuf line bits into line */
  78: #define DHV_RX_LINE(rbuf)   (((rbuf) & DHV_RB_RLN) >> 8)
  79: 
  80: /* Bits in dhvlpr */
  81: #define DHV_LP_TSPEED   0xf000
  82: #define DHV_LP_RSPEED   0x0f00
  83: #define DHV_LP_TWOSB    0x0080
  84: #define DHV_LP_EPAR 0x0040
  85: #define DHV_LP_PENABLE  0x0020
  86: #define DHV_LP_BITS8    0x0018
  87: #define DHV_LP_BITS7    0x0010
  88: #define DHV_LP_BITS6    0x0008
  89: 
  90: /* Bits in dhvstat */
  91: #define DHV_ST_DSR  0x80        /* data set ready */
  92: #define DHV_ST_RI   0x20        /* ring indicator */
  93: #define DHV_ST_DCD  0x10        /* carrier detect */
  94: #define DHV_ST_CTS  0x08        /* clear to send */
  95: #define DHV_ST_DHU  0x01        /* always one on a dhu, zero on dhv */
  96: 
  97: /* Bits in dhvlcr */
  98: #define DHV_LC_RTS  0x1000      /* request to send */
  99: #define DHV_LC_DTR  0x0200      /* data terminal ready */
 100: #define DHV_LC_MODEM    0x0100      /* modem control enable */
 101: #define DHV_LC_MAINT    0x00c0      /* maintenance mode */
 102: #define DHV_LC_FXOFF    0x0020      /* force xoff */
 103: #define DHV_LC_OAUTOF   0x0010      /* output auto flow */
 104: #define DHV_LC_BREAK    0x0008      /* break control */
 105: #define DHV_LC_RXEN 0x0004      /* receiver enable */
 106: #define DHV_LC_IAUTOF   0x0002      /* input auto flow */
 107: #define DHV_LC_TXABORT  0x0001      /* transmitter abort */
 108: 
 109: /* Bits in dhvlcr2 */
 110: #define DHV_LC2_TXEN    0x80        /* transmitter enable */
 111: 
 112: /* Bits in dhvbar2 */
 113: #define DHV_BA2_DMAGO   0x80        /* transmit dma start */
 114: #define DHV_BA2_XBA 0x03        /* top two bits of dma address */
 115: #define DHV_XBA_SHIFT   16      /* amount to shift xba bits */
 116: 
 117: /* Bits for dhvmctl only:  stat bits are shifted up 16 */
 118: #define DHV_ON  (DHV_LC_DTR|DHV_LC_RTS|DHV_LC_MODEM)
 119: #define DHV_OFF DHV_LC_MODEM
 120: 
 121: #define DHV_DSR ((long)DHV_ST_DSR << 16)
 122: #define DHV_RNG ((long)DHV_ST_RI << 16)
 123: #define DHV_CAR ((long)DHV_ST_DCD << 16)
 124: #define DHV_CTS ((long)DHV_ST_CTS << 16)
 125: 
 126: #define DHV_RTS DHV_LC_RTS
 127: #define DHV_DTR DHV_LC_DTR
 128: #define DHV_BRK DHV_LC_BREAK
 129: #define DHV_LE  DHV_LC_MODEM

Defined struct's

dhvdevice defined in line 12; used 30 times

Defined macros

DHV_BA2_DMAGO defined in line 113; used 2 times
DHV_BA2_XBA defined in line 114; used 1 times
DHV_BRK defined in line 128; used 3 times
DHV_CAR defined in line 123; used 1 times
DHV_CSH_NXM defined in line 61; used 1 times
DHV_CSH_TI defined in line 60; used 1 times
DHV_CSH_TLN defined in line 62; used 1 times
  • in line 65
DHV_CS_DFAIL defined in line 48; used 1 times
DHV_CS_IAP defined in line 52; used 1 times
  • in line 57
DHV_CS_MCLR defined in line 51; used 2 times
DHV_CS_RI defined in line 49; used 1 times
DHV_CS_RIE defined in line 50; used 2 times
DHV_CS_TIE defined in line 47; used 1 times
  • in line 54
DHV_CTS defined in line 124; used 1 times
DHV_DSR defined in line 121; used 1 times
DHV_DTR defined in line 127; used 4 times
DHV_IE defined in line 54; used 8 times
DHV_LC2_TXEN defined in line 110; used 3 times
DHV_LC_BREAK defined in line 104; used 1 times
DHV_LC_DTR defined in line 99; used 2 times
DHV_LC_FXOFF defined in line 102; never used
DHV_LC_IAUTOF defined in line 106; never used
DHV_LC_MAINT defined in line 101; never used
DHV_LC_MODEM defined in line 100; used 3 times
DHV_LC_OAUTOF defined in line 103; used 3 times
DHV_LC_RTS defined in line 98; used 2 times
DHV_LC_RXEN defined in line 105; used 1 times
DHV_LC_TXABORT defined in line 107; used 2 times
DHV_LE defined in line 129; used 2 times
DHV_LP_BITS6 defined in line 88; used 1 times
DHV_LP_BITS7 defined in line 87; used 1 times
DHV_LP_BITS8 defined in line 86; used 2 times
DHV_LP_EPAR defined in line 84; used 1 times
DHV_LP_PENABLE defined in line 85; used 3 times
DHV_LP_RSPEED defined in line 82; never used
DHV_LP_TSPEED defined in line 81; never used
DHV_LP_TWOSB defined in line 83; used 1 times
DHV_OFF defined in line 119; used 2 times
DHV_ON defined in line 118; used 1 times
DHV_RB_DIAG defined in line 75; used 1 times
DHV_RB_DO defined in line 70; used 2 times
DHV_RB_FE defined in line 71; used 2 times
DHV_RB_PE defined in line 72; used 3 times
DHV_RB_RDS defined in line 74; never used
DHV_RB_RLN defined in line 73; used 1 times
  • in line 78
DHV_RB_STAT defined in line 69; used 2 times
DHV_RB_VALID defined in line 68; used 2 times
DHV_RNG defined in line 122; used 1 times
DHV_RTS defined in line 126; used 4 times
DHV_RX_LINE defined in line 78; used 1 times
DHV_SELECT defined in line 57; used 8 times
DHV_ST_CTS defined in line 94; used 3 times
DHV_ST_DCD defined in line 93; used 3 times
DHV_ST_DHU defined in line 95; never used
DHV_ST_DSR defined in line 91; used 1 times
DHV_ST_RI defined in line 92; used 1 times
DHV_TX_LINE defined in line 65; used 1 times
DHV_XBA_SHIFT defined in line 115; never used
dhvbyte defined in line 35; never used
dhvcsr defined in line 20; used 8 times
dhvcsrh defined in line 22; used 1 times
dhvcsrl defined in line 21; used 4 times
dhvfifo defined in line 36; never used
dhvrbuf defined in line 27; used 2 times
dhvsize defined in line 37; never used
dhvstat defined in line 38; used 3 times
dhvtimo defined in line 28; never used

Usage of this include

Last modified: 1997-05-02
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3708
Valid CSS Valid XHTML 1.0 Strict