pre-2.3.4..
[davej-history.git] / drivers / isdn / eicon / eicon_isa.h
blob5b0dc1a6a60fd7d5c06553ef6dd656c9bdc5d074
1 /* $Id: eicon_isa.h,v 1.3 1999/03/29 11:19:47 armin Exp $
3 * ISDN low-level module for Eicon.Diehl active ISDN-Cards.
5 * Copyright 1998 by Fritz Elfert (fritz@wuemaus.franken.de)
6 * Copyright 1998,99 by Armin Schindler (mac@melware.de)
7 * Copyright 1999 Cytronics & Melware (info@melware.de)
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * $Log: eicon_isa.h,v $
24 * Revision 1.3 1999/03/29 11:19:47 armin
25 * I/O stuff now in seperate file (eicon_io.c)
26 * Old ISA type cards (S,SX,SCOM,Quadro,S2M) implemented.
28 * Revision 1.2 1999/03/02 12:37:46 armin
29 * Added some important checks.
30 * Analog Modem with DSP.
31 * Channels will be added to Link-Level after loading firmware.
33 * Revision 1.1 1999/01/01 18:09:44 armin
34 * First checkin of new eicon driver.
35 * DIVA-Server BRI/PCI and PRI/PCI are supported.
36 * Old diehl code is obsolete.
41 #ifndef eicon_isa_h
42 #define eicon_isa_h
44 #ifdef __KERNEL__
46 /* Factory defaults for ISA-Cards */
47 #define EICON_ISA_MEMBASE 0xd0000
48 #define EICON_ISA_IRQ 3
49 /* shmem offset for Quadro parts */
50 #define EICON_ISA_QOFFSET 0x0800
52 typedef struct {
53 __u16 length __attribute__ ((packed)); /* length of data/parameter field */
54 __u8 P[270]; /* data/parameter field */
55 } eicon_scom_PBUFFER;
57 /* General communication buffer */
58 typedef struct {
59 __u8 Req; /* request register */
60 __u8 ReqId; /* request task/entity identification */
61 __u8 Rc; /* return code register */
62 __u8 RcId; /* return code task/entity identification */
63 __u8 Ind; /* Indication register */
64 __u8 IndId; /* Indication task/entity identification */
65 __u8 IMask; /* Interrupt Mask Flag */
66 __u8 RNR; /* Receiver Not Ready (set by PC) */
67 __u8 XLock; /* XBuffer locked Flag */
68 __u8 Int; /* ISDN interrupt */
69 __u8 ReqCh; /* Channel field for layer-3 Requests */
70 __u8 RcCh; /* Channel field for layer-3 Returncodes */
71 __u8 IndCh; /* Channel field for layer-3 Indications */
72 __u8 MInd; /* more data indication field */
73 __u16 MLength; /* more data total packet length */
74 __u8 ReadyInt; /* request field for ready interrupt */
75 __u8 Reserved[12]; /* reserved space */
76 __u8 IfType; /* 1 = 16k-Interface */
77 __u16 Signature __attribute__ ((packed)); /* ISDN adapter Signature */
78 eicon_scom_PBUFFER XBuffer; /* Transmit Buffer */
79 eicon_scom_PBUFFER RBuffer; /* Receive Buffer */
80 } eicon_isa_com;
82 /* struct for downloading firmware */
83 typedef struct {
84 __u8 ctrl;
85 __u8 card;
86 __u8 msize;
87 __u8 fill0;
88 __u16 ebit __attribute__ ((packed));
89 __u32 eloc __attribute__ ((packed));
90 __u8 reserved[20];
91 __u16 signature __attribute__ ((packed));
92 __u8 fill[224];
93 __u8 b[256];
94 } eicon_isa_boot;
96 /* Shared memory */
97 typedef union {
98 unsigned char c[0x400];
99 eicon_isa_com com;
100 eicon_isa_boot boot;
101 } eicon_isa_shmem;
104 * card's description
106 typedef struct {
107 int ramsize;
108 int irq; /* IRQ */
109 void* card;
110 eicon_isa_shmem* shmem; /* Shared-memory area */
111 unsigned char* intack; /* Int-Acknowledge */
112 unsigned char* stopcpu; /* Writing here stops CPU */
113 unsigned char* startcpu; /* Writing here starts CPU */
114 unsigned char type; /* card type */
115 int channels; /* No. of channels */
116 unsigned char irqprobe; /* Flag: IRQ-probing */
117 unsigned char mvalid; /* Flag: Memory is valid */
118 unsigned char ivalid; /* Flag: IRQ is valid */
119 unsigned char master; /* Flag: Card ist Quadro 1/4 */
120 void* generic; /* Ptr to generic card struct */
121 } eicon_isa_card;
123 /* Offsets for special locations on standard cards */
124 #define INTACK 0x03fe
125 #define STOPCPU 0x0400
126 #define STARTCPU 0x0401
127 #define RAMSIZE 0x0400
128 /* Offsets for special location on PRI card */
129 #define INTACK_P 0x3ffc
130 #define STOPCPU_P 0x3ffe
131 #define STARTCPU_P 0x3fff
132 #define RAMSIZE_P 0x4000
135 extern int eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb);
136 extern int eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb);
137 extern void eicon_isa_release(eicon_isa_card *card);
138 extern void eicon_isa_printpar(eicon_isa_card *card);
139 extern void eicon_isa_transmit(eicon_isa_card *card);
140 extern int eicon_isa_find_card(int Mem, int Irq, char * Id);
142 #endif /* __KERNEL__ */
144 #endif /* eicon_isa_h */