istallion.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*****************************************************************************/
  2. /*
  3. * istallion.h -- stallion intelligent multiport serial driver.
  4. *
  5. * Copyright (C) 1996-1998 Stallion Technologies
  6. * Copyright (C) 1994-1996 Greg Ungerer.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. /*****************************************************************************/
  23. #ifndef _ISTALLION_H
  24. #define _ISTALLION_H
  25. /*****************************************************************************/
  26. /*
  27. * Define important driver constants here.
  28. */
  29. #define STL_MAXBRDS 4
  30. #define STL_MAXPANELS 4
  31. #define STL_MAXPORTS 64
  32. #define STL_MAXCHANS (STL_MAXPORTS + 1)
  33. #define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS)
  34. /*
  35. * Define a set of structures to hold all the board/panel/port info
  36. * for our ports. These will be dynamically allocated as required at
  37. * driver initialization time.
  38. */
  39. /*
  40. * Port and board structures to hold status info about each object.
  41. * The board structure contains pointers to structures for each port
  42. * connected to it. Panels are not distinguished here, since
  43. * communication with the slave board will always be on a per port
  44. * basis.
  45. */
  46. struct stliport {
  47. unsigned long magic;
  48. unsigned int portnr;
  49. unsigned int panelnr;
  50. unsigned int brdnr;
  51. unsigned long state;
  52. unsigned int devnr;
  53. int flags;
  54. int baud_base;
  55. int custom_divisor;
  56. int close_delay;
  57. int closing_wait;
  58. int refcount;
  59. int openwaitcnt;
  60. int rc;
  61. int argsize;
  62. void *argp;
  63. unsigned int rxmarkmsk;
  64. struct tty_struct *tty;
  65. wait_queue_head_t open_wait;
  66. wait_queue_head_t close_wait;
  67. wait_queue_head_t raw_wait;
  68. struct work_struct tqhangup;
  69. struct asysigs asig;
  70. unsigned long addr;
  71. unsigned long rxoffset;
  72. unsigned long txoffset;
  73. unsigned long sigs;
  74. unsigned long pflag;
  75. unsigned int rxsize;
  76. unsigned int txsize;
  77. unsigned char reqbit;
  78. unsigned char portidx;
  79. unsigned char portbit;
  80. };
  81. /*
  82. * Use a structure of function pointers to do board level operations.
  83. * These include, enable/disable, paging shared memory, interrupting, etc.
  84. */
  85. struct stlibrd {
  86. unsigned long magic;
  87. unsigned int brdnr;
  88. unsigned int brdtype;
  89. unsigned int state;
  90. unsigned int nrpanels;
  91. unsigned int nrports;
  92. unsigned int nrdevs;
  93. unsigned int iobase;
  94. int iosize;
  95. unsigned long memaddr;
  96. void __iomem *membase;
  97. unsigned long memsize;
  98. int pagesize;
  99. int hostoffset;
  100. int slaveoffset;
  101. int bitsize;
  102. int enabval;
  103. unsigned int panels[STL_MAXPANELS];
  104. int panelids[STL_MAXPANELS];
  105. void (*init)(struct stlibrd *brdp);
  106. void (*enable)(struct stlibrd *brdp);
  107. void (*reenable)(struct stlibrd *brdp);
  108. void (*disable)(struct stlibrd *brdp);
  109. void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
  110. void (*intr)(struct stlibrd *brdp);
  111. void (*reset)(struct stlibrd *brdp);
  112. struct stliport *ports[STL_MAXPORTS];
  113. };
  114. /*
  115. * Define MAGIC numbers used for above structures.
  116. */
  117. #define STLI_PORTMAGIC 0xe671c7a1
  118. #define STLI_BOARDMAGIC 0x4bc6c825
  119. /*****************************************************************************/
  120. #endif