root/include/linux/cyclades.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * linux/include/linux/cyclades.h
   3  *
   4  * This file is maintained by Marcio Saito <marcio@cyclades.com> and
   5  * Randolph Bentson <bentson@grieg.seaslug.org>.
   6  *
   7  * This file contains the general definitions for the cyclades.c driver
   8  *$Log: cyclades.h,v $
   9  * Revision 1.5  1995/11/13  21:13:31  bentson
  10  * changes suggested by Michael Chastain <mec@duracef.shout.net>
  11  * to support use of this file in non-kernel applications
  12  *
  13  *
  14  */
  15 
  16 #ifndef _LINUX_CYCLADES_H
  17 #define _LINUX_CYCLADES_H
  18 
  19 /* PCI vendor and device ID's */
  20 
  21 #ifndef PCI_VENDOR_ID_CYCLADES
  22 #define PCI_VENDOR_ID_CYCLADES  0x120e
  23 #endif
  24 
  25 #ifndef PCI_DEVICE_ID_CYCLOMY
  26 #define PCI_DEVICE_ID_CYCLOMY   0x0100
  27 #endif
  28 
  29 struct cyclades_monitor {
  30         unsigned long           int_count;
  31         unsigned long           char_count;
  32         unsigned long           char_max;
  33         unsigned long           char_last;
  34 };
  35 
  36 #define CYCLADES_MAGIC  0x4359
  37 
  38 #define CYGETMON                0x435901
  39 #define CYGETTHRESH             0x435902
  40 #define CYSETTHRESH             0x435903
  41 #define CYGETDEFTHRESH          0x435904
  42 #define CYSETDEFTHRESH          0x435905
  43 #define CYGETTIMEOUT            0x435906
  44 #define CYSETTIMEOUT            0x435907
  45 #define CYGETDEFTIMEOUT         0x435908
  46 #define CYSETDEFTIMEOUT         0x435909
  47 
  48 #ifdef __KERNEL__
  49 
  50 /* Per card data structure */
  51 
  52 struct cyclades_card {
  53     int base_addr;
  54     int irq;
  55     int num_chips;      /* 0 if card is absent */
  56     int first_line;     /* minor number of first channel on card */
  57     int bus_index;      /* address shift - 0 for ISA, 1 for PCI */
  58 };
  59 
  60 struct cyclades_chip {
  61   int filler;
  62 };
  63 
  64 /*
  65  * This is our internal structure for each serial port's state.
  66  * 
  67  * Many fields are paralleled by the structure used by the serial_struct
  68  * structure.
  69  *
  70  * For definitions of the flags field, see tty.h
  71  */
  72 
  73 struct cyclades_port {
  74         int                     magic;
  75         int                     type;
  76         int                     card;
  77         int                     line;
  78         int                     flags;          /* defined in tty.h */
  79         struct tty_struct       *tty;
  80         int                     read_status_mask;
  81         int                     timeout;
  82         int                     xmit_fifo_size;
  83         int                     cor1,cor2,cor3,cor4,cor5;
  84         int                     tbpr,tco,rbpr,rco;
  85         int                     ignore_status_mask;
  86         int                     close_delay;
  87         int                     IER;    /* Interrupt Enable Register */
  88         int                     event;
  89         unsigned long           last_active;
  90         int                     count;  /* # of fd on device */
  91         int                     x_char; /* to be pushed out ASAP */
  92         int                     x_break;
  93         int                     blocked_open; /* # of blocked opens */
  94         long                    session; /* Session of opening process */
  95         long                    pgrp; /* pgrp of opening process */
  96         unsigned char           *xmit_buf;
  97         int                     xmit_head;
  98         int                     xmit_tail;
  99         int                     xmit_cnt;
 100         int                     default_threshold;
 101         int                     default_timeout;
 102         struct tq_struct        tqueue;
 103         struct termios          normal_termios;
 104         struct termios          callout_termios;
 105         struct wait_queue       *open_wait;
 106         struct wait_queue       *close_wait;
 107         struct cyclades_monitor mon;
 108 };
 109 
 110 /*
 111  * Events are used to schedule things to happen at timer-interrupt
 112  * time, instead of at cy interrupt time.
 113  */
 114 #define Cy_EVENT_READ_PROCESS   0
 115 #define Cy_EVENT_WRITE_WAKEUP   1
 116 #define Cy_EVENT_HANGUP         2
 117 #define Cy_EVENT_BREAK          3
 118 #define Cy_EVENT_OPEN_WAKEUP    4
 119 
 120 
 121 
 122 #define CyMaxChipsPerCard 8
 123 
 124 /**** CD1400 registers ****/
 125 
 126 #define CyRegSize  0x0400
 127 #define Cy_HwReset 0x1400
 128 #define Cy_ClrIntr 0x1800
 129 #define Cy_EpldRev 0x1e00
 130 
 131 /* Global Registers */
 132 
 133 #define CyGFRCR         (0x40*2)
 134 #define      CyRevE             (44)
 135 #define CyCAR           (0x68*2)
 136 #define      CyCHAN_0           (0x00)
 137 #define      CyCHAN_1           (0x01)
 138 #define      CyCHAN_2           (0x02)
 139 #define      CyCHAN_3           (0x03)
 140 #define CyGCR           (0x4B*2)
 141 #define      CyCH0_SERIAL       (0x00)
 142 #define      CyCH0_PARALLEL     (0x80)
 143 #define CySVRR          (0x67*2)
 144 #define      CySRModem          (0x04)
 145 #define      CySRTransmit       (0x02)
 146 #define      CySRReceive        (0x01)
 147 #define CyRICR          (0x44*2)
 148 #define CyTICR          (0x45*2)
 149 #define CyMICR          (0x46*2)
 150 #define      CyICR0             (0x00)
 151 #define      CyICR1             (0x01)
 152 #define      CyICR2             (0x02)
 153 #define      CyICR3             (0x03)
 154 #define CyRIR           (0x6B*2)
 155 #define CyTIR           (0x6A*2)
 156 #define CyMIR           (0x69*2)
 157 #define      CyIRDirEq          (0x80)
 158 #define      CyIRBusy           (0x40)
 159 #define      CyIRUnfair         (0x20)
 160 #define      CyIRContext        (0x1C)
 161 #define      CyIRChannel        (0x03)
 162 #define CyPPR           (0x7E*2)
 163 #define      CyCLOCK_20_1MS     (0x27)
 164 #define      CyCLOCK_25_1MS     (0x31)
 165 
 166 /* Virtual Registers */
 167 
 168 #define CyRIVR          (0x43*2)
 169 #define CyTIVR          (0x42*2)
 170 #define CyMIVR          (0x41*2)
 171 #define      CyIVRMask (0x07)
 172 #define      CyIVRRxEx (0x07)
 173 #define      CyIVRRxOK (0x03)
 174 #define      CyIVRTxOK (0x02)
 175 #define      CyIVRMdmOK (0x01)
 176 #define CyTDR           (0x63*2)
 177 #define CyRDSR          (0x62*2)
 178 #define      CyTIMEOUT          (0x80)
 179 #define      CySPECHAR          (0x70)
 180 #define      CyBREAK            (0x08)
 181 #define      CyPARITY           (0x04)
 182 #define      CyFRAME            (0x02)
 183 #define      CyOVERRUN          (0x01)
 184 #define CyMISR          (0x4C*2)
 185 /* see CyMCOR_ and CyMSVR_ for bits*/
 186 #define CyEOSRR         (0x60*2)
 187 
 188 /* Channel Registers */
 189 
 190 #define CyLIVR          (0x18*2)
 191 #define      CyMscsr            (0x01)
 192 #define      CyTdsr             (0x02)
 193 #define      CyRgdsr            (0x03)
 194 #define      CyRedsr            (0x07)
 195 #define CyCCR           (0x05*2)
 196 /* Format 1 */
 197 #define      CyCHAN_RESET       (0x80)
 198 #define      CyCHIP_RESET       (0x81)
 199 #define      CyFlushTransFIFO   (0x82)
 200 /* Format 2 */
 201 #define      CyCOR_CHANGE       (0x40)
 202 #define      CyCOR1ch           (0x02)
 203 #define      CyCOR2ch           (0x04)
 204 #define      CyCOR3ch           (0x08)
 205 /* Format 3 */
 206 #define      CySEND_SPEC_1      (0x21)
 207 #define      CySEND_SPEC_2      (0x22)
 208 #define      CySEND_SPEC_3      (0x23)
 209 #define      CySEND_SPEC_4      (0x24)
 210 /* Format 4 */
 211 #define      CyCHAN_CTL         (0x10)
 212 #define      CyDIS_RCVR         (0x01)
 213 #define      CyENB_RCVR         (0x02)
 214 #define      CyDIS_XMTR         (0x04)
 215 #define      CyENB_XMTR         (0x08)
 216 #define CySRER          (0x06*2)
 217 #define      CyMdmCh            (0x80)
 218 #define      CyRxData           (0x10)
 219 #define      CyTxRdy            (0x04)
 220 #define      CyTxMpty           (0x02)
 221 #define      CyNNDT             (0x01)
 222 #define CyCOR1          (0x08*2)
 223 #define      CyPARITY_NONE      (0x00)
 224 #define      CyPARITY_0         (0x20)
 225 #define      CyPARITY_1         (0xA0)
 226 #define      CyPARITY_E         (0x40)
 227 #define      CyPARITY_O         (0xC0)
 228 #define      Cy_1_STOP          (0x00)
 229 #define      Cy_1_5_STOP        (0x04)
 230 #define      Cy_2_STOP          (0x08)
 231 #define      Cy_5_BITS          (0x00)
 232 #define      Cy_6_BITS          (0x01)
 233 #define      Cy_7_BITS          (0x02)
 234 #define      Cy_8_BITS          (0x03)
 235 #define CyCOR2          (0x09*2)
 236 #define      CyIXM              (0x80)
 237 #define      CyTxIBE            (0x40)
 238 #define      CyETC              (0x20)
 239 #define      CyAUTO_TXFL        (0x60)
 240 #define      CyLLM              (0x10)
 241 #define      CyRLM              (0x08)
 242 #define      CyRtsAO            (0x04)
 243 #define      CyCtsAE            (0x02)
 244 #define      CyDsrAE            (0x01)
 245 #define CyCOR3          (0x0A*2)
 246 #define      CySPL_CH_DRANGE    (0x80)  /* special character detect range */
 247 #define      CySPL_CH_DET1      (0x40)  /* enable special character detection
 248                                                                on SCHR4-SCHR3 */
 249 #define      CyFL_CTRL_TRNSP    (0x20)  /* Flow Control Transparency */
 250 #define      CySPL_CH_DET2      (0x10)  /* Enable special character detection
 251                                                                on SCHR2-SCHR1 */
 252 #define      CyREC_FIFO         (0x0F)  /* Receive FIFO threshold */
 253 #define CyCOR4          (0x1E*2)
 254 #define CyCOR5          (0x1F*2)
 255 #define CyCCSR          (0x0B*2)
 256 #define      CyRxEN             (0x80)
 257 #define      CyRxFloff          (0x40)
 258 #define      CyRxFlon           (0x20)
 259 #define      CyTxEN             (0x08)
 260 #define      CyTxFloff          (0x04)
 261 #define      CyTxFlon           (0x02)
 262 #define CyRDCR          (0x0E*2)
 263 #define CySCHR1         (0x1A*2)
 264 #define CySCHR2         (0x1B*2)
 265 #define CySCHR3         (0x1C*2)
 266 #define CySCHR4         (0x1D*2)
 267 #define CySCRL          (0x22*2)
 268 #define CySCRH          (0x23*2)
 269 #define CyLNC           (0x24*2)
 270 #define CyMCOR1         (0x15*2)
 271 #define CyMCOR2         (0x16*2)
 272 #define CyRTPR          (0x21*2)
 273 #define CyMSVR1         (0x6C*2)
 274 #define CyMSVR2         (0x6D*2)
 275 #define      CyDSR              (0x80)
 276 #define      CyCTS              (0x40)
 277 #define      CyRI               (0x20)
 278 #define      CyDCD              (0x10)
 279 #define      CyDTR              (0x02)
 280 #define      CyRTS              (0x01)
 281 #define CyPVSR          (0x6F*2)
 282 #define CyRBPR          (0x78*2)
 283 #define CyRCOR          (0x7C*2)
 284 #define CyTBPR          (0x72*2)
 285 #define CyTCOR          (0x76*2)
 286 
 287 /* max number of chars in the FIFO */
 288 
 289 #define CyMAX_CHAR_FIFO 12
 290 
 291 /***************************************************************************/
 292 
 293 #endif /* __KERNEL__ */
 294 #endif /* _LINUX_CYCLADES_H */

/* [previous][next][first][last][top][bottom][index][help] */