1 /* 2 * Copyright (c) 1982, 1986 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 the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * 17 * @(#)if_dmc.h 7.4 (Berkeley) 08/04/88 18 */ 19 20 /* 21 * DMC-11 Interface 22 */ 23 24 struct dmcdevice { 25 char bsel0; 26 char bsel1; 27 char bsel2; 28 char bsel3; 29 short sel4; 30 short sel6; 31 }; 32 33 /* 34 * dmc software packet encapsulation. This allows the dmc 35 * link to be multiplexed among several protocols. 36 * The first eight bytes of the dmc header are garbage, 37 * since on a vax the uba has been known to mung these 38 * bytes. The next two bytes encapsulate packet type. 39 */ 40 struct dmc_header { 41 char dmc_buf[8]; /* space for uba on vax */ 42 short dmc_type; /* encapsulate packet type */ 43 }; 44 45 /* packet types */ 46 #define DMC_IPTYPE 1 47 #define DMC_TRAILER 2 48 #define DMC_NTRAILER 16 49 50 /* 51 * DMCMTU includes space for data (1024) + 52 * protocol header (256) + trailer descriptor (4). 53 * The software link encapsulation header (dmc_header) 54 * is handled separately. 55 #define DMCMTU 1284 56 */ 57 #define DMCMTU 1500 58 59 #define RDYSCAN 16 /* loop delay for RDYI after RQI */ 60 61 /* defines for bsel0 */ 62 #define DMC_BACCI 0 63 #define DMC_CNTLI 1 64 #define DMC_PERR 2 65 #define DMC_BASEI 3 66 #define DMC_WRITE 0 /* transmit block */ 67 #define DMC_READ 4 /* read block */ 68 #define DMC_RQI 0040 /* port request bit */ 69 #define DMC_IEI 0100 /* enable input interrupts */ 70 #define DMC_RDYI 0200 /* port ready */ 71 #define DMC0BITS "\10\10RDI\7IEI\6RQI" 72 73 /* defines for bsel1 */ 74 #define DMC_MCLR 0100 /* DMC11 Master Clear */ 75 #define DMC_RUN 0200 /* clock running */ 76 #define DMC1BITS "\10\10RUN\7MCLR" 77 78 /* defines for bsel2 */ 79 #define DMC_BACCO 0 80 #define DMC_CNTLO 1 81 #define DMC_OUX 0 /* transmit block */ 82 #define DMC_OUR 4 /* read block */ 83 #define DMC_IEO 0100 /* enable output interrupts */ 84 #define DMC_RDYO 0200 /* port available */ 85 #define DMC2BITS "\10\10RDO\7IEO" 86 87 /* defines for CNTLI mode */ 88 #define DMC_HDPLX 02000 /* half duplex DDCMP operation */ 89 #define DMC_SEC 04000 /* half duplex secondary station */ 90 #define DMC_MAINT 00400 /* enter maintenance mode */ 91 92 /* defines for BACCI/O and BASEI mode */ 93 #define DMC_XMEM 0140000 /* xmem bit position */ 94 #define DMC_CCOUNT 0037777 /* character count mask */ 95 #define DMC_RESUME 0002000 /* resume (BASEI only) */ 96 97 /* defines for CNTLO */ 98 #define DMC_CNTMASK 01777 99 100 #define DMC_DATACK 01 101 #define DMC_TIMEOUT 02 102 #define DMC_NOBUFS 04 103 #define DMC_MAINTREC 010 104 #define DMC_LOSTDATA 020 105 #define DMC_DISCONN 0100 106 #define DMC_START 0200 107 #define DMC_NEXMEM 0400 108 #define DMC_ERROR 01000 109 110 #define DMC_FATAL (DMC_ERROR|DMC_NEXMEM|DMC_START|DMC_LOSTDATA|DMC_MAINTREC) 111 #define CNTLO_BITS \ 112 "\10\12ERROR\11NEXMEM\10START\7DISC\5LSTDATA\4MAINT\3NOBUF\2TIMEO\1DATACK" 113