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