root/include/linux/istallion.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


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

/* [previous][next][first][last][top][bottom][index][help] */