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/errno.h>
11 #include <linux/major.h>
13 #include <linux/delay.h>
14 #include <linux/kernel.h>
15 #include <linux/signal.h>
16 #include <linux/slab.h>
18 #include <linux/mman.h>
19 #include <linux/ioport.h>
20 #include <linux/timer.h>
21 #include <linux/wait.h>
22 #include <linux/isdnif.h>
23 #include <linux/tty.h>
24 #include <linux/serial_reg.h>
25 #include <linux/netdevice.h>
27 #define ERROR_STATISTIC
34 #define HW_ENABLE 0x0000
35 #define HW_RESET 0x0004
36 #define HW_POWERUP 0x0008
37 #define HW_ACTIVATE 0x0010
38 #define HW_DEACTIVATE 0x0018
40 #define HW_INFO1 0x0010
41 #define HW_INFO2 0x0020
42 #define HW_INFO3 0x0030
43 #define HW_INFO4 0x0040
44 #define HW_INFO4_P8 0x0040
45 #define HW_INFO4_P10 0x0048
46 #define HW_RSYNC 0x0060
47 #define HW_TESTLOOP 0x0070
48 #define CARD_RESET 0x00F0
49 #define CARD_INIT 0x00F2
50 #define CARD_RELEASE 0x00F3
51 #define CARD_TEST 0x00F4
52 #define CARD_AUX_IND 0x00F5
54 #define PH_ACTIVATE 0x0100
55 #define PH_DEACTIVATE 0x0110
56 #define PH_DATA 0x0120
57 #define PH_PULL 0x0130
58 #define PH_TESTLOOP 0x0140
59 #define PH_PAUSE 0x0150
60 #define MPH_ACTIVATE 0x0180
61 #define MPH_DEACTIVATE 0x0190
62 #define MPH_INFORMATION 0x01A0
64 #define DL_ESTABLISH 0x0200
65 #define DL_RELEASE 0x0210
66 #define DL_DATA 0x0220
67 #define DL_FLUSH 0x0224
68 #define DL_UNIT_DATA 0x0230
70 #define MDL_BC_RELEASE 0x0278 // Formula-n enter:now
71 #define MDL_BC_ASSIGN 0x027C // Formula-n enter:now
72 #define MDL_ASSIGN 0x0280
73 #define MDL_REMOVE 0x0284
74 #define MDL_ERROR 0x0288
75 #define MDL_INFO_SETUP 0x02E0
76 #define MDL_INFO_CONN 0x02E4
77 #define MDL_INFO_REL 0x02E8
79 #define CC_SETUP 0x0300
80 #define CC_RESUME 0x0304
81 #define CC_MORE_INFO 0x0310
82 #define CC_IGNORE 0x0320
83 #define CC_REJECT 0x0324
84 #define CC_SETUP_COMPL 0x0330
85 #define CC_PROCEEDING 0x0340
86 #define CC_ALERTING 0x0344
87 #define CC_PROGRESS 0x0348
88 #define CC_CONNECT 0x0350
89 #define CC_CHARGE 0x0354
90 #define CC_NOTIFY 0x0358
91 #define CC_DISCONNECT 0x0360
92 #define CC_RELEASE 0x0368
93 #define CC_SUSPEND 0x0370
94 #define CC_PROCEED_SEND 0x0374
95 #define CC_REDIR 0x0378
96 #define CC_T302 0x0382
97 #define CC_T303 0x0383
98 #define CC_T304 0x0384
99 #define CC_T305 0x0385
100 #define CC_T308_1 0x0388
101 #define CC_T308_2 0x038A
102 #define CC_T309 0x0309
103 #define CC_T310 0x0390
104 #define CC_T313 0x0393
105 #define CC_T318 0x0398
106 #define CC_T319 0x0399
107 #define CC_TSPID 0x03A0
108 #define CC_NOSETUP_RSP 0x03E0
109 #define CC_SETUP_ERR 0x03E1
110 #define CC_SUSPEND_ERR 0x03E2
111 #define CC_RESUME_ERR 0x03E3
112 #define CC_CONNECT_ERR 0x03E4
113 #define CC_RELEASE_ERR 0x03E5
114 #define CC_RESTART 0x03F4
115 #define CC_TDSS1_IO 0x13F4 /* DSS1 IO user timer */
116 #define CC_TNI1_IO 0x13F5 /* NI1 IO user timer */
118 /* define maximum number of possible waiting incoming calls */
119 #define MAX_WAITING_CALLS 2
124 /* include l3dss1 & ni1 specific process structures, but no other defines */
125 #ifdef CONFIG_HISAX_EURO
126 #define l3dss1_process
128 #undef l3dss1_process
129 #endif /* CONFIG_HISAX_EURO */
131 #ifdef CONFIG_HISAX_NI1
132 #define l3ni1_process
135 #endif /* CONFIG_HISAX_NI1 */
137 #define MAX_DFRAME_LEN 260
138 #define MAX_DFRAME_LEN_L1 300
139 #define HSCX_BUFMAX 4096
140 #define MAX_DATA_SIZE (HSCX_BUFMAX - 4)
141 #define MAX_DATA_MEM (HSCX_BUFMAX + 64)
142 #define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)
143 #define MAX_HEADER_LEN 4
145 #define MAX_MON_FRAME 32
146 #define MAX_DLOG_SPACE 2048
147 #define MAX_BLOG_SPACE 256
149 /* #define I4L_IRQ_FLAG SA_INTERRUPT */
150 #define I4L_IRQ_FLAG 0
158 typedef void (* FSMFNPTR)(struct FsmInst *, int, void *);
161 FSMFNPTR *jumpmatrix;
162 int state_count, event_count;
163 char **strEvent, **strState;
172 void (*printdebug) (struct FsmInst *, char *, ...);
177 void (*routine) (struct FsmInst *, int, void *);
182 struct timer_list tl;
188 struct l3_process *pc;
189 struct timer_list tl;
193 #define FLG_L1_ACTIVATING 1
194 #define FLG_L1_ACTIVATED 2
195 #define FLG_L1_DEACTTIMER 3
196 #define FLG_L1_ACTTIMER 4
197 #define FLG_L1_T3RUN 5
198 #define FLG_L1_PULL_REQ 6
199 #define FLG_L1_UINT 7
204 struct PStack **stlistp;
207 struct FsmTimer timer;
208 void (*l1l2) (struct PStack *, int, void *);
209 void (*l1hw) (struct PStack *, int, void *);
210 void (*l1tei) (struct PStack *, int, void *);
215 #define GROUP_TEI 127
218 #define PACKET_NOACK 7
226 #define FLG_PEND_REL 4
227 #define FLG_L3_INIT 5
228 #define FLG_T200_RUN 6
229 #define FLG_ACK_PEND 7
231 #define FLG_OWN_BUSY 9
232 #define FLG_PEER_BUSY 10
233 #define FLG_DCHAN_BUSY 11
234 #define FLG_L1_ACTIV 12
235 #define FLG_ESTAB_PEND 13
237 #define FLG_FIXED_TEI 15
238 #define FLG_L2BLOCK 16
250 struct sk_buff *windowar[MAX_WINDOW];
251 struct sk_buff_head i_queue;
252 struct sk_buff_head ui_queue;
253 void (*l2l1) (struct PStack *, int, void *);
254 void (*l2l3) (struct PStack *, int, void *);
255 void (*l2tei) (struct PStack *, int, void *);
257 struct FsmTimer t200, t203;
258 int T200, N200, T203;
264 void (*l3l4) (struct PStack *, int, void *);
265 void (*l3ml3) (struct PStack *, int, void *);
266 void (*l3l2) (struct PStack *, int, void *);
268 struct FsmTimer l3m_timer;
269 struct sk_buff_head squeue;
270 struct l3_process *proc;
271 struct l3_process *global;
278 void (*l4l3) (struct PStack *, int, void *);
279 int (*l4l3_proto) (struct PStack *, isdn_ctrl *);
284 #define FLG_LLI_L1WAKEUP 1
285 #define FLG_LLI_L2WAKEUP 2
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 {
408 } __attribute__((packed));
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 work_struct tq_rcv;
457 struct work_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
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 */
501 struct timer_list transbusy;
502 struct work_struct tqueue;
504 int (*BC_SetStack) (struct PStack *, struct BCState *);
505 void (*BC_Close) (struct BCState *);
506 #ifdef ERROR_STATISTIC
517 struct tiger_hw tiger;
518 struct amd7930_hw amd7930;
519 struct w6692B_hw w6692;
520 struct hisax_b_if *b_if;
525 struct PStack *b_st, *d_st;
526 struct IsdnCardState *cs;
531 struct FsmTimer drel_timer, dial_timer;
533 int l2_protocol, l2_active_protocol;
536 struct l3_process *proc;
537 setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
538 u_long Flags; /* for remembering action done in l4 */
553 unsigned int counter;
555 struct timer_list tl;
562 unsigned int transcnt;
572 unsigned int cfg_reg;
576 signed int hscxfifo[2];
580 unsigned int cfg_reg;
581 void __iomem *membase;
582 unsigned long phymem;
586 unsigned int cfg_reg;
588 unsigned int hscx[2];
589 unsigned int isacfifo;
590 unsigned int hscxfifo[2];
591 unsigned int counter;
596 unsigned int cfg_reg;
597 unsigned int isac_ale;
599 unsigned int hscx_ale;
604 unsigned long cfg_reg;
605 unsigned long pci_cfg;
607 unsigned long isac_adr;
609 unsigned long hscx_adr;
612 struct timer_list tl;
618 unsigned int cfg_reg;
629 unsigned int fifosize;
634 struct timer_list timer;
638 unsigned int cfg_reg;
642 unsigned int reset_on;
643 unsigned int reset_off;
644 struct isar_reg isar;
651 unsigned int cfg_reg;
653 unsigned int hscx[2];
654 unsigned char res_irq;
658 unsigned int cfg_reg;
669 unsigned char dmactrl;
670 unsigned char ctrl_reg;
671 unsigned char irqmask0;
672 unsigned char irqstat0;
673 unsigned char last_is0;
682 unsigned char int_m1;
683 unsigned char int_m2;
684 unsigned char int_s1;
686 unsigned char sctrl_r;
687 unsigned char sctrl_e;
691 unsigned char fifo_en;
692 unsigned char bswapped;
693 unsigned char nt_mode;
696 unsigned char *pci_io; /* start of PCI IO memory */
697 void *share_start; /* shared memory for Fifos start */
698 void *fifos; /* FIFO memory */
699 int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
700 struct timer_list timer;
709 unsigned char int_m1;
710 unsigned char int_m2;
711 unsigned char int_s1;
713 unsigned char sctrl_r;
714 unsigned char sctrl_e;
718 unsigned char bswapped;
719 unsigned char nt_mode;
722 unsigned char last_fifo;
725 struct timer_list timer;
730 unsigned int bfifosize;
731 unsigned int dfifosize;
737 unsigned char int_m1;
738 unsigned char int_m2;
739 unsigned char int_s1;
746 struct timer_list timer;
751 unsigned long phymem;
754 struct isar_reg isar_r;
759 unsigned int cfg_reg;
763 struct timer_list timer;
770 unsigned long isac_adr;
771 unsigned int isac_ale;
772 unsigned long jade_adr;
773 unsigned int jade_ale;
774 /* Scitel Quadro stuff */
775 unsigned long plx_adr;
776 unsigned long data_adr;
781 unsigned int cfg_reg;
782 unsigned int pciaddr[2];
787 signed int hscxfifo[2];
788 unsigned char timeslot;
795 struct timer_list timer;
799 struct arcofi_msg *next;
812 struct arcofi_msg *arcofi_list;
813 struct timer_list arcofitimer;
814 wait_queue_head_t arcofi_wait;
837 struct amd7930_chip {
842 unsigned int tx_xmtlen;
843 struct timer_list timer3;
844 void (*ph_command) (struct IsdnCardState *, u_char, char *);
845 void (*setIrqMask) (struct IsdnCardState *, u_char);
855 struct arcofi_msg *arcofi_list;
856 struct timer_list arcofitimer;
857 wait_queue_head_t arcofi_wait;
868 #define FLG_TWO_DCHAN 4
869 #define FLG_L1_DBUSY 5
870 #define FLG_DBUSY_TIMER 6
871 #define FLG_LOCK_ATOMIC 7
872 #define FLG_ARCOFI_TIMER 8
873 #define FLG_ARCOFI_ERROR 9
874 #define FLG_HW_L1_UINT 10
876 struct IsdnCardState {
885 int chanlimit; /* limited number of B-chans to use */
886 int logecho; /* log echo if supported by card */
889 struct teles0_hw teles0;
890 struct teles3_hw teles3;
901 struct hfcPCI_hw hfcpci;
902 struct hfcSX_hw hfcsx;
904 struct isurf_hw isurf;
905 struct saphir_hw saphir;
907 struct gazel_hw gazel;
908 struct w6692_hw w6692;
909 struct hisax_d_if *hisax_d_if;
916 u_char *status_write;
918 u_char (*readisac) (struct IsdnCardState *, u_char);
919 void (*writeisac) (struct IsdnCardState *, u_char, u_char);
920 void (*readisacfifo) (struct IsdnCardState *, u_char *, int);
921 void (*writeisacfifo) (struct IsdnCardState *, u_char *, int);
922 u_char (*BC_Read_Reg) (struct IsdnCardState *, int, u_char);
923 void (*BC_Write_Reg) (struct IsdnCardState *, int, u_char, u_char);
924 void (*BC_Send_Data) (struct BCState *);
925 int (*cardmsg) (struct IsdnCardState *, int, void *);
926 void (*setstack_d) (struct PStack *, struct IsdnCardState *);
927 void (*DC_Close) (struct IsdnCardState *);
928 int (*irq_func) (int, void *);
929 int (*auxcmd) (struct IsdnCardState *, isdn_ctrl *);
930 struct Channel channel[2+MAX_WAITING_CALLS];
931 struct BCState bcs[2+MAX_WAITING_CALLS];
932 struct PStack *stlist;
933 struct sk_buff_head rq, sq; /* D-channel queues */
938 struct isac_chip isac;
939 struct hfcd_chip hfcd;
940 struct hfcpci_chip hfcpci;
941 struct hfcsx_chip hfcsx;
942 struct w6692_chip w6692;
943 struct amd7930_chip amd7930;
948 struct sk_buff *tx_skb;
951 struct work_struct tqueue;
952 struct timer_list dbusytimer;
953 #ifdef ERROR_STATISTIC
961 #define schedule_event(s, ev) do {test_and_set_bit(ev, &s->event);schedule_work(&s->tqueue); } while(0)
969 #ifdef ISDN_CHIP_ISAC
970 #undef ISDN_CHIP_ISAC
973 #ifdef CONFIG_HISAX_16_0
974 #define CARD_TELES0 1
975 #ifndef ISDN_CHIP_ISAC
976 #define ISDN_CHIP_ISAC 1
979 #define CARD_TELES0 0
982 #ifdef CONFIG_HISAX_16_3
983 #define CARD_TELES3 1
984 #ifndef ISDN_CHIP_ISAC
985 #define ISDN_CHIP_ISAC 1
988 #define CARD_TELES3 0
991 #ifdef CONFIG_HISAX_TELESPCI
992 #define CARD_TELESPCI 1
993 #ifndef ISDN_CHIP_ISAC
994 #define ISDN_CHIP_ISAC 1
997 #define CARD_TELESPCI 0
1000 #ifdef CONFIG_HISAX_AVM_A1
1001 #define CARD_AVM_A1 1
1002 #ifndef ISDN_CHIP_ISAC
1003 #define ISDN_CHIP_ISAC 1
1006 #define CARD_AVM_A1 0
1009 #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
1010 #define CARD_AVM_A1_PCMCIA 1
1011 #ifndef ISDN_CHIP_ISAC
1012 #define ISDN_CHIP_ISAC 1
1015 #define CARD_AVM_A1_PCMCIA 0
1018 #ifdef CONFIG_HISAX_FRITZPCI
1019 #define CARD_FRITZPCI 1
1020 #ifndef ISDN_CHIP_ISAC
1021 #define ISDN_CHIP_ISAC 1
1024 #define CARD_FRITZPCI 0
1027 #ifdef CONFIG_HISAX_ELSA
1029 #ifndef ISDN_CHIP_ISAC
1030 #define ISDN_CHIP_ISAC 1
1036 #ifdef CONFIG_HISAX_IX1MICROR2
1037 #define CARD_IX1MICROR2 1
1038 #ifndef ISDN_CHIP_ISAC
1039 #define ISDN_CHIP_ISAC 1
1042 #define CARD_IX1MICROR2 0
1045 #ifdef CONFIG_HISAX_DIEHLDIVA
1046 #define CARD_DIEHLDIVA 1
1047 #ifndef ISDN_CHIP_ISAC
1048 #define ISDN_CHIP_ISAC 1
1051 #define CARD_DIEHLDIVA 0
1054 #ifdef CONFIG_HISAX_ASUSCOM
1055 #define CARD_ASUSCOM 1
1056 #ifndef ISDN_CHIP_ISAC
1057 #define ISDN_CHIP_ISAC 1
1060 #define CARD_ASUSCOM 0
1063 #ifdef CONFIG_HISAX_TELEINT
1064 #define CARD_TELEINT 1
1065 #ifndef ISDN_CHIP_ISAC
1066 #define ISDN_CHIP_ISAC 1
1069 #define CARD_TELEINT 0
1072 #ifdef CONFIG_HISAX_SEDLBAUER
1073 #define CARD_SEDLBAUER 1
1074 #ifndef ISDN_CHIP_ISAC
1075 #define ISDN_CHIP_ISAC 1
1078 #define CARD_SEDLBAUER 0
1081 #ifdef CONFIG_HISAX_SPORTSTER
1082 #define CARD_SPORTSTER 1
1083 #ifndef ISDN_CHIP_ISAC
1084 #define ISDN_CHIP_ISAC 1
1087 #define CARD_SPORTSTER 0
1090 #ifdef CONFIG_HISAX_MIC
1092 #ifndef ISDN_CHIP_ISAC
1093 #define ISDN_CHIP_ISAC 1
1099 #ifdef CONFIG_HISAX_NETJET
1100 #define CARD_NETJET_S 1
1101 #ifndef ISDN_CHIP_ISAC
1102 #define ISDN_CHIP_ISAC 1
1105 #define CARD_NETJET_S 0
1108 #ifdef CONFIG_HISAX_HFCS
1114 #ifdef CONFIG_HISAX_HFC_PCI
1115 #define CARD_HFC_PCI 1
1117 #define CARD_HFC_PCI 0
1120 #ifdef CONFIG_HISAX_HFC_SX
1121 #define CARD_HFC_SX 1
1123 #define CARD_HFC_SX 0
1126 #ifdef CONFIG_HISAX_NICCY
1127 #define CARD_NICCY 1
1128 #ifndef ISDN_CHIP_ISAC
1129 #define ISDN_CHIP_ISAC 1
1132 #define CARD_NICCY 0
1135 #ifdef CONFIG_HISAX_ISURF
1136 #define CARD_ISURF 1
1137 #ifndef ISDN_CHIP_ISAC
1138 #define ISDN_CHIP_ISAC 1
1141 #define CARD_ISURF 0
1144 #ifdef CONFIG_HISAX_S0BOX
1145 #define CARD_S0BOX 1
1146 #ifndef ISDN_CHIP_ISAC
1147 #define ISDN_CHIP_ISAC 1
1150 #define CARD_S0BOX 0
1153 #ifdef CONFIG_HISAX_HSTSAPHIR
1154 #define CARD_HSTSAPHIR 1
1155 #ifndef ISDN_CHIP_ISAC
1156 #define ISDN_CHIP_ISAC 1
1159 #define CARD_HSTSAPHIR 0
1162 #ifdef CONFIG_HISAX_BKM_A4T
1163 #define CARD_BKM_A4T 1
1164 #ifndef ISDN_CHIP_ISAC
1165 #define ISDN_CHIP_ISAC 1
1168 #define CARD_BKM_A4T 0
1171 #ifdef CONFIG_HISAX_SCT_QUADRO
1172 #define CARD_SCT_QUADRO 1
1173 #ifndef ISDN_CHIP_ISAC
1174 #define ISDN_CHIP_ISAC 1
1177 #define CARD_SCT_QUADRO 0
1180 #ifdef CONFIG_HISAX_GAZEL
1181 #define CARD_GAZEL 1
1182 #ifndef ISDN_CHIP_ISAC
1183 #define ISDN_CHIP_ISAC 1
1186 #define CARD_GAZEL 0
1189 #ifdef CONFIG_HISAX_W6692
1190 #define CARD_W6692 1
1191 #ifndef ISDN_CHIP_W6692
1192 #define ISDN_CHIP_W6692 1
1195 #define CARD_W6692 0
1198 #ifdef CONFIG_HISAX_NETJET_U
1199 #define CARD_NETJET_U 1
1200 #ifndef ISDN_CHIP_ICC
1201 #define ISDN_CHIP_ICC 1
1203 #ifndef HISAX_UINTERFACE
1204 #define HISAX_UINTERFACE 1
1207 #define CARD_NETJET_U 0
1210 #ifdef CONFIG_HISAX_ENTERNOW_PCI
1211 #define CARD_FN_ENTERNOW_PCI 1
1213 #define CARD_FN_ENTERNOW_PCI 0
1216 #define TEI_PER_CARD 1
1219 #define L1_DEB_WARN 0x01
1220 #define L1_DEB_INTSTAT 0x02
1221 #define L1_DEB_ISAC 0x04
1222 #define L1_DEB_ISAC_FIFO 0x08
1223 #define L1_DEB_HSCX 0x10
1224 #define L1_DEB_HSCX_FIFO 0x20
1225 #define L1_DEB_LAPD 0x40
1226 #define L1_DEB_IPAC 0x80
1227 #define L1_DEB_RECEIVE_FRAME 0x100
1228 #define L1_DEB_MONITOR 0x200
1229 #define DEB_DLOG_HEX 0x400
1230 #define DEB_DLOG_VERBOSE 0x800
1232 #define L2FRAME_DEBUG
1234 #ifdef L2FRAME_DEBUG
1235 extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, int dir);
1238 #include "hisax_cfg.h"
1240 void init_bcstate(struct IsdnCardState *cs, int bc);
1242 void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs);
1243 void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st);
1244 void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st);
1246 void setstack_l1_B(struct PStack *st);
1248 void setstack_tei(struct PStack *st);
1249 void setstack_manager(struct PStack *st);
1251 void setstack_isdnl2(struct PStack *st, char *debug_id);
1252 void releasestack_isdnl2(struct PStack *st);
1253 void setstack_transl2(struct PStack *st);
1254 void releasestack_transl2(struct PStack *st);
1255 void lli_writewakeup(struct PStack *st, int len);
1257 void setstack_l3dc(struct PStack *st, struct Channel *chanp);
1258 void setstack_l3bc(struct PStack *st, struct Channel *chanp);
1259 void releasestack_isdnl3(struct PStack *st);
1261 u_char *findie(u_char * p, int size, u_char ie, int wanted_set);
1262 int getcallref(u_char * p);
1263 int newcallref(void);
1265 int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
1266 void FsmFree(struct Fsm *fsm);
1267 int FsmEvent(struct FsmInst *fi, int event, void *arg);
1268 void FsmChangeState(struct FsmInst *fi, int newstate);
1269 void FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft);
1270 int FsmAddTimer(struct FsmTimer *ft, int millisec, int event,
1271 void *arg, int where);
1272 void FsmRestartTimer(struct FsmTimer *ft, int millisec, int event,
1273 void *arg, int where);
1274 void FsmDelTimer(struct FsmTimer *ft, int where);
1275 int jiftime(char *s, long mark);
1277 int HiSax_command(isdn_ctrl * ic);
1278 int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
1279 void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
1280 void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
1281 void HiSax_reportcard(int cardnr, int sel);
1282 int QuickHex(char *txt, u_char * p, int cnt);
1283 void LogFrame(struct IsdnCardState *cs, u_char * p, int size);
1284 void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir);
1285 void iecpy(u_char * dest, u_char * iestart, int ieoffset);
1286 #endif /* __KERNEL__ */
1289 * Busywait delay for `jiffs' jiffies
1291 #define HZDELAY(jiffs) do { \
1295 int loops = USEC_PER_SEC / HZ; \
1301 int ll_run(struct IsdnCardState *cs, int addfeatures);
1303 void CallcFree(void);
1304 int CallcNewChan(struct IsdnCardState *cs);
1305 void CallcFreeChan(struct IsdnCardState *cs);
1306 int Isdnl1New(void);
1307 void Isdnl1Free(void);
1308 int Isdnl2New(void);
1309 void Isdnl2Free(void);
1310 int Isdnl3New(void);
1311 void Isdnl3Free(void);
1312 void init_tei(struct IsdnCardState *cs, int protocol);
1313 void release_tei(struct IsdnCardState *cs);
1314 char *HiSax_getrev(const char *revision);