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:  *	@(#)dhureg.h	1.2 (2.11BSD) 1997/5/9
   7:  */
   8: 
   9: /*
  10:  * DHU-11 device register definitions.
  11:  */
  12: struct dhudevice {
  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 dhucsr  un1.csr
  21: #define dhucsrl un1.cb.csrl
  22: #define dhucsrh 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 dhurbuf un2.rbuf
  28: #define dhutimo un2.timo
  29:     u_short dhulpr;         /* 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 dhubyte un3.fbyte[0]
  36: #define dhufifo un3.fdata
  37: #define dhusize un3.sbyte[0]
  38: #define dhustat un3.sbyte[1]
  39:     u_short dhulcr;         /* line control register */
  40:     u_short dhubar1;        /* buffer address register 1 */
  41:     char    dhubar2;        /* buffer address register 2 */
  42:     char    dhulcr2;        /* xmit enable bit */
  43:     short   dhubcr;         /* buffer count register */
  44: };
  45: 
  46: /* Bits in dhucsr */
  47: #define DHU_CS_TIE  0x4000      /* transmit interrupt enable */
  48: #define DHU_CS_DFAIL    0x2000      /* diagnostic fail */
  49: #define DHU_CS_RI   0x0080      /* receiver interrupt */
  50: #define DHU_CS_RIE  0x0040      /* receiver interrupt enable */
  51: #define DHU_CS_MCLR 0x0020      /* master clear */
  52: #define DHU_CS_SST  0x0010      /* skip self test (with DHU_CS_MCLR) */
  53: #define DHU_CS_IAP  0x000f      /* indirect address pointer */
  54: 
  55: #define DHU_IE  (DHU_CS_TIE|DHU_CS_RIE)
  56: 
  57: /* map unit into iap register select */
  58: #define DHU_SELECT(unit)    ((unit) & DHU_CS_IAP)
  59: 
  60: /* Transmitter bits in high byte of dhucsr */
  61: #define DHU_CSH_TI  0x80        /* transmit interrupt */
  62: #define DHU_CSH_NXM 0x10        /* transmit dma err: non-exist-mem */
  63: #define DHU_CSH_TLN 0x0f        /* transmit line number */
  64: 
  65: /* map csrh line bits into line */
  66: #define DHU_TX_LINE(csrh)   ((csrh) & DHU_CSH_TLN)
  67: 
  68: /* Bits in dhurbuf */
  69: #define DHU_RB_VALID    0x8000      /* data valid */
  70: #define DHU_RB_STAT 0x7000      /* status bits */
  71: #define DHU_RB_DO   0x4000      /* data overrun */
  72: #define DHU_RB_FE   0x2000      /* framing error */
  73: #define DHU_RB_PE   0x1000      /* parity error */
  74: #define DHU_RB_RLN  0x0f00      /* receive line number */
  75: #define DHU_RB_RDS  0x00ff      /* receive data/status */
  76: #define DHU_RB_DIAG 0x0001      /* if DHU_RB_STAT -> diag vs modem */
  77: 
  78: /* map rbuf line bits into line */
  79: #define DHU_RX_LINE(rbuf)   (((rbuf) & DHU_RB_RLN) >> 8)
  80: 
  81: /* Bits in dhulpr */
  82: #define DHU_LP_TSPEED   0xf000
  83: #define DHU_LP_RSPEED   0x0f00
  84: #define DHU_LP_TWOSB    0x0080
  85: #define DHU_LP_EPAR 0x0040
  86: #define DHU_LP_PENABLE  0x0020
  87: #define DHU_LP_BITS8    0x0018
  88: #define DHU_LP_BITS7    0x0010
  89: #define DHU_LP_BITS6    0x0008
  90: 
  91: /* Bits in dhustat */
  92: #define DHU_ST_DSR  0x80        /* data set ready */
  93: #define DHU_ST_RI   0x20        /* ring indicator */
  94: #define DHU_ST_DCD  0x10        /* carrier detect */
  95: #define DHU_ST_CTS  0x08        /* clear to send */
  96: #define DHU_ST_DHU  0x01        /* always one on a dhu, zero on dhv */
  97: 
  98: /* Bits in dhulcr */
  99: #define DHU_LC_RTS  0x1000      /* request to send */
 100: #define DHU_LC_DTR  0x0200      /* data terminal ready */
 101: #define DHU_LC_MODEM    0x0100      /* modem control enable */
 102: #define DHU_LC_MAINT    0x00c0      /* maintenance mode */
 103: #define DHU_LC_FXOFF    0x0020      /* force xoff */
 104: #define DHU_LC_OAUTOF   0x0010      /* output auto flow */
 105: #define DHU_LC_BREAK    0x0008      /* break control */
 106: #define DHU_LC_RXEN 0x0004      /* receiver enable */
 107: #define DHU_LC_IAUTOF   0x0002      /* input auto flow */
 108: #define DHU_LC_TXABORT  0x0001      /* transmitter abort */
 109: 
 110: /* Bits in dhulcr2 */
 111: #define DHU_LC2_TXEN    0x80        /* transmitter enable */
 112: 
 113: /* Bits in dhubar2 */
 114: #define DHU_BA2_DMAGO   0x80        /* transmit dma start */
 115: #define DHU_BA2_XBA 0x03        /* top two bits of dma address */
 116: #define DHU_XBA_SHIFT   16      /* amount to shift xba bits */
 117: 
 118: /* Bits for dhumctl only:  stat bits are shifted up 16 */
 119: #define DHU_ON  (DHU_LC_DTR|DHU_LC_RTS|DHU_LC_MODEM)
 120: #define DHU_OFF DHU_LC_MODEM
 121: 
 122: #define DHU_DSR ((long)DHU_ST_DSR << 16)
 123: #define DHU_RNG ((long)DHU_ST_RI << 16)
 124: #define DHU_CAR ((long)DHU_ST_DCD << 16)
 125: #define DHU_CTS ((long)DHU_ST_CTS << 16)
 126: 
 127: #define DHU_RTS DHU_LC_RTS
 128: #define DHU_DTR DHU_LC_DTR
 129: #define DHU_BRK DHU_LC_BREAK
 130: #define DHU_LE  DHU_LC_MODEM

Defined struct's

dhudevice defined in line 12; used 28 times

Defined macros

DHU_BA2_DMAGO defined in line 114; used 2 times
DHU_BA2_XBA defined in line 115; used 1 times
DHU_BRK defined in line 129; used 3 times
DHU_CAR defined in line 124; used 1 times
DHU_CSH_NXM defined in line 62; used 1 times
DHU_CSH_TI defined in line 61; used 1 times
DHU_CSH_TLN defined in line 63; used 1 times
  • in line 66
DHU_CS_DFAIL defined in line 48; never used
DHU_CS_IAP defined in line 53; used 1 times
  • in line 58
DHU_CS_MCLR defined in line 51; never used
DHU_CS_RI defined in line 49; never used
DHU_CS_RIE defined in line 50; used 1 times
  • in line 55
DHU_CS_SST defined in line 52; never used
DHU_CS_TIE defined in line 47; used 1 times
  • in line 55
DHU_CTS defined in line 125; used 1 times
DHU_DSR defined in line 122; used 1 times
DHU_DTR defined in line 128; used 4 times
DHU_IE defined in line 55; used 8 times
DHU_LC2_TXEN defined in line 111; used 1 times
DHU_LC_BREAK defined in line 105; used 1 times
DHU_LC_DTR defined in line 100; used 2 times
DHU_LC_FXOFF defined in line 103; never used
DHU_LC_IAUTOF defined in line 107; never used
DHU_LC_MAINT defined in line 102; never used
DHU_LC_MODEM defined in line 101; used 3 times
DHU_LC_OAUTOF defined in line 104; never used
DHU_LC_RTS defined in line 99; used 2 times
DHU_LC_RXEN defined in line 106; used 1 times
DHU_LC_TXABORT defined in line 108; used 2 times
DHU_LE defined in line 130; used 2 times
DHU_LP_BITS6 defined in line 89; used 1 times
DHU_LP_BITS7 defined in line 88; used 1 times
DHU_LP_BITS8 defined in line 87; used 1 times
DHU_LP_EPAR defined in line 85; used 1 times
DHU_LP_PENABLE defined in line 86; used 2 times
DHU_LP_RSPEED defined in line 83; never used
DHU_LP_TSPEED defined in line 82; never used
DHU_LP_TWOSB defined in line 84; used 1 times
DHU_OFF defined in line 120; used 2 times
DHU_ON defined in line 119; used 1 times
DHU_RB_DIAG defined in line 76; used 1 times
DHU_RB_DO defined in line 71; used 1 times
DHU_RB_FE defined in line 72; used 1 times
DHU_RB_PE defined in line 73; used 1 times
DHU_RB_RDS defined in line 75; never used
DHU_RB_RLN defined in line 74; used 1 times
  • in line 79
DHU_RB_STAT defined in line 70; used 2 times
DHU_RB_VALID defined in line 69; used 1 times
DHU_RNG defined in line 123; used 1 times
DHU_RTS defined in line 127; used 4 times
DHU_RX_LINE defined in line 79; used 1 times
DHU_SELECT defined in line 58; used 8 times
DHU_ST_CTS defined in line 95; used 3 times
DHU_ST_DCD defined in line 94; used 3 times
DHU_ST_DHU defined in line 96; never used
DHU_ST_DSR defined in line 92; used 1 times
DHU_ST_RI defined in line 93; used 1 times
DHU_TX_LINE defined in line 66; used 1 times
DHU_XBA_SHIFT defined in line 116; never used
dhubyte defined in line 35; never used
dhucsr defined in line 20; used 4 times
dhucsrh defined in line 22; used 1 times
dhucsrl defined in line 21; used 4 times
dhufifo defined in line 36; never used
dhurbuf defined in line 27; used 2 times
dhusize defined in line 37; never used
dhustat defined in line 38; used 3 times
dhutimo defined in line 28; used 1 times

Usage of this include

dhureg.h used 1 times
Last modified: 1997-05-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3411
Valid CSS Valid XHTML 1.0 Strict