serial167.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * serial167.h
  3. *
  4. * Richard Hirst [richard@sleepie.demon.co.uk]
  5. *
  6. * Based on cyclades.h
  7. */
  8. struct cyclades_monitor {
  9. unsigned long int_count;
  10. unsigned long char_count;
  11. unsigned long char_max;
  12. unsigned long char_last;
  13. };
  14. /*
  15. * This is our internal structure for each serial port's state.
  16. *
  17. * Many fields are paralleled by the structure used by the serial_struct
  18. * structure.
  19. *
  20. * For definitions of the flags field, see tty.h
  21. */
  22. struct cyclades_port {
  23. int magic;
  24. int type;
  25. int card;
  26. int line;
  27. int flags; /* defined in tty.h */
  28. struct tty_struct *tty;
  29. int read_status_mask;
  30. int timeout;
  31. int xmit_fifo_size;
  32. int cor1,cor2,cor3,cor4,cor5,cor6,cor7;
  33. int tbpr,tco,rbpr,rco;
  34. int ignore_status_mask;
  35. int close_delay;
  36. int IER; /* Interrupt Enable Register */
  37. unsigned long event;
  38. unsigned long last_active;
  39. int count; /* # of fd on device */
  40. int x_char; /* to be pushed out ASAP */
  41. int x_break;
  42. int blocked_open; /* # of blocked opens */
  43. unsigned char *xmit_buf;
  44. int xmit_head;
  45. int xmit_tail;
  46. int xmit_cnt;
  47. int default_threshold;
  48. int default_timeout;
  49. struct work_struct tqueue;
  50. wait_queue_head_t open_wait;
  51. wait_queue_head_t close_wait;
  52. struct cyclades_monitor mon;
  53. };
  54. #define CYCLADES_MAGIC 0x4359
  55. #define CYGETMON 0x435901
  56. #define CYGETTHRESH 0x435902
  57. #define CYSETTHRESH 0x435903
  58. #define CYGETDEFTHRESH 0x435904
  59. #define CYSETDEFTHRESH 0x435905
  60. #define CYGETTIMEOUT 0x435906
  61. #define CYSETTIMEOUT 0x435907
  62. #define CYGETDEFTIMEOUT 0x435908
  63. #define CYSETDEFTIMEOUT 0x435909
  64. /*
  65. * Events are used to schedule things to happen at timer-interrupt
  66. * time, instead of at cy interrupt time.
  67. */
  68. #define Cy_EVENT_READ_PROCESS 0
  69. #define Cy_EVENT_WRITE_WAKEUP 1
  70. #define Cy_EVENT_HANGUP 2
  71. #define Cy_EVENT_BREAK 3
  72. #define Cy_EVENT_OPEN_WAKEUP 4
  73. #define CyMaxChipsPerCard 1
  74. /**** cd2401 registers ****/
  75. #define CyGFRCR (0x81)
  76. #define CyCCR (0x13)
  77. #define CyCLR_CHAN (0x40)
  78. #define CyINIT_CHAN (0x20)
  79. #define CyCHIP_RESET (0x10)
  80. #define CyENB_XMTR (0x08)
  81. #define CyDIS_XMTR (0x04)
  82. #define CyENB_RCVR (0x02)
  83. #define CyDIS_RCVR (0x01)
  84. #define CyCAR (0xee)
  85. #define CyIER (0x11)
  86. #define CyMdmCh (0x80)
  87. #define CyRxExc (0x20)
  88. #define CyRxData (0x08)
  89. #define CyTxMpty (0x02)
  90. #define CyTxRdy (0x01)
  91. #define CyLICR (0x26)
  92. #define CyRISR (0x89)
  93. #define CyTIMEOUT (0x80)
  94. #define CySPECHAR (0x70)
  95. #define CyOVERRUN (0x08)
  96. #define CyPARITY (0x04)
  97. #define CyFRAME (0x02)
  98. #define CyBREAK (0x01)
  99. #define CyREOIR (0x84)
  100. #define CyTEOIR (0x85)
  101. #define CyMEOIR (0x86)
  102. #define CyNOTRANS (0x08)
  103. #define CyRFOC (0x30)
  104. #define CyRDR (0xf8)
  105. #define CyTDR (0xf8)
  106. #define CyMISR (0x8b)
  107. #define CyRISR (0x89)
  108. #define CyTISR (0x8a)
  109. #define CyMSVR1 (0xde)
  110. #define CyMSVR2 (0xdf)
  111. #define CyDSR (0x80)
  112. #define CyDCD (0x40)
  113. #define CyCTS (0x20)
  114. #define CyDTR (0x02)
  115. #define CyRTS (0x01)
  116. #define CyRTPRL (0x25)
  117. #define CyRTPRH (0x24)
  118. #define CyCOR1 (0x10)
  119. #define CyPARITY_NONE (0x00)
  120. #define CyPARITY_E (0x40)
  121. #define CyPARITY_O (0xC0)
  122. #define Cy_5_BITS (0x04)
  123. #define Cy_6_BITS (0x05)
  124. #define Cy_7_BITS (0x06)
  125. #define Cy_8_BITS (0x07)
  126. #define CyCOR2 (0x17)
  127. #define CyETC (0x20)
  128. #define CyCtsAE (0x02)
  129. #define CyCOR3 (0x16)
  130. #define Cy_1_STOP (0x02)
  131. #define Cy_2_STOP (0x04)
  132. #define CyCOR4 (0x15)
  133. #define CyREC_FIFO (0x0F) /* Receive FIFO threshold */
  134. #define CyCOR5 (0x14)
  135. #define CyCOR6 (0x18)
  136. #define CyCOR7 (0x07)
  137. #define CyRBPR (0xcb)
  138. #define CyRCOR (0xc8)
  139. #define CyTBPR (0xc3)
  140. #define CyTCOR (0xc0)
  141. #define CySCHR1 (0x1f)
  142. #define CySCHR2 (0x1e)
  143. #define CyTPR (0xda)
  144. #define CyPILR1 (0xe3)
  145. #define CyPILR2 (0xe0)
  146. #define CyPILR3 (0xe1)
  147. #define CyCMR (0x1b)
  148. #define CyASYNC (0x02)
  149. #define CyLICR (0x26)
  150. #define CyLIVR (0x09)
  151. #define CySCRL (0x23)
  152. #define CySCRH (0x22)
  153. #define CyTFTC (0x80)
  154. /* max number of chars in the FIFO */
  155. #define CyMAX_CHAR_FIFO 12
  156. /***************************************************************************/