1 /* $Id: hisax.h,v 2.64.2.4 2004/02/11 13:21:33 keil Exp $
3 * Basic declarations, defines and prototypes
5 * This software may be used and distributed according to the terms
6 * of the GNU General Public License, incorporated herein by reference.
9 #include <linux/config.h>
10 #include <linux/errno.h>
12 #include <linux/major.h>
13 #include <asm/segment.h>
15 #include <linux/delay.h>
16 #include <linux/kernel.h>
17 #include <linux/signal.h>
18 #include <linux/slab.h>
20 #include <linux/mman.h>
21 #include <linux/ioport.h>
22 #include <linux/timer.h>
23 #include <linux/wait.h>
24 #include <linux/isdnif.h>
25 #include <linux/tty.h>
26 #include <linux/serial_reg.h>
27 #include <linux/netdevice.h>
29 #define ERROR_STATISTIC
36 #define HW_ENABLE 0x0000
37 #define HW_RESET 0x0004
38 #define HW_POWERUP 0x0008
39 #define HW_ACTIVATE 0x0010
40 #define HW_DEACTIVATE 0x0018
42 #define HW_INFO1 0x0010
43 #define HW_INFO2 0x0020
44 #define HW_INFO3 0x0030
45 #define HW_INFO4 0x0040
46 #define HW_INFO4_P8 0x0040
47 #define HW_INFO4_P10 0x0048
48 #define HW_RSYNC 0x0060
49 #define HW_TESTLOOP 0x0070
50 #define CARD_RESET 0x00F0
51 #define CARD_INIT 0x00F2
52 #define CARD_RELEASE 0x00F3
53 #define CARD_TEST 0x00F4
54 #define CARD_AUX_IND 0x00F5
56 #define PH_ACTIVATE 0x0100
57 #define PH_DEACTIVATE 0x0110
58 #define PH_DATA 0x0120
59 #define PH_PULL 0x0130
60 #define PH_TESTLOOP 0x0140
61 #define PH_PAUSE 0x0150
62 #define MPH_ACTIVATE 0x0180
63 #define MPH_DEACTIVATE 0x0190
64 #define MPH_INFORMATION 0x01A0
66 #define DL_ESTABLISH 0x0200
67 #define DL_RELEASE 0x0210
68 #define DL_DATA 0x0220
69 #define DL_FLUSH 0x0224
70 #define DL_UNIT_DATA 0x0230
72 #define MDL_BC_RELEASE 0x0278 // Formula-n enter:now
73 #define MDL_BC_ASSIGN 0x027C // Formula-n enter:now
74 #define MDL_ASSIGN 0x0280
75 #define MDL_REMOVE 0x0284
76 #define MDL_ERROR 0x0288
77 #define MDL_INFO_SETUP 0x02E0
78 #define MDL_INFO_CONN 0x02E4
79 #define MDL_INFO_REL 0x02E8
81 #define CC_SETUP 0x0300
82 #define CC_RESUME 0x0304
83 #define CC_MORE_INFO 0x0310
84 #define CC_IGNORE 0x0320
85 #define CC_REJECT 0x0324
86 #define CC_SETUP_COMPL 0x0330
87 #define CC_PROCEEDING 0x0340
88 #define CC_ALERTING 0x0344
89 #define CC_PROGRESS 0x0348
90 #define CC_CONNECT 0x0350
91 #define CC_CHARGE 0x0354
92 #define CC_NOTIFY 0x0358
93 #define CC_DISCONNECT 0x0360
94 #define CC_RELEASE 0x0368
95 #define CC_SUSPEND 0x0370
96 #define CC_PROCEED_SEND 0x0374
97 #define CC_REDIR 0x0378
98 #define CC_T302 0x0382
99 #define CC_T303 0x0383
100 #define CC_T304 0x0384
101 #define CC_T305 0x0385
102 #define CC_T308_1 0x0388
103 #define CC_T308_2 0x038A
104 #define CC_T309 0x0309
105 #define CC_T310 0x0390
106 #define CC_T313 0x0393
107 #define CC_T318 0x0398
108 #define CC_T319 0x0399
109 #define CC_TSPID 0x03A0
110 #define CC_NOSETUP_RSP 0x03E0
111 #define CC_SETUP_ERR 0x03E1
112 #define CC_SUSPEND_ERR 0x03E2
113 #define CC_RESUME_ERR 0x03E3
114 #define CC_CONNECT_ERR 0x03E4
115 #define CC_RELEASE_ERR 0x03E5
116 #define CC_RESTART 0x03F4
117 #define CC_TDSS1_IO 0x13F4 /* DSS1 IO user timer */
118 #define CC_TNI1_IO 0x13F5 /* NI1 IO user timer */
120 /* define maximum number of possible waiting incoming calls */
121 #define MAX_WAITING_CALLS 2
126 /* include l3dss1 & ni1 specific process structures, but no other defines */
127 #ifdef CONFIG_HISAX_EURO
128 #define l3dss1_process
130 #undef l3dss1_process
131 #endif /* CONFIG_HISAX_EURO */
133 #ifdef CONFIG_HISAX_NI1
134 #define l3ni1_process
137 #endif /* CONFIG_HISAX_NI1 */
139 #define MAX_DFRAME_LEN 260
140 #define MAX_DFRAME_LEN_L1 300
141 #define HSCX_BUFMAX 4096
142 #define MAX_DATA_SIZE (HSCX_BUFMAX - 4)
143 #define MAX_DATA_MEM (HSCX_BUFMAX + 64)
144 #define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)
145 #define MAX_HEADER_LEN 4
147 #define MAX_MON_FRAME 32
148 #define MAX_DLOG_SPACE 2048
149 #define MAX_BLOG_SPACE 256
151 /* #define I4L_IRQ_FLAG SA_INTERRUPT */
152 #define I4L_IRQ_FLAG 0
160 typedef void (* FSMFNPTR)(struct FsmInst *, int, void *);
163 FSMFNPTR *jumpmatrix;
164 int state_count, event_count;
165 char **strEvent, **strState;
174 void (*printdebug) (struct FsmInst *, char *, ...);
179 void (*routine) (struct FsmInst *, int, void *);
184 struct timer_list tl;
190 struct l3_process *pc;
191 struct timer_list tl;
195 #define FLG_L1_ACTIVATING 1
196 #define FLG_L1_ACTIVATED 2
197 #define FLG_L1_DEACTTIMER 3
198 #define FLG_L1_ACTTIMER 4
199 #define FLG_L1_T3RUN 5
200 #define FLG_L1_PULL_REQ 6
201 #define FLG_L1_UINT 7
206 struct PStack **stlistp;
209 struct FsmTimer timer;
210 void (*l1l2) (struct PStack *, int, void *);
211 void (*l1hw) (struct PStack *, int, void *);
212 void (*l1tei) (struct PStack *, int, void *);
217 #define GROUP_TEI 127
220 #define PACKET_NOACK 250
228 #define FLG_PEND_REL 4
229 #define FLG_L3_INIT 5
230 #define FLG_T200_RUN 6
231 #define FLG_ACK_PEND 7
233 #define FLG_OWN_BUSY 9
234 #define FLG_PEER_BUSY 10
235 #define FLG_DCHAN_BUSY 11
236 #define FLG_L1_ACTIV 12
237 #define FLG_ESTAB_PEND 13
239 #define FLG_FIXED_TEI 15
240 #define FLG_L2BLOCK 16
252 struct sk_buff *windowar[MAX_WINDOW];
253 struct sk_buff_head i_queue;
254 struct sk_buff_head ui_queue;
255 void (*l2l1) (struct PStack *, int, void *);
256 void (*l2l3) (struct PStack *, int, void *);
257 void (*l2tei) (struct PStack *, int, void *);
259 struct FsmTimer t200, t203;
260 int T200, N200, T203;
266 void (*l3l4) (struct PStack *, int, void *);
267 void (*l3ml3) (struct PStack *, int, void *);
268 void (*l3l2) (struct PStack *, int, void *);
270 struct FsmTimer l3m_timer;
271 struct sk_buff_head squeue;
272 struct l3_process *proc;
273 struct l3_process *global;
280 void (*l4l3) (struct PStack *, int, void *);
281 int (*l4l3_proto) (struct PStack *, isdn_ctrl *);
286 #define FLG_LLI_L1WAKEUP 1
287 #define FLG_LLI_L2WAKEUP 2
291 struct FsmInst tei_m;
292 struct FsmTimer t202;
293 int T202, N202, debug;
294 void (*layer) (struct PStack *, int, void *);
305 int spv; /* SPV Flag */
306 setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
307 u_char moderate; /* transfer mode and rate (bearer octet 4) */
316 struct LLInterface lli;
317 struct Management ma;
318 int protocol; /* EDSS1, 1TR6 or NI1 */
320 /* protocol specific data fields */
322 { u_char uuuu; /* only as dummy */
323 #ifdef CONFIG_HISAX_EURO
324 dss1_stk_priv dss1; /* private dss1 data */
325 #endif /* CONFIG_HISAX_EURO */
326 #ifdef CONFIG_HISAX_NI1
327 ni1_stk_priv ni1; /* private ni1 data */
328 #endif /* CONFIG_HISAX_NI1 */
335 struct L3Timer timer;
339 struct Channel *chan;
341 struct l3_process *next;
344 /* protocol specific data fields */
346 { u_char uuuu; /* only when euro not defined, avoiding empty union */
347 #ifdef CONFIG_HISAX_EURO
348 dss1_proc_priv dss1; /* private dss1 data */
349 #endif /* CONFIG_HISAX_EURO */
350 #ifdef CONFIG_HISAX_NI1
351 ni1_proc_priv ni1; /* private ni1 data */
352 #endif /* CONFIG_HISAX_NI1 */
359 int count; /* Current skb sent count */
360 u_char *rcvbuf; /* B-Channel receive Buffer */
368 int count; /* Current skb sent count */
369 u_char *rcvbuf; /* B-Channel receive Buffer */
374 volatile u_char bstat;
376 volatile u_char cmsb;
377 volatile u_char clsb;
378 volatile u_char par[8];
392 struct timer_list ftimer;
393 u_char *rcvbuf; /* B-Channel receive Buffer */
395 struct isar_reg *reg;
398 struct hdlc_stat_reg {
400 u_char fill __attribute__((packed));
401 u_char mode __attribute__((packed));
402 u_char xml __attribute__((packed));
403 u_char cmd __attribute__((packed));
405 u_char cmd __attribute__((packed));
406 u_char xml __attribute__((packed));
407 u_char mode __attribute__((packed));
408 u_char fill __attribute__((packed));
415 struct hdlc_stat_reg sr;
419 int count; /* Current skb sent count */
420 u_char *rcvbuf; /* B-Channel receive Buffer */
456 struct sk_buff *rv_skb;
457 struct hdlc_state *hdlc_state;
458 struct work_struct tq_rcv;
459 struct work_struct tq_xmt;
462 #define BC_FLG_INIT 1
463 #define BC_FLG_ACTIV 2
464 #define BC_FLG_BUSY 3
465 #define BC_FLG_NOFRAME 4
466 #define BC_FLG_HALF 5
467 #define BC_FLG_EMPTY 6
468 #define BC_FLG_ORIG 7
469 #define BC_FLG_DLEETX 8
470 #define BC_FLG_LASTDLE 9
471 #define BC_FLG_FIRST 10
472 #define BC_FLG_LASTDATA 11
473 #define BC_FLG_NMD_DATA 12
474 #define BC_FLG_FTI_RUN 13
475 #define BC_FLG_LL_OK 14
476 #define BC_FLG_LL_CONN 15
477 #define BC_FLG_FTI_FTS 16
478 #define BC_FLG_FRH_WAIT 17
480 #define L1_MODE_NULL 0
481 #define L1_MODE_TRANS 1
482 #define L1_MODE_HDLC 2
483 #define L1_MODE_EXTRN 3
484 #define L1_MODE_HDLC_56K 4
485 #define L1_MODE_MODEM 7
486 #define L1_MODE_V32 8
487 #define L1_MODE_FAX 9
493 struct IsdnCardState *cs;
494 int tx_cnt; /* B-Channel transmit counter */
495 struct sk_buff *tx_skb; /* B-Channel transmit Buffer */
496 struct sk_buff_head rqueue; /* B-Channel receive Queue */
497 struct sk_buff_head squeue; /* B-Channel send Queue */
503 struct timer_list transbusy;
504 struct work_struct tqueue;
506 int (*BC_SetStack) (struct PStack *, struct BCState *);
507 void (*BC_Close) (struct BCState *);
508 #ifdef ERROR_STATISTIC
519 struct tiger_hw tiger;
520 struct amd7930_hw amd7930;
521 struct w6692B_hw w6692;
522 struct hisax_b_if *b_if;
527 struct PStack *b_st, *d_st;
528 struct IsdnCardState *cs;
533 struct FsmTimer drel_timer, dial_timer;
535 int l2_protocol, l2_active_protocol;
538 struct l3_process *proc;
539 setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
540 u_long Flags; /* for remembering action done in l4 */
555 unsigned int counter;
557 struct timer_list tl;
564 unsigned int transcnt;
574 unsigned int cfg_reg;
578 signed int hscxfifo[2];
582 unsigned int cfg_reg;
583 void __iomem *membase;
584 unsigned long phymem;
588 unsigned int cfg_reg;
590 unsigned int hscx[2];
591 unsigned int isacfifo;
592 unsigned int hscxfifo[2];
593 unsigned int counter;
598 unsigned int cfg_reg;
599 unsigned int isac_ale;
601 unsigned int hscx_ale;
606 unsigned long cfg_reg;
607 unsigned long pci_cfg;
609 unsigned long isac_adr;
611 unsigned long hscx_adr;
614 struct timer_list tl;
620 unsigned int cfg_reg;
631 unsigned int fifosize;
636 struct timer_list timer;
640 unsigned int cfg_reg;
644 unsigned int reset_on;
645 unsigned int reset_off;
646 struct isar_reg isar;
653 unsigned int cfg_reg;
655 unsigned int hscx[2];
656 unsigned char res_irq;
660 unsigned int cfg_reg;
671 unsigned char dmactrl;
672 unsigned char ctrl_reg;
673 unsigned char irqmask0;
674 unsigned char irqstat0;
675 unsigned char last_is0;
684 unsigned char int_m1;
685 unsigned char int_m2;
686 unsigned char int_s1;
688 unsigned char sctrl_r;
689 unsigned char sctrl_e;
693 unsigned char fifo_en;
694 unsigned char bswapped;
695 unsigned char nt_mode;
698 unsigned char *pci_io; /* start of PCI IO memory */
699 void *share_start; /* shared memory for Fifos start */
700 void *fifos; /* FIFO memory */
701 int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
702 struct timer_list timer;
711 unsigned char int_m1;
712 unsigned char int_m2;
713 unsigned char int_s1;
715 unsigned char sctrl_r;
716 unsigned char sctrl_e;
720 unsigned char bswapped;
721 unsigned char nt_mode;
724 unsigned char last_fifo;
727 struct timer_list timer;
732 unsigned int bfifosize;
733 unsigned int dfifosize;
739 unsigned char int_m1;
740 unsigned char int_m2;
741 unsigned char int_s1;
748 struct timer_list timer;
753 unsigned long phymem;
756 struct isar_reg isar_r;
761 unsigned int cfg_reg;
765 struct timer_list timer;
772 unsigned long isac_adr;
773 unsigned int isac_ale;
774 unsigned long jade_adr;
775 unsigned int jade_ale;
776 /* Scitel Quadro stuff */
777 unsigned long plx_adr;
778 unsigned long data_adr;
783 unsigned int cfg_reg;
784 unsigned int pciaddr[2];
789 signed int hscxfifo[2];
790 unsigned char timeslot;
797 struct timer_list timer;
800 #ifdef CONFIG_HISAX_TESTEMU
802 unsigned char *sfifo;
803 unsigned char *sfifo_w;
804 unsigned char *sfifo_r;
805 unsigned char *sfifo_e;
808 wait_queue_head_t rwaitq;
809 wait_queue_head_t swaitq;
814 struct arcofi_msg *next;
827 struct arcofi_msg *arcofi_list;
828 struct timer_list arcofitimer;
829 wait_queue_head_t arcofi_wait;
852 struct amd7930_chip {
857 unsigned int tx_xmtlen;
858 struct timer_list timer3;
859 void (*ph_command) (struct IsdnCardState *, u_char, char *);
860 void (*setIrqMask) (struct IsdnCardState *, u_char);
870 struct arcofi_msg *arcofi_list;
871 struct timer_list arcofitimer;
872 wait_queue_head_t arcofi_wait;
883 #define FLG_TWO_DCHAN 4
884 #define FLG_L1_DBUSY 5
885 #define FLG_DBUSY_TIMER 6
886 #define FLG_LOCK_ATOMIC 7
887 #define FLG_ARCOFI_TIMER 8
888 #define FLG_ARCOFI_ERROR 9
889 #define FLG_HW_L1_UINT 10
891 struct IsdnCardState {
900 int chanlimit; /* limited number of B-chans to use */
901 int logecho; /* log echo if supported by card */
904 struct teles0_hw teles0;
905 struct teles3_hw teles3;
916 struct hfcPCI_hw hfcpci;
917 struct hfcSX_hw hfcsx;
919 struct isurf_hw isurf;
920 struct saphir_hw saphir;
921 #ifdef CONFIG_HISAX_TESTEMU
925 struct gazel_hw gazel;
926 struct w6692_hw w6692;
927 struct hisax_d_if *hisax_d_if;
934 u_char *status_write;
936 u_char (*readisac) (struct IsdnCardState *, u_char);
937 void (*writeisac) (struct IsdnCardState *, u_char, u_char);
938 void (*readisacfifo) (struct IsdnCardState *, u_char *, int);
939 void (*writeisacfifo) (struct IsdnCardState *, u_char *, int);
940 u_char (*BC_Read_Reg) (struct IsdnCardState *, int, u_char);
941 void (*BC_Write_Reg) (struct IsdnCardState *, int, u_char, u_char);
942 void (*BC_Send_Data) (struct BCState *);
943 int (*cardmsg) (struct IsdnCardState *, int, void *);
944 void (*setstack_d) (struct PStack *, struct IsdnCardState *);
945 void (*DC_Close) (struct IsdnCardState *);
946 int (*irq_func) (int, void *, struct pt_regs *);
947 int (*auxcmd) (struct IsdnCardState *, isdn_ctrl *);
948 struct Channel channel[2+MAX_WAITING_CALLS];
949 struct BCState bcs[2+MAX_WAITING_CALLS];
950 struct PStack *stlist;
951 struct sk_buff_head rq, sq; /* D-channel queues */
956 struct isac_chip isac;
957 struct hfcd_chip hfcd;
958 struct hfcpci_chip hfcpci;
959 struct hfcsx_chip hfcsx;
960 struct w6692_chip w6692;
961 struct amd7930_chip amd7930;
966 struct sk_buff *tx_skb;
969 struct work_struct tqueue;
970 struct timer_list dbusytimer;
971 #ifdef ERROR_STATISTIC
979 #define schedule_event(s, ev) do {test_and_set_bit(ev, &s->event);schedule_work(&s->tqueue); } while(0)
987 #ifdef ISDN_CHIP_ISAC
988 #undef ISDN_CHIP_ISAC
991 #ifdef CONFIG_HISAX_16_0
992 #define CARD_TELES0 1
993 #ifndef ISDN_CHIP_ISAC
994 #define ISDN_CHIP_ISAC 1
997 #define CARD_TELES0 0
1000 #ifdef CONFIG_HISAX_16_3
1001 #define CARD_TELES3 1
1002 #ifndef ISDN_CHIP_ISAC
1003 #define ISDN_CHIP_ISAC 1
1006 #define CARD_TELES3 0
1009 #ifdef CONFIG_HISAX_TELESPCI
1010 #define CARD_TELESPCI 1
1011 #ifndef ISDN_CHIP_ISAC
1012 #define ISDN_CHIP_ISAC 1
1015 #define CARD_TELESPCI 0
1018 #ifdef CONFIG_HISAX_AVM_A1
1019 #define CARD_AVM_A1 1
1020 #ifndef ISDN_CHIP_ISAC
1021 #define ISDN_CHIP_ISAC 1
1024 #define CARD_AVM_A1 0
1027 #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
1028 #define CARD_AVM_A1_PCMCIA 1
1029 #ifndef ISDN_CHIP_ISAC
1030 #define ISDN_CHIP_ISAC 1
1033 #define CARD_AVM_A1_PCMCIA 0
1036 #ifdef CONFIG_HISAX_FRITZPCI
1037 #define CARD_FRITZPCI 1
1038 #ifndef ISDN_CHIP_ISAC
1039 #define ISDN_CHIP_ISAC 1
1042 #define CARD_FRITZPCI 0
1045 #ifdef CONFIG_HISAX_ELSA
1047 #ifndef ISDN_CHIP_ISAC
1048 #define ISDN_CHIP_ISAC 1
1054 #ifdef CONFIG_HISAX_IX1MICROR2
1055 #define CARD_IX1MICROR2 1
1056 #ifndef ISDN_CHIP_ISAC
1057 #define ISDN_CHIP_ISAC 1
1060 #define CARD_IX1MICROR2 0
1063 #ifdef CONFIG_HISAX_DIEHLDIVA
1064 #define CARD_DIEHLDIVA 1
1065 #ifndef ISDN_CHIP_ISAC
1066 #define ISDN_CHIP_ISAC 1
1069 #define CARD_DIEHLDIVA 0
1072 #ifdef CONFIG_HISAX_ASUSCOM
1073 #define CARD_ASUSCOM 1
1074 #ifndef ISDN_CHIP_ISAC
1075 #define ISDN_CHIP_ISAC 1
1078 #define CARD_ASUSCOM 0
1081 #ifdef CONFIG_HISAX_TELEINT
1082 #define CARD_TELEINT 1
1083 #ifndef ISDN_CHIP_ISAC
1084 #define ISDN_CHIP_ISAC 1
1087 #define CARD_TELEINT 0
1090 #ifdef CONFIG_HISAX_SEDLBAUER
1091 #define CARD_SEDLBAUER 1
1092 #ifndef ISDN_CHIP_ISAC
1093 #define ISDN_CHIP_ISAC 1
1096 #define CARD_SEDLBAUER 0
1099 #ifdef CONFIG_HISAX_SPORTSTER
1100 #define CARD_SPORTSTER 1
1101 #ifndef ISDN_CHIP_ISAC
1102 #define ISDN_CHIP_ISAC 1
1105 #define CARD_SPORTSTER 0
1108 #ifdef CONFIG_HISAX_MIC
1110 #ifndef ISDN_CHIP_ISAC
1111 #define ISDN_CHIP_ISAC 1
1117 #ifdef CONFIG_HISAX_NETJET
1118 #define CARD_NETJET_S 1
1119 #ifndef ISDN_CHIP_ISAC
1120 #define ISDN_CHIP_ISAC 1
1123 #define CARD_NETJET_S 0
1126 #ifdef CONFIG_HISAX_HFCS
1132 #ifdef CONFIG_HISAX_HFC_PCI
1133 #define CARD_HFC_PCI 1
1135 #define CARD_HFC_PCI 0
1138 #ifdef CONFIG_HISAX_HFC_SX
1139 #define CARD_HFC_SX 1
1141 #define CARD_HFC_SX 0
1144 #ifdef CONFIG_HISAX_AMD7930
1145 #define CARD_AMD7930 1
1147 #define CARD_AMD7930 0
1150 #ifdef CONFIG_HISAX_NICCY
1151 #define CARD_NICCY 1
1152 #ifndef ISDN_CHIP_ISAC
1153 #define ISDN_CHIP_ISAC 1
1156 #define CARD_NICCY 0
1159 #ifdef CONFIG_HISAX_ISURF
1160 #define CARD_ISURF 1
1161 #ifndef ISDN_CHIP_ISAC
1162 #define ISDN_CHIP_ISAC 1
1165 #define CARD_ISURF 0
1168 #ifdef CONFIG_HISAX_S0BOX
1169 #define CARD_S0BOX 1
1170 #ifndef ISDN_CHIP_ISAC
1171 #define ISDN_CHIP_ISAC 1
1174 #define CARD_S0BOX 0
1177 #ifdef CONFIG_HISAX_HSTSAPHIR
1178 #define CARD_HSTSAPHIR 1
1179 #ifndef ISDN_CHIP_ISAC
1180 #define ISDN_CHIP_ISAC 1
1183 #define CARD_HSTSAPHIR 0
1186 #ifdef CONFIG_HISAX_TESTEMU
1187 #define CARD_TESTEMU 1
1188 #define ISDN_CTYPE_TESTEMU 99
1189 #undef ISDN_CTYPE_COUNT
1190 #define ISDN_CTYPE_COUNT ISDN_CTYPE_TESTEMU
1192 #define CARD_TESTEMU 0
1195 #ifdef CONFIG_HISAX_BKM_A4T
1196 #define CARD_BKM_A4T 1
1197 #ifndef ISDN_CHIP_ISAC
1198 #define ISDN_CHIP_ISAC 1
1201 #define CARD_BKM_A4T 0
1204 #ifdef CONFIG_HISAX_SCT_QUADRO
1205 #define CARD_SCT_QUADRO 1
1206 #ifndef ISDN_CHIP_ISAC
1207 #define ISDN_CHIP_ISAC 1
1210 #define CARD_SCT_QUADRO 0
1213 #ifdef CONFIG_HISAX_GAZEL
1214 #define CARD_GAZEL 1
1215 #ifndef ISDN_CHIP_ISAC
1216 #define ISDN_CHIP_ISAC 1
1219 #define CARD_GAZEL 0
1222 #ifdef CONFIG_HISAX_W6692
1223 #define CARD_W6692 1
1224 #ifndef ISDN_CHIP_W6692
1225 #define ISDN_CHIP_W6692 1
1228 #define CARD_W6692 0
1231 #ifdef CONFIG_HISAX_NETJET_U
1232 #define CARD_NETJET_U 1
1233 #ifndef ISDN_CHIP_ICC
1234 #define ISDN_CHIP_ICC 1
1236 #ifndef HISAX_UINTERFACE
1237 #define HISAX_UINTERFACE 1
1240 #define CARD_NETJET_U 0
1243 #ifdef CONFIG_HISAX_ENTERNOW_PCI
1244 #define CARD_FN_ENTERNOW_PCI 1
1247 #define TEI_PER_CARD 1
1250 #define L1_DEB_WARN 0x01
1251 #define L1_DEB_INTSTAT 0x02
1252 #define L1_DEB_ISAC 0x04
1253 #define L1_DEB_ISAC_FIFO 0x08
1254 #define L1_DEB_HSCX 0x10
1255 #define L1_DEB_HSCX_FIFO 0x20
1256 #define L1_DEB_LAPD 0x40
1257 #define L1_DEB_IPAC 0x80
1258 #define L1_DEB_RECEIVE_FRAME 0x100
1259 #define L1_DEB_MONITOR 0x200
1260 #define DEB_DLOG_HEX 0x400
1261 #define DEB_DLOG_VERBOSE 0x800
1263 #define L2FRAME_DEBUG
1265 #ifdef L2FRAME_DEBUG
1266 extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, int dir);
1269 #include "hisax_cfg.h"
1271 void init_bcstate(struct IsdnCardState *cs, int bc);
1273 void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs);
1274 void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st);
1275 void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st);
1277 void setstack_l1_B(struct PStack *st);
1279 void setstack_tei(struct PStack *st);
1280 void setstack_manager(struct PStack *st);
1282 void setstack_isdnl2(struct PStack *st, char *debug_id);
1283 void releasestack_isdnl2(struct PStack *st);
1284 void setstack_transl2(struct PStack *st);
1285 void releasestack_transl2(struct PStack *st);
1286 void lli_writewakeup(struct PStack *st, int len);
1288 void setstack_l3dc(struct PStack *st, struct Channel *chanp);
1289 void setstack_l3bc(struct PStack *st, struct Channel *chanp);
1290 void releasestack_isdnl3(struct PStack *st);
1292 u_char *findie(u_char * p, int size, u_char ie, int wanted_set);
1293 int getcallref(u_char * p);
1294 int newcallref(void);
1296 int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
1297 void FsmFree(struct Fsm *fsm);
1298 int FsmEvent(struct FsmInst *fi, int event, void *arg);
1299 void FsmChangeState(struct FsmInst *fi, int newstate);
1300 void FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft);
1301 int FsmAddTimer(struct FsmTimer *ft, int millisec, int event,
1302 void *arg, int where);
1303 void FsmRestartTimer(struct FsmTimer *ft, int millisec, int event,
1304 void *arg, int where);
1305 void FsmDelTimer(struct FsmTimer *ft, int where);
1306 int jiftime(char *s, long mark);
1308 int HiSax_command(isdn_ctrl * ic);
1309 int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
1310 void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
1311 void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
1312 void HiSax_reportcard(int cardnr, int sel);
1313 int QuickHex(char *txt, u_char * p, int cnt);
1314 void LogFrame(struct IsdnCardState *cs, u_char * p, int size);
1315 void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir);
1316 void iecpy(u_char * dest, u_char * iestart, int ieoffset);
1317 #endif /* __KERNEL__ */
1319 #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);}
1321 int ll_run(struct IsdnCardState *cs, int addfeatures);
1323 void CallcFree(void);
1324 int CallcNewChan(struct IsdnCardState *cs);
1325 void CallcFreeChan(struct IsdnCardState *cs);
1326 int Isdnl1New(void);
1327 void Isdnl1Free(void);
1328 int Isdnl2New(void);
1329 void Isdnl2Free(void);
1330 int Isdnl3New(void);
1331 void Isdnl3Free(void);
1332 void init_tei(struct IsdnCardState *cs, int protocol);
1333 void release_tei(struct IsdnCardState *cs);
1334 char *HiSax_getrev(const char *revision);