Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


scc.h
001: /* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
002: 
003: #ifndef _SCC_H
004: #define _SCC_H
005: 
006: 
007: /* selection of hardware types */
008: 
009: #define PA0HZP          0x00    /* hardware type for PA0HZP SCC card and compatible */
010: #define EAGLE           0x01    /* hardware type for EAGLE card */
011: #define PC100           0x02    /* hardware type for PC100 card */
012: #define PRIMUS          0x04    /* hardware type for PRIMUS-PC (DG9BL) card */
013: #define DRSI            0x08    /* hardware type for DRSI PC*Packet card */
014: #define BAYCOM          0x10    /* hardware type for BayCom (U)SCC */
015: 
016: /* DEV ioctl() commands */
017: 
018: enum SCC_ioctl_cmds {
019:         SIOCSCCRESERVED = SIOCDEVPRIVATE,
020:         SIOCSCCCFG,
021:         SIOCSCCINI,
022:         SIOCSCCCHANINI,
023:         SIOCSCCSMEM,
024:         SIOCSCCGKISS,
025:         SIOCSCCSKISS,
026:         SIOCSCCGSTAT,
027:         SIOCSCCCAL
028: };
029: 
030: /* Device parameter control (from WAMPES) */
031: 
032: enum L1_params {
033:         PARAM_DATA,
034:         PARAM_TXDELAY,
035:         PARAM_PERSIST,
036:         PARAM_SLOTTIME,
037:         PARAM_TXTAIL,
038:         PARAM_FULLDUP,
039:         PARAM_SOFTDCD,          /* was: PARAM_HW */
040:         PARAM_MUTE,             /* ??? */
041:         PARAM_DTR,
042:         PARAM_RTS,
043:         PARAM_SPEED,
044:         PARAM_ENDDELAY,         /* ??? */
045:         PARAM_GROUP,
046:         PARAM_IDLE,
047:         PARAM_MIN,
048:         PARAM_MAXKEY,
049:         PARAM_WAIT,
050:         PARAM_MAXDEFER,
051:         PARAM_TX,
052:         PARAM_HWEVENT = 31,
053:         PARAM_RETURN = 255      /* reset kiss mode */
054: };
055: 
056: /* fulldup parameter */
057: 
058: enum FULLDUP_modes {
059:         KISS_DUPLEX_HALF,       /* normal CSMA operation */
060:         KISS_DUPLEX_FULL,       /* fullduplex, key down trx after transmission */
061:         KISS_DUPLEX_LINK,       /* fullduplex, key down trx after 'idletime' sec */
062:         KISS_DUPLEX_OPTIMA      /* fullduplex, let the protocol layer control the hw */
063: };
064: 
065: /* misc. parameters */
066: 
067: #define TIMER_OFF       65535U  /* to switch off timers */
068: #define NO_SUCH_PARAM   65534U  /* param not implemented */
069: 
070: /* HWEVENT parameter */
071: 
072: enum HWEVENT_opts {
073:         HWEV_DCD_ON,
074:         HWEV_DCD_OFF,
075:         HWEV_ALL_SENT
076: };
077: 
078: /* channel grouping */
079: 
080: #define RXGROUP         0100    /* if set, only tx when all channels clear */
081: #define TXGROUP         0200    /* if set, don't transmit simultaneously */
082: 
083: /* Tx/Rx clock sources */
084: 
085: enum CLOCK_sources {
086:         CLK_DPLL,       /* normal halfduplex operation */
087:         CLK_EXTERNAL,   /* external clocking (G3RUH/DF9IC modems) */
088:         CLK_DIVIDER,    /* Rx = DPLL, Tx = divider (fullduplex with */
089:                         /* modems without clock regeneration */
090:         CLK_BRG         /* experimental fullduplex mode with DPLL/BRG for */
091:                         /* MODEMs without clock recovery */
092: };
093: 
094: /* Tx state */
095: 
096: enum TX_state {
097:         TXS_IDLE,       /* Transmitter off, no data pending */
098:         TXS_BUSY,       /* waiting for permission to send / tailtime */
099:         TXS_ACTIVE,     /* Transmitter on, sending data */
100:         TXS_NEWFRAME,   /* reset CRC and send (next) frame */
101:         TXS_IDLE2,      /* Transmitter on, no data pending */
102:         TXS_WAIT,       /* Waiting for Mintime to expire */
103:         TXS_TIMEOUT     /* We had a transmission timeout */
104: };
105: 
106: typedef unsigned long io_port;  /* type definition for an 'io port address' */
107: 
108: /* SCC statistical information */
109: 
110: struct scc_stat {
111:         long rxints;            /* Receiver interrupts */
112:         long txints;            /* Transmitter interrupts */
113:         long exints;            /* External/status interrupts */
114:         long spints;            /* Special receiver interrupts */
115: 
116:         long txframes;          /* Packets sent */
117:         long rxframes;          /* Number of Frames Actually Received */
118:         long rxerrs;            /* CRC Errors */
119:         long txerrs;            /* KISS errors */
120:         
121:         unsigned int nospace;   /* "Out of buffers" */
122:         unsigned int rx_over;   /* Receiver Overruns */
123:         unsigned int tx_under;  /* Transmitter Underruns */
124: 
125:         unsigned int tx_state;  /* Transmitter state */
126:         int tx_queued;          /* tx frames enqueued */
127: 
128:         unsigned int maxqueue;  /* allocated tx_buffers */
129:         unsigned int bufsize;   /* used buffersize */
130: };
131: 
132: struct scc_modem {
133:         long speed;             /* Line speed, bps */
134:         char clocksrc;          /* 0 = DPLL, 1 = external, 2 = divider */
135:         char nrz;               /* NRZ instead of NRZI */       
136: };
137: 
138: struct scc_kiss_cmd {
139:         int      command;       /* one of the KISS-Commands defined above */
140:         unsigned param;         /* KISS-Param */
141: };
142: 
143: struct scc_hw_config {
144:         io_port data_a;         /* data port channel A */
145:         io_port ctrl_a;         /* control port channel A */
146:         io_port data_b;         /* data port channel B */
147:         io_port ctrl_b;         /* control port channel B */
148:         io_port vector_latch;   /* INTACK-Latch (#) */
149:         io_port special;        /* special function port */
150: 
151:         int     irq;            /* irq */
152:         long    clock;          /* clock */
153:         char    option;         /* command for function port */
154: 
155:         char brand;             /* hardware type */
156:         char escc;              /* use ext. features of a 8580/85180/85280 */
157: };
158: 
159: /* (#) only one INTACK latch allowed. */
160: 
161: 
162: struct scc_mem_config {
163:         unsigned int dummy;
164:         unsigned int bufsize;
165: };
166: 
167: struct scc_calibrate {
168:         unsigned int time;
169:         unsigned char pattern;
170: };
171: 
172: #endif /* defined(_SCC_H) */
173: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/