Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
0003 
0004 #ifndef _UAPI_SCC_H
0005 #define _UAPI_SCC_H
0006 
0007 #include <linux/sockios.h>
0008 
0009 /* selection of hardware types */
0010 
0011 #define PA0HZP      0x00    /* hardware type for PA0HZP SCC card and compatible */
0012 #define EAGLE       0x01    /* hardware type for EAGLE card */
0013 #define PC100       0x02    /* hardware type for PC100 card */
0014 #define PRIMUS      0x04    /* hardware type for PRIMUS-PC (DG9BL) card */
0015 #define DRSI        0x08    /* hardware type for DRSI PC*Packet card */
0016 #define BAYCOM      0x10    /* hardware type for BayCom (U)SCC */
0017 
0018 /* DEV ioctl() commands */
0019 
0020 enum SCC_ioctl_cmds {
0021     SIOCSCCRESERVED = SIOCDEVPRIVATE,
0022     SIOCSCCCFG,
0023     SIOCSCCINI,
0024     SIOCSCCCHANINI,
0025     SIOCSCCSMEM,
0026     SIOCSCCGKISS,
0027     SIOCSCCSKISS,
0028     SIOCSCCGSTAT,
0029     SIOCSCCCAL
0030 };
0031 
0032 /* Device parameter control (from WAMPES) */
0033 
0034 enum L1_params {
0035     PARAM_DATA,
0036     PARAM_TXDELAY,
0037     PARAM_PERSIST,
0038     PARAM_SLOTTIME,
0039     PARAM_TXTAIL,
0040     PARAM_FULLDUP,
0041     PARAM_SOFTDCD,      /* was: PARAM_HW */
0042     PARAM_MUTE,     /* ??? */
0043     PARAM_DTR,
0044     PARAM_RTS,
0045     PARAM_SPEED,
0046     PARAM_ENDDELAY,     /* ??? */
0047     PARAM_GROUP,
0048     PARAM_IDLE,
0049     PARAM_MIN,
0050     PARAM_MAXKEY,
0051     PARAM_WAIT,
0052     PARAM_MAXDEFER,
0053     PARAM_TX,
0054     PARAM_HWEVENT = 31,
0055     PARAM_RETURN = 255  /* reset kiss mode */
0056 };
0057 
0058 /* fulldup parameter */
0059 
0060 enum FULLDUP_modes {
0061     KISS_DUPLEX_HALF,   /* normal CSMA operation */
0062     KISS_DUPLEX_FULL,   /* fullduplex, key down trx after transmission */
0063     KISS_DUPLEX_LINK,   /* fullduplex, key down trx after 'idletime' sec */
0064     KISS_DUPLEX_OPTIMA  /* fullduplex, let the protocol layer control the hw */
0065 };
0066 
0067 /* misc. parameters */
0068 
0069 #define TIMER_OFF   65535U  /* to switch off timers */
0070 #define NO_SUCH_PARAM   65534U  /* param not implemented */
0071 
0072 /* HWEVENT parameter */
0073 
0074 enum HWEVENT_opts {
0075     HWEV_DCD_ON,
0076     HWEV_DCD_OFF,
0077     HWEV_ALL_SENT
0078 };
0079 
0080 /* channel grouping */
0081 
0082 #define RXGROUP     0100    /* if set, only tx when all channels clear */
0083 #define TXGROUP     0200    /* if set, don't transmit simultaneously */
0084 
0085 /* Tx/Rx clock sources */
0086 
0087 enum CLOCK_sources {
0088     CLK_DPLL,   /* normal halfduplex operation */
0089     CLK_EXTERNAL,   /* external clocking (G3RUH/DF9IC modems) */
0090     CLK_DIVIDER,    /* Rx = DPLL, Tx = divider (fullduplex with */
0091             /* modems without clock regeneration */
0092     CLK_BRG     /* experimental fullduplex mode with DPLL/BRG for */
0093             /* MODEMs without clock recovery */
0094 };
0095 
0096 /* Tx state */
0097 
0098 enum TX_state {
0099     TXS_IDLE,   /* Transmitter off, no data pending */
0100     TXS_BUSY,   /* waiting for permission to send / tailtime */
0101     TXS_ACTIVE, /* Transmitter on, sending data */
0102     TXS_NEWFRAME,   /* reset CRC and send (next) frame */
0103     TXS_IDLE2,  /* Transmitter on, no data pending */
0104     TXS_WAIT,   /* Waiting for Mintime to expire */
0105     TXS_TIMEOUT /* We had a transmission timeout */
0106 };
0107 
0108 typedef unsigned long io_port;  /* type definition for an 'io port address' */
0109 
0110 /* SCC statistical information */
0111 
0112 struct scc_stat {
0113         long rxints;            /* Receiver interrupts */
0114         long txints;            /* Transmitter interrupts */
0115         long exints;            /* External/status interrupts */
0116         long spints;            /* Special receiver interrupts */
0117 
0118         long txframes;          /* Packets sent */
0119         long rxframes;          /* Number of Frames Actually Received */
0120         long rxerrs;            /* CRC Errors */
0121         long txerrs;        /* KISS errors */
0122         
0123     unsigned int nospace;   /* "Out of buffers" */
0124     unsigned int rx_over;   /* Receiver Overruns */
0125     unsigned int tx_under;  /* Transmitter Underruns */
0126 
0127     unsigned int tx_state;  /* Transmitter state */
0128     int tx_queued;      /* tx frames enqueued */
0129 
0130     unsigned int maxqueue;  /* allocated tx_buffers */
0131     unsigned int bufsize;   /* used buffersize */
0132 };
0133 
0134 struct scc_modem {
0135     long speed;     /* Line speed, bps */
0136     char clocksrc;      /* 0 = DPLL, 1 = external, 2 = divider */
0137     char nrz;       /* NRZ instead of NRZI */   
0138 };
0139 
0140 struct scc_kiss_cmd {
0141     int      command;   /* one of the KISS-Commands defined above */
0142     unsigned param;     /* KISS-Param */
0143 };
0144 
0145 struct scc_hw_config {
0146     io_port data_a;     /* data port channel A */
0147     io_port ctrl_a;     /* control port channel A */
0148     io_port data_b;     /* data port channel B */
0149     io_port ctrl_b;     /* control port channel B */
0150     io_port vector_latch;   /* INTACK-Latch (#) */
0151     io_port special;    /* special function port */
0152 
0153     int irq;        /* irq */
0154     long    clock;      /* clock */
0155     char    option;     /* command for function port */
0156 
0157     char brand;     /* hardware type */
0158     char escc;      /* use ext. features of a 8580/85180/85280 */
0159 };
0160 
0161 /* (#) only one INTACK latch allowed. */
0162 
0163 
0164 struct scc_mem_config {
0165     unsigned int dummy;
0166     unsigned int bufsize;
0167 };
0168 
0169 struct scc_calibrate {
0170     unsigned int time;
0171     unsigned char pattern;
0172 };
0173 
0174 #endif /* _UAPI_SCC_H */