1 /* 2 * Copyright (c) 1988 Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)if_dmv.h 7.4 (Berkeley) 06/28/90 8 */ 9 10 /* 11 * DMV-11 Driver 12 * 13 * Qbus Sync DDCMP interface - DMV operated in full duplex, point to point mode 14 * 15 * Written by Bob Kridle of Mt Xinu 16 * starting from if_dmc.h version 6.4 dated 6/8/85 17 */ 18 19 struct dmvdevice { 20 union { 21 u_char xbsel[2]; 22 u_short xwsel; 23 } xw0; 24 union { 25 u_char xbsel[2]; 26 u_short xwsel; 27 } xw1; 28 union { 29 u_char xbsel[2]; 30 u_short xwsel; 31 } xw2; 32 union { 33 u_char xbsel[2]; 34 u_short xwsel; 35 } xw3; 36 union { 37 u_char xbsel[2]; 38 u_short xwsel; 39 } xw4; 40 }; 41 42 #define bsel0 xw0.xbsel[0] 43 #define bsel1 xw0.xbsel[1] 44 #define bsel2 xw1.xbsel[0] 45 #define bsel3 xw1.xbsel[1] 46 #define bsel4 xw2.xbsel[0] 47 #define bsel5 xw2.xbsel[1] 48 #define bsel6 xw3.xbsel[0] 49 #define bsel7 xw3.xbsel[1] 50 #define bsel10 xw4.xbsel[0] 51 #define bsel11 xw4.xbsel[1] 52 53 #define wsel0 xw0.xwsel 54 #define wsel2 xw1.xwsel 55 #define wsel4 xw2.xwsel 56 #define wsel6 xw3.xwsel 57 #define wsel10 xw4.xwsel 58 59 /* 60 * dmv software packet encapsulation. This allows the dmv 61 * link to be multiplexed among several protocols. 62 * The first eight bytes of the dmc header are garbage, 63 * since on a vax the uba has been known to mung these 64 * bytes. The next two bytes encapsulate packet type. 65 */ 66 struct dmv_header { 67 short dmv_type; /* encapsulate packet type */ 68 }; 69 70 /* packet types */ 71 #define DMV_IPTYPE 1 72 #define DMV_TRAILER 2 73 #define DMV_NTRAILER 16 74 75 /* 76 * DMVMTU includes space for data (1024) + 77 * protocol header (256) + trailer descriptor (4). 78 * The software link encapsulation header (dmv_header) 79 * is handled separately. 80 */ 81 #define DMVMTU 1284 82 83 #define RDYSCAN 16 /* loop delay for RDYI after RQI */ 84 85 /* defines for bsel0 */ 86 87 #define DMV_IEI 0x01 /* interrupt enable, input */ 88 #define DMV_IEO 0x10 /* interrupt enable, output */ 89 #define DMV_RQI 0x80 /* request input */ 90 #define DMV0BITS "\10\8RQI\5IEO\1IEI" 91 92 /* defines for bsel1 */ 93 94 #define DMV_MCLR 0x40 /* master clear */ 95 #define DMV_RUN 0x80 /* run */ 96 #define DMV1BITS "\10\8RUN\7MCLR" 97 98 /* defines for bsel2 */ 99 100 #define DMV_CMD 0x07 /* command/response type field */ 101 102 103 /* input commands */ 104 105 #define DMV_BACCR 0x00 /* buffer address, char. count - rec */ 106 #define DMV_BACCX 0x04 /* buffer address, char. count - xmit */ 107 #define DMV_MDEFI 0x02 /* mode definition input */ 108 #define DMV_CNTRLI 0x01 /* control input */ 109 110 /* response identifiers */ 111 112 #define DMV_CNTRLO 0x01 /* control output */ 113 #define DMV_MDEFO 0x02 /* information output */ 114 #define DMV_BDRUS 0x00 /* buffer definition - rec. used */ 115 #define DMV_BDRUNUS 0x03 /* buffer disposition - rec. unused */ 116 #define DMV_BDXSA 0x04 /* buffer dispostiion - sent & ack */ 117 #define DMV_BDXSN 0x06 /* buffer dispostiion - sent & not ack*/ 118 #define DMV_BDXNS 0x07 /* buffer dispostiion - not sent */ 119 120 #define DMV_22BIT 0x08 /* buffer address in 22 bit format */ 121 #define DMV_RDI 0x10 /* ready for input */ 122 #define DMV_RDO 0x80 /* ready for output */ 123 #define DMV2BITS "\10\8RDO\5RDI" 124 125 /* defines for CNTRLI mode */ 126 127 #define DMV_RDTSS 0x20 /* read tributary status slot */ 128 #define DMV_RDCTSS 0x40 /* read/clear tributary status slot */ 129 #define DMV_WRTSS 0x80 /* write tributary status slot */ 130 #define DMV_TRIBN 0x1f /* tributary number */ 131 #define DMV_RQKEY 0x1f /* control command request key */ 132 #define DMV_ECBP 0x100 /* establish common buffer pool */ 133 134 /* relevant command request keys */ 135 136 #define DMV_NOP 0x00 /* no-op */ 137 #define DMV_ESTTRIB 0x01 /* establish tributary */ 138 #define DMV_REQSUS 0x03 /* request start up state */ 139 #define DMV_REQHS 0x05 /* request halt state */ 140 #define DMV_WMC 0x10 /* write modem control */ 141 #define DMV_RMC 0x11 /* read modem control */ 142 143 /* some interesting CNTRLO codes 144 * 145 * use the manual if yours isn't here!! 146 */ 147 148 #define DMV_RTE 0002 /* receive threshold error */ 149 #define DMV_TTE 0004 /* xmit threshold error */ 150 #define DMV_STE 0006 /* select threshold error */ 151 #define DMV_ORUN 0024 /* other end enters run state */ 152 #define DMV_NXM 0302 /* non-existant memory */ 153 #define DMV_MODD 0304 /* modem disconnected */ 154 #define DMV_QOVF 0306 /* response queue overflow */ 155 #define DMV_CXRL 0310 /* modem cxr lost */ 156 157 #define DMV_EEC 0377 /* CNTRLO error code mask */ 158