Import changeset
[linux-flexiantxendom0-3.2.10.git] / drivers / isdn / sc / card.h
1 /*
2  *  $Id: card.h,v 1.1 1996/11/07 13:07:40 fritz Exp $
3  *  Copyright (C) 1996  SpellCaster Telecommunications Inc.
4  *
5  *  card.h - Driver parameters for SpellCaster ISA ISDN adapters
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  *  For more information, please contact gpl-info@spellcast.com or write:
22  *
23  *     SpellCaster Telecommunications Inc.
24  *     5621 Finch Avenue East, Unit #3
25  *     Scarborough, Ontario  Canada
26  *     M1B 2T9
27  *     +1 (416) 297-8565
28  *     +1 (416) 297-6433 Facsimile
29  */
30
31 #ifndef CARD_H
32 #define CARD_H
33
34 /*
35  * We need these if they're not already included
36  */
37 #include <linux/timer.h>
38 #include <linux/isdnif.h>
39 #include "message.h"
40
41 /*
42  * Amount of time to wait for a reset to complete
43  */
44 #define CHECKRESET_TIME         milliseconds(4000)
45
46 /*
47  * Amount of time between line status checks
48  */
49 #define CHECKSTAT_TIME          milliseconds(8000)
50
51 /*
52  * The maximum amount of time to wait for a message response
53  * to arrive. Use exclusively by send_and_receive
54  */
55 #define SAR_TIMEOUT             milliseconds(10000)
56
57 /*
58  * Macro to determine is a card id is valid
59  */
60 #define IS_VALID_CARD(x)        ((x >= 0) && (x <= cinst))
61
62 /*
63  * Per channel status and configuration
64  */
65 typedef struct {
66         int l2_proto;
67         int l3_proto;
68         char dn[50];
69         unsigned long first_sendbuf;    /* Offset of first send buffer */
70         unsigned int num_sendbufs;      /* Number of send buffers */
71         unsigned int free_sendbufs;     /* Number of free sendbufs */
72         unsigned int next_sendbuf;      /* Next sequential buffer */
73         char eazlist[50];               /* Set with SETEAZ */
74         char sillist[50];               /* Set with SETSIL */
75         int eazclear;                   /* Don't accept calls if TRUE */
76 } bchan;
77
78 /*
79  * Everything you want to know about the adapter ...
80  */
81 typedef struct {
82         int model;
83         int driverId;                   /* LL Id */
84         char devicename[20];            /* The device name */
85         isdn_if *card;                  /* ISDN4Linux structure */
86         bchan *channel;                 /* status of the B channels */
87         char nChannels;                 /* Number of channels */
88         unsigned int interrupt;         /* Interrupt number */
89         int iobase;                     /* I/O Base address */
90         int ioport[MAX_IO_REGS];        /* Index to I/O ports */
91         int shmem_pgport;               /* port for the exp mem page reg. */
92         int shmem_magic;                /* adapter magic number */
93         unsigned int rambase;           /* Shared RAM base address */
94         unsigned int ramsize;           /* Size of shared memory */
95         RspMessage async_msg;           /* Async response message */
96         int want_async_messages;        /* Snoop the Q ? */
97         unsigned char seq_no;           /* Next send seq. number */
98         struct timer_list reset_timer;  /* Check reset timer */
99         struct timer_list stat_timer;   /* Check startproc timer */
100         unsigned char nphystat;         /* Latest PhyStat info */
101         unsigned char phystat;          /* Last PhyStat info */
102         HWConfig_pl hwconfig;           /* Hardware config info */
103         char load_ver[11];              /* CommManage Version string */
104         char proc_ver[11];              /* CommEngine Version */
105         int StartOnReset;               /* Indicates startproc after reset */
106         int EngineUp;                   /* Indicates CommEngine Up */
107         int trace_mode;                 /* Indicate if tracing is on */
108 } board;
109
110 #endif /* CARD_H */