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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [isdn/] [hisax/] [hisax.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

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