OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [linux/] [b1lli.h] - Blame information for rev 1778

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 * $Id: b1lli.h,v 1.1.1.1 2001-09-10 07:43:48 simons Exp $
3
 *
4
 * ISDN lowlevel-module for AVM B1-card.
5
 *
6
 * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
7
 *
8
 * $Log: not supported by cvs2svn $
9
 * Revision 1.1.1.1  2001/07/02 17:58:00  simons
10
 * Initial revision
11
 *
12
 * Revision 1.1.2.10  1998/10/25 14:37:35  fritz
13
 * Backported from MIPS (Cobalt).
14
 *
15
 * Revision 1.1.2.9  1998/03/20 14:30:02  calle
16
 * added cardnr to detect if you try to add same T1 to different io address.
17
 * change number of nccis depending on number of channels.
18
 *
19
 * Revision 1.1.2.8  1998/03/04 17:32:33  calle
20
 * Changes for T1.
21
 *
22
 * Revision 1.1.2.7  1998/02/27 15:38:29  calle
23
 * T1 running with slow link.
24
 *
25
 * Revision 1.1.2.6  1998/02/24 17:57:36  calle
26
 * changes for T1.
27
 *
28
 * Revision 1.1.2.5  1998/01/27 16:11:50  calle
29
 * support for PCMCIA B1/M1/M2 ready.
30
 *
31
 * Revision 1.1.2.4  1998/01/26 14:51:56  calle
32
 * interface change for pcmcia cards.
33
 *
34
 * Revision 1.1.2.3  1998/01/23 16:46:45  calle
35
 * new functions for pcmcia cards.
36
 *
37
 * Revision 1.1.2.2  1997/11/26 16:57:26  calle
38
 * more changes for B1/M1/T1.
39
 *
40
 * Revision 1.1.2.1  1997/11/26 10:47:01  calle
41
 * prepared for M1 (Mobile) and T1 (PMX) cards.
42
 * prepared to set configuration after load to support other D-channel
43
 * protocols, point-to-point and leased lines.
44
 *
45
 * Revision 1.1  1997/03/04 21:27:32  calle
46
 * First version in isdn4linux
47
 *
48
 * Revision 2.2  1997/02/12 09:31:39  calle
49
 * new version
50
 *
51
 * Revision 1.1  1997/01/31 10:32:20  calle
52
 * Initial revision
53
 *
54
 */
55
 
56
#ifndef _B1LLI_H_
57
#define _B1LLI_H_
58
/*
59
 * struct for loading t4 file
60
 */
61
typedef struct avmb1_t4file {
62
        int len;
63
        unsigned char *data;
64
} avmb1_t4file;
65
 
66
typedef struct avmb1_loaddef {
67
        int contr;
68
        avmb1_t4file t4file;
69
} avmb1_loaddef;
70
 
71
typedef struct avmb1_loadandconfigdef {
72
        int contr;
73
        avmb1_t4file t4file;
74
        avmb1_t4file t4config;
75
} avmb1_loadandconfigdef;
76
 
77
typedef struct avmb1_resetdef {
78
        int contr;
79
} avmb1_resetdef;
80
 
81
typedef struct avmb1_getdef {
82
        int contr;
83
        int cardtype;
84
        int cardstate;
85
} avmb1_getdef;
86
 
87
/*
88
 * struct for adding new cards
89
 */
90
typedef struct avmb1_carddef {
91
        int port;
92
        int irq;
93
} avmb1_carddef;
94
 
95
#define AVM_CARDTYPE_B1 0
96
#define AVM_CARDTYPE_T1 1
97
#define AVM_CARDTYPE_M1 2
98
#define AVM_CARDTYPE_M2 3
99
 
100
typedef struct avmb1_extcarddef {
101
        int port;
102
        int irq;
103
        int cardtype;
104
        int cardnr;  /* for HEMA/T1 */
105
} avmb1_extcarddef;
106
 
107
#define AVMB1_LOAD              0        /* load image to card */
108
#define AVMB1_ADDCARD           1       /* add a new card */
109
#define AVMB1_RESETCARD         2       /* reset a card */
110
#define AVMB1_LOAD_AND_CONFIG   3       /* load image and config to card */
111
#define AVMB1_ADDCARD_WITH_TYPE 4       /* add a new card, with cardtype */
112
#define AVMB1_GET_CARDINFO      5       /* get cardtype */
113
#define AVMB1_REMOVECARD        6       /* remove a card (usefull for T1) */
114
 
115
 
116
 
117
/*
118
 * card states for startup
119
 */
120
 
121
#define CARD_FREE       0
122
#define CARD_DETECTED   1
123
#define CARD_LOADING    2
124
#define CARD_INITSTATE  4
125
#define CARD_RUNNING    5
126
#define CARD_ACTIVE     6
127
 
128
#ifdef __KERNEL__
129
 
130
#define AVMB1_PORTLEN           0x1f
131
 
132
#define AVM_MAXVERSION          8
133
 
134
#define AVM_NAPPS               30
135
#define AVM_NNCCI_PER_CHANNEL   4
136
 
137
/*
138
 * Main driver data
139
 */
140
 
141
typedef struct avmb1_card {
142
        struct avmb1_card *next;
143
        int cnr;
144
        unsigned int port;
145
        unsigned irq;
146
        int cardtype;
147
        int cardnr; /* for T1-HEMA */
148
        volatile unsigned short cardstate;
149
        int interrupt;
150
        int blocked;
151
        int versionlen;
152
        char versionbuf[1024];
153
        char *version[AVM_MAXVERSION];
154
        char msgbuf[128];       /* capimsg msg part */
155
        char databuf[2048];     /* capimsg data part */
156
        capi_version cversion;
157
        char name[10];
158
} avmb1_card;
159
 
160
/*
161
 * Versions
162
 */
163
 
164
#define VER_DRIVER      0
165
#define VER_CARDTYPE    1
166
#define VER_HWID        2
167
#define VER_SERIAL      3
168
#define VER_OPTION      4
169
#define VER_PROTO       5
170
#define VER_PROFILE     6
171
#define VER_CAPI        7
172
 
173
 
174
/* b1lli.c */
175
int B1_detect(unsigned int base, int cardtype);
176
int T1_detectandinit(unsigned int base, unsigned irq, int cardnr);
177
void B1_reset(unsigned int base);
178
void T1_reset(unsigned int base);
179
int B1_load_t4file(unsigned int base, avmb1_t4file * t4file);
180
int B1_load_config(unsigned int base, avmb1_t4file * config);
181
int B1_loaded(unsigned int base);
182
void B1_setinterrupt(unsigned int base, unsigned irq, int cardtype);
183
unsigned char B1_disable_irq(unsigned int base);
184
void T1_disable_irq(unsigned int base);
185
int B1_valid_irq(unsigned irq, int cardtype);
186
int B1_valid_port(unsigned port, int cardtype);
187
void B1_handle_interrupt(avmb1_card * card);
188
void B1_send_init(unsigned int port,
189
            unsigned int napps, unsigned int nncci, unsigned int cardnr);
190
void B1_send_register(unsigned int port,
191
                      __u16 appid, __u32 nmsg,
192
                      __u32 nb3conn, __u32 nb3blocks, __u32 b3bsize);
193
void B1_send_release(unsigned int port, __u16 appid);
194
void B1_send_message(unsigned int port, struct sk_buff *skb);
195
 
196
/* b1capi.c */
197
void avmb1_handle_new_ncci(avmb1_card * card,
198
                           __u16 appl, __u32 ncci, __u32 winsize);
199
void avmb1_handle_free_ncci(avmb1_card * card,
200
                            __u16 appl, __u32 ncci);
201
void avmb1_handle_capimsg(avmb1_card * card, __u16 appl, struct sk_buff *skb);
202
void avmb1_card_ready(avmb1_card * card);
203
 
204
/* standard calls, with check and allocation of resources */
205
int avmb1_addcard(int port, int irq, int cardtype);
206
int avmb1_probecard(int port, int irq, int cardtype);
207
 
208
int avmb1_resetcard(int cardnr);
209
 
210
/* calls for pcmcia driver */
211
int avmb1_detectcard(int port, int irq, int cardtype);
212
int avmb1_registercard(int port, int irq, int cardtype, int allocio);
213
int avmb1_unregistercard(int cnr, int freeio);
214
 
215
#endif                          /* __KERNEL__ */
216
 
217
#endif                          /* _B1LLI_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.