riscom8.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * linux/drivers/char/riscom8.h -- RISCom/8 multiport serial driver.
  3. *
  4. * Copyright (C) 1994-1996 Dmitry Gorodchanin (pgmdsg@ibi.com)
  5. *
  6. * This code is loosely based on the Linux serial driver, written by
  7. * Linus Torvalds, Theodore T'so and others. The RISCom/8 card
  8. * programming info was obtained from various drivers for other OSes
  9. * (FreeBSD, ISC, etc), but no source code from those drivers were
  10. * directly included in this driver.
  11. *
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26. */
  27. #ifndef __LINUX_RISCOM8_H
  28. #define __LINUX_RISCOM8_H
  29. #include <linux/serial.h>
  30. #ifdef __KERNEL__
  31. #define RC_NBOARD 4
  32. /* NOTE: RISCom decoder recognizes 16 addresses... */
  33. #define RC_NPORT 8
  34. #define RC_BOARD(line) (((line) >> 3) & 0x07)
  35. #define RC_PORT(line) ((line) & (RC_NPORT - 1))
  36. /* Ticks per sec. Used for setting receiver timeout and break length */
  37. #define RISCOM_TPS 4000
  38. /* Yeah, after heavy testing I decided it must be 6.
  39. * Sure, You can change it if needed.
  40. */
  41. #define RISCOM_RXFIFO 6 /* Max. receiver FIFO size (1-8) */
  42. #define RISCOM8_MAGIC 0x0907
  43. #define RC_IOBASE1 0x220
  44. #define RC_IOBASE2 0x240
  45. #define RC_IOBASE3 0x250
  46. #define RC_IOBASE4 0x260
  47. struct riscom_board {
  48. unsigned long flags;
  49. unsigned short base;
  50. unsigned char irq;
  51. signed char count;
  52. unsigned char DTR;
  53. };
  54. #define RC_BOARD_PRESENT 0x00000001
  55. #define RC_BOARD_ACTIVE 0x00000002
  56. struct riscom_port {
  57. int magic;
  58. int baud_base;
  59. int flags;
  60. struct tty_struct * tty;
  61. int count;
  62. int blocked_open;
  63. long event; /* long req'd for set_bit --RR */
  64. int timeout;
  65. int close_delay;
  66. unsigned char * xmit_buf;
  67. int custom_divisor;
  68. int xmit_head;
  69. int xmit_tail;
  70. int xmit_cnt;
  71. wait_queue_head_t open_wait;
  72. wait_queue_head_t close_wait;
  73. struct work_struct tqueue;
  74. struct work_struct tqueue_hangup;
  75. short wakeup_chars;
  76. short break_length;
  77. unsigned short closing_wait;
  78. unsigned char mark_mask;
  79. unsigned char IER;
  80. unsigned char MSVR;
  81. unsigned char COR2;
  82. #ifdef RC_REPORT_OVERRUN
  83. unsigned long overrun;
  84. #endif
  85. #ifdef RC_REPORT_FIFO
  86. unsigned long hits[10];
  87. #endif
  88. };
  89. #endif /* __KERNEL__ */
  90. #endif /* __LINUX_RISCOM8_H */