PageRenderTime 23ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/char/sx.h

http://github.com/CyanogenMod/cm-kernel
C Header | 201 lines | 129 code | 47 blank | 25 comment | 0 complexity | 7a20296a5aee9b6abc9d5520cea1ca98 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
  1. /*
  2. * sx.h
  3. *
  4. * Copyright (C) 1998/1999 R.E.Wolff@BitWizard.nl
  5. *
  6. * SX serial driver.
  7. * -- Supports SI, XIO and SX host cards.
  8. * -- Supports TAs, MTAs and SXDCs.
  9. *
  10. * Version 1.3 -- March, 1999.
  11. *
  12. */
  13. #define SX_NBOARDS 4
  14. #define SX_PORTSPERBOARD 32
  15. #define SX_NPORTS (SX_NBOARDS * SX_PORTSPERBOARD)
  16. #ifdef __KERNEL__
  17. #define SX_MAGIC 0x12345678
  18. struct sx_port {
  19. struct gs_port gs;
  20. struct wait_queue *shutdown_wait;
  21. int ch_base;
  22. int c_dcd;
  23. struct sx_board *board;
  24. int line;
  25. unsigned long locks;
  26. };
  27. struct sx_board {
  28. int magic;
  29. void __iomem *base;
  30. void __iomem *base2;
  31. unsigned long hw_base;
  32. resource_size_t hw_len;
  33. int eisa_base;
  34. int port_base; /* Number of the first port */
  35. struct sx_port *ports;
  36. int nports;
  37. int flags;
  38. int irq;
  39. int poll;
  40. int ta_type;
  41. struct timer_list timer;
  42. unsigned long locks;
  43. };
  44. struct vpd_prom {
  45. unsigned short id;
  46. char hwrev;
  47. char hwass;
  48. int uniqid;
  49. char myear;
  50. char mweek;
  51. char hw_feature[5];
  52. char oem_id;
  53. char identifier[16];
  54. };
  55. #ifndef MOD_RS232DB25MALE
  56. #define MOD_RS232DB25MALE 0x0a
  57. #endif
  58. #define SI_ISA_BOARD 0x00000001
  59. #define SX_ISA_BOARD 0x00000002
  60. #define SX_PCI_BOARD 0x00000004
  61. #define SX_CFPCI_BOARD 0x00000008
  62. #define SX_CFISA_BOARD 0x00000010
  63. #define SI_EISA_BOARD 0x00000020
  64. #define SI1_ISA_BOARD 0x00000040
  65. #define SX_BOARD_PRESENT 0x00001000
  66. #define SX_BOARD_INITIALIZED 0x00002000
  67. #define SX_IRQ_ALLOCATED 0x00004000
  68. #define SX_BOARD_TYPE 0x000000ff
  69. #define IS_SX_BOARD(board) (board->flags & (SX_PCI_BOARD | SX_CFPCI_BOARD | \
  70. SX_ISA_BOARD | SX_CFISA_BOARD))
  71. #define IS_SI_BOARD(board) (board->flags & SI_ISA_BOARD)
  72. #define IS_SI1_BOARD(board) (board->flags & SI1_ISA_BOARD)
  73. #define IS_EISA_BOARD(board) (board->flags & SI_EISA_BOARD)
  74. #define IS_CF_BOARD(board) (board->flags & (SX_CFISA_BOARD | SX_CFPCI_BOARD))
  75. /* The SI processor clock is required to calculate the cc_int_count register
  76. value for the SI cards. */
  77. #define SI_PROCESSOR_CLOCK 25000000
  78. /* port flags */
  79. /* Make sure these don't clash with gs flags or async flags */
  80. #define SX_RX_THROTTLE 0x0000001
  81. #define SX_PORT_TRANSMIT_LOCK 0
  82. #define SX_BOARD_INTR_LOCK 0
  83. /* Debug flags. Add these together to get more debug info. */
  84. #define SX_DEBUG_OPEN 0x00000001
  85. #define SX_DEBUG_SETTING 0x00000002
  86. #define SX_DEBUG_FLOW 0x00000004
  87. #define SX_DEBUG_MODEMSIGNALS 0x00000008
  88. #define SX_DEBUG_TERMIOS 0x00000010
  89. #define SX_DEBUG_TRANSMIT 0x00000020
  90. #define SX_DEBUG_RECEIVE 0x00000040
  91. #define SX_DEBUG_INTERRUPTS 0x00000080
  92. #define SX_DEBUG_PROBE 0x00000100
  93. #define SX_DEBUG_INIT 0x00000200
  94. #define SX_DEBUG_CLEANUP 0x00000400
  95. #define SX_DEBUG_CLOSE 0x00000800
  96. #define SX_DEBUG_FIRMWARE 0x00001000
  97. #define SX_DEBUG_MEMTEST 0x00002000
  98. #define SX_DEBUG_ALL 0xffffffff
  99. #define O_OTHER(tty) \
  100. ((O_OLCUC(tty)) ||\
  101. (O_ONLCR(tty)) ||\
  102. (O_OCRNL(tty)) ||\
  103. (O_ONOCR(tty)) ||\
  104. (O_ONLRET(tty)) ||\
  105. (O_OFILL(tty)) ||\
  106. (O_OFDEL(tty)) ||\
  107. (O_NLDLY(tty)) ||\
  108. (O_CRDLY(tty)) ||\
  109. (O_TABDLY(tty)) ||\
  110. (O_BSDLY(tty)) ||\
  111. (O_VTDLY(tty)) ||\
  112. (O_FFDLY(tty)))
  113. /* Same for input. */
  114. #define I_OTHER(tty) \
  115. ((I_INLCR(tty)) ||\
  116. (I_IGNCR(tty)) ||\
  117. (I_ICRNL(tty)) ||\
  118. (I_IUCLC(tty)) ||\
  119. (L_ISIG(tty)))
  120. #define MOD_TA ( TA>>4)
  121. #define MOD_MTA (MTA_CD1400>>4)
  122. #define MOD_SXDC ( SXDC>>4)
  123. /* We copy the download code over to the card in chunks of ... bytes */
  124. #define SX_CHUNK_SIZE 128
  125. #endif /* __KERNEL__ */
  126. /* Specialix document 6210046-11 page 3 */
  127. #define SPX(X) (('S'<<24) | ('P' << 16) | (X))
  128. /* Specialix-Linux specific IOCTLS. */
  129. #define SPXL(X) (SPX(('L' << 8) | (X)))
  130. #define SXIO_SET_BOARD SPXL(0x01)
  131. #define SXIO_GET_TYPE SPXL(0x02)
  132. #define SXIO_DOWNLOAD SPXL(0x03)
  133. #define SXIO_INIT SPXL(0x04)
  134. #define SXIO_SETDEBUG SPXL(0x05)
  135. #define SXIO_GETDEBUG SPXL(0x06)
  136. #define SXIO_DO_RAMTEST SPXL(0x07)
  137. #define SXIO_SETGSDEBUG SPXL(0x08)
  138. #define SXIO_GETGSDEBUG SPXL(0x09)
  139. #define SXIO_GETNPORTS SPXL(0x0a)
  140. #ifndef SXCTL_MISC_MINOR
  141. /* Allow others to gather this into "major.h" or something like that */
  142. #define SXCTL_MISC_MINOR 167
  143. #endif
  144. #ifndef SX_NORMAL_MAJOR
  145. /* This allows overriding on the compiler commandline, or in a "major.h"
  146. include or something like that */
  147. #define SX_NORMAL_MAJOR 32
  148. #define SX_CALLOUT_MAJOR 33
  149. #endif
  150. #define SX_TYPE_SX 0x01
  151. #define SX_TYPE_SI 0x02
  152. #define SX_TYPE_CF 0x03
  153. #define WINDOW_LEN(board) (IS_CF_BOARD(board)?0x20000:SX_WINDOW_LEN)
  154. /* Need a #define for ^^^^^^^ !!! */