istallion.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. #include <linux/version.h>
  23. /*****************************************************************************/
  24. #ifndef _ISTALLION_H
  25. #define _ISTALLION_H
  26. /*****************************************************************************/
  27. /*
  28. * Define important driver constants here.
  29. */
  30. #define STL_MAXBRDS 4
  31. #define STL_MAXPANELS 4
  32. #define STL_MAXPORTS 64
  33. #define STL_MAXCHANS (STL_MAXPORTS + 1)
  34. #define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS)
  35. /*
  36. * Define a set of structures to hold all the board/panel/port info
  37. * for our ports. These will be dynamically allocated as required at
  38. * driver initialization time.
  39. */
  40. /*
  41. * Port and board structures to hold status info about each object.
  42. * The board structure contains pointers to structures for each port
  43. * connected to it. Panels are not distinguished here, since
  44. * communication with the slave board will always be on a per port
  45. * basis.
  46. */
  47. typedef struct {
  48. unsigned long magic;
  49. int portnr;
  50. int panelnr;
  51. int brdnr;
  52. unsigned long state;
  53. int devnr;
  54. int flags;
  55. int baud_base;
  56. int custom_divisor;
  57. int close_delay;
  58. int closing_wait;
  59. int refcount;
  60. int openwaitcnt;
  61. int rc;
  62. int argsize;
  63. void *argp;
  64. unsigned int rxmarkmsk;
  65. struct tty_struct *tty;
  66. wait_queue_head_t open_wait;
  67. wait_queue_head_t close_wait;
  68. wait_queue_head_t raw_wait;
  69. struct work_struct tqhangup;
  70. asysigs_t asig;
  71. unsigned long addr;
  72. unsigned long rxoffset;
  73. unsigned long txoffset;
  74. unsigned long sigs;
  75. unsigned long pflag;
  76. unsigned int rxsize;
  77. unsigned int txsize;
  78. unsigned char reqbit;
  79. unsigned char portidx;
  80. unsigned char portbit;
  81. } stliport_t;
  82. /*
  83. * Use a structure of function pointers to do board level operations.
  84. * These include, enable/disable, paging shared memory, interrupting, etc.
  85. */
  86. typedef struct stlibrd {
  87. unsigned long magic;
  88. int brdnr;
  89. int brdtype;
  90. int state;
  91. int nrpanels;
  92. int nrports;
  93. int nrdevs;
  94. unsigned int iobase;
  95. int iosize;
  96. unsigned long memaddr;
  97. void *membase;
  98. int memsize;
  99. int pagesize;
  100. int hostoffset;
  101. int slaveoffset;
  102. int bitsize;
  103. int enabval;
  104. int panels[STL_MAXPANELS];
  105. int panelids[STL_MAXPANELS];
  106. void (*init)(struct stlibrd *brdp);
  107. void (*enable)(struct stlibrd *brdp);
  108. void (*reenable)(struct stlibrd *brdp);
  109. void (*disable)(struct stlibrd *brdp);
  110. char *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
  111. void (*intr)(struct stlibrd *brdp);
  112. void (*reset)(struct stlibrd *brdp);
  113. stliport_t *ports[STL_MAXPORTS];
  114. } stlibrd_t;
  115. /*
  116. * Define MAGIC numbers used for above structures.
  117. */
  118. #define STLI_PORTMAGIC 0xe671c7a1
  119. #define STLI_BOARDMAGIC 0x4bc6c825
  120. /*****************************************************************************/
  121. #endif