home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / sys / vax / if / if_dmv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-08  |  5.9 KB  |  184 lines

  1. /*
  2.  * Copyright (c) 1988 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    @(#)if_dmv.h    7.4 (Berkeley) 6/28/90
  34.  */
  35.  
  36. /*
  37.  * DMV-11 Driver
  38.  *
  39.  * Qbus Sync DDCMP interface - DMV operated in full duplex, point to point mode
  40.  *
  41.  * Written by Bob Kridle of Mt Xinu
  42.  * starting from if_dmc.h version 6.4 dated 6/8/85 
  43.  */
  44.  
  45. struct dmvdevice {
  46.     union {
  47.         u_char    xbsel[2];
  48.         u_short    xwsel;
  49.     } xw0;
  50.     union {
  51.         u_char    xbsel[2];
  52.         u_short    xwsel;
  53.     } xw1;
  54.     union {
  55.         u_char    xbsel[2];
  56.         u_short    xwsel;
  57.     } xw2;
  58.     union {
  59.         u_char    xbsel[2];
  60.         u_short    xwsel;
  61.     } xw3;
  62.     union {
  63.         u_char    xbsel[2];
  64.         u_short    xwsel;
  65.     } xw4;
  66. };
  67.  
  68. #define  bsel0    xw0.xbsel[0]
  69. #define  bsel1    xw0.xbsel[1]
  70. #define  bsel2    xw1.xbsel[0]
  71. #define  bsel3    xw1.xbsel[1]
  72. #define  bsel4    xw2.xbsel[0]
  73. #define  bsel5    xw2.xbsel[1]
  74. #define  bsel6    xw3.xbsel[0]
  75. #define  bsel7    xw3.xbsel[1]
  76. #define  bsel10    xw4.xbsel[0]
  77. #define  bsel11    xw4.xbsel[1]
  78.  
  79. #define     wsel0    xw0.xwsel
  80. #define     wsel2    xw1.xwsel
  81. #define     wsel4    xw2.xwsel
  82. #define     wsel6    xw3.xwsel
  83. #define     wsel10    xw4.xwsel
  84.  
  85. /*
  86.  * dmv software packet encapsulation.  This allows the dmv
  87.  * link to be multiplexed among several protocols.
  88.  * The first eight bytes of the dmc header are garbage,
  89.  * since on a vax the uba has been known to mung these
  90.  * bytes.  The next two bytes encapsulate packet type.
  91.  */
  92. struct dmv_header {
  93.     short    dmv_type;    /* encapsulate packet type */
  94. };
  95.  
  96. /* packet types */
  97. #define    DMV_IPTYPE    1
  98. #define    DMV_TRAILER    2
  99. #define    DMV_NTRAILER    16
  100.  
  101. /*
  102.  * DMVMTU includes space for data (1024) + 
  103.  * protocol header (256) + trailer descriptor (4).
  104.  * The software link encapsulation header (dmv_header)
  105.  * is handled separately.
  106.  */
  107. #define DMVMTU  1284
  108.  
  109. #define    RDYSCAN    16    /* loop delay for RDYI after RQI */
  110.  
  111.     /* defines for bsel0 */
  112.  
  113. #define    DMV_IEI        0x01        /* interrupt enable, input */
  114. #define    DMV_IEO        0x10        /* interrupt enable, output */
  115. #define    DMV_RQI        0x80        /* request input */
  116. #define DMV0BITS    "\10\8RQI\5IEO\1IEI"
  117.  
  118.     /* defines for bsel1 */
  119.  
  120. #define    DMV_MCLR    0x40        /* master clear */
  121. #define    DMV_RUN        0x80        /* run */
  122. #define DMV1BITS    "\10\8RUN\7MCLR"
  123.  
  124.     /* defines for bsel2 */
  125.  
  126. #define    DMV_CMD        0x07        /* command/response type field */
  127.  
  128.  
  129.     /* input commands */
  130.  
  131. #define    DMV_BACCR    0x00        /* buffer address, char. count - rec */
  132. #define    DMV_BACCX    0x04        /* buffer address, char. count - xmit */
  133. #define    DMV_MDEFI    0x02        /* mode definition input */
  134. #define    DMV_CNTRLI    0x01        /* control input */
  135.  
  136.     /* response identifiers */
  137.  
  138. #define    DMV_CNTRLO    0x01        /* control output */
  139. #define    DMV_MDEFO    0x02        /* information output */
  140. #define    DMV_BDRUS    0x00        /* buffer definition - rec. used */
  141. #define    DMV_BDRUNUS    0x03        /* buffer disposition - rec. unused */
  142. #define    DMV_BDXSA    0x04        /* buffer dispostiion - sent & ack */
  143. #define    DMV_BDXSN    0x06        /* buffer dispostiion - sent & not ack*/
  144. #define    DMV_BDXNS    0x07        /* buffer dispostiion - not sent */
  145.  
  146. #define DMV_22BIT    0x08        /* buffer address in 22 bit format */
  147. #define DMV_RDI        0x10        /* ready for input */
  148. #define DMV_RDO        0x80        /* ready for output */
  149. #define DMV2BITS    "\10\8RDO\5RDI"
  150.  
  151.     /* defines for CNTRLI mode */
  152.  
  153. #define    DMV_RDTSS    0x20        /* read tributary status slot */
  154. #define    DMV_RDCTSS    0x40        /* read/clear tributary status slot */
  155. #define    DMV_WRTSS    0x80        /* write tributary status slot */
  156. #define    DMV_TRIBN    0x1f        /* tributary number */
  157. #define    DMV_RQKEY    0x1f        /* control command request key */
  158. #define DMV_ECBP    0x100        /* establish common buffer pool */
  159.  
  160.     /* relevant command request keys */
  161.  
  162. #define DMV_NOP        0x00        /* no-op */
  163. #define DMV_ESTTRIB    0x01        /* establish tributary */
  164. #define DMV_REQSUS    0x03        /* request start up state */
  165. #define DMV_REQHS    0x05        /* request halt state */
  166. #define DMV_WMC        0x10        /* write modem control */
  167. #define DMV_RMC        0x11        /* read modem control */
  168.  
  169.     /* some interesting CNTRLO codes 
  170.      *
  171.      * use the manual if yours isn't here!!
  172.      */
  173.  
  174. #define    DMV_RTE        0002        /* receive threshold error */
  175. #define    DMV_TTE        0004        /* xmit threshold error */
  176. #define    DMV_STE        0006        /* select threshold error */
  177. #define DMV_ORUN    0024        /* other end enters run state */
  178. #define DMV_NXM        0302        /* non-existant memory */
  179. #define DMV_MODD    0304        /* modem disconnected */
  180. #define DMV_QOVF    0306        /* response queue overflow */
  181. #define DMV_CXRL    0310        /* modem cxr lost */
  182.  
  183. #define DMV_EEC        0377        /* CNTRLO error code mask */
  184.