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

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