Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / drivers / isdn / eicon / eicon_isa.h
blob1c8034f77786e6412b0611418764e88a39ef5ebd
1 /* $Id: eicon_isa.h,v 1.10 2000/05/07 08:51:04 armin Exp $
3 * ISDN low-level module for Eicon active ISDN-Cards.
5 * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
6 * Copyright 1998-2000 by Armin Schindler (mac@melware.de)
7 * Copyright 1999,2000 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.
25 #ifndef eicon_isa_h
26 #define eicon_isa_h
28 #ifdef __KERNEL__
29 #include <linux/config.h>
31 /* Factory defaults for ISA-Cards */
32 #define EICON_ISA_MEMBASE 0xd0000
33 #define EICON_ISA_IRQ 3
34 /* shmem offset for Quadro parts */
35 #define EICON_ISA_QOFFSET 0x0800
37 typedef struct {
38 __u16 length __attribute__ ((packed)); /* length of data/parameter field */
39 __u8 P[270]; /* data/parameter field */
40 } eicon_scom_PBUFFER;
42 /* General communication buffer */
43 typedef struct {
44 __u8 Req; /* request register */
45 __u8 ReqId; /* request task/entity identification */
46 __u8 Rc; /* return code register */
47 __u8 RcId; /* return code task/entity identification */
48 __u8 Ind; /* Indication register */
49 __u8 IndId; /* Indication task/entity identification */
50 __u8 IMask; /* Interrupt Mask Flag */
51 __u8 RNR; /* Receiver Not Ready (set by PC) */
52 __u8 XLock; /* XBuffer locked Flag */
53 __u8 Int; /* ISDN interrupt */
54 __u8 ReqCh; /* Channel field for layer-3 Requests */
55 __u8 RcCh; /* Channel field for layer-3 Returncodes */
56 __u8 IndCh; /* Channel field for layer-3 Indications */
57 __u8 MInd; /* more data indication field */
58 __u16 MLength; /* more data total packet length */
59 __u8 ReadyInt; /* request field for ready interrupt */
60 __u8 Reserved[12]; /* reserved space */
61 __u8 IfType; /* 1 = 16k-Interface */
62 __u16 Signature __attribute__ ((packed)); /* ISDN adapter Signature */
63 eicon_scom_PBUFFER XBuffer; /* Transmit Buffer */
64 eicon_scom_PBUFFER RBuffer; /* Receive Buffer */
65 } eicon_isa_com;
67 /* struct for downloading firmware */
68 typedef struct {
69 __u8 ctrl;
70 __u8 card;
71 __u8 msize;
72 __u8 fill0;
73 __u16 ebit __attribute__ ((packed));
74 __u32 eloc __attribute__ ((packed));
75 __u8 reserved[20];
76 __u16 signature __attribute__ ((packed));
77 __u8 fill[224];
78 __u8 b[256];
79 } eicon_isa_boot;
81 /* Shared memory */
82 typedef union {
83 unsigned char c[0x400];
84 eicon_isa_com com;
85 eicon_isa_boot boot;
86 } eicon_isa_shmem;
89 * card's description
91 typedef struct {
92 int ramsize;
93 int irq; /* IRQ */
94 unsigned long physmem; /* physical memory address */
95 #ifdef CONFIG_MCA
96 int io; /* IO-port for MCA brand */
97 #endif /* CONFIG_MCA */
98 void* card;
99 eicon_isa_shmem* shmem; /* Shared-memory area */
100 unsigned char* intack; /* Int-Acknowledge */
101 unsigned char* stopcpu; /* Writing here stops CPU */
102 unsigned char* startcpu; /* Writing here starts CPU */
103 unsigned char type; /* card type */
104 int channels; /* No. of channels */
105 unsigned char irqprobe; /* Flag: IRQ-probing */
106 unsigned char mvalid; /* Flag: Memory is valid */
107 unsigned char ivalid; /* Flag: IRQ is valid */
108 unsigned char master; /* Flag: Card ist Quadro 1/4 */
109 } eicon_isa_card;
111 /* Offsets for special locations on standard cards */
112 #define INTACK 0x03fe
113 #define STOPCPU 0x0400
114 #define STARTCPU 0x0401
115 #define RAMSIZE 0x0400
116 /* Offsets for special location on PRI card */
117 #define INTACK_P 0x3ffc
118 #define STOPCPU_P 0x3ffe
119 #define STARTCPU_P 0x3fff
120 #define RAMSIZE_P 0x4000
123 extern int eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb);
124 extern int eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb);
125 extern void eicon_isa_release(eicon_isa_card *card);
126 extern void eicon_isa_printpar(eicon_isa_card *card);
127 extern void eicon_isa_transmit(eicon_isa_card *card);
128 extern int eicon_isa_find_card(int Mem, int Irq, char * Id);
130 #endif /* __KERNEL__ */
132 #endif /* eicon_isa_h */