2  *      linux/drivers/char/specialix_io8.h  -- 
 
   3  *                                   Specialix IO8+ multiport serial driver.
 
   5  *      Copyright (C) 1997 Roger Wolff (R.E.Wolff@BitWizard.nl)
 
   6  *      Copyright (C) 1994-1996  Dmitry Gorodchanin (pgmdsg@ibi.com)
 
   9  *      Specialix pays for the development and support of this driver.
 
  10  *      Please DO contact io8-linux@specialix.co.uk if you require
 
  13  *      This driver was developped in the BitWizard linux device
 
  14  *      driver service. If you require a linux device driver for your
 
  15  *      product, please contact devices@BitWizard.nl for a quote.
 
  17  *      This code is firmly based on the riscom/8 serial driver,
 
  18  *      written by Dmitry Gorodchanin. The specialix IO8+ card
 
  19  *      programming information was obtained from the CL-CD1865 Data
 
  20  *      Book, and Specialix document number 6200059: IO8+ Hardware
 
  21  *      Functional Specification.
 
  23  *      This program is free software; you can redistribute it and/or
 
  24  *      modify it under the terms of the GNU General Public License as
 
  25  *      published by the Free Software Foundation; either version 2 of
 
  26  *      the License, or (at your option) any later version.
 
  28  *      This program is distributed in the hope that it will be
 
  29  *      useful, but WITHOUT ANY WARRANTY; without even the implied
 
  30  *      warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 
  31  *      PURPOSE.  See the GNU General Public License for more details.
 
  33  *      You should have received a copy of the GNU General Public
 
  34  *      License along with this program; if not, write to the Free
 
  35  *      Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 
  39 #ifndef __LINUX_SPECIALIX_H
 
  40 #define __LINUX_SPECIALIX_H
 
  42 #include <linux/serial.h>
 
  46 /* You can have max 4 ISA cards in one PC, and I recommend not much 
 
  47 more than a few  PCI versions of the card. */
 
  51 /* NOTE: Specialix decoder recognizes 4 addresses, but only two are used.... */
 
  53 /* The PCI version decodes 8 addresses, but still only 2 are used. */
 
  54 #define SX_PCI_IO_SPACE         8
 
  56 /* eight ports per board. */
 
  58 #define SX_BOARD(line)          ((line) / SX_NPORT)
 
  59 #define SX_PORT(line)           ((line) & (SX_NPORT - 1))
 
  62 #define SX_DATA_REG 0     /* Base+0 : Data register */
 
  63 #define SX_ADDR_REG 1     /* base+1 : Address register. */
 
  65 #define MHz *1000000    /* I'm ashamed of myself. */
 
  67 /* On-board oscillator frequency */
 
  68 #define SX_OSCFREQ      (25 MHz/2)
 
  69 /* There is a 25MHz crystal on the board, but the chip is in /2 mode */
 
  72 /* Ticks per sec. Used for setting receiver timeout and break length */
 
  73 #define SPECIALIX_TPS           4000
 
  75 /* Yeah, after heavy testing I decided it must be 6.
 
  76  * Sure, You can change it if needed.
 
  78 #define SPECIALIX_RXFIFO        6       /* Max. receiver FIFO size (1-8) */
 
  80 #define SPECIALIX_MAGIC         0x0907
 
  82 #define SX_CCR_TIMEOUT 10000   /* CCR timeout. You may need to wait upto
 
  83                                   10 milliseconds before the internal
 
  84                                   processor is available again after
 
  85                                   you give it a command */
 
  87 #define SX_IOBASE1      0x100
 
  88 #define SX_IOBASE2      0x180
 
  89 #define SX_IOBASE3      0x250
 
  90 #define SX_IOBASE4      0x260
 
  92 struct specialix_board {
 
 103 #define SX_BOARD_PRESENT        0x00000001
 
 104 #define SX_BOARD_ACTIVE         0x00000002
 
 105 #define SX_BOARD_IS_PCI         0x00000004
 
 108 struct specialix_port {
 
 110         struct tty_port         port;
 
 114         unsigned char           * xmit_buf;
 
 121         unsigned char           mark_mask;
 
 125         unsigned long           overrun;
 
 126         unsigned long           hits[10];
 
 130 #endif /* __KERNEL__ */
 
 131 #endif /* __LINUX_SPECIALIX_H */