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