1 /* $Id: hisax.h,v 2.26 1998/11/15 23:54:45 keil Exp $
3 * Basic declarations, defines and prototypes
6 * Revision 2.26 1998/11/15 23:54:45 keil
9 * Revision 2.25 1998/09/30 22:28:42 keil
10 * More work for ISAR support
12 * Revision 2.24 1998/08/20 13:50:39 keil
13 * More support for hybrid modem (not working yet)
15 * Revision 2.23 1998/08/13 23:36:31 keil
16 * HiSax 3.1 - don't work stable with current LinkLevel
18 * Revision 2.22 1998/07/15 15:01:28 calle
19 * Support for AVM passive PCMCIA cards:
20 * A1 PCMCIA, FRITZ!Card PCMCIA and FRITZ!Card PCMCIA 2.0
22 * Revision 2.21 1998/05/25 14:10:05 keil
24 * X.75 and leased are working again.
26 * Revision 2.20 1998/05/25 12:57:57 keil
27 * HiSax golden code from certification, Don't use !!!
28 * No leased lines, no X75, but many changes.
30 * Revision 2.19 1998/04/15 16:39:15 keil
31 * Add S0Box and Teles PCI support
33 * Revision 2.18 1998/03/26 07:10:04 paul
34 * The jumpmatrix table in struct Fsm was an array of "int". This is not
35 * large enough for pointers to functions on Linux/Alpha (instant crash
36 * on "insmod hisax). Now there is a typedef for the pointer to function.
37 * This also prevents warnings about "incompatible pointer types".
39 * Revision 2.17 1998/03/19 13:18:43 keil
40 * Start of a CAPI like interface for supplementary Service
41 * first service: SUSPEND
43 * Revision 2.16 1998/03/09 23:19:25 keil
46 * Revision 2.14 1998/02/11 17:28:04 keil
47 * Niccy PnP/PCI support
49 * Revision 2.13 1998/02/09 18:46:02 keil
50 * Support for Sedlbauer PCMCIA (Marcus Niemann)
52 * Revision 2.12 1998/02/03 23:31:30 keil
55 * Revision 2.11 1998/02/02 13:33:00 keil
58 * Revision 2.10 1997/11/08 21:37:52 keil
59 * new l1 init;new Compaq card
61 * Revision 2.9 1997/11/06 17:09:09 keil
64 * Revision 2.8 1997/10/29 19:04:13 keil
65 * new L1; changes for 2.1
67 * Revision 2.7 1997/10/10 20:56:47 fritz
70 * Revision 2.6 1997/09/11 17:25:51 keil
73 * Revision 2.5 1997/08/03 14:36:31 keil
74 * Implement RESTART procedure
76 * Revision 2.4 1997/07/31 19:25:20 keil
77 * PTP_DATA_LINK support
79 * Revision 2.3 1997/07/31 11:50:17 keil
80 * ONE TEI and FIXED TEI handling
82 * Revision 2.2 1997/07/30 17:13:02 keil
83 * more changes for 'One TEI per card'
85 * Revision 2.1 1997/07/27 21:45:13 keil
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
92 * old changes removed KKe
95 #include <linux/config.h>
96 #include <linux/module.h>
97 #include <linux/version.h>
98 #include <linux/errno.h>
100 #include <linux/major.h>
101 #include <asm/segment.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/init.h>
115 #include <linux/serialP.h>
122 #define HW_ENABLE 0x0000
123 #define HW_RESET 0x0004
124 #define HW_POWERUP 0x0008
125 #define HW_ACTIVATE 0x0010
126 #define HW_DEACTIVATE 0x0018
127 #define HW_INFO2 0x0020
128 #define HW_INFO3 0x0030
129 #define HW_INFO4_P8 0x0040
130 #define HW_INFO4_P10 0x0048
131 #define HW_RSYNC 0x0060
132 #define HW_TESTLOOP 0x0070
133 #define CARD_RESET 0x00F0
134 #define CARD_SETIRQ 0x00F1
135 #define CARD_INIT 0x00F2
136 #define CARD_RELEASE 0x00F3
137 #define CARD_TEST 0x00F4
138 #define CARD_AUX_IND 0x00F5
139 #define CARD_LOAD_FIRM 0x00F6
141 #define PH_ACTIVATE 0x0100
142 #define PH_DEACTIVATE 0x0110
143 #define PH_DATA 0x0120
144 #define PH_PULL 0x0130
145 #define PH_TESTLOOP 0x0140
146 #define PH_PAUSE 0x0150
147 #define MPH_ACTIVATE 0x0180
148 #define MPH_DEACTIVATE 0x0190
149 #define MPH_INFORMATION 0x01A0
151 #define DL_ESTABLISH 0x0200
152 #define DL_RELEASE 0x0210
153 #define DL_DATA 0x0220
154 #define DL_FLUSH 0x0224
155 #define DL_UNIT_DATA 0x0230
156 #define MDL_ASSIGN 0x0280
157 #define MDL_REMOVE 0x0284
158 #define MDL_ERROR 0x0288
159 #define MDL_INFO_SETUP 0x02E0
160 #define MDL_INFO_CONN 0x02E4
161 #define MDL_INFO_REL 0x02E8
163 #define CC_SETUP 0x0300
164 #define CC_RESUME 0x0304
165 #define CC_MORE_INFO 0x0310
166 #define CC_IGNORE 0x0320
167 #define CC_REJECT 0x0324
168 #define CC_SETUP_COMPL 0x0330
169 #define CC_PROCEEDING 0x0340
170 #define CC_ALERTING 0x0344
171 #define CC_CONNECT 0x0350
172 #define CC_CHARGE 0x0354
173 #define CC_DISCONNECT 0x0360
174 #define CC_RELEASE 0x0368
175 #define CC_SUSPEND 0x0370
176 #define CC_T303 0x0383
177 #define CC_T304 0x0384
178 #define CC_T305 0x0385
179 #define CC_T308_1 0x0388
180 #define CC_T308_2 0x0389
181 #define CC_T310 0x0390
182 #define CC_T313 0x0393
183 #define CC_T318 0x0398
184 #define CC_T319 0x0399
185 #define CC_NOSETUP_RSP 0x03E0
186 #define CC_SETUP_ERR 0x03E1
187 #define CC_SUSPEND_ERR 0x03E2
188 #define CC_RESUME_ERR 0x03E3
189 #define CC_CONNECT_ERR 0x03E4
190 #define CC_RELEASE_ERR 0x03E5
191 #define CC_DLRL 0x03F0
192 #define CC_RESTART 0x03F4
197 #define MAX_DFRAME_LEN 260
198 #define MAX_DFRAME_LEN_L1 300
199 #define HSCX_BUFMAX 4096
200 #define MAX_DATA_SIZE (HSCX_BUFMAX - 4)
201 #define MAX_DATA_MEM (HSCX_BUFMAX + 64)
202 #define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)
203 #define MAX_HEADER_LEN 4
205 #define MAX_MON_FRAME 32
206 #define MAX_DLOG_SPACE 2048
207 #define MAX_BLOG_SPACE 256
209 /* #define I4L_IRQ_FLAG SA_INTERRUPT */
210 #define I4L_IRQ_FLAG 0
218 typedef void (* FSMFNPTR
)(struct FsmInst
*, int, void *);
221 FSMFNPTR
*jumpmatrix
;
222 int state_count
, event_count
;
223 char **strEvent
, **strState
;
232 void (*printdebug
) (struct FsmInst
*, char *, ...);
237 void (*routine
) (struct FsmInst
*, int, void *);
242 struct timer_list tl
;
248 struct l3_process
*pc
;
249 struct timer_list tl
;
253 #define FLG_L1_ACTIVATING 1
254 #define FLG_L1_ACTIVATED 2
255 #define FLG_L1_DEACTTIMER 3
256 #define FLG_L1_ACTTIMER 4
257 #define FLG_L1_T3RUN 5
258 #define FLG_L1_PULL_REQ 6
263 struct PStack
**stlistp
;
266 struct FsmTimer timer
;
267 void (*l1l2
) (struct PStack
*, int, void *);
268 void (*l1hw
) (struct PStack
*, int, void *);
269 void (*l1tei
) (struct PStack
*, int, void *);
274 #define GROUP_TEI 127
277 #define PACKET_NOACK 250
285 #define FLG_PEND_REL 4
286 #define FLG_L3_INIT 5
287 #define FLG_T200_RUN 6
288 #define FLG_ACK_PEND 7
290 #define FLG_OWN_BUSY 9
291 #define FLG_PEER_BUSY 10
292 #define FLG_DCHAN_BUSY 11
293 #define FLG_L1_ACTIV 12
294 #define FLG_ESTAB_PEND 13
296 #define FLG_FIXED_TEI 15
307 struct sk_buff
*windowar
[MAX_WINDOW
];
308 struct sk_buff_head i_queue
;
309 struct sk_buff_head ui_queue
;
310 void (*l2l1
) (struct PStack
*, int, void *);
311 void (*l2l3
) (struct PStack
*, int, void *);
312 void (*l2tei
) (struct PStack
*, int, void *);
314 struct FsmTimer t200
, t203
;
315 int T200
, N200
, T203
;
321 void (*l3l4
) (struct PStack
*, int, void *);
322 void (*l3l2
) (struct PStack
*, int, void *);
324 struct sk_buff_head squeue
;
325 struct l3_process
*proc
;
326 struct l3_process
*global
;
333 void (*l4l3
) (struct PStack
*, int, void *);
335 void (*l1writewakeup
) (struct PStack
*, int);
336 void (*l2writewakeup
) (struct PStack
*, int);
342 struct FsmInst tei_m
;
343 struct FsmTimer t202
;
344 int T202
, N202
, debug
;
345 void (*layer
) (struct PStack
*, int, void *);
353 setup_parm setup
; /* from isdnif.h numbers and Serviceindicator */
354 int chargeinfo
; /* Charge Info - only for 1tr6 in
357 int spv
; /* SPV Flag */
366 struct LLInterface lli
;
367 struct Management ma
;
368 int protocol
; /* EDSS1 or 1TR6 */
374 struct L3Timer timer
;
378 struct Channel
*chan
;
380 struct l3_process
*next
;
386 int count
; /* Current skb sent count */
387 u_char
*rcvbuf
; /* B-Channel receive Buffer */
392 volatile u_char bstat
;
394 volatile u_char cmsb
;
395 volatile u_char clsb
;
396 volatile u_char par
[8];
404 u_char
*rcvbuf
; /* B-Channel receive Buffer */
405 struct isar_reg
*reg
;
408 struct hdlc_stat_reg
{
409 u_char cmd
__attribute__((packed
));
410 u_char xml
__attribute__((packed
));
411 u_char mode
__attribute__((packed
));
412 u_char fill
__attribute__((packed
));
418 struct hdlc_stat_reg sr
;
422 int count
; /* Current skb sent count */
423 u_char
*rcvbuf
; /* B-Channel receive Buffer */
459 struct sk_buff
*rv_skb
;
460 struct hdlc_state
*hdlc_state
;
461 struct tq_struct tq_rcv
;
462 struct tq_struct tq_xmt
;
466 #define BC_FLG_INIT 1
467 #define BC_FLG_ACTIV 2
468 #define BC_FLG_BUSY 3
469 #define BC_FLG_NOFRAME 4
470 #define BC_FLG_HALF 5
471 #define BC_FLG_EMPTY 6
473 #define L1_MODE_NULL 0
474 #define L1_MODE_TRANS 1
475 #define L1_MODE_HDLC 2
476 #define L1_MODE_MODEM 7
482 struct IsdnCardState
*cs
;
483 int tx_cnt
; /* B-Channel transmit counter */
484 struct sk_buff
*tx_skb
; /* B-Channel transmit Buffer */
485 struct sk_buff_head rqueue
; /* B-Channel receive Queue */
486 struct sk_buff_head squeue
; /* B-Channel send Queue */
489 struct timer_list transbusy
;
490 struct tq_struct tqueue
;
492 int (*BC_SetStack
) (struct PStack
*, struct BCState
*);
493 void (*BC_Close
) (struct BCState
*);
499 struct tiger_hw tiger
;
500 struct amd7930_hw amd7930
;
505 struct PStack
*b_st
, *d_st
;
506 struct IsdnCardState
*cs
;
511 struct FsmTimer drel_timer
, dial_timer
;
513 int l2_protocol
, l2_active_protocol
;
516 struct l3_process
*proc
;
517 setup_parm setup
; /* from isdnif.h numbers and Serviceindicator */
518 int Flags
; /* for remembering action done in l4 */
532 unsigned int counter
;
534 struct timer_list tl
;
541 unsigned int transcnt
;
551 unsigned int cfg_reg
;
555 signed int hscxfifo
[2];
559 unsigned int cfg_reg
;
560 unsigned int membase
;
564 unsigned int cfg_reg
;
566 unsigned int hscx
[2];
567 unsigned int isacfifo
;
568 unsigned int hscxfifo
[2];
569 unsigned int counter
;
573 unsigned int cfg_reg
;
574 unsigned int isac_ale
;
576 unsigned int hscx_ale
;
581 unsigned int cfg_reg
;
583 unsigned int isac_adr
;
585 unsigned int hscx_adr
;
588 struct timer_list tl
;
593 unsigned int cfg_reg
;
604 unsigned int fifosize
;
609 struct timer_list timer
;
613 unsigned int cfg_reg
;
617 unsigned int reset_on
;
618 unsigned int reset_off
;
619 struct isar_reg isar
;
625 unsigned int cfg_reg
;
627 unsigned int hscx
[2];
628 unsigned char res_irq
;
632 unsigned int cfg_reg
;
643 unsigned char dmactrl
;
644 unsigned char ctrl_reg
;
645 unsigned char irqmask0
;
646 unsigned char irqstat0
;
647 unsigned char last_is0
;
652 unsigned int bfifosize
;
653 unsigned int dfifosize
;
659 unsigned char int_m1
;
660 unsigned char int_m2
;
661 unsigned char int_s1
;
668 struct timer_list timer
;
674 #define FLG_TWO_DCHAN 4
675 #define FLG_L1_DBUSY 5
676 #define FLG_DBUSY_TIMER 6
677 #define FLG_LOCK_ATOMIC 7
678 #define HW_MON0_RX_END 8
679 #define HW_MON1_RX_END 9
680 #define HW_MON0_TX_END 10
681 #define HW_MON1_TX_END 11
683 struct IsdnCardState
{
685 unsigned char subtyp
;
692 struct teles0_hw teles0
;
693 struct teles3_hw teles3
;
710 u_char
*status_write
;
712 u_char (*readisac
) (struct IsdnCardState
*, u_char
);
713 void (*writeisac
) (struct IsdnCardState
*, u_char
, u_char
);
714 void (*readisacfifo
) (struct IsdnCardState
*, u_char
*, int);
715 void (*writeisacfifo
) (struct IsdnCardState
*, u_char
*, int);
716 u_char (*BC_Read_Reg
) (struct IsdnCardState
*, int, u_char
);
717 void (*BC_Write_Reg
) (struct IsdnCardState
*, int, u_char
, u_char
);
718 void (*BC_Send_Data
) (struct BCState
*);
719 int (*cardmsg
) (struct IsdnCardState
*, int, void *);
720 struct Channel channel
[2];
721 struct BCState bcs
[2];
722 struct PStack
*stlist
;
725 struct sk_buff
*tx_skb
;
728 struct tq_struct tqueue
;
729 struct timer_list dbusytimer
;
730 struct sk_buff_head rq
, sq
; /* D-channel queues */
741 void (*setstack_d
) (struct PStack
*, struct IsdnCardState
*);
749 #define HISAX_MAX_CARDS 8
751 #define ISDN_CTYPE_16_0 1
752 #define ISDN_CTYPE_8_0 2
753 #define ISDN_CTYPE_16_3 3
754 #define ISDN_CTYPE_PNP 4
755 #define ISDN_CTYPE_A1 5
756 #define ISDN_CTYPE_ELSA 6
757 #define ISDN_CTYPE_ELSA_PNP 7
758 #define ISDN_CTYPE_TELESPCMCIA 8
759 #define ISDN_CTYPE_IX1MICROR2 9
760 #define ISDN_CTYPE_ELSA_PCMCIA 10
761 #define ISDN_CTYPE_DIEHLDIVA 11
762 #define ISDN_CTYPE_ASUSCOM 12
763 #define ISDN_CTYPE_TELEINT 13
764 #define ISDN_CTYPE_TELES3C 14
765 #define ISDN_CTYPE_SEDLBAUER 15
766 #define ISDN_CTYPE_SPORTSTER 16
767 #define ISDN_CTYPE_MIC 17
768 #define ISDN_CTYPE_ELSA_PCI 18
769 #define ISDN_CTYPE_COMPAQ_ISA 19
770 #define ISDN_CTYPE_NETJET 20
771 #define ISDN_CTYPE_TELESPCI 21
772 #define ISDN_CTYPE_SEDLBAUER_PCMCIA 22
773 #define ISDN_CTYPE_AMD7930 23
774 #define ISDN_CTYPE_NICCY 24
775 #define ISDN_CTYPE_S0BOX 25
776 #define ISDN_CTYPE_A1_PCMCIA 26
777 #define ISDN_CTYPE_FRITZPCI 27
778 #define ISDN_CTYPE_SEDLBAUER_FAX 28
780 #define ISDN_CTYPE_COUNT 28
782 #ifdef ISDN_CHIP_ISAC
783 #undef ISDN_CHIP_ISAC
786 #define HISAX_INITFUNC(__arginit) __initfunc(__arginit)
787 #define HISAX_INITDATA __initdata
789 #ifdef CONFIG_HISAX_16_0
790 #define CARD_TELES0 (1<< ISDN_CTYPE_16_0) | (1<< ISDN_CTYPE_8_0)
791 #ifndef ISDN_CHIP_ISAC
792 #define ISDN_CHIP_ISAC 1
795 #define CARD_TELES0 0
798 #ifdef CONFIG_HISAX_16_3
799 #define CARD_TELES3 (1<< ISDN_CTYPE_16_3) | (1<< ISDN_CTYPE_PNP) | \
800 (1<< ISDN_CTYPE_TELESPCMCIA) | (1<< ISDN_CTYPE_COMPAQ_ISA)
801 #ifndef ISDN_CHIP_ISAC
802 #define ISDN_CHIP_ISAC 1
805 #define CARD_TELES3 0
808 #ifdef CONFIG_HISAX_TELESPCI
809 #define CARD_TELESPCI (1<< ISDN_CTYPE_TELESPCI)
810 #ifndef ISDN_CHIP_ISAC
811 #define ISDN_CHIP_ISAC 1
814 #define CARD_TELESPCI 0
817 #ifdef CONFIG_HISAX_AVM_A1
818 #define CARD_AVM_A1 (1<< ISDN_CTYPE_A1)
819 #ifndef ISDN_CHIP_ISAC
820 #define ISDN_CHIP_ISAC 1
823 #define CARD_AVM_A1 0
826 #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
827 #define CARD_AVM_A1_PCMCIA (1<< ISDN_CTYPE_A1_PCMCIA)
828 #ifndef ISDN_CHIP_ISAC
829 #define ISDN_CHIP_ISAC 1
832 #define CARD_AVM_A1_PCMCIA 0
835 #ifdef CONFIG_HISAX_FRITZPCI
836 #define CARD_FRITZPCI (1<< ISDN_CTYPE_FRITZPCI)
837 #ifndef ISDN_CHIP_ISAC
838 #define ISDN_CHIP_ISAC 1
841 #define CARD_FRITZPCI 0
844 #ifdef CONFIG_HISAX_ELSA
845 #define CARD_ELSA (1<< ISDN_CTYPE_ELSA) | (1<< ISDN_CTYPE_ELSA_PNP) | \
846 (1<< ISDN_CTYPE_ELSA_PCMCIA) | (1<< ISDN_CTYPE_ELSA_PCI)
847 #ifndef ISDN_CHIP_ISAC
848 #define ISDN_CHIP_ISAC 1
850 #undef HISAX_INITFUNC
851 #define HISAX_INITFUNC(__arginit) __arginit
852 #undef HISAX_INITDATA
853 #define HISAX_INITDATA
859 #ifdef CONFIG_HISAX_IX1MICROR2
860 #define CARD_IX1MICROR2 (1 << ISDN_CTYPE_IX1MICROR2)
861 #ifndef ISDN_CHIP_ISAC
862 #define ISDN_CHIP_ISAC 1
865 #define CARD_IX1MICROR2 0
868 #ifdef CONFIG_HISAX_DIEHLDIVA
869 #define CARD_DIEHLDIVA (1 << ISDN_CTYPE_DIEHLDIVA)
870 #ifndef ISDN_CHIP_ISAC
871 #define ISDN_CHIP_ISAC 1
874 #define CARD_DIEHLDIVA 0
877 #ifdef CONFIG_HISAX_ASUSCOM
878 #define CARD_ASUSCOM (1 << ISDN_CTYPE_ASUSCOM)
879 #ifndef ISDN_CHIP_ISAC
880 #define ISDN_CHIP_ISAC 1
883 #define CARD_ASUSCOM 0
886 #ifdef CONFIG_HISAX_TELEINT
887 #define CARD_TELEINT (1 << ISDN_CTYPE_TELEINT)
888 #ifndef ISDN_CHIP_ISAC
889 #define ISDN_CHIP_ISAC 1
892 #define CARD_TELEINT 0
895 #ifdef CONFIG_HISAX_SEDLBAUER
896 #define CARD_SEDLBAUER (1 << ISDN_CTYPE_SEDLBAUER) | (1 << ISDN_CTYPE_SEDLBAUER_PCMCIA) | ( 1 << ISDN_CTYPE_SEDLBAUER_FAX)
897 #ifndef ISDN_CHIP_ISAC
898 #define ISDN_CHIP_ISAC 1
901 #define CARD_SEDLBAUER 0
904 #ifdef CONFIG_HISAX_SPORTSTER
905 #define CARD_SPORTSTER (1 << ISDN_CTYPE_SPORTSTER)
906 #ifndef ISDN_CHIP_ISAC
907 #define ISDN_CHIP_ISAC 1
910 #define CARD_SPORTSTER 0
913 #ifdef CONFIG_HISAX_MIC
914 #define CARD_MIC (1 << ISDN_CTYPE_MIC)
915 #ifndef ISDN_CHIP_ISAC
916 #define ISDN_CHIP_ISAC 1
922 #ifdef CONFIG_HISAX_NETJET
923 #define CARD_NETJET (1 << ISDN_CTYPE_NETJET)
924 #ifndef ISDN_CHIP_ISAC
925 #define ISDN_CHIP_ISAC 1
928 #define CARD_NETJET 0
931 #ifdef CONFIG_HISAX_TELES3C
932 #define CARD_TELES3C (1<< ISDN_CTYPE_TELES3C)
934 #define CARD_TELES3C 0
937 #ifdef CONFIG_HISAX_AMD7930
938 #define CARD_AMD7930 (1 << ISDN_CTYPE_AMD7930)
940 #define CARD_AMD7930 0
943 #ifdef CONFIG_HISAX_NICCY
944 #define CARD_NICCY (1 << ISDN_CTYPE_NICCY)
945 #ifndef ISDN_CHIP_ISAC
946 #define ISDN_CHIP_ISAC 1
952 #ifdef CONFIG_HISAX_S0BOX
953 #define CARD_S0BOX (1 << ISDN_CTYPE_S0BOX)
954 #ifndef ISDN_CHIP_ISAC
955 #define ISDN_CHIP_ISAC 1
961 #define SUPORTED_CARDS (CARD_TELES0 | CARD_TELES3 | CARD_AVM_A1 | CARD_ELSA \
962 | CARD_IX1MICROR2 | CARD_DIEHLDIVA | CARD_ASUSCOM \
963 | CARD_TELEINT | CARD_SEDLBAUER | CARD_SPORTSTER \
964 | CARD_MIC | CARD_NETJET | CARD_TELES3C | CARD_AMD7930 \
965 | CARD_AVM_A1_PCMCIA | CARD_FRITZPCI\
966 | CARD_NICCY | CARD_S0BOX | CARD_TELESPCI)
968 #define TEI_PER_CARD 0
970 #ifdef CONFIG_HISAX_1TR6
972 #define TEI_PER_CARD 1
975 #ifdef CONFIG_HISAX_EURO
977 #define TEI_PER_CARD 1
978 #define HISAX_EURO_SENDCOMPLETE 1
979 #define EXT_BEARER_CAPS 1
980 #define HISAX_SEND_STD_LLC_IE 1
981 #ifdef CONFIG_HISAX_NO_SENDCOMPLETE
982 #undef HISAX_EURO_SENDCOMPLETE
984 #ifdef CONFIG_HISAX_NO_LLC
985 #undef HISAX_SEND_STD_LLC_IE
989 #define HISAX_DE_AOC 1
994 #define L1_DEB_WARN 0x01
995 #define L1_DEB_INTSTAT 0x02
996 #define L1_DEB_ISAC 0x04
997 #define L1_DEB_ISAC_FIFO 0x08
998 #define L1_DEB_HSCX 0x10
999 #define L1_DEB_HSCX_FIFO 0x20
1000 #define L1_DEB_LAPD 0x40
1001 #define L1_DEB_IPAC 0x80
1002 #define L1_DEB_RECEIVE_FRAME 0x100
1003 #define L1_DEB_MONITOR 0x200
1004 #define DEB_DLOG_HEX 0x400
1005 #define DEB_DLOG_VERBOSE 0x800
1007 #define L2FRAME_DEBUG
1009 #ifdef L2FRAME_DEBUG
1010 extern void Logl2Frame(struct IsdnCardState
*cs
, struct sk_buff
*skb
, char *buf
, int dir
);
1015 int protocol
; /* EDSS1 or 1TR6 */
1016 unsigned int para
[4];
1017 struct IsdnCardState
*cs
;
1020 void init_bcstate(struct IsdnCardState
*cs
, int bc
);
1022 void setstack_HiSax(struct PStack
*st
, struct IsdnCardState
*cs
);
1023 unsigned int random_ri(void);
1024 void HiSax_addlist(struct IsdnCardState
*sp
, struct PStack
*st
);
1025 void HiSax_rmlist(struct IsdnCardState
*sp
, struct PStack
*st
);
1027 void setstack_l1_B(struct PStack
*st
);
1029 void setstack_tei(struct PStack
*st
);
1030 void setstack_manager(struct PStack
*st
);
1032 void setstack_isdnl2(struct PStack
*st
, char *debug_id
);
1033 void releasestack_isdnl2(struct PStack
*st
);
1034 void setstack_transl2(struct PStack
*st
);
1035 void releasestack_transl2(struct PStack
*st
);
1037 void setstack_l3dc(struct PStack
*st
, struct Channel
*chanp
);
1038 void setstack_l3bc(struct PStack
*st
, struct Channel
*chanp
);
1039 void releasestack_isdnl3(struct PStack
*st
);
1041 u_char
*findie(u_char
* p
, int size
, u_char ie
, int wanted_set
);
1042 int getcallref(u_char
* p
);
1043 int newcallref(void);
1045 void FsmNew(struct Fsm
*fsm
, struct FsmNode
*fnlist
, int fncount
);
1046 void FsmFree(struct Fsm
*fsm
);
1047 int FsmEvent(struct FsmInst
*fi
, int event
, void *arg
);
1048 void FsmChangeState(struct FsmInst
*fi
, int newstate
);
1049 void FsmInitTimer(struct FsmInst
*fi
, struct FsmTimer
*ft
);
1050 int FsmAddTimer(struct FsmTimer
*ft
, int millisec
, int event
,
1051 void *arg
, int where
);
1052 void FsmRestartTimer(struct FsmTimer
*ft
, int millisec
, int event
,
1053 void *arg
, int where
);
1054 void FsmDelTimer(struct FsmTimer
*ft
, int where
);
1055 int jiftime(char *s
, long mark
);
1057 int HiSax_command(isdn_ctrl
* ic
);
1058 int HiSax_writebuf_skb(int id
, int chan
, int ack
, struct sk_buff
*skb
);
1059 void HiSax_putstatus(struct IsdnCardState
*cs
, char *head
, char *fmt
, ...);
1060 void VHiSax_putstatus(struct IsdnCardState
*cs
, char *head
, char *fmt
, va_list args
);
1061 void HiSax_reportcard(int cardnr
);
1062 int QuickHex(char *txt
, u_char
* p
, int cnt
);
1063 void LogFrame(struct IsdnCardState
*cs
, u_char
* p
, int size
);
1064 void dlogframe(struct IsdnCardState
*cs
, struct sk_buff
*skb
, int dir
);
1065 void iecpy(u_char
* dest
, u_char
* iestart
, int ieoffset
);
1066 int discard_queue(struct sk_buff_head
*q
);
1067 #ifdef ISDN_CHIP_ISAC
1068 void setstack_isac(struct PStack
*st
, struct IsdnCardState
*cs
);
1069 #endif /* ISDN_CHIP_ISAC */
1070 #endif /* __KERNEL__ */
1072 #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);}
1074 int ll_run(struct IsdnCardState
*cs
);
1075 void ll_stop(struct IsdnCardState
*cs
);
1076 void CallcNew(void);
1077 void CallcFree(void);
1078 int CallcNewChan(struct IsdnCardState
*cs
);
1079 void CallcFreeChan(struct IsdnCardState
*cs
);
1080 void Isdnl1New(void);
1081 void Isdnl1Free(void);
1082 void Isdnl2New(void);
1083 void Isdnl2Free(void);
1084 void Isdnl3New(void);
1085 void Isdnl3Free(void);
1086 void init_tei(struct IsdnCardState
*cs
, int protocol
);
1087 void release_tei(struct IsdnCardState
*cs
);
1088 char *HiSax_getrev(const char *revision
);
1091 int certification_check(int output
);