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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [drivers/] [isdn/] [hisax/] [hisax.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* $Id: hisax.h,v 1.1.1.1 2001-09-10 07:44:18 simons Exp $
2
 
3
 *   Basic declarations, defines and prototypes
4
 *
5
 * $Log: not supported by cvs2svn $
6
 * Revision 1.1.1.1  2001/07/02 17:58:32  simons
7
 * Initial revision
8
 *
9
 * Revision 1.13.2.19  1998/11/05 21:11:17  keil
10
 * AVM PnP support
11
 *
12
 * Revision 1.13.2.18  1998/11/03 00:06:33  keil
13
 * certification related changes
14
 * fixed logging for smaller stack use
15
 *
16
 * Revision 1.13.2.17  1998/10/11 19:33:48  niemann
17
 * Added new IPAC based cards.
18
 * Code cleanup and simplified (sedlbauer.c)
19
 *
20
 * Revision 1.13.2.16  1998/10/04 23:04:54  keil
21
 * ISAR works now
22
 *
23
 * Revision 1.13.2.15  1998/09/30 22:28:04  keil
24
 * more work for isar support
25
 *
26
 * Revision 1.13.2.14  1998/09/27 13:06:09  keil
27
 * Apply most changes from 2.1.X (HiSax 3.1)
28
 *
29
 * Revision 1.13.2.13  1998/08/25 14:01:30  calle
30
 * Ported driver for AVM Fritz!Card PCI from the 2.1 tree.
31
 * I could not test it.
32
 *
33
 * Revision 1.13.2.12  1998/07/15 14:43:33  calle
34
 * Support for AVM passive PCMCIA cards:
35
 *    A1 PCMCIA, FRITZ!Card PCMCIA and FRITZ!Card PCMCIA 2.0
36
 *
37
 * Revision 1.13.2.11  1998/05/27 18:05:30  keil
38
 * HiSax 3.0
39
 *
40
 * Revision 1.13.2.10  1998/04/11 18:43:16  keil
41
 * New cards
42
 *
43
 * Revision 1.13.2.9  1998/03/07 23:15:21  tsbogend
44
 * made HiSax working on Linux/Alpha
45
 *
46
 * Revision 1.13.2.8  1998/02/11 14:23:10  keil
47
 * support for Dr Neuhaus Niccy PnP and PCI
48
 *
49
 * Revision 1.13.2.7  1998/02/09 11:21:22  keil
50
 * Sedlbauer PCMCIA support from Marcus Niemann
51
 *
52
 * Revision 1.13.2.6  1998/02/03 23:16:12  keil
53
 * german AOC
54
 *
55
 * Revision 1.13.2.5  1998/01/27 22:42:42  keil
56
 * changes for new teles 16.3c and dynalink ---> asuscom
57
 *
58
 * Revision 1.13.2.4  1998/01/11 22:55:17  keil
59
 * 16.3c support
60
 *
61
 * Revision 1.13.2.3  1997/11/27 12:31:59  keil
62
 * Working netjet driver
63
 *
64
 * Revision 1.13.2.2  1997/11/15 18:55:43  keil
65
 * New init, new cards
66
 *
67
 * Revision 1.13.2.1  1997/10/17 22:13:51  keil
68
 * update to last hisax version
69
 *
70
 * Revision 2.6  1997/09/11 17:25:51  keil
71
 * Add new cards
72
 *
73
 * Revision 2.5  1997/08/03 14:36:31  keil
74
 * Implement RESTART procedure
75
 *
76
 * Revision 2.4  1997/07/31 19:25:20  keil
77
 * PTP_DATA_LINK support
78
 *
79
 * Revision 2.3  1997/07/31 11:50:17  keil
80
 * ONE TEI and FIXED TEI handling
81
 *
82
 * Revision 2.2  1997/07/30 17:13:02  keil
83
 * more changes for 'One TEI per card'
84
 *
85
 * Revision 2.1  1997/07/27 21:45:13  keil
86
 * new main structures
87
 *
88
 * Revision 2.0  1997/06/26 11:06:27  keil
89
 * New card and L1 interface.
90
 * Eicon.Diehl Diva and Dynalink IS64PH support
91
 *
92
 * old changes removed KKe
93
 *
94
 */
95
#include <linux/config.h>
96
#include <linux/module.h>
97
#include <linux/version.h>
98
#include <linux/errno.h>
99
#include <linux/fs.h>
100
#include <linux/major.h>
101
#include <asm/segment.h>
102
#include <asm/io.h>
103
#include <linux/delay.h>
104
#include <linux/kernel.h>
105
#include <linux/signal.h>
106
#include <linux/malloc.h>
107
#include <linux/mm.h>
108
#include <linux/mman.h>
109
#include <linux/ioport.h>
110
#include <linux/timer.h>
111
#include <linux/wait.h>
112
#include <linux/isdnif.h>
113
#include <linux/tty.h>
114
#include <linux/serial_reg.h>
115
 
116
#define REQUEST         0
117
#define CONFIRM         1
118
#define INDICATION      2
119
#define RESPONSE        3
120
 
121
#define HW_ENABLE       0x0000
122
#define HW_RESET        0x0004
123
#define HW_POWERUP      0x0008
124
#define HW_ACTIVATE     0x0010
125
#define HW_DEACTIVATE   0x0018
126
#define HW_INFO2        0x0020
127
#define HW_INFO3        0x0030
128
#define HW_INFO4_P8     0x0040
129
#define HW_INFO4_P10    0x0048
130
#define HW_RSYNC        0x0060
131
#define HW_TESTLOOP     0x0070
132
#define CARD_RESET      0x00F0
133
#define CARD_SETIRQ     0x00F1
134
#define CARD_INIT       0x00F2
135
#define CARD_RELEASE    0x00F3
136
#define CARD_TEST       0x00F4
137
#define CARD_AUX_IND    0x00F5
138
#define CARD_LOAD_FIRM  0x00F6
139
 
140
#define PH_ACTIVATE     0x0100
141
#define PH_DEACTIVATE   0x0110
142
#define PH_DATA         0x0120
143
#define PH_PULL         0x0130
144
#define PH_TESTLOOP     0x0140
145
#define PH_PAUSE        0x0150
146
#define MPH_ACTIVATE    0x0180
147
#define MPH_DEACTIVATE  0x0190
148
#define MPH_INFORMATION 0x01A0
149
 
150
#define DL_ESTABLISH    0x0200
151
#define DL_RELEASE      0x0210
152
#define DL_DATA         0x0220
153
#define DL_FLUSH        0x0224
154
#define DL_UNIT_DATA    0x0230
155
#define MDL_ASSIGN      0x0280
156
#define MDL_REMOVE      0x0284
157
#define MDL_ERROR       0x0288
158
#define MDL_INFO_SETUP  0x02E0
159
#define MDL_INFO_CONN   0x02E4
160
#define MDL_INFO_REL    0x02E8
161
 
162
#define CC_SETUP        0x0300
163
#define CC_RESUME       0x0304
164
#define CC_MORE_INFO    0x0310
165
#define CC_IGNORE       0x0320
166
#define CC_REJECT       0x0324
167
#define CC_SETUP_COMPL  0x0330
168
#define CC_PROCEEDING   0x0340
169
#define CC_ALERTING     0x0344
170
#define CC_CONNECT      0x0350
171
#define CC_CHARGE       0x0354
172
#define CC_DISCONNECT   0x0360
173
#define CC_RELEASE      0x0368
174
#define CC_SUSPEND      0x0370
175
#define CC_T303         0x0383
176
#define CC_T304         0x0384
177
#define CC_T305         0x0385
178
#define CC_T308_1       0x0388
179
#define CC_T308_2       0x0389
180
#define CC_T310         0x0390
181
#define CC_T313         0x0393
182
#define CC_T318         0x0398
183
#define CC_T319         0x0399
184
#define CC_NOSETUP_RSP  0x03E0
185
#define CC_SETUP_ERR    0x03E1
186
#define CC_SUSPEND_ERR  0x03E2
187
#define CC_RESUME_ERR   0x03E3
188
#define CC_CONNECT_ERR  0x03E4
189
#define CC_RELEASE_ERR  0x03E5
190
#define CC_DLRL         0x03F0
191
#define CC_RESTART      0x03F4
192
 
193
 
194
#ifdef __KERNEL__
195
 
196
#define MAX_DFRAME_LEN  260
197
#define MAX_DFRAME_LEN_L1       300
198
#define HSCX_BUFMAX     4096
199
#define MAX_DATA_SIZE   (HSCX_BUFMAX - 4)
200
#define MAX_DATA_MEM    (HSCX_BUFMAX + 64)
201
#define RAW_BUFMAX      (((HSCX_BUFMAX*6)/5) + 5)
202
#define MAX_HEADER_LEN  4
203
#define MAX_WINDOW      8
204
#define MAX_MON_FRAME   32
205
#define MAX_DLOG_SPACE  2048
206
#define MAX_BLOG_SPACE  256
207
 
208
/* #define I4L_IRQ_FLAG SA_INTERRUPT */
209
#define I4L_IRQ_FLAG    0
210
 
211
/*
212
 * Statemachine
213
 */
214
 
215
struct FsmInst;
216
 
217
typedef void (* FSMFNPTR)(struct FsmInst *, int, void *);
218
 
219
struct Fsm {
220
        FSMFNPTR *jumpmatrix;
221
        int state_count, event_count;
222
        char **strEvent, **strState;
223
};
224
 
225
struct FsmInst {
226
        struct Fsm *fsm;
227
        int state;
228
        int debug;
229
        void *userdata;
230
        int userint;
231
        void (*printdebug) (struct FsmInst *, char *, ...);
232
};
233
 
234
struct FsmNode {
235
        int state, event;
236
        void (*routine) (struct FsmInst *, int, void *);
237
};
238
 
239
struct FsmTimer {
240
        struct FsmInst *fi;
241
        struct timer_list tl;
242
        int event;
243
        void *arg;
244
};
245
 
246
struct L3Timer {
247
        struct l3_process *pc;
248
        struct timer_list tl;
249
        int event;
250
};
251
 
252
#define FLG_L1_ACTIVATING       1
253
#define FLG_L1_ACTIVATED        2
254
#define FLG_L1_DEACTTIMER       3
255
#define FLG_L1_ACTTIMER         4
256
#define FLG_L1_T3RUN            5
257
#define FLG_L1_PULL_REQ         6
258
 
259
struct Layer1 {
260
        void *hardware;
261
        struct BCState *bcs;
262
        struct PStack **stlistp;
263
        int Flags;
264
        struct FsmInst l1m;
265
        struct FsmTimer timer;
266
        void (*l1l2) (struct PStack *, int, void *);
267
        void (*l1hw) (struct PStack *, int, void *);
268
        void (*l1tei) (struct PStack *, int, void *);
269
        int mode, bc;
270
        int delay;
271
};
272
 
273
#define GROUP_TEI       127
274
#define TEI_SAPI        63
275
#define CTRL_SAPI       0
276
#define PACKET_NOACK    250
277
 
278
/* Layer2 Flags */
279
 
280
#define FLG_LAPB        0
281
#define FLG_LAPD        1
282
#define FLG_ORIG        2
283
#define FLG_MOD128      3
284
#define FLG_PEND_REL    4
285
#define FLG_L3_INIT     5
286
#define FLG_T200_RUN    6
287
#define FLG_ACK_PEND    7
288
#define FLG_REJEXC      8
289
#define FLG_OWN_BUSY    9
290
#define FLG_PEER_BUSY   10
291
#define FLG_DCHAN_BUSY  11
292
#define FLG_L1_ACTIV    12
293
#define FLG_ESTAB_PEND  13
294
#define FLG_PTP         14
295
#define FLG_FIXED_TEI   15
296
 
297
struct Layer2 {
298
        int tei;
299
        int sap;
300
        int maxlen;
301
        unsigned int flag;
302
        int vs, va, vr;
303
        int rc;
304
        int window;
305
        int sow;
306
        struct sk_buff *windowar[MAX_WINDOW];
307
        struct sk_buff_head i_queue;
308
        struct sk_buff_head ui_queue;
309
        void (*l2l1) (struct PStack *, int, void *);
310
        void (*l2l3) (struct PStack *, int, void *);
311
        void (*l2tei) (struct PStack *, int, void *);
312
        struct FsmInst l2m;
313
        struct FsmTimer t200, t203;
314
        int T200, N200, T203;
315
        int debug;
316
        char debug_id[16];
317
};
318
 
319
struct Layer3 {
320
        void (*l3l4) (struct PStack *, int, void *);
321
        void (*l3l2) (struct PStack *, int, void *);
322
        struct FsmInst l3m;
323
        struct sk_buff_head squeue;
324
        struct l3_process *proc;
325
        struct l3_process *global;
326
        int N303;
327
        int debug;
328
        char debug_id[8];
329
};
330
 
331
struct LLInterface {
332
        void (*l4l3) (struct PStack *, int, void *);
333
        void *userdata;
334
        void (*l1writewakeup) (struct PStack *, int);
335
        void (*l2writewakeup) (struct PStack *, int);
336
};
337
 
338
 
339
struct Management {
340
        int     ri;
341
        struct FsmInst tei_m;
342
        struct FsmTimer t202;
343
        int T202, N202, debug;
344
        void (*layer) (struct PStack *, int, void *);
345
};
346
 
347
 
348
struct Param {
349
        int cause;
350
        int loc;
351
        int bchannel;
352
        setup_parm setup;       /* from isdnif.h numbers and Serviceindicator */
353
        int chargeinfo;         /* Charge Info - only for 1tr6 in
354
                                 * the moment
355
                                 */
356
        int spv;                /* SPV Flag */
357
};
358
 
359
 
360
struct PStack {
361
        struct PStack *next;
362
        struct Layer1 l1;
363
        struct Layer2 l2;
364
        struct Layer3 l3;
365
        struct LLInterface lli;
366
        struct Management ma;
367
        int protocol;           /* EDSS1 or 1TR6 */
368
};
369
 
370
struct l3_process {
371
        int callref;
372
        int state;
373
        struct L3Timer timer;
374
        int N303;
375
        int debug;
376
        struct Param para;
377
        struct Channel *chan;
378
        struct PStack *st;
379
        struct l3_process *next;
380
};
381
 
382
struct hscx_hw {
383
        int hscx;
384
        int rcvidx;
385
        int count;              /* Current skb sent count */
386
        u_char *rcvbuf;         /* B-Channel receive Buffer */
387
};
388
 
389
struct isar_reg {
390
        unsigned int Flags;
391
        volatile u_char bstat;
392
        volatile u_char iis;
393
        volatile u_char cmsb;
394
        volatile u_char clsb;
395
        volatile u_char par[8];
396
};
397
 
398
struct isar_hw {
399
        int dpath;
400
        int rcvidx;
401
        int txcnt;
402
        int mml;
403
        u_char *rcvbuf;         /* B-Channel receive Buffer */
404
        struct isar_reg *reg;
405
};
406
 
407
struct hdlc_stat_reg {
408
        u_char cmd  __attribute__((packed));
409
        u_char xml  __attribute__((packed));
410
        u_char mode __attribute__((packed));
411
        u_char fill __attribute__((packed));
412
};
413
 
414
struct hdlc_hw {
415
        union {
416
                u_int ctrl;
417
                struct hdlc_stat_reg sr;
418
        } ctrl;
419
        u_int stat;
420
        int rcvidx;
421
        int count;              /* Current skb sent count */
422
        u_char *rcvbuf;         /* B-Channel receive Buffer */
423
};
424
 
425
struct hfcB_hw {
426
        unsigned int *send;
427
        int f1;
428
        int f2;
429
};
430
 
431
struct tiger_hw {
432
        u_int *send;
433
        u_int *s_irq;
434
        u_int *s_end;
435
        u_int *sendp;
436
        u_int *rec;
437
        int free;
438
        u_char *rcvbuf;
439
        u_char *sendbuf;
440
        u_char *sp;
441
        int sendcnt;
442
        u_int s_tot;
443
        u_int r_bitcnt;
444
        u_int r_tot;
445
        u_int r_err;
446
        u_int r_fcs;
447
        u_char r_state;
448
        u_char r_one;
449
        u_char r_val;
450
        u_char s_state;
451
};
452
 
453
struct amd7930_hw {
454
        u_char *tx_buff;
455
        u_char *rv_buff;
456
        int rv_buff_in;
457
        int rv_buff_out;
458
        struct sk_buff *rv_skb;
459
        struct hdlc_state *hdlc_state;
460
        struct tq_struct tq_rcv;
461
        struct tq_struct tq_xmt;
462
};
463
 
464
 
465
#define BC_FLG_INIT     1
466
#define BC_FLG_ACTIV    2
467
#define BC_FLG_BUSY     3
468
#define BC_FLG_NOFRAME  4
469
#define BC_FLG_HALF     5
470
#define BC_FLG_EMPTY    6
471
 
472
#define L1_MODE_NULL    0
473
#define L1_MODE_TRANS   1
474
#define L1_MODE_HDLC    2
475
#define L1_MODE_MODEM   7
476
 
477
struct BCState {
478
        int channel;
479
        int mode;
480
        int Flag;
481
        struct IsdnCardState *cs;
482
        int tx_cnt;             /* B-Channel transmit counter */
483
        struct sk_buff *tx_skb; /* B-Channel transmit Buffer */
484
        struct sk_buff_head rqueue;     /* B-Channel receive Queue */
485
        struct sk_buff_head squeue;     /* B-Channel send Queue */
486
        struct PStack *st;
487
        u_char *blog;
488
        struct timer_list transbusy;
489
        struct tq_struct tqueue;
490
        int event;
491
        int  (*BC_SetStack) (struct PStack *, struct BCState *);
492
        void (*BC_Close) (struct BCState *);
493
        union {
494
                struct hscx_hw hscx;
495
                struct hdlc_hw hdlc;
496
                struct isar_hw isar;
497
                struct hfcB_hw hfc;
498
                struct tiger_hw tiger;
499
                struct amd7930_hw  amd7930;
500
        } hw;
501
};
502
 
503
struct Channel {
504
        struct PStack *b_st, *d_st;
505
        struct IsdnCardState *cs;
506
        struct BCState *bcs;
507
        int chan;
508
        int incoming;
509
        struct FsmInst fi;
510
        struct FsmTimer drel_timer, dial_timer;
511
        int debug;
512
        int l2_protocol, l2_active_protocol;
513
        int l3_protocol;
514
        int data_open;
515
        struct l3_process *proc;
516
        setup_parm setup;       /* from isdnif.h numbers and Serviceindicator */
517
        int Flags;              /* for remembering action done in l4 */
518
        int leased;
519
};
520
 
521
struct elsa_hw {
522
        unsigned int base;
523
        unsigned int cfg;
524
        unsigned int ctrl;
525
        unsigned int ale;
526
        unsigned int isac;
527
        unsigned int itac;
528
        unsigned int hscx;
529
        unsigned int trig;
530
        unsigned int timer;
531
        unsigned int counter;
532
        unsigned int status;
533
        struct timer_list tl;
534
        unsigned int MFlag;
535
        struct BCState *bcs;
536
        u_char *transbuf;
537
        u_char *rcvbuf;
538
        unsigned int transp;
539
        unsigned int rcvp;
540
        unsigned int transcnt;
541
        unsigned int rcvcnt;
542
        u_char IER;
543
        u_char FCR;
544
        u_char LCR;
545
        u_char MCR;
546
        u_char ctrl_reg;
547
};
548
 
549
struct teles3_hw {
550
        unsigned int cfg_reg;
551
        signed   int isac;
552
        signed   int hscx[2];
553
        signed   int isacfifo;
554
        signed   int hscxfifo[2];
555
};
556
 
557
struct teles0_hw {
558
        unsigned int cfg_reg;
559
        unsigned int membase;
560
};
561
 
562
struct avm_hw {
563
        unsigned int cfg_reg;
564
        unsigned int isac;
565
        unsigned int hscx[2];
566
        unsigned int isacfifo;
567
        unsigned int hscxfifo[2];
568
        unsigned int counter;
569
};
570
 
571
struct ix1_hw {
572
        unsigned int cfg_reg;
573
        unsigned int isac_ale;
574
        unsigned int isac;
575
        unsigned int hscx_ale;
576
        unsigned int hscx;
577
};
578
 
579
struct diva_hw {
580
        unsigned int cfg_reg;
581
        unsigned int ctrl;
582
        unsigned int isac_adr;
583
        unsigned int isac;
584
        unsigned int hscx_adr;
585
        unsigned int hscx;
586
        unsigned int status;
587
        struct timer_list tl;
588
        u_char ctrl_reg;
589
};
590
 
591
struct asus_hw {
592
        unsigned int cfg_reg;
593
        unsigned int adr;
594
        unsigned int isac;
595
        unsigned int hscx;
596
        unsigned int u7;
597
        unsigned int pots;
598
};
599
 
600
 
601
struct hfc_hw {
602
        unsigned int addr;
603
        unsigned int fifosize;
604
        unsigned char cirm;
605
        unsigned char ctmt;
606
        unsigned char cip;
607
        u_char isac_spcr;
608
        struct timer_list timer;
609
};
610
 
611
struct sedl_hw {
612
        unsigned int cfg_reg;
613
        unsigned int adr;
614
        unsigned int isac;
615
        unsigned int hscx;
616
        unsigned int reset_on;
617
        unsigned int reset_off;
618
        struct isar_reg isar;
619
        unsigned int chip;
620
        unsigned int bus;
621
};
622
 
623
struct spt_hw {
624
        unsigned int cfg_reg;
625
        unsigned int isac;
626
        unsigned int hscx[2];
627
        unsigned char res_irq;
628
};
629
 
630
struct mic_hw {
631
        unsigned int cfg_reg;
632
        unsigned int adr;
633
        unsigned int isac;
634
        unsigned int hscx;
635
};
636
 
637
struct njet_hw {
638
        unsigned int base;
639
        unsigned int isac;
640
        unsigned int auxa;
641
        unsigned char auxd;
642
        unsigned char dmactrl;
643
        unsigned char ctrl_reg;
644
        unsigned char irqmask0;
645
        unsigned char irqstat0;
646
        unsigned char last_is0;
647
};
648
 
649
struct hfcD_hw {
650
        unsigned int addr;
651
        unsigned int bfifosize;
652
        unsigned int dfifosize;
653
        unsigned char cirm;
654
        unsigned char ctmt;
655
        unsigned char cip;
656
        unsigned char conn;
657
        unsigned char mst_m;
658
        unsigned char int_m1;
659
        unsigned char int_m2;
660
        unsigned char int_s1;
661
        unsigned char sctrl;
662
        unsigned char stat;
663
        unsigned char fifo;
664
        unsigned char f1;
665
        unsigned char f2;
666
        unsigned int *send;
667
        struct timer_list timer;
668
};
669
 
670
#define HW_IOM1         0
671
#define HW_IPAC         1
672
#define HW_ISAR         2
673
#define FLG_TWO_DCHAN   4
674
#define FLG_L1_DBUSY    5
675
#define FLG_DBUSY_TIMER 6
676
#define FLG_LOCK_ATOMIC 7
677
#define HW_MON0_RX_END  8
678
#define HW_MON1_RX_END  9
679
#define HW_MON0_TX_END  10
680
#define HW_MON1_TX_END  11
681
 
682
struct IsdnCardState {
683
        unsigned char typ;
684
        unsigned char subtyp;
685
        int protocol;
686
        unsigned int irq;
687
        int HW_Flags;
688
        int *busy_flag;
689
        union {
690
                struct elsa_hw elsa;
691
                struct teles0_hw teles0;
692
                struct teles3_hw teles3;
693
                struct avm_hw avm;
694
                struct ix1_hw ix1;
695
                struct diva_hw diva;
696
                struct asus_hw asus;
697
                struct hfc_hw hfc;
698
                struct sedl_hw sedl;
699
                struct spt_hw spt;
700
                struct mic_hw mic;
701
                struct njet_hw njet;
702
                struct hfcD_hw hfcD;
703
                struct ix1_hw niccy;
704
        } hw;
705
        int myid;
706
        isdn_if iif;
707
        u_char *status_buf;
708
        u_char *status_read;
709
        u_char *status_write;
710
        u_char *status_end;
711
        u_char (*readisac) (struct IsdnCardState *, u_char);
712
        void   (*writeisac) (struct IsdnCardState *, u_char, u_char);
713
        void   (*readisacfifo) (struct IsdnCardState *, u_char *, int);
714
        void   (*writeisacfifo) (struct IsdnCardState *, u_char *, int);
715
        u_char (*BC_Read_Reg) (struct IsdnCardState *, int, u_char);
716
        void   (*BC_Write_Reg) (struct IsdnCardState *, int, u_char, u_char);
717
        void   (*BC_Send_Data) (struct BCState *);
718
        int    (*cardmsg) (struct IsdnCardState *, int, void *);
719
        struct Channel channel[2];
720
        struct BCState bcs[2];
721
        struct PStack *stlist;
722
        u_char *rcvbuf;
723
        int rcvidx;
724
        struct sk_buff *tx_skb;
725
        int tx_cnt;
726
        int event;
727
        struct tq_struct tqueue;
728
        struct timer_list dbusytimer;
729
        struct sk_buff_head rq, sq; /* D-channel queues */
730
        int ph_state;
731
        int cardnr;
732
        char *dlog;
733
        int debug;
734
        u_char *mon_tx;
735
        u_char *mon_rx;
736
        int mon_txp;
737
        int mon_txc;
738
        int mon_rxp;
739
        u_char mocr;
740
        void   (*setstack_d) (struct PStack *, struct IsdnCardState *);
741
};
742
 
743
#define  MON0_RX        1
744
#define  MON1_RX        2
745
#define  MON0_TX        4
746
#define  MON1_TX        8
747
 
748
#define  HISAX_MAX_CARDS        8
749
 
750
#define  ISDN_CTYPE_16_0        1
751
#define  ISDN_CTYPE_8_0         2
752
#define  ISDN_CTYPE_16_3        3
753
#define  ISDN_CTYPE_PNP         4
754
#define  ISDN_CTYPE_A1          5
755
#define  ISDN_CTYPE_ELSA        6
756
#define  ISDN_CTYPE_ELSA_PNP    7
757
#define  ISDN_CTYPE_TELESPCMCIA 8
758
#define  ISDN_CTYPE_IX1MICROR2  9
759
#define  ISDN_CTYPE_ELSA_PCMCIA 10
760
#define  ISDN_CTYPE_DIEHLDIVA   11
761
#define  ISDN_CTYPE_ASUSCOM     12
762
#define  ISDN_CTYPE_TELEINT     13
763
#define  ISDN_CTYPE_TELES3C     14
764
#define  ISDN_CTYPE_SEDLBAUER   15
765
#define  ISDN_CTYPE_SPORTSTER   16
766
#define  ISDN_CTYPE_MIC         17
767
#define  ISDN_CTYPE_ELSA_PCI    18
768
#define  ISDN_CTYPE_COMPAQ_ISA  19
769
#define  ISDN_CTYPE_NETJET      20
770
#define  ISDN_CTYPE_TELESPCI    21
771
#define  ISDN_CTYPE_SEDLBAUER_PCMCIA    22
772
#define  ISDN_CTYPE_AMD7930     23
773
#define  ISDN_CTYPE_NICCY       24
774
#define  ISDN_CTYPE_S0BOX       25
775
#define  ISDN_CTYPE_A1_PCMCIA   26
776
#define  ISDN_CTYPE_FRITZPCI    27
777
#define  ISDN_CTYPE_SEDLBAUER_FAX     28
778
 
779
#define  ISDN_CTYPE_COUNT       28
780
 
781
#ifdef ISDN_CHIP_ISAC
782
#undef ISDN_CHIP_ISAC
783
#endif
784
 
785
#ifndef __initfunc
786
#define __initfunc(__arginit) __arginit
787
#endif
788
 
789
#ifndef __initdata
790
#define __initdata
791
#endif
792
 
793
#define HISAX_INITFUNC(__arginit) __initfunc(__arginit)
794
#define HISAX_INITDATA __initdata
795
 
796
#ifdef  CONFIG_HISAX_16_0
797
#define  CARD_TELES0 (1<< ISDN_CTYPE_16_0) | (1<< ISDN_CTYPE_8_0)
798
#ifndef ISDN_CHIP_ISAC
799
#define ISDN_CHIP_ISAC 1
800
#endif
801
#else
802
#define  CARD_TELES0  0
803
#endif
804
 
805
#ifdef  CONFIG_HISAX_16_3
806
#define  CARD_TELES3 (1<< ISDN_CTYPE_16_3) | (1<< ISDN_CTYPE_PNP) | \
807
                     (1<< ISDN_CTYPE_TELESPCMCIA) | (1<< ISDN_CTYPE_COMPAQ_ISA)
808
#ifndef ISDN_CHIP_ISAC
809
#define ISDN_CHIP_ISAC 1
810
#endif
811
#else
812
#define  CARD_TELES3  0
813
#endif
814
 
815
#ifdef  CONFIG_HISAX_TELESPCI
816
#define  CARD_TELESPCI (1<< ISDN_CTYPE_TELESPCI)
817
#ifndef ISDN_CHIP_ISAC
818
#define ISDN_CHIP_ISAC 1
819
#endif
820
#else
821
#define  CARD_TELESPCI  0
822
#endif
823
 
824
#ifdef  CONFIG_HISAX_AVM_A1
825
#define  CARD_AVM_A1 (1<< ISDN_CTYPE_A1)
826
#ifndef ISDN_CHIP_ISAC
827
#define ISDN_CHIP_ISAC 1
828
#endif
829
#else
830
#define  CARD_AVM_A1  0
831
#endif
832
 
833
#ifdef  CONFIG_HISAX_AVM_A1_PCMCIA
834
#define  CARD_AVM_A1_PCMCIA (1<< ISDN_CTYPE_A1_PCMCIA)
835
#ifndef ISDN_CHIP_ISAC
836
#define ISDN_CHIP_ISAC 1
837
#endif
838
#else
839
#define  CARD_AVM_A1_PCMCIA  0
840
#endif
841
 
842
#ifdef  CONFIG_HISAX_FRITZPCI
843
#define  CARD_FRITZPCI (1<< ISDN_CTYPE_FRITZPCI)
844
#ifndef ISDN_CHIP_ISAC
845
#define ISDN_CHIP_ISAC 1
846
#endif
847
#else
848
#define  CARD_FRITZPCI  0
849
#endif
850
 
851
#ifdef  CONFIG_HISAX_ELSA
852
#define  CARD_ELSA (1<< ISDN_CTYPE_ELSA) | (1<< ISDN_CTYPE_ELSA_PNP) | \
853
                   (1<< ISDN_CTYPE_ELSA_PCMCIA) | (1<< ISDN_CTYPE_ELSA_PCI)
854
#ifndef ISDN_CHIP_ISAC
855
#define ISDN_CHIP_ISAC 1
856
#endif
857
#undef HISAX_INITFUNC
858
#define HISAX_INITFUNC(__arginit) __arginit
859
#undef HISAX_INITDATA
860
#define HISAX_INITDATA
861
#else
862
#define  CARD_ELSA  0
863
#endif
864
 
865
 
866
#ifdef  CONFIG_HISAX_IX1MICROR2
867
#define CARD_IX1MICROR2 (1 << ISDN_CTYPE_IX1MICROR2)
868
#ifndef ISDN_CHIP_ISAC
869
#define ISDN_CHIP_ISAC 1
870
#endif
871
#else
872
#define CARD_IX1MICROR2 0
873
#endif
874
 
875
#ifdef  CONFIG_HISAX_DIEHLDIVA
876
#define CARD_DIEHLDIVA (1 << ISDN_CTYPE_DIEHLDIVA)
877
#ifndef ISDN_CHIP_ISAC
878
#define ISDN_CHIP_ISAC 1
879
#endif
880
#else
881
#define CARD_DIEHLDIVA 0
882
#endif
883
 
884
#ifdef  CONFIG_HISAX_ASUSCOM
885
#define CARD_ASUSCOM (1 << ISDN_CTYPE_ASUSCOM)
886
#ifndef ISDN_CHIP_ISAC
887
#define ISDN_CHIP_ISAC 1
888
#endif
889
#else
890
#define CARD_ASUSCOM 0
891
#endif
892
 
893
#ifdef  CONFIG_HISAX_TELEINT
894
#define CARD_TELEINT (1 << ISDN_CTYPE_TELEINT)
895
#ifndef ISDN_CHIP_ISAC
896
#define ISDN_CHIP_ISAC 1
897
#endif
898
#else
899
#define CARD_TELEINT 0
900
#endif
901
 
902
#ifdef  CONFIG_HISAX_SEDLBAUER
903
#define CARD_SEDLBAUER (1 << ISDN_CTYPE_SEDLBAUER) | (1 << ISDN_CTYPE_SEDLBAUER_PCMCIA) | ( 1 << ISDN_CTYPE_SEDLBAUER_FAX)
904
#ifndef ISDN_CHIP_ISAC
905
#define ISDN_CHIP_ISAC 1
906
#endif
907
#else
908
#define CARD_SEDLBAUER 0
909
#endif
910
 
911
#ifdef  CONFIG_HISAX_SPORTSTER
912
#define CARD_SPORTSTER (1 << ISDN_CTYPE_SPORTSTER)
913
#ifndef ISDN_CHIP_ISAC
914
#define ISDN_CHIP_ISAC 1
915
#endif
916
#else
917
#define CARD_SPORTSTER 0
918
#endif
919
 
920
#ifdef  CONFIG_HISAX_MIC
921
#define CARD_MIC (1 << ISDN_CTYPE_MIC)
922
#ifndef ISDN_CHIP_ISAC
923
#define ISDN_CHIP_ISAC 1
924
#endif
925
#else
926
#define CARD_MIC 0
927
#endif
928
 
929
#ifdef  CONFIG_HISAX_NETJET
930
#define CARD_NETJET (1 << ISDN_CTYPE_NETJET)
931
#ifndef ISDN_CHIP_ISAC
932
#define ISDN_CHIP_ISAC 1
933
#endif
934
#else
935
#define CARD_NETJET 0
936
#endif
937
 
938
#ifdef  CONFIG_HISAX_TELES3C
939
#define  CARD_TELES3C (1<< ISDN_CTYPE_TELES3C)
940
#else
941
#define  CARD_TELES3C  0
942
#endif
943
 
944
#ifdef  CONFIG_HISAX_AMD7930
945
#define CARD_AMD7930 (1 << ISDN_CTYPE_AMD7930)
946
#else
947
#define CARD_AMD7930 0
948
#endif
949
 
950
#ifdef  CONFIG_HISAX_NICCY
951
#define CARD_NICCY (1 << ISDN_CTYPE_NICCY)
952
#ifndef ISDN_CHIP_ISAC
953
#define ISDN_CHIP_ISAC 1
954
#endif
955
#else
956
#define CARD_NICCY 0
957
#endif
958
 
959
#ifdef  CONFIG_HISAX_S0BOX
960
#define CARD_S0BOX (1 << ISDN_CTYPE_S0BOX)
961
#ifndef ISDN_CHIP_ISAC
962
#define ISDN_CHIP_ISAC 1
963
#endif
964
#else
965
#define CARD_S0BOX 0
966
#endif
967
 
968
#define  SUPORTED_CARDS  (CARD_TELES0 | CARD_TELES3 | CARD_AVM_A1 | CARD_ELSA \
969
                         | CARD_IX1MICROR2 | CARD_DIEHLDIVA | CARD_ASUSCOM \
970
                         | CARD_TELEINT | CARD_SEDLBAUER | CARD_SPORTSTER \
971
                         | CARD_MIC | CARD_NETJET | CARD_TELES3C | CARD_AMD7930 \
972
                         | CARD_AVM_A1_PCMCIA | CARD_FRITZPCI\
973
                         | CARD_NICCY | CARD_S0BOX | CARD_TELESPCI)
974
 
975
#define TEI_PER_CARD 0
976
 
977
#ifdef CONFIG_HISAX_1TR6
978
#undef TEI_PER_CARD
979
#define TEI_PER_CARD 1
980
#endif
981
 
982
#ifdef CONFIG_HISAX_EURO
983
#undef TEI_PER_CARD
984
#define TEI_PER_CARD 1
985
#define HISAX_EURO_SENDCOMPLETE 1
986
#define EXT_BEARER_CAPS 1
987
#define HISAX_SEND_STD_LLC_IE 1
988
#ifdef  CONFIG_HISAX_NO_SENDCOMPLETE
989
#undef HISAX_EURO_SENDCOMPLETE
990
#endif
991
#ifdef  CONFIG_HISAX_NO_LLC
992
#undef HISAX_SEND_STD_LLC_IE
993
#endif
994
#undef HISAX_DE_AOC
995
#ifdef CONFIG_DE_AOC
996
#define HISAX_DE_AOC 1
997
#endif
998
#endif
999
 
1000
/* L1 Debug */
1001
#define L1_DEB_WARN             0x01
1002
#define L1_DEB_INTSTAT          0x02
1003
#define L1_DEB_ISAC             0x04
1004
#define L1_DEB_ISAC_FIFO        0x08
1005
#define L1_DEB_HSCX             0x10
1006
#define L1_DEB_HSCX_FIFO        0x20
1007
#define L1_DEB_LAPD             0x40
1008
#define L1_DEB_IPAC             0x80
1009
#define L1_DEB_RECEIVE_FRAME    0x100
1010
#define L1_DEB_MONITOR          0x200
1011
#define DEB_DLOG_HEX            0x400
1012
#define DEB_DLOG_VERBOSE        0x800
1013
 
1014
#define L2FRAME_DEBUG
1015
 
1016
#ifdef L2FRAME_DEBUG
1017
extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, int dir);
1018
#endif
1019
 
1020
struct IsdnCard {
1021
        int typ;
1022
        int protocol;           /* EDSS1 or 1TR6 */
1023
        unsigned int para[4];
1024
        struct IsdnCardState *cs;
1025
};
1026
 
1027
void init_bcstate(struct IsdnCardState *cs, int bc);
1028
 
1029
void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs);
1030
unsigned int random_ri(void);
1031
void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st);
1032
void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st);
1033
 
1034
void setstack_l1_B(struct PStack *st);
1035
 
1036
void setstack_tei(struct PStack *st);
1037
void setstack_manager(struct PStack *st);
1038
 
1039
void setstack_isdnl2(struct PStack *st, char *debug_id);
1040
void releasestack_isdnl2(struct PStack *st);
1041
void setstack_transl2(struct PStack *st);
1042
void releasestack_transl2(struct PStack *st);
1043
 
1044
void setstack_l3dc(struct PStack *st, struct Channel *chanp);
1045
void setstack_l3bc(struct PStack *st, struct Channel *chanp);
1046
void releasestack_isdnl3(struct PStack *st);
1047
 
1048
u_char *findie(u_char * p, int size, u_char ie, int wanted_set);
1049
int getcallref(u_char * p);
1050
int newcallref(void);
1051
 
1052
void FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
1053
void FsmFree(struct Fsm *fsm);
1054
int FsmEvent(struct FsmInst *fi, int event, void *arg);
1055
void FsmChangeState(struct FsmInst *fi, int newstate);
1056
void FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft);
1057
int FsmAddTimer(struct FsmTimer *ft, int millisec, int event,
1058
        void *arg, int where);
1059
void FsmRestartTimer(struct FsmTimer *ft, int millisec, int event,
1060
        void *arg, int where);
1061
void FsmDelTimer(struct FsmTimer *ft, int where);
1062
int jiftime(char *s, long mark);
1063
 
1064
int HiSax_command(isdn_ctrl * ic);
1065
int HiSax_writebuf_skb(int id, int chan, struct sk_buff *skb);
1066
void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
1067
void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
1068
void HiSax_reportcard(int cardnr);
1069
int QuickHex(char *txt, u_char * p, int cnt);
1070
void LogFrame(struct IsdnCardState *cs, u_char * p, int size);
1071
void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir);
1072
void iecpy(u_char * dest, u_char * iestart, int ieoffset);
1073
int discard_queue(struct sk_buff_head *q);
1074
#ifdef ISDN_CHIP_ISAC
1075
void setstack_isac(struct PStack *st, struct IsdnCardState *cs);
1076
#endif  /* ISDN_CHIP_ISAC */
1077
#endif  /* __KERNEL__ */
1078
 
1079
#define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);}
1080
 
1081
int ll_run(struct IsdnCardState *cs);
1082
void ll_stop(struct IsdnCardState *cs);
1083
void CallcNew(void);
1084
void CallcFree(void);
1085
int CallcNewChan(struct IsdnCardState *cs);
1086
void CallcFreeChan(struct IsdnCardState *cs);
1087
void Isdnl1New(void);
1088
void Isdnl1Free(void);
1089
void Isdnl2New(void);
1090
void Isdnl2Free(void);
1091
void Isdnl3New(void);
1092
void Isdnl3Free(void);
1093
void init_tei(struct IsdnCardState *cs, int protocol);
1094
void release_tei(struct IsdnCardState *cs);
1095
char *HiSax_getrev(const char *revision);
1096
void TeiNew(void);
1097
void TeiFree(void);
1098
int certification_check(int output);

powered by: WebSVN 2.1.0

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