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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [b1lli.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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