1 /* $Id: hisax.h,v 1.1.4.2 2001/12/09 19:15:28 kai 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
247 unsigned int vs, va, vr;
251 struct sk_buff *windowar[MAX_WINDOW];
252 struct sk_buff_head i_queue;
253 struct sk_buff_head ui_queue;
254 void (*l2l1) (struct PStack *, int, void *);
255 void (*l2l3) (struct PStack *, int, void *);
256 void (*l2tei) (struct PStack *, int, void *);
258 struct FsmTimer t200, t203;
259 int T200, N200, T203;
265 void (*l3l4) (struct PStack *, int, void *);
266 void (*l3ml3) (struct PStack *, int, void *);
267 void (*l3l2) (struct PStack *, int, void *);
269 struct FsmTimer l3m_timer;
270 struct sk_buff_head squeue;
271 struct l3_process *proc;
272 struct l3_process *global;
279 void (*l4l3) (struct PStack *, int, void *);
280 int (*l4l3_proto) (struct PStack *, isdn_ctrl *);
282 void (*l1writewakeup) (struct PStack *, int);
283 void (*l2writewakeup) (struct PStack *, int);
289 struct FsmInst tei_m;
290 struct FsmTimer t202;
291 int T202, N202, debug;
292 void (*layer) (struct PStack *, int, void *);
303 int spv; /* SPV Flag */
304 setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
305 u_char moderate; /* transfer mode and rate (bearer octet 4) */
314 struct LLInterface lli;
315 struct Management ma;
316 int protocol; /* EDSS1, 1TR6 or NI1 */
318 /* protocol specific data fields */
320 { u_char uuuu; /* only as dummy */
321 #ifdef CONFIG_HISAX_EURO
322 dss1_stk_priv dss1; /* private dss1 data */
323 #endif /* CONFIG_HISAX_EURO */
324 #ifdef CONFIG_HISAX_NI1
325 ni1_stk_priv ni1; /* private ni1 data */
326 #endif /* CONFIG_HISAX_NI1 */
333 struct L3Timer timer;
337 struct Channel *chan;
339 struct l3_process *next;
342 /* protocol specific data fields */
344 { u_char uuuu; /* only when euro not defined, avoiding empty union */
345 #ifdef CONFIG_HISAX_EURO
346 dss1_proc_priv dss1; /* private dss1 data */
347 #endif /* CONFIG_HISAX_EURO */
348 #ifdef CONFIG_HISAX_NI1
349 ni1_proc_priv ni1; /* private ni1 data */
350 #endif /* CONFIG_HISAX_NI1 */
357 int count; /* Current skb sent count */
358 u_char *rcvbuf; /* B-Channel receive Buffer */
366 int count; /* Current skb sent count */
367 u_char *rcvbuf; /* B-Channel receive Buffer */
372 volatile u_char bstat;
374 volatile u_char cmsb;
375 volatile u_char clsb;
376 volatile u_char par[8];
390 struct timer_list ftimer;
391 u_char *rcvbuf; /* B-Channel receive Buffer */
393 struct isar_reg *reg;
396 struct hdlc_stat_reg {
413 struct hdlc_stat_reg sr;
417 int count; /* Current skb sent count */
418 u_char *rcvbuf; /* B-Channel receive Buffer */
454 struct sk_buff *rv_skb;
455 struct hdlc_state *hdlc_state;
456 struct tq_struct tq_rcv;
457 struct tq_struct tq_xmt;
460 #define BC_FLG_INIT 1
461 #define BC_FLG_ACTIV 2
462 #define BC_FLG_BUSY 3
463 #define BC_FLG_NOFRAME 4
464 #define BC_FLG_HALF 5
465 #define BC_FLG_EMPTY 6
466 #define BC_FLG_ORIG 7
467 #define BC_FLG_DLEETX 8
468 #define BC_FLG_LASTDLE 9
469 #define BC_FLG_FIRST 10
470 #define BC_FLG_LASTDATA 11
471 #define BC_FLG_NMD_DATA 12
472 #define BC_FLG_FTI_RUN 13
473 #define BC_FLG_LL_OK 14
474 #define BC_FLG_LL_CONN 15
475 #define BC_FLG_FTI_FTS 16
476 #define BC_FLG_FRH_WAIT 17
478 #define L1_MODE_NULL 0
479 #define L1_MODE_TRANS 1
480 #define L1_MODE_HDLC 2
481 #define L1_MODE_EXTRN 3
482 #define L1_MODE_HDLC_56K 4
483 #define L1_MODE_MODEM 7
484 #define L1_MODE_V32 8
485 #define L1_MODE_FAX 9
490 long Flag; /* long req'd for set_bit --RR */
491 struct IsdnCardState *cs;
492 int tx_cnt; /* B-Channel transmit counter */
493 struct sk_buff *tx_skb; /* B-Channel transmit Buffer */
494 struct sk_buff_head rqueue; /* B-Channel receive Queue */
495 struct sk_buff_head squeue; /* B-Channel send Queue */
499 struct timer_list transbusy;
500 struct tq_struct tqueue;
502 int (*BC_SetStack) (struct PStack *, struct BCState *);
503 void (*BC_Close) (struct BCState *);
504 #ifdef ERROR_STATISTIC
515 struct tiger_hw tiger;
516 struct amd7930_hw amd7930;
517 struct w6692B_hw w6692;
518 struct hisax_b_if *b_if;
523 struct PStack *b_st, *d_st;
524 struct IsdnCardState *cs;
529 struct FsmTimer drel_timer, dial_timer;
531 int l2_protocol, l2_active_protocol;
534 struct l3_process *proc;
535 setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
536 long Flags; /* for remembering action done in l4 */
537 /* long req'd for set_bit --RR */
551 unsigned int counter;
553 struct timer_list tl;
560 unsigned int transcnt;
570 unsigned int cfg_reg;
574 signed int hscxfifo[2];
578 unsigned int cfg_reg;
579 unsigned long membase;
580 unsigned long phymem;
584 unsigned int cfg_reg;
586 unsigned int hscx[2];
587 unsigned int isacfifo;
588 unsigned int hscxfifo[2];
589 unsigned int counter;
593 unsigned int cfg_reg;
594 unsigned int isac_ale;
596 unsigned int hscx_ale;
601 unsigned long cfg_reg;
602 unsigned long pci_cfg;
604 unsigned long isac_adr;
606 unsigned long hscx_adr;
609 struct timer_list tl;
614 unsigned int cfg_reg;
625 unsigned int fifosize;
630 struct timer_list timer;
634 unsigned int cfg_reg;
638 unsigned int reset_on;
639 unsigned int reset_off;
640 struct isar_reg isar;
646 unsigned int cfg_reg;
648 unsigned int hscx[2];
649 unsigned char res_irq;
653 unsigned int cfg_reg;
664 unsigned char dmactrl;
665 unsigned char ctrl_reg;
666 unsigned char irqmask0;
667 unsigned char irqstat0;
668 unsigned char last_is0;
676 unsigned char int_m1;
677 unsigned char int_m2;
678 unsigned char int_s1;
680 unsigned char sctrl_r;
681 unsigned char sctrl_e;
685 unsigned char fifo_en;
686 unsigned char bswapped;
687 unsigned char nt_mode;
689 unsigned char pci_bus;
690 unsigned char pci_device_fn;
691 unsigned char *pci_io; /* start of PCI IO memory */
692 void *share_start; /* shared memory for Fifos start */
693 void *fifos; /* FIFO memory */
694 int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
695 struct timer_list timer;
704 unsigned char int_m1;
705 unsigned char int_m2;
706 unsigned char int_s1;
708 unsigned char sctrl_r;
709 unsigned char sctrl_e;
713 unsigned char bswapped;
714 unsigned char nt_mode;
717 unsigned char last_fifo;
720 struct timer_list timer;
725 unsigned int bfifosize;
726 unsigned int dfifosize;
732 unsigned char int_m1;
733 unsigned char int_m2;
734 unsigned char int_s1;
741 struct timer_list timer;
746 unsigned long phymem;
749 struct isar_reg isar_r;
753 unsigned int cfg_reg;
757 struct timer_list timer;
763 unsigned long isac_adr;
764 unsigned int isac_ale;
765 unsigned long jade_adr;
766 unsigned int jade_ale;
767 /* Scitel Quadro stuff */
768 unsigned long plx_adr;
769 unsigned long data_adr;
773 unsigned int cfg_reg;
774 unsigned int pciaddr[2];
779 signed int hscxfifo[2];
780 unsigned char timeslot;
786 struct timer_list timer;
789 #ifdef CONFIG_HISAX_TESTEMU
791 unsigned char *sfifo;
792 unsigned char *sfifo_w;
793 unsigned char *sfifo_r;
794 unsigned char *sfifo_e;
797 wait_queue_head_t rwaitq;
798 wait_queue_head_t swaitq;
803 struct arcofi_msg *next;
816 struct arcofi_msg *arcofi_list;
817 struct timer_list arcofitimer;
818 wait_queue_head_t arcofi_wait;
841 struct amd7930_chip {
846 unsigned int tx_xmtlen;
847 struct timer_list timer3;
848 void (*ph_command) (struct IsdnCardState *, u_char, char *);
849 void (*setIrqMask) (struct IsdnCardState *, u_char);
859 struct arcofi_msg *arcofi_list;
860 struct timer_list arcofitimer;
861 wait_queue_head_t arcofi_wait;
872 #define FLG_TWO_DCHAN 4
873 #define FLG_L1_DBUSY 5
874 #define FLG_DBUSY_TIMER 6
875 #define FLG_LOCK_ATOMIC 7
876 #define FLG_ARCOFI_TIMER 8
877 #define FLG_ARCOFI_ERROR 9
878 #define FLG_HW_L1_UINT 10
880 struct IsdnCardState {
882 unsigned char subtyp;
885 unsigned long irq_flags;
888 int chanlimit; /* limited number of B-chans to use */
889 int logecho; /* log echo if supported by card */
892 struct teles0_hw teles0;
893 struct teles3_hw teles3;
904 struct hfcPCI_hw hfcpci;
905 struct hfcSX_hw hfcsx;
907 struct isurf_hw isurf;
908 struct saphir_hw saphir;
909 #ifdef CONFIG_HISAX_TESTEMU
913 struct gazel_hw gazel;
914 struct w6692_hw w6692;
915 struct hisax_d_if *hisax_d_if;
921 u_char *status_write;
923 u_char (*readisac) (struct IsdnCardState *, u_char);
924 void (*writeisac) (struct IsdnCardState *, u_char, u_char);
925 void (*readisacfifo) (struct IsdnCardState *, u_char *, int);
926 void (*writeisacfifo) (struct IsdnCardState *, u_char *, int);
927 u_char (*BC_Read_Reg) (struct IsdnCardState *, int, u_char);
928 void (*BC_Write_Reg) (struct IsdnCardState *, int, u_char, u_char);
929 void (*BC_Send_Data) (struct BCState *);
930 int (*cardmsg) (struct IsdnCardState *, int, void *);
931 void (*setstack_d) (struct PStack *, struct IsdnCardState *);
932 void (*DC_Close) (struct IsdnCardState *);
933 void (*irq_func) (int, void *, struct pt_regs *);
934 int (*auxcmd) (struct IsdnCardState *, isdn_ctrl *);
935 struct Channel channel[2+MAX_WAITING_CALLS];
936 struct BCState bcs[2+MAX_WAITING_CALLS];
937 struct PStack *stlist;
938 struct sk_buff_head rq, sq; /* D-channel queues */
943 struct isac_chip isac;
944 struct hfcd_chip hfcd;
945 struct hfcpci_chip hfcpci;
946 struct hfcsx_chip hfcsx;
947 struct w6692_chip w6692;
948 struct amd7930_chip amd7930;
953 struct sk_buff *tx_skb;
956 struct tq_struct tqueue;
957 struct timer_list dbusytimer;
958 #ifdef ERROR_STATISTIC
970 #define ISDN_CTYPE_16_0 1
971 #define ISDN_CTYPE_8_0 2
972 #define ISDN_CTYPE_16_3 3
973 #define ISDN_CTYPE_PNP 4
974 #define ISDN_CTYPE_A1 5
975 #define ISDN_CTYPE_ELSA 6
976 #define ISDN_CTYPE_ELSA_PNP 7
977 #define ISDN_CTYPE_TELESPCMCIA 8
978 #define ISDN_CTYPE_IX1MICROR2 9
979 #define ISDN_CTYPE_ELSA_PCMCIA 10
980 #define ISDN_CTYPE_DIEHLDIVA 11
981 #define ISDN_CTYPE_ASUSCOM 12
982 #define ISDN_CTYPE_TELEINT 13
983 #define ISDN_CTYPE_TELES3C 14
984 #define ISDN_CTYPE_SEDLBAUER 15
985 #define ISDN_CTYPE_SPORTSTER 16
986 #define ISDN_CTYPE_MIC 17
987 #define ISDN_CTYPE_ELSA_PCI 18
988 #define ISDN_CTYPE_COMPAQ_ISA 19
989 #define ISDN_CTYPE_NETJET_S 20
990 #define ISDN_CTYPE_TELESPCI 21
991 #define ISDN_CTYPE_SEDLBAUER_PCMCIA 22
992 #define ISDN_CTYPE_AMD7930 23
993 #define ISDN_CTYPE_NICCY 24
994 #define ISDN_CTYPE_S0BOX 25
995 #define ISDN_CTYPE_A1_PCMCIA 26
996 #define ISDN_CTYPE_FRITZPCI 27
997 #define ISDN_CTYPE_SEDLBAUER_FAX 28
998 #define ISDN_CTYPE_ISURF 29
999 #define ISDN_CTYPE_ACERP10 30
1000 #define ISDN_CTYPE_HSTSAPHIR 31
1001 #define ISDN_CTYPE_BKM_A4T 32
1002 #define ISDN_CTYPE_SCT_QUADRO 33
1003 #define ISDN_CTYPE_GAZEL 34
1004 #define ISDN_CTYPE_HFC_PCI 35
1005 #define ISDN_CTYPE_W6692 36
1006 #define ISDN_CTYPE_HFC_SX 37
1007 #define ISDN_CTYPE_NETJET_U 38
1008 #define ISDN_CTYPE_HFC_SP_PCMCIA 39
1009 #define ISDN_CTYPE_DYNAMIC 40
1010 #define ISDN_CTYPE_ENTERNOW 41
1011 #define ISDN_CTYPE_COUNT 41
1014 #ifdef ISDN_CHIP_ISAC
1015 #undef ISDN_CHIP_ISAC
1018 #ifdef CONFIG_HISAX_16_0
1019 #define CARD_TELES0 1
1020 #ifndef ISDN_CHIP_ISAC
1021 #define ISDN_CHIP_ISAC 1
1024 #define CARD_TELES0 0
1027 #ifdef CONFIG_HISAX_16_3
1028 #define CARD_TELES3 1
1029 #ifndef ISDN_CHIP_ISAC
1030 #define ISDN_CHIP_ISAC 1
1033 #define CARD_TELES3 0
1036 #ifdef CONFIG_HISAX_TELESPCI
1037 #define CARD_TELESPCI 1
1038 #ifndef ISDN_CHIP_ISAC
1039 #define ISDN_CHIP_ISAC 1
1042 #define CARD_TELESPCI 0
1045 #ifdef CONFIG_HISAX_AVM_A1
1046 #define CARD_AVM_A1 1
1047 #ifndef ISDN_CHIP_ISAC
1048 #define ISDN_CHIP_ISAC 1
1051 #define CARD_AVM_A1 0
1054 #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
1055 #define CARD_AVM_A1_PCMCIA 1
1056 #ifndef ISDN_CHIP_ISAC
1057 #define ISDN_CHIP_ISAC 1
1060 #define CARD_AVM_A1_PCMCIA 0
1063 #ifdef CONFIG_HISAX_FRITZPCI
1064 #define CARD_FRITZPCI 1
1065 #ifndef ISDN_CHIP_ISAC
1066 #define ISDN_CHIP_ISAC 1
1069 #define CARD_FRITZPCI 0
1072 #ifdef CONFIG_HISAX_ELSA
1074 #ifndef ISDN_CHIP_ISAC
1075 #define ISDN_CHIP_ISAC 1
1081 #ifdef CONFIG_HISAX_IX1MICROR2
1082 #define CARD_IX1MICROR2 1
1083 #ifndef ISDN_CHIP_ISAC
1084 #define ISDN_CHIP_ISAC 1
1087 #define CARD_IX1MICROR2 0
1090 #ifdef CONFIG_HISAX_DIEHLDIVA
1091 #define CARD_DIEHLDIVA 1
1092 #ifndef ISDN_CHIP_ISAC
1093 #define ISDN_CHIP_ISAC 1
1096 #define CARD_DIEHLDIVA 0
1099 #ifdef CONFIG_HISAX_ASUSCOM
1100 #define CARD_ASUSCOM 1
1101 #ifndef ISDN_CHIP_ISAC
1102 #define ISDN_CHIP_ISAC 1
1105 #define CARD_ASUSCOM 0
1108 #ifdef CONFIG_HISAX_TELEINT
1109 #define CARD_TELEINT 1
1110 #ifndef ISDN_CHIP_ISAC
1111 #define ISDN_CHIP_ISAC 1
1114 #define CARD_TELEINT 0
1117 #ifdef CONFIG_HISAX_SEDLBAUER
1118 #define CARD_SEDLBAUER 1
1119 #ifndef ISDN_CHIP_ISAC
1120 #define ISDN_CHIP_ISAC 1
1123 #define CARD_SEDLBAUER 0
1126 #ifdef CONFIG_HISAX_SPORTSTER
1127 #define CARD_SPORTSTER 1
1128 #ifndef ISDN_CHIP_ISAC
1129 #define ISDN_CHIP_ISAC 1
1132 #define CARD_SPORTSTER 0
1135 #ifdef CONFIG_HISAX_MIC
1137 #ifndef ISDN_CHIP_ISAC
1138 #define ISDN_CHIP_ISAC 1
1144 #ifdef CONFIG_HISAX_NETJET
1145 #define CARD_NETJET_S 1
1146 #ifndef ISDN_CHIP_ISAC
1147 #define ISDN_CHIP_ISAC 1
1150 #define CARD_NETJET_S 0
1153 #ifdef CONFIG_HISAX_HFCS
1159 #ifdef CONFIG_HISAX_HFC_PCI
1160 #define CARD_HFC_PCI 1
1162 #define CARD_HFC_PCI 0
1165 #ifdef CONFIG_HISAX_HFC_SX
1166 #define CARD_HFC_SX 1
1168 #define CARD_HFC_SX 0
1171 #ifdef CONFIG_HISAX_AMD7930
1172 #define CARD_AMD7930 1
1174 #define CARD_AMD7930 0
1177 #ifdef CONFIG_HISAX_NICCY
1178 #define CARD_NICCY 1
1179 #ifndef ISDN_CHIP_ISAC
1180 #define ISDN_CHIP_ISAC 1
1183 #define CARD_NICCY 0
1186 #ifdef CONFIG_HISAX_ISURF
1187 #define CARD_ISURF 1
1188 #ifndef ISDN_CHIP_ISAC
1189 #define ISDN_CHIP_ISAC 1
1192 #define CARD_ISURF 0
1195 #ifdef CONFIG_HISAX_S0BOX
1196 #define CARD_S0BOX 1
1197 #ifndef ISDN_CHIP_ISAC
1198 #define ISDN_CHIP_ISAC 1
1201 #define CARD_S0BOX 0
1204 #ifdef CONFIG_HISAX_HSTSAPHIR
1205 #define CARD_HSTSAPHIR 1
1206 #ifndef ISDN_CHIP_ISAC
1207 #define ISDN_CHIP_ISAC 1
1210 #define CARD_HSTSAPHIR 0
1213 #ifdef CONFIG_HISAX_TESTEMU
1214 #define CARD_TESTEMU 1
1215 #define ISDN_CTYPE_TESTEMU 99
1216 #undef ISDN_CTYPE_COUNT
1217 #define ISDN_CTYPE_COUNT ISDN_CTYPE_TESTEMU
1219 #define CARD_TESTEMU 0
1222 #ifdef CONFIG_HISAX_BKM_A4T
1223 #define CARD_BKM_A4T 1
1224 #ifndef ISDN_CHIP_ISAC
1225 #define ISDN_CHIP_ISAC 1
1228 #define CARD_BKM_A4T 0
1231 #ifdef CONFIG_HISAX_SCT_QUADRO
1232 #define CARD_SCT_QUADRO 1
1233 #ifndef ISDN_CHIP_ISAC
1234 #define ISDN_CHIP_ISAC 1
1237 #define CARD_SCT_QUADRO 0
1240 #ifdef CONFIG_HISAX_GAZEL
1241 #define CARD_GAZEL 1
1242 #ifndef ISDN_CHIP_ISAC
1243 #define ISDN_CHIP_ISAC 1
1246 #define CARD_GAZEL 0
1249 #ifdef CONFIG_HISAX_W6692
1250 #define CARD_W6692 1
1251 #ifndef ISDN_CHIP_W6692
1252 #define ISDN_CHIP_W6692 1
1255 #define CARD_W6692 0
1258 #ifdef CONFIG_HISAX_NETJET_U
1259 #define CARD_NETJET_U 1
1260 #ifndef ISDN_CHIP_ICC
1261 #define ISDN_CHIP_ICC 1
1263 #ifndef HISAX_UINTERFACE
1264 #define HISAX_UINTERFACE 1
1267 #define CARD_NETJET_U 0
1270 #ifdef CONFIG_HISAX_ENTERNOW_PCI
1271 #define CARD_FN_ENTERNOW_PCI 1
1274 #define TEI_PER_CARD 1
1277 #define L1_DEB_WARN 0x01
1278 #define L1_DEB_INTSTAT 0x02
1279 #define L1_DEB_ISAC 0x04
1280 #define L1_DEB_ISAC_FIFO 0x08
1281 #define L1_DEB_HSCX 0x10
1282 #define L1_DEB_HSCX_FIFO 0x20
1283 #define L1_DEB_LAPD 0x40
1284 #define L1_DEB_IPAC 0x80
1285 #define L1_DEB_RECEIVE_FRAME 0x100
1286 #define L1_DEB_MONITOR 0x200
1287 #define DEB_DLOG_HEX 0x400
1288 #define DEB_DLOG_VERBOSE 0x800
1290 #define L2FRAME_DEBUG
1292 #ifdef L2FRAME_DEBUG
1293 extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, int dir);
1298 int protocol; /* EDSS1, 1TR6 or NI1 */
1299 unsigned long para[4];
1300 struct IsdnCardState *cs;
1303 void init_bcstate(struct IsdnCardState *cs, int bc);
1305 void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs);
1306 unsigned int random_ri(void);
1307 void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st);
1308 void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st);
1310 void setstack_l1_B(struct PStack *st);
1312 void setstack_tei(struct PStack *st);
1313 void setstack_manager(struct PStack *st);
1315 void setstack_isdnl2(struct PStack *st, char *debug_id);
1316 void releasestack_isdnl2(struct PStack *st);
1317 void setstack_transl2(struct PStack *st);
1318 void releasestack_transl2(struct PStack *st);
1320 void setstack_l3dc(struct PStack *st, struct Channel *chanp);
1321 void setstack_l3bc(struct PStack *st, struct Channel *chanp);
1322 void releasestack_isdnl3(struct PStack *st);
1324 u_char *findie(u_char * p, int size, u_char ie, int wanted_set);
1325 int getcallref(u_char * p);
1326 int newcallref(void);
1328 int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
1329 void FsmFree(struct Fsm *fsm);
1330 int FsmEvent(struct FsmInst *fi, int event, void *arg);
1331 void FsmChangeState(struct FsmInst *fi, int newstate);
1332 void FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft);
1333 int FsmAddTimer(struct FsmTimer *ft, int millisec, int event,
1334 void *arg, int where);
1335 void FsmRestartTimer(struct FsmTimer *ft, int millisec, int event,
1336 void *arg, int where);
1337 void FsmDelTimer(struct FsmTimer *ft, int where);
1338 int jiftime(char *s, long mark);
1340 int HiSax_command(isdn_ctrl * ic);
1341 int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
1342 void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
1343 void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
1344 void HiSax_reportcard(int cardnr, int sel);
1345 int QuickHex(char *txt, u_char * p, int cnt);
1346 void LogFrame(struct IsdnCardState *cs, u_char * p, int size);
1347 void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir);
1348 void iecpy(u_char * dest, u_char * iestart, int ieoffset);
1349 #ifdef ISDN_CHIP_ISAC
1350 void setstack_isac(struct PStack *st, struct IsdnCardState *cs);
1351 #endif /* ISDN_CHIP_ISAC */
1352 #endif /* __KERNEL__ */
1354 #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);}
1356 int ll_run(struct IsdnCardState *cs, int addfeatures);
1357 void ll_stop(struct IsdnCardState *cs);
1359 void CallcFree(void);
1360 int CallcNewChan(struct IsdnCardState *cs);
1361 void CallcFreeChan(struct IsdnCardState *cs);
1362 int Isdnl1New(void);
1363 void Isdnl1Free(void);
1364 int Isdnl2New(void);
1365 void Isdnl2Free(void);
1366 int Isdnl3New(void);
1367 void Isdnl3Free(void);
1368 void init_tei(struct IsdnCardState *cs, int protocol);
1369 void release_tei(struct IsdnCardState *cs);
1370 char *HiSax_getrev(const char *revision);
1373 int certification_check(int output);