istallion.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. struct tty_port port;
  49. unsigned int portnr;
  50. unsigned int panelnr;
  51. unsigned int brdnr;
  52. unsigned long state;
  53. unsigned int devnr;
  54. int baud_base;
  55. int custom_divisor;
  56. int closing_wait;
  57. int rc;
  58. int argsize;
  59. void *argp;
  60. unsigned int rxmarkmsk;
  61. wait_queue_head_t raw_wait;
  62. struct asysigs asig;
  63. unsigned long addr;
  64. unsigned long rxoffset;
  65. unsigned long txoffset;
  66. unsigned long sigs;
  67. unsigned long pflag;
  68. unsigned int rxsize;
  69. unsigned int txsize;
  70. unsigned char reqbit;
  71. unsigned char portidx;
  72. unsigned char portbit;
  73. };
  74. /*
  75. * Use a structure of function pointers to do board level operations.
  76. * These include, enable/disable, paging shared memory, interrupting, etc.
  77. */
  78. struct stlibrd {
  79. unsigned long magic;
  80. unsigned int brdnr;
  81. unsigned int brdtype;
  82. unsigned long state;
  83. unsigned int nrpanels;
  84. unsigned int nrports;
  85. unsigned int nrdevs;
  86. unsigned int iobase;
  87. int iosize;
  88. unsigned long memaddr;
  89. void __iomem *membase;
  90. unsigned long memsize;
  91. int pagesize;
  92. int hostoffset;
  93. int slaveoffset;
  94. int bitsize;
  95. int enabval;
  96. unsigned int panels[STL_MAXPANELS];
  97. int panelids[STL_MAXPANELS];
  98. void (*init)(struct stlibrd *brdp);
  99. void (*enable)(struct stlibrd *brdp);
  100. void (*reenable)(struct stlibrd *brdp);
  101. void (*disable)(struct stlibrd *brdp);
  102. void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
  103. void (*intr)(struct stlibrd *brdp);
  104. void (*reset)(struct stlibrd *brdp);
  105. struct stliport *ports[STL_MAXPORTS];
  106. };
  107. /*
  108. * Define MAGIC numbers used for above structures.
  109. */
  110. #define STLI_PORTMAGIC 0xe671c7a1
  111. #define STLI_BOARDMAGIC 0x4bc6c825
  112. /*****************************************************************************/
  113. #endif