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/interrupt.h>
20 #include <linux/ioport.h>
21 #include <linux/timer.h>
22 #include <linux/wait.h>
23 #include <linux/isdnif.h>
24 #include <linux/tty.h>
25 #include <linux/serial_reg.h>
26 #include <linux/netdevice.h>
28 #define ERROR_STATISTIC
35 #define HW_ENABLE 0x0000
36 #define HW_RESET 0x0004
37 #define HW_POWERUP 0x0008
38 #define HW_ACTIVATE 0x0010
39 #define HW_DEACTIVATE 0x0018
41 #define HW_INFO1 0x0010
42 #define HW_INFO2 0x0020
43 #define HW_INFO3 0x0030
44 #define HW_INFO4 0x0040
45 #define HW_INFO4_P8 0x0040
46 #define HW_INFO4_P10 0x0048
47 #define HW_RSYNC 0x0060
48 #define HW_TESTLOOP 0x0070
49 #define CARD_RESET 0x00F0
50 #define CARD_INIT 0x00F2
51 #define CARD_RELEASE 0x00F3
52 #define CARD_TEST 0x00F4
53 #define CARD_AUX_IND 0x00F5
55 #define PH_ACTIVATE 0x0100
56 #define PH_DEACTIVATE 0x0110
57 #define PH_DATA 0x0120
58 #define PH_PULL 0x0130
59 #define PH_TESTLOOP 0x0140
60 #define PH_PAUSE 0x0150
61 #define MPH_ACTIVATE 0x0180
62 #define MPH_DEACTIVATE 0x0190
63 #define MPH_INFORMATION 0x01A0
65 #define DL_ESTABLISH 0x0200
66 #define DL_RELEASE 0x0210
67 #define DL_DATA 0x0220
68 #define DL_FLUSH 0x0224
69 #define DL_UNIT_DATA 0x0230
71 #define MDL_BC_RELEASE 0x0278 // Formula-n enter:now
72 #define MDL_BC_ASSIGN 0x027C // Formula-n enter:now
73 #define MDL_ASSIGN 0x0280
74 #define MDL_REMOVE 0x0284
75 #define MDL_ERROR 0x0288
76 #define MDL_INFO_SETUP 0x02E0
77 #define MDL_INFO_CONN 0x02E4
78 #define MDL_INFO_REL 0x02E8
80 #define CC_SETUP 0x0300
81 #define CC_RESUME 0x0304
82 #define CC_MORE_INFO 0x0310
83 #define CC_IGNORE 0x0320
84 #define CC_REJECT 0x0324
85 #define CC_SETUP_COMPL 0x0330
86 #define CC_PROCEEDING 0x0340
87 #define CC_ALERTING 0x0344
88 #define CC_PROGRESS 0x0348
89 #define CC_CONNECT 0x0350
90 #define CC_CHARGE 0x0354
91 #define CC_NOTIFY 0x0358
92 #define CC_DISCONNECT 0x0360
93 #define CC_RELEASE 0x0368
94 #define CC_SUSPEND 0x0370
95 #define CC_PROCEED_SEND 0x0374
96 #define CC_REDIR 0x0378
97 #define CC_T302 0x0382
98 #define CC_T303 0x0383
99 #define CC_T304 0x0384
100 #define CC_T305 0x0385
101 #define CC_T308_1 0x0388
102 #define CC_T308_2 0x038A
103 #define CC_T309 0x0309
104 #define CC_T310 0x0390
105 #define CC_T313 0x0393
106 #define CC_T318 0x0398
107 #define CC_T319 0x0399
108 #define CC_TSPID 0x03A0
109 #define CC_NOSETUP_RSP 0x03E0
110 #define CC_SETUP_ERR 0x03E1
111 #define CC_SUSPEND_ERR 0x03E2
112 #define CC_RESUME_ERR 0x03E3
113 #define CC_CONNECT_ERR 0x03E4
114 #define CC_RELEASE_ERR 0x03E5
115 #define CC_RESTART 0x03F4
116 #define CC_TDSS1_IO 0x13F4 /* DSS1 IO user timer */
117 #define CC_TNI1_IO 0x13F5 /* NI1 IO user timer */
119 /* define maximum number of possible waiting incoming calls */
120 #define MAX_WAITING_CALLS 2
125 extern const char *CardType
[];
128 extern const char *l1_revision
;
129 extern const char *l2_revision
;
130 extern const char *l3_revision
;
131 extern const char *lli_revision
;
132 extern const char *tei_revision
;
134 /* include l3dss1 & ni1 specific process structures, but no other defines */
135 #ifdef CONFIG_HISAX_EURO
136 #define l3dss1_process
138 #undef l3dss1_process
139 #endif /* CONFIG_HISAX_EURO */
141 #ifdef CONFIG_HISAX_NI1
142 #define l3ni1_process
145 #endif /* CONFIG_HISAX_NI1 */
147 #define MAX_DFRAME_LEN 260
148 #define MAX_DFRAME_LEN_L1 300
149 #define HSCX_BUFMAX 4096
150 #define MAX_DATA_SIZE (HSCX_BUFMAX - 4)
151 #define MAX_DATA_MEM (HSCX_BUFMAX + 64)
152 #define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)
153 #define MAX_HEADER_LEN 4
155 #define MAX_MON_FRAME 32
156 #define MAX_DLOG_SPACE 2048
157 #define MAX_BLOG_SPACE 256
159 /* #define I4L_IRQ_FLAG SA_INTERRUPT */
160 #define I4L_IRQ_FLAG 0
168 typedef void (* FSMFNPTR
)(struct FsmInst
*, int, void *);
171 FSMFNPTR
*jumpmatrix
;
172 int state_count
, event_count
;
173 char **strEvent
, **strState
;
182 void (*printdebug
) (struct FsmInst
*, char *, ...);
187 void (*routine
) (struct FsmInst
*, int, void *);
192 struct timer_list tl
;
198 struct l3_process
*pc
;
199 struct timer_list tl
;
203 #define FLG_L1_ACTIVATING 1
204 #define FLG_L1_ACTIVATED 2
205 #define FLG_L1_DEACTTIMER 3
206 #define FLG_L1_ACTTIMER 4
207 #define FLG_L1_T3RUN 5
208 #define FLG_L1_PULL_REQ 6
209 #define FLG_L1_UINT 7
214 struct PStack
**stlistp
;
217 struct FsmTimer timer
;
218 void (*l1l2
) (struct PStack
*, int, void *);
219 void (*l1hw
) (struct PStack
*, int, void *);
220 void (*l1tei
) (struct PStack
*, int, void *);
225 #define GROUP_TEI 127
228 #define PACKET_NOACK 7
236 #define FLG_PEND_REL 4
237 #define FLG_L3_INIT 5
238 #define FLG_T200_RUN 6
239 #define FLG_ACK_PEND 7
241 #define FLG_OWN_BUSY 9
242 #define FLG_PEER_BUSY 10
243 #define FLG_DCHAN_BUSY 11
244 #define FLG_L1_ACTIV 12
245 #define FLG_ESTAB_PEND 13
247 #define FLG_FIXED_TEI 15
248 #define FLG_L2BLOCK 16
260 struct sk_buff
*windowar
[MAX_WINDOW
];
261 struct sk_buff_head i_queue
;
262 struct sk_buff_head ui_queue
;
263 void (*l2l1
) (struct PStack
*, int, void *);
264 void (*l2l3
) (struct PStack
*, int, void *);
265 void (*l2tei
) (struct PStack
*, int, void *);
267 struct FsmTimer t200
, t203
;
268 int T200
, N200
, T203
;
274 void (*l3l4
) (struct PStack
*, int, void *);
275 void (*l3ml3
) (struct PStack
*, int, void *);
276 void (*l3l2
) (struct PStack
*, int, void *);
278 struct FsmTimer l3m_timer
;
279 struct sk_buff_head squeue
;
280 struct l3_process
*proc
;
281 struct l3_process
*global
;
288 void (*l4l3
) (struct PStack
*, int, void *);
289 int (*l4l3_proto
) (struct PStack
*, isdn_ctrl
*);
294 #define FLG_LLI_L1WAKEUP 1
295 #define FLG_LLI_L2WAKEUP 2
299 struct FsmInst tei_m
;
300 struct FsmTimer t202
;
301 int T202
, N202
, debug
;
302 void (*layer
) (struct PStack
*, int, void *);
313 int spv
; /* SPV Flag */
314 setup_parm setup
; /* from isdnif.h numbers and Serviceindicator */
315 u_char moderate
; /* transfer mode and rate (bearer octet 4) */
324 struct LLInterface lli
;
325 struct Management ma
;
326 int protocol
; /* EDSS1, 1TR6 or NI1 */
328 /* protocol specific data fields */
330 { u_char uuuu
; /* only as dummy */
331 #ifdef CONFIG_HISAX_EURO
332 dss1_stk_priv dss1
; /* private dss1 data */
333 #endif /* CONFIG_HISAX_EURO */
334 #ifdef CONFIG_HISAX_NI1
335 ni1_stk_priv ni1
; /* private ni1 data */
336 #endif /* CONFIG_HISAX_NI1 */
343 struct L3Timer timer
;
347 struct Channel
*chan
;
349 struct l3_process
*next
;
352 /* protocol specific data fields */
354 { u_char uuuu
; /* only when euro not defined, avoiding empty union */
355 #ifdef CONFIG_HISAX_EURO
356 dss1_proc_priv dss1
; /* private dss1 data */
357 #endif /* CONFIG_HISAX_EURO */
358 #ifdef CONFIG_HISAX_NI1
359 ni1_proc_priv ni1
; /* private ni1 data */
360 #endif /* CONFIG_HISAX_NI1 */
367 int count
; /* Current skb sent count */
368 u_char
*rcvbuf
; /* B-Channel receive Buffer */
376 int count
; /* Current skb sent count */
377 u_char
*rcvbuf
; /* B-Channel receive Buffer */
382 volatile u_char bstat
;
384 volatile u_char cmsb
;
385 volatile u_char clsb
;
386 volatile u_char par
[8];
400 struct timer_list ftimer
;
401 u_char
*rcvbuf
; /* B-Channel receive Buffer */
403 struct isar_reg
*reg
;
406 struct hdlc_stat_reg
{
418 } __attribute__((packed
));
423 struct hdlc_stat_reg sr
;
427 int count
; /* Current skb sent count */
428 u_char
*rcvbuf
; /* B-Channel receive Buffer */
464 struct sk_buff
*rv_skb
;
465 struct hdlc_state
*hdlc_state
;
466 struct work_struct tq_rcv
;
467 struct work_struct tq_xmt
;
470 #define BC_FLG_INIT 1
471 #define BC_FLG_ACTIV 2
472 #define BC_FLG_BUSY 3
473 #define BC_FLG_NOFRAME 4
474 #define BC_FLG_HALF 5
475 #define BC_FLG_EMPTY 6
476 #define BC_FLG_ORIG 7
477 #define BC_FLG_DLEETX 8
478 #define BC_FLG_LASTDLE 9
479 #define BC_FLG_FIRST 10
480 #define BC_FLG_LASTDATA 11
481 #define BC_FLG_NMD_DATA 12
482 #define BC_FLG_FTI_RUN 13
483 #define BC_FLG_LL_OK 14
484 #define BC_FLG_LL_CONN 15
485 #define BC_FLG_FTI_FTS 16
486 #define BC_FLG_FRH_WAIT 17
488 #define L1_MODE_NULL 0
489 #define L1_MODE_TRANS 1
490 #define L1_MODE_HDLC 2
491 #define L1_MODE_EXTRN 3
492 #define L1_MODE_HDLC_56K 4
493 #define L1_MODE_MODEM 7
494 #define L1_MODE_V32 8
495 #define L1_MODE_FAX 9
501 struct IsdnCardState
*cs
;
502 int tx_cnt
; /* B-Channel transmit counter */
503 struct sk_buff
*tx_skb
; /* B-Channel transmit Buffer */
504 struct sk_buff_head rqueue
; /* B-Channel receive Queue */
505 struct sk_buff_head squeue
; /* B-Channel send Queue */
511 struct timer_list transbusy
;
512 struct work_struct tqueue
;
514 int (*BC_SetStack
) (struct PStack
*, struct BCState
*);
515 void (*BC_Close
) (struct BCState
*);
516 #ifdef ERROR_STATISTIC
527 struct tiger_hw tiger
;
528 struct amd7930_hw amd7930
;
529 struct w6692B_hw w6692
;
530 struct hisax_b_if
*b_if
;
535 struct PStack
*b_st
, *d_st
;
536 struct IsdnCardState
*cs
;
541 struct FsmTimer drel_timer
, dial_timer
;
543 int l2_protocol
, l2_active_protocol
;
546 struct l3_process
*proc
;
547 setup_parm setup
; /* from isdnif.h numbers and Serviceindicator */
548 u_long Flags
; /* for remembering action done in l4 */
563 unsigned int counter
;
565 struct timer_list tl
;
572 unsigned int transcnt
;
582 unsigned int cfg_reg
;
586 signed int hscxfifo
[2];
590 unsigned int cfg_reg
;
591 void __iomem
*membase
;
592 unsigned long phymem
;
596 unsigned int cfg_reg
;
598 unsigned int hscx
[2];
599 unsigned int isacfifo
;
600 unsigned int hscxfifo
[2];
601 unsigned int counter
;
606 unsigned int cfg_reg
;
607 unsigned int isac_ale
;
609 unsigned int hscx_ale
;
614 unsigned long cfg_reg
;
615 unsigned long pci_cfg
;
617 unsigned long isac_adr
;
619 unsigned long hscx_adr
;
622 struct timer_list tl
;
628 unsigned int cfg_reg
;
639 unsigned int fifosize
;
644 struct timer_list timer
;
648 unsigned int cfg_reg
;
652 unsigned int reset_on
;
653 unsigned int reset_off
;
654 struct isar_reg isar
;
661 unsigned int cfg_reg
;
663 unsigned int hscx
[2];
664 unsigned char res_irq
;
668 unsigned int cfg_reg
;
679 unsigned char dmactrl
;
680 unsigned char ctrl_reg
;
681 unsigned char irqmask0
;
682 unsigned char irqstat0
;
683 unsigned char last_is0
;
692 unsigned char int_m1
;
693 unsigned char int_m2
;
694 unsigned char int_s1
;
696 unsigned char sctrl_r
;
697 unsigned char sctrl_e
;
701 unsigned char fifo_en
;
702 unsigned char bswapped
;
703 unsigned char nt_mode
;
706 unsigned char *pci_io
; /* start of PCI IO memory */
707 dma_addr_t dma
; /* dma handle for Fifos */
708 void *fifos
; /* FIFO memory */
709 int last_bfifo_cnt
[2]; /* marker saving last b-fifo frame count */
710 struct timer_list timer
;
719 unsigned char int_m1
;
720 unsigned char int_m2
;
721 unsigned char int_s1
;
723 unsigned char sctrl_r
;
724 unsigned char sctrl_e
;
728 unsigned char bswapped
;
729 unsigned char nt_mode
;
732 unsigned char last_fifo
;
735 struct timer_list timer
;
740 unsigned int bfifosize
;
741 unsigned int dfifosize
;
747 unsigned char int_m1
;
748 unsigned char int_m2
;
749 unsigned char int_s1
;
756 struct timer_list timer
;
761 unsigned long phymem
;
764 struct isar_reg isar_r
;
769 unsigned int cfg_reg
;
773 struct timer_list timer
;
780 unsigned long isac_adr
;
781 unsigned int isac_ale
;
782 unsigned long jade_adr
;
783 unsigned int jade_ale
;
784 /* Scitel Quadro stuff */
785 unsigned long plx_adr
;
786 unsigned long data_adr
;
791 unsigned int cfg_reg
;
792 unsigned int pciaddr
[2];
797 signed int hscxfifo
[2];
798 unsigned char timeslot
;
805 struct timer_list timer
;
809 struct arcofi_msg
*next
;
822 struct arcofi_msg
*arcofi_list
;
823 struct timer_list arcofitimer
;
824 wait_queue_head_t arcofi_wait
;
847 struct amd7930_chip
{
852 unsigned int tx_xmtlen
;
853 struct timer_list timer3
;
854 void (*ph_command
) (struct IsdnCardState
*, u_char
, char *);
855 void (*setIrqMask
) (struct IsdnCardState
*, u_char
);
865 struct arcofi_msg
*arcofi_list
;
866 struct timer_list arcofitimer
;
867 wait_queue_head_t arcofi_wait
;
878 #define FLG_TWO_DCHAN 4
879 #define FLG_L1_DBUSY 5
880 #define FLG_DBUSY_TIMER 6
881 #define FLG_LOCK_ATOMIC 7
882 #define FLG_ARCOFI_TIMER 8
883 #define FLG_ARCOFI_ERROR 9
884 #define FLG_HW_L1_UINT 10
886 struct IsdnCardState
{
895 int chanlimit
; /* limited number of B-chans to use */
896 int logecho
; /* log echo if supported by card */
899 struct teles0_hw teles0
;
900 struct teles3_hw teles3
;
911 struct hfcPCI_hw hfcpci
;
912 struct hfcSX_hw hfcsx
;
914 struct isurf_hw isurf
;
915 struct saphir_hw saphir
;
917 struct gazel_hw gazel
;
918 struct w6692_hw w6692
;
919 struct hisax_d_if
*hisax_d_if
;
926 u_char
*status_write
;
928 u_char (*readisac
) (struct IsdnCardState
*, u_char
);
929 void (*writeisac
) (struct IsdnCardState
*, u_char
, u_char
);
930 void (*readisacfifo
) (struct IsdnCardState
*, u_char
*, int);
931 void (*writeisacfifo
) (struct IsdnCardState
*, u_char
*, int);
932 u_char (*BC_Read_Reg
) (struct IsdnCardState
*, int, u_char
);
933 void (*BC_Write_Reg
) (struct IsdnCardState
*, int, u_char
, u_char
);
934 void (*BC_Send_Data
) (struct BCState
*);
935 int (*cardmsg
) (struct IsdnCardState
*, int, void *);
936 void (*setstack_d
) (struct PStack
*, struct IsdnCardState
*);
937 void (*DC_Close
) (struct IsdnCardState
*);
938 irq_handler_t irq_func
;
939 int (*auxcmd
) (struct IsdnCardState
*, isdn_ctrl
*);
940 struct Channel channel
[2+MAX_WAITING_CALLS
];
941 struct BCState bcs
[2+MAX_WAITING_CALLS
];
942 struct PStack
*stlist
;
943 struct sk_buff_head rq
, sq
; /* D-channel queues */
948 struct isac_chip isac
;
949 struct hfcd_chip hfcd
;
950 struct hfcpci_chip hfcpci
;
951 struct hfcsx_chip hfcsx
;
952 struct w6692_chip w6692
;
953 struct amd7930_chip amd7930
;
958 struct sk_buff
*tx_skb
;
961 struct work_struct tqueue
;
962 struct timer_list dbusytimer
;
963 unsigned int irq_cnt
;
964 #ifdef ERROR_STATISTIC
972 #define schedule_event(s, ev) do {test_and_set_bit(ev, &s->event);schedule_work(&s->tqueue); } while(0)
980 #ifdef ISDN_CHIP_ISAC
981 #undef ISDN_CHIP_ISAC
984 #ifdef CONFIG_HISAX_16_0
985 #define CARD_TELES0 1
986 #ifndef ISDN_CHIP_ISAC
987 #define ISDN_CHIP_ISAC 1
990 #define CARD_TELES0 0
993 #ifdef CONFIG_HISAX_16_3
994 #define CARD_TELES3 1
995 #ifndef ISDN_CHIP_ISAC
996 #define ISDN_CHIP_ISAC 1
999 #define CARD_TELES3 0
1002 #ifdef CONFIG_HISAX_TELESPCI
1003 #define CARD_TELESPCI 1
1004 #ifndef ISDN_CHIP_ISAC
1005 #define ISDN_CHIP_ISAC 1
1008 #define CARD_TELESPCI 0
1011 #ifdef CONFIG_HISAX_AVM_A1
1012 #define CARD_AVM_A1 1
1013 #ifndef ISDN_CHIP_ISAC
1014 #define ISDN_CHIP_ISAC 1
1017 #define CARD_AVM_A1 0
1020 #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
1021 #define CARD_AVM_A1_PCMCIA 1
1022 #ifndef ISDN_CHIP_ISAC
1023 #define ISDN_CHIP_ISAC 1
1026 #define CARD_AVM_A1_PCMCIA 0
1029 #ifdef CONFIG_HISAX_FRITZPCI
1030 #define CARD_FRITZPCI 1
1031 #ifndef ISDN_CHIP_ISAC
1032 #define ISDN_CHIP_ISAC 1
1035 #define CARD_FRITZPCI 0
1038 #ifdef CONFIG_HISAX_ELSA
1040 #ifndef ISDN_CHIP_ISAC
1041 #define ISDN_CHIP_ISAC 1
1047 #ifdef CONFIG_HISAX_IX1MICROR2
1048 #define CARD_IX1MICROR2 1
1049 #ifndef ISDN_CHIP_ISAC
1050 #define ISDN_CHIP_ISAC 1
1053 #define CARD_IX1MICROR2 0
1056 #ifdef CONFIG_HISAX_DIEHLDIVA
1057 #define CARD_DIEHLDIVA 1
1058 #ifndef ISDN_CHIP_ISAC
1059 #define ISDN_CHIP_ISAC 1
1062 #define CARD_DIEHLDIVA 0
1065 #ifdef CONFIG_HISAX_ASUSCOM
1066 #define CARD_ASUSCOM 1
1067 #ifndef ISDN_CHIP_ISAC
1068 #define ISDN_CHIP_ISAC 1
1071 #define CARD_ASUSCOM 0
1074 #ifdef CONFIG_HISAX_TELEINT
1075 #define CARD_TELEINT 1
1076 #ifndef ISDN_CHIP_ISAC
1077 #define ISDN_CHIP_ISAC 1
1080 #define CARD_TELEINT 0
1083 #ifdef CONFIG_HISAX_SEDLBAUER
1084 #define CARD_SEDLBAUER 1
1085 #ifndef ISDN_CHIP_ISAC
1086 #define ISDN_CHIP_ISAC 1
1089 #define CARD_SEDLBAUER 0
1092 #ifdef CONFIG_HISAX_SPORTSTER
1093 #define CARD_SPORTSTER 1
1094 #ifndef ISDN_CHIP_ISAC
1095 #define ISDN_CHIP_ISAC 1
1098 #define CARD_SPORTSTER 0
1101 #ifdef CONFIG_HISAX_MIC
1103 #ifndef ISDN_CHIP_ISAC
1104 #define ISDN_CHIP_ISAC 1
1110 #ifdef CONFIG_HISAX_NETJET
1111 #define CARD_NETJET_S 1
1112 #ifndef ISDN_CHIP_ISAC
1113 #define ISDN_CHIP_ISAC 1
1116 #define CARD_NETJET_S 0
1119 #ifdef CONFIG_HISAX_HFCS
1125 #ifdef CONFIG_HISAX_HFC_PCI
1126 #define CARD_HFC_PCI 1
1128 #define CARD_HFC_PCI 0
1131 #ifdef CONFIG_HISAX_HFC_SX
1132 #define CARD_HFC_SX 1
1134 #define CARD_HFC_SX 0
1137 #ifdef CONFIG_HISAX_NICCY
1138 #define CARD_NICCY 1
1139 #ifndef ISDN_CHIP_ISAC
1140 #define ISDN_CHIP_ISAC 1
1143 #define CARD_NICCY 0
1146 #ifdef CONFIG_HISAX_ISURF
1147 #define CARD_ISURF 1
1148 #ifndef ISDN_CHIP_ISAC
1149 #define ISDN_CHIP_ISAC 1
1152 #define CARD_ISURF 0
1155 #ifdef CONFIG_HISAX_S0BOX
1156 #define CARD_S0BOX 1
1157 #ifndef ISDN_CHIP_ISAC
1158 #define ISDN_CHIP_ISAC 1
1161 #define CARD_S0BOX 0
1164 #ifdef CONFIG_HISAX_HSTSAPHIR
1165 #define CARD_HSTSAPHIR 1
1166 #ifndef ISDN_CHIP_ISAC
1167 #define ISDN_CHIP_ISAC 1
1170 #define CARD_HSTSAPHIR 0
1173 #ifdef CONFIG_HISAX_BKM_A4T
1174 #define CARD_BKM_A4T 1
1175 #ifndef ISDN_CHIP_ISAC
1176 #define ISDN_CHIP_ISAC 1
1179 #define CARD_BKM_A4T 0
1182 #ifdef CONFIG_HISAX_SCT_QUADRO
1183 #define CARD_SCT_QUADRO 1
1184 #ifndef ISDN_CHIP_ISAC
1185 #define ISDN_CHIP_ISAC 1
1188 #define CARD_SCT_QUADRO 0
1191 #ifdef CONFIG_HISAX_GAZEL
1192 #define CARD_GAZEL 1
1193 #ifndef ISDN_CHIP_ISAC
1194 #define ISDN_CHIP_ISAC 1
1197 #define CARD_GAZEL 0
1200 #ifdef CONFIG_HISAX_W6692
1201 #define CARD_W6692 1
1202 #ifndef ISDN_CHIP_W6692
1203 #define ISDN_CHIP_W6692 1
1206 #define CARD_W6692 0
1209 #ifdef CONFIG_HISAX_NETJET_U
1210 #define CARD_NETJET_U 1
1211 #ifndef ISDN_CHIP_ICC
1212 #define ISDN_CHIP_ICC 1
1214 #ifndef HISAX_UINTERFACE
1215 #define HISAX_UINTERFACE 1
1218 #define CARD_NETJET_U 0
1221 #ifdef CONFIG_HISAX_ENTERNOW_PCI
1222 #define CARD_FN_ENTERNOW_PCI 1
1224 #define CARD_FN_ENTERNOW_PCI 0
1227 #define TEI_PER_CARD 1
1230 #define L1_DEB_WARN 0x01
1231 #define L1_DEB_INTSTAT 0x02
1232 #define L1_DEB_ISAC 0x04
1233 #define L1_DEB_ISAC_FIFO 0x08
1234 #define L1_DEB_HSCX 0x10
1235 #define L1_DEB_HSCX_FIFO 0x20
1236 #define L1_DEB_LAPD 0x40
1237 #define L1_DEB_IPAC 0x80
1238 #define L1_DEB_RECEIVE_FRAME 0x100
1239 #define L1_DEB_MONITOR 0x200
1240 #define DEB_DLOG_HEX 0x400
1241 #define DEB_DLOG_VERBOSE 0x800
1243 #define L2FRAME_DEBUG
1245 #ifdef L2FRAME_DEBUG
1246 extern void Logl2Frame(struct IsdnCardState
*cs
, struct sk_buff
*skb
, char *buf
, int dir
);
1249 #include "hisax_cfg.h"
1251 void init_bcstate(struct IsdnCardState
*cs
, int bc
);
1253 void setstack_HiSax(struct PStack
*st
, struct IsdnCardState
*cs
);
1254 void HiSax_addlist(struct IsdnCardState
*sp
, struct PStack
*st
);
1255 void HiSax_rmlist(struct IsdnCardState
*sp
, struct PStack
*st
);
1257 void setstack_l1_B(struct PStack
*st
);
1259 void setstack_tei(struct PStack
*st
);
1260 void setstack_manager(struct PStack
*st
);
1262 void setstack_isdnl2(struct PStack
*st
, char *debug_id
);
1263 void releasestack_isdnl2(struct PStack
*st
);
1264 void setstack_transl2(struct PStack
*st
);
1265 void releasestack_transl2(struct PStack
*st
);
1266 void lli_writewakeup(struct PStack
*st
, int len
);
1268 void setstack_l3dc(struct PStack
*st
, struct Channel
*chanp
);
1269 void setstack_l3bc(struct PStack
*st
, struct Channel
*chanp
);
1270 void releasestack_isdnl3(struct PStack
*st
);
1272 u_char
*findie(u_char
* p
, int size
, u_char ie
, int wanted_set
);
1273 int getcallref(u_char
* p
);
1274 int newcallref(void);
1276 int FsmNew(struct Fsm
*fsm
, struct FsmNode
*fnlist
, int fncount
);
1277 void FsmFree(struct Fsm
*fsm
);
1278 int FsmEvent(struct FsmInst
*fi
, int event
, void *arg
);
1279 void FsmChangeState(struct FsmInst
*fi
, int newstate
);
1280 void FsmInitTimer(struct FsmInst
*fi
, struct FsmTimer
*ft
);
1281 int FsmAddTimer(struct FsmTimer
*ft
, int millisec
, int event
,
1282 void *arg
, int where
);
1283 void FsmRestartTimer(struct FsmTimer
*ft
, int millisec
, int event
,
1284 void *arg
, int where
);
1285 void FsmDelTimer(struct FsmTimer
*ft
, int where
);
1286 int jiftime(char *s
, long mark
);
1288 int HiSax_command(isdn_ctrl
* ic
);
1289 int HiSax_writebuf_skb(int id
, int chan
, int ack
, struct sk_buff
*skb
);
1291 void HiSax_putstatus(struct IsdnCardState
*cs
, char *head
, char *fmt
, ...);
1293 void VHiSax_putstatus(struct IsdnCardState
*cs
, char *head
, char *fmt
, va_list args
);
1294 void HiSax_reportcard(int cardnr
, int sel
);
1295 int QuickHex(char *txt
, u_char
* p
, int cnt
);
1296 void LogFrame(struct IsdnCardState
*cs
, u_char
* p
, int size
);
1297 void dlogframe(struct IsdnCardState
*cs
, struct sk_buff
*skb
, int dir
);
1298 void iecpy(u_char
* dest
, u_char
* iestart
, int ieoffset
);
1299 #endif /* __KERNEL__ */
1302 * Busywait delay for `jiffs' jiffies
1304 #define HZDELAY(jiffs) do { \
1308 int loops = USEC_PER_SEC / HZ; \
1314 int ll_run(struct IsdnCardState
*cs
, int addfeatures
);
1316 void CallcFree(void);
1317 int CallcNewChan(struct IsdnCardState
*cs
);
1318 void CallcFreeChan(struct IsdnCardState
*cs
);
1319 int Isdnl1New(void);
1320 void Isdnl1Free(void);
1321 int Isdnl2New(void);
1322 void Isdnl2Free(void);
1323 int Isdnl3New(void);
1324 void Isdnl3Free(void);
1325 void init_tei(struct IsdnCardState
*cs
, int protocol
);
1326 void release_tei(struct IsdnCardState
*cs
);
1327 char *HiSax_getrev(const char *revision
);
1333 #include <linux/pci.h>
1335 /* adaptation wrapper for old usage
1336 * WARNING! This is unfit for use in a PCI hotplug environment,
1337 * as the returned PCI device can disappear at any moment in time.
1338 * Callers should be converted to use pci_get_device() instead.
1340 static inline struct pci_dev
*hisax_find_pci_device(unsigned int vendor
,
1341 unsigned int device
,
1342 struct pci_dev
*from
)
1344 struct pci_dev
*pdev
;
1347 pdev
= pci_get_subsys(vendor
, device
, PCI_ANY_ID
, PCI_ANY_ID
, from
);