Linux 2.2.0
[davej-history.git] / include / linux / b1lli.h
blobf564ae89884dd3af26bef69a276a0a5e5b4f710d
1 /*
2 * $Id: b1lli.h,v 1.3 1998/01/31 10:54:37 calle Exp $
4 * ISDN lowlevel-module for AVM B1-card.
6 * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
8 * $Log: b1lli.h,v $
9 * Revision 1.3 1998/01/31 10:54:37 calle
10 * include changes for PCMCIA cards from 2.0 version
12 * Revision 1.2 1997/12/10 19:38:42 calle
13 * get changes from 2.0 tree
15 * Revision 1.1.2.2 1997/11/26 16:57:26 calle
16 * more changes for B1/M1/T1.
18 * Revision 1.1.2.1 1997/11/26 10:47:01 calle
19 * prepared for M1 (Mobile) and T1 (PMX) cards.
20 * prepared to set configuration after load to support other D-channel
21 * protocols, point-to-point and leased lines.
23 * Revision 1.1 1997/03/04 21:27:32 calle
24 * First version in isdn4linux
26 * Revision 2.2 1997/02/12 09:31:39 calle
27 * new version
29 * Revision 1.1 1997/01/31 10:32:20 calle
30 * Initial revision
34 #ifndef _B1LLI_H_
35 #define _B1LLI_H_
37 * struct for loading t4 file
39 typedef struct avmb1_t4file {
40 int len;
41 unsigned char *data;
42 } avmb1_t4file;
44 typedef struct avmb1_loaddef {
45 int contr;
46 avmb1_t4file t4file;
47 } avmb1_loaddef;
49 typedef struct avmb1_loadandconfigdef {
50 int contr;
51 avmb1_t4file t4file;
52 avmb1_t4file t4config;
53 } avmb1_loadandconfigdef;
55 typedef struct avmb1_resetdef {
56 int contr;
57 } avmb1_resetdef;
59 typedef struct avmb1_getdef {
60 int contr;
61 int cardtype;
62 int cardstate;
63 } avmb1_getdef;
66 * struct for adding new cards
68 typedef struct avmb1_carddef {
69 int port;
70 int irq;
71 } avmb1_carddef;
73 #define AVM_CARDTYPE_B1 0
74 #define AVM_CARDTYPE_T1 1
75 #define AVM_CARDTYPE_M1 2
76 #define AVM_CARDTYPE_M2 3
78 typedef struct avmb1_extcarddef {
79 int port;
80 int irq;
81 int cardtype;
82 } avmb1_extcarddef;
84 #define AVMB1_LOAD 0 /* load image to card */
85 #define AVMB1_ADDCARD 1 /* add a new card */
86 #define AVMB1_RESETCARD 2 /* reset a card */
87 #define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */
88 #define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */
89 #define AVMB1_GET_CARDINFO 5 /* get cardtype */
94 * card states for startup
97 #define CARD_FREE 0
98 #define CARD_DETECTED 1
99 #define CARD_LOADING 2
100 #define CARD_INITSTATE 4
101 #define CARD_RUNNING 5
102 #define CARD_ACTIVE 6
104 #ifdef __KERNEL__
106 #define AVMB1_PORTLEN 0x1f
108 #define AVM_MAXVERSION 8
109 #define AVM_NBCHAN 2
111 #define AVM_NAPPS 30
112 #define AVM_NPLCI 5
113 #define AVM_NNCCI 6
116 * Main driver data
119 typedef struct avmb1_card {
120 struct avmb1_card *next;
121 int cnr;
122 unsigned short port;
123 unsigned irq;
124 int cardtype;
125 volatile unsigned short cardstate;
126 int interrupt;
127 int blocked;
128 int versionlen;
129 char versionbuf[1024];
130 char *version[AVM_MAXVERSION];
131 char msgbuf[128]; /* capimsg msg part */
132 char databuf[2048]; /* capimsg data part */
133 capi_version cversion;
134 char name[10];
135 } avmb1_card;
138 * Versions
141 #define VER_DRIVER 0
142 #define VER_CARDTYPE 1
143 #define VER_HWID 2
144 #define VER_SERIAL 3
145 #define VER_OPTION 4
146 #define VER_PROTO 5
147 #define VER_PROFILE 6
148 #define VER_CAPI 7
151 /* b1lli.c */
152 int B1_detect(unsigned short base, int cardtype);
153 void B1_reset(unsigned short base);
154 int B1_load_t4file(unsigned short base, avmb1_t4file * t4file);
155 int B1_load_config(unsigned short base, avmb1_t4file * config);
156 int B1_loaded(unsigned short base);
157 unsigned char B1_assign_irq(unsigned short base, unsigned irq, int cardtype);
158 unsigned char B1_enable_irq(unsigned short base);
159 unsigned char B1_disable_irq(unsigned short base);
160 int B1_valid_irq(unsigned irq, int cardtype);
161 void B1_handle_interrupt(avmb1_card * card);
162 void B1_send_init(unsigned short port,
163 unsigned int napps, unsigned int nncci, unsigned int cardnr);
164 void B1_send_register(unsigned short port,
165 __u16 appid, __u32 nmsg,
166 __u32 nb3conn, __u32 nb3blocks, __u32 b3bsize);
167 void B1_send_release(unsigned short port, __u16 appid);
168 void B1_send_message(unsigned short port, struct sk_buff *skb);
170 /* b1capi.c */
171 void avmb1_handle_new_ncci(avmb1_card * card,
172 __u16 appl, __u32 ncci, __u32 winsize);
173 void avmb1_handle_free_ncci(avmb1_card * card,
174 __u16 appl, __u32 ncci);
175 void avmb1_handle_capimsg(avmb1_card * card, __u16 appl, struct sk_buff *skb);
176 void avmb1_card_ready(avmb1_card * card);
178 /* standard calls, with check and allocation of resources */
179 int avmb1_addcard(int port, int irq, int cardtype);
180 int avmb1_probecard(int port, int irq, int cardtype);
183 int avmb1_resetcard(int cardnr);
185 /* calls for pcmcia driver */
186 int avmb1_detectcard(int port, int irq, int cardtype);
187 int avmb1_registercard(int port, int irq, int cardtype, int allocio);
188 int avmb1_unregistercard(int cnr, int freeio);
190 #endif /* __KERNEL__ */
192 #endif /* _B1LLI_H_ */