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 extern const char *CardType
[];
127 extern const char *l1_revision
;
128 extern const char *l2_revision
;
129 extern const char *l3_revision
;
130 extern const char *lli_revision
;
131 extern const char *tei_revision
;
133 /* include l3dss1 & ni1 specific process structures, but no other defines */
134 #ifdef CONFIG_HISAX_EURO
135 #define l3dss1_process
137 #undef l3dss1_process
138 #endif /* CONFIG_HISAX_EURO */
140 #ifdef CONFIG_HISAX_NI1
141 #define l3ni1_process
144 #endif /* CONFIG_HISAX_NI1 */
146 #define MAX_DFRAME_LEN 260
147 #define MAX_DFRAME_LEN_L1 300
148 #define HSCX_BUFMAX 4096
149 #define MAX_DATA_SIZE (HSCX_BUFMAX - 4)
150 #define MAX_DATA_MEM (HSCX_BUFMAX + 64)
151 #define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)
152 #define MAX_HEADER_LEN 4
154 #define MAX_MON_FRAME 32
155 #define MAX_DLOG_SPACE 2048
156 #define MAX_BLOG_SPACE 256
158 /* #define I4L_IRQ_FLAG SA_INTERRUPT */
159 #define I4L_IRQ_FLAG 0
167 typedef void (* FSMFNPTR
)(struct FsmInst
*, int, void *);
170 FSMFNPTR
*jumpmatrix
;
171 int state_count
, event_count
;
172 char **strEvent
, **strState
;
181 void (*printdebug
) (struct FsmInst
*, char *, ...);
186 void (*routine
) (struct FsmInst
*, int, void *);
191 struct timer_list tl
;
197 struct l3_process
*pc
;
198 struct timer_list tl
;
202 #define FLG_L1_ACTIVATING 1
203 #define FLG_L1_ACTIVATED 2
204 #define FLG_L1_DEACTTIMER 3
205 #define FLG_L1_ACTTIMER 4
206 #define FLG_L1_T3RUN 5
207 #define FLG_L1_PULL_REQ 6
208 #define FLG_L1_UINT 7
213 struct PStack
**stlistp
;
216 struct FsmTimer timer
;
217 void (*l1l2
) (struct PStack
*, int, void *);
218 void (*l1hw
) (struct PStack
*, int, void *);
219 void (*l1tei
) (struct PStack
*, int, void *);
224 #define GROUP_TEI 127
227 #define PACKET_NOACK 7
235 #define FLG_PEND_REL 4
236 #define FLG_L3_INIT 5
237 #define FLG_T200_RUN 6
238 #define FLG_ACK_PEND 7
240 #define FLG_OWN_BUSY 9
241 #define FLG_PEER_BUSY 10
242 #define FLG_DCHAN_BUSY 11
243 #define FLG_L1_ACTIV 12
244 #define FLG_ESTAB_PEND 13
246 #define FLG_FIXED_TEI 15
247 #define FLG_L2BLOCK 16
259 struct sk_buff
*windowar
[MAX_WINDOW
];
260 struct sk_buff_head i_queue
;
261 struct sk_buff_head ui_queue
;
262 void (*l2l1
) (struct PStack
*, int, void *);
263 void (*l2l3
) (struct PStack
*, int, void *);
264 void (*l2tei
) (struct PStack
*, int, void *);
266 struct FsmTimer t200
, t203
;
267 int T200
, N200
, T203
;
273 void (*l3l4
) (struct PStack
*, int, void *);
274 void (*l3ml3
) (struct PStack
*, int, void *);
275 void (*l3l2
) (struct PStack
*, int, void *);
277 struct FsmTimer l3m_timer
;
278 struct sk_buff_head squeue
;
279 struct l3_process
*proc
;
280 struct l3_process
*global
;
287 void (*l4l3
) (struct PStack
*, int, void *);
288 int (*l4l3_proto
) (struct PStack
*, isdn_ctrl
*);
293 #define FLG_LLI_L1WAKEUP 1
294 #define FLG_LLI_L2WAKEUP 2
298 struct FsmInst tei_m
;
299 struct FsmTimer t202
;
300 int T202
, N202
, debug
;
301 void (*layer
) (struct PStack
*, int, void *);
312 int spv
; /* SPV Flag */
313 setup_parm setup
; /* from isdnif.h numbers and Serviceindicator */
314 u_char moderate
; /* transfer mode and rate (bearer octet 4) */
323 struct LLInterface lli
;
324 struct Management ma
;
325 int protocol
; /* EDSS1, 1TR6 or NI1 */
327 /* protocol specific data fields */
329 { u_char uuuu
; /* only as dummy */
330 #ifdef CONFIG_HISAX_EURO
331 dss1_stk_priv dss1
; /* private dss1 data */
332 #endif /* CONFIG_HISAX_EURO */
333 #ifdef CONFIG_HISAX_NI1
334 ni1_stk_priv ni1
; /* private ni1 data */
335 #endif /* CONFIG_HISAX_NI1 */
342 struct L3Timer timer
;
346 struct Channel
*chan
;
348 struct l3_process
*next
;
351 /* protocol specific data fields */
353 { u_char uuuu
; /* only when euro not defined, avoiding empty union */
354 #ifdef CONFIG_HISAX_EURO
355 dss1_proc_priv dss1
; /* private dss1 data */
356 #endif /* CONFIG_HISAX_EURO */
357 #ifdef CONFIG_HISAX_NI1
358 ni1_proc_priv ni1
; /* private ni1 data */
359 #endif /* CONFIG_HISAX_NI1 */
366 int count
; /* Current skb sent count */
367 u_char
*rcvbuf
; /* B-Channel receive Buffer */
375 int count
; /* Current skb sent count */
376 u_char
*rcvbuf
; /* B-Channel receive Buffer */
381 volatile u_char bstat
;
383 volatile u_char cmsb
;
384 volatile u_char clsb
;
385 volatile u_char par
[8];
399 struct timer_list ftimer
;
400 u_char
*rcvbuf
; /* B-Channel receive Buffer */
402 struct isar_reg
*reg
;
405 struct hdlc_stat_reg
{
417 } __attribute__((packed
));
422 struct hdlc_stat_reg sr
;
426 int count
; /* Current skb sent count */
427 u_char
*rcvbuf
; /* B-Channel receive Buffer */
463 struct sk_buff
*rv_skb
;
464 struct hdlc_state
*hdlc_state
;
465 struct work_struct tq_rcv
;
466 struct work_struct tq_xmt
;
469 #define BC_FLG_INIT 1
470 #define BC_FLG_ACTIV 2
471 #define BC_FLG_BUSY 3
472 #define BC_FLG_NOFRAME 4
473 #define BC_FLG_HALF 5
474 #define BC_FLG_EMPTY 6
475 #define BC_FLG_ORIG 7
476 #define BC_FLG_DLEETX 8
477 #define BC_FLG_LASTDLE 9
478 #define BC_FLG_FIRST 10
479 #define BC_FLG_LASTDATA 11
480 #define BC_FLG_NMD_DATA 12
481 #define BC_FLG_FTI_RUN 13
482 #define BC_FLG_LL_OK 14
483 #define BC_FLG_LL_CONN 15
484 #define BC_FLG_FTI_FTS 16
485 #define BC_FLG_FRH_WAIT 17
487 #define L1_MODE_NULL 0
488 #define L1_MODE_TRANS 1
489 #define L1_MODE_HDLC 2
490 #define L1_MODE_EXTRN 3
491 #define L1_MODE_HDLC_56K 4
492 #define L1_MODE_MODEM 7
493 #define L1_MODE_V32 8
494 #define L1_MODE_FAX 9
500 struct IsdnCardState
*cs
;
501 int tx_cnt
; /* B-Channel transmit counter */
502 struct sk_buff
*tx_skb
; /* B-Channel transmit Buffer */
503 struct sk_buff_head rqueue
; /* B-Channel receive Queue */
504 struct sk_buff_head squeue
; /* B-Channel send Queue */
510 struct timer_list transbusy
;
511 struct work_struct tqueue
;
513 int (*BC_SetStack
) (struct PStack
*, struct BCState
*);
514 void (*BC_Close
) (struct BCState
*);
515 #ifdef ERROR_STATISTIC
526 struct tiger_hw tiger
;
527 struct amd7930_hw amd7930
;
528 struct w6692B_hw w6692
;
529 struct hisax_b_if
*b_if
;
534 struct PStack
*b_st
, *d_st
;
535 struct IsdnCardState
*cs
;
540 struct FsmTimer drel_timer
, dial_timer
;
542 int l2_protocol
, l2_active_protocol
;
545 struct l3_process
*proc
;
546 setup_parm setup
; /* from isdnif.h numbers and Serviceindicator */
547 u_long Flags
; /* for remembering action done in l4 */
562 unsigned int counter
;
564 struct timer_list tl
;
571 unsigned int transcnt
;
581 unsigned int cfg_reg
;
585 signed int hscxfifo
[2];
589 unsigned int cfg_reg
;
590 void __iomem
*membase
;
591 unsigned long phymem
;
595 unsigned int cfg_reg
;
597 unsigned int hscx
[2];
598 unsigned int isacfifo
;
599 unsigned int hscxfifo
[2];
600 unsigned int counter
;
605 unsigned int cfg_reg
;
606 unsigned int isac_ale
;
608 unsigned int hscx_ale
;
613 unsigned long cfg_reg
;
614 unsigned long pci_cfg
;
616 unsigned long isac_adr
;
618 unsigned long hscx_adr
;
621 struct timer_list tl
;
627 unsigned int cfg_reg
;
638 unsigned int fifosize
;
643 struct timer_list timer
;
647 unsigned int cfg_reg
;
651 unsigned int reset_on
;
652 unsigned int reset_off
;
653 struct isar_reg isar
;
660 unsigned int cfg_reg
;
662 unsigned int hscx
[2];
663 unsigned char res_irq
;
667 unsigned int cfg_reg
;
678 unsigned char dmactrl
;
679 unsigned char ctrl_reg
;
680 unsigned char irqmask0
;
681 unsigned char irqstat0
;
682 unsigned char last_is0
;
691 unsigned char int_m1
;
692 unsigned char int_m2
;
693 unsigned char int_s1
;
695 unsigned char sctrl_r
;
696 unsigned char sctrl_e
;
700 unsigned char fifo_en
;
701 unsigned char bswapped
;
702 unsigned char nt_mode
;
705 unsigned char *pci_io
; /* start of PCI IO memory */
706 dma_addr_t dma
; /* dma handle for Fifos */
707 void *fifos
; /* FIFO memory */
708 int last_bfifo_cnt
[2]; /* marker saving last b-fifo frame count */
709 struct timer_list timer
;
718 unsigned char int_m1
;
719 unsigned char int_m2
;
720 unsigned char int_s1
;
722 unsigned char sctrl_r
;
723 unsigned char sctrl_e
;
727 unsigned char bswapped
;
728 unsigned char nt_mode
;
731 unsigned char last_fifo
;
734 struct timer_list timer
;
739 unsigned int bfifosize
;
740 unsigned int dfifosize
;
746 unsigned char int_m1
;
747 unsigned char int_m2
;
748 unsigned char int_s1
;
755 struct timer_list timer
;
760 unsigned long phymem
;
763 struct isar_reg isar_r
;
768 unsigned int cfg_reg
;
772 struct timer_list timer
;
779 unsigned long isac_adr
;
780 unsigned int isac_ale
;
781 unsigned long jade_adr
;
782 unsigned int jade_ale
;
783 /* Scitel Quadro stuff */
784 unsigned long plx_adr
;
785 unsigned long data_adr
;
790 unsigned int cfg_reg
;
791 unsigned int pciaddr
[2];
796 signed int hscxfifo
[2];
797 unsigned char timeslot
;
804 struct timer_list timer
;
808 struct arcofi_msg
*next
;
821 struct arcofi_msg
*arcofi_list
;
822 struct timer_list arcofitimer
;
823 wait_queue_head_t arcofi_wait
;
846 struct amd7930_chip
{
851 unsigned int tx_xmtlen
;
852 struct timer_list timer3
;
853 void (*ph_command
) (struct IsdnCardState
*, u_char
, char *);
854 void (*setIrqMask
) (struct IsdnCardState
*, u_char
);
864 struct arcofi_msg
*arcofi_list
;
865 struct timer_list arcofitimer
;
866 wait_queue_head_t arcofi_wait
;
877 #define FLG_TWO_DCHAN 4
878 #define FLG_L1_DBUSY 5
879 #define FLG_DBUSY_TIMER 6
880 #define FLG_LOCK_ATOMIC 7
881 #define FLG_ARCOFI_TIMER 8
882 #define FLG_ARCOFI_ERROR 9
883 #define FLG_HW_L1_UINT 10
885 struct IsdnCardState
{
894 int chanlimit
; /* limited number of B-chans to use */
895 int logecho
; /* log echo if supported by card */
898 struct teles0_hw teles0
;
899 struct teles3_hw teles3
;
910 struct hfcPCI_hw hfcpci
;
911 struct hfcSX_hw hfcsx
;
913 struct isurf_hw isurf
;
914 struct saphir_hw saphir
;
916 struct gazel_hw gazel
;
917 struct w6692_hw w6692
;
918 struct hisax_d_if
*hisax_d_if
;
925 u_char
*status_write
;
927 u_char (*readisac
) (struct IsdnCardState
*, u_char
);
928 void (*writeisac
) (struct IsdnCardState
*, u_char
, u_char
);
929 void (*readisacfifo
) (struct IsdnCardState
*, u_char
*, int);
930 void (*writeisacfifo
) (struct IsdnCardState
*, u_char
*, int);
931 u_char (*BC_Read_Reg
) (struct IsdnCardState
*, int, u_char
);
932 void (*BC_Write_Reg
) (struct IsdnCardState
*, int, u_char
, u_char
);
933 void (*BC_Send_Data
) (struct BCState
*);
934 int (*cardmsg
) (struct IsdnCardState
*, int, void *);
935 void (*setstack_d
) (struct PStack
*, struct IsdnCardState
*);
936 void (*DC_Close
) (struct IsdnCardState
*);
937 irq_handler_t irq_func
;
938 int (*auxcmd
) (struct IsdnCardState
*, isdn_ctrl
*);
939 struct Channel channel
[2+MAX_WAITING_CALLS
];
940 struct BCState bcs
[2+MAX_WAITING_CALLS
];
941 struct PStack
*stlist
;
942 struct sk_buff_head rq
, sq
; /* D-channel queues */
947 struct isac_chip isac
;
948 struct hfcd_chip hfcd
;
949 struct hfcpci_chip hfcpci
;
950 struct hfcsx_chip hfcsx
;
951 struct w6692_chip w6692
;
952 struct amd7930_chip amd7930
;
957 struct sk_buff
*tx_skb
;
960 struct work_struct tqueue
;
961 struct timer_list dbusytimer
;
962 #ifdef ERROR_STATISTIC
970 #define schedule_event(s, ev) do {test_and_set_bit(ev, &s->event);schedule_work(&s->tqueue); } while(0)
978 #ifdef ISDN_CHIP_ISAC
979 #undef ISDN_CHIP_ISAC
982 #ifdef CONFIG_HISAX_16_0
983 #define CARD_TELES0 1
984 #ifndef ISDN_CHIP_ISAC
985 #define ISDN_CHIP_ISAC 1
988 #define CARD_TELES0 0
991 #ifdef CONFIG_HISAX_16_3
992 #define CARD_TELES3 1
993 #ifndef ISDN_CHIP_ISAC
994 #define ISDN_CHIP_ISAC 1
997 #define CARD_TELES3 0
1000 #ifdef CONFIG_HISAX_TELESPCI
1001 #define CARD_TELESPCI 1
1002 #ifndef ISDN_CHIP_ISAC
1003 #define ISDN_CHIP_ISAC 1
1006 #define CARD_TELESPCI 0
1009 #ifdef CONFIG_HISAX_AVM_A1
1010 #define CARD_AVM_A1 1
1011 #ifndef ISDN_CHIP_ISAC
1012 #define ISDN_CHIP_ISAC 1
1015 #define CARD_AVM_A1 0
1018 #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
1019 #define CARD_AVM_A1_PCMCIA 1
1020 #ifndef ISDN_CHIP_ISAC
1021 #define ISDN_CHIP_ISAC 1
1024 #define CARD_AVM_A1_PCMCIA 0
1027 #ifdef CONFIG_HISAX_FRITZPCI
1028 #define CARD_FRITZPCI 1
1029 #ifndef ISDN_CHIP_ISAC
1030 #define ISDN_CHIP_ISAC 1
1033 #define CARD_FRITZPCI 0
1036 #ifdef CONFIG_HISAX_ELSA
1038 #ifndef ISDN_CHIP_ISAC
1039 #define ISDN_CHIP_ISAC 1
1045 #ifdef CONFIG_HISAX_IX1MICROR2
1046 #define CARD_IX1MICROR2 1
1047 #ifndef ISDN_CHIP_ISAC
1048 #define ISDN_CHIP_ISAC 1
1051 #define CARD_IX1MICROR2 0
1054 #ifdef CONFIG_HISAX_DIEHLDIVA
1055 #define CARD_DIEHLDIVA 1
1056 #ifndef ISDN_CHIP_ISAC
1057 #define ISDN_CHIP_ISAC 1
1060 #define CARD_DIEHLDIVA 0
1063 #ifdef CONFIG_HISAX_ASUSCOM
1064 #define CARD_ASUSCOM 1
1065 #ifndef ISDN_CHIP_ISAC
1066 #define ISDN_CHIP_ISAC 1
1069 #define CARD_ASUSCOM 0
1072 #ifdef CONFIG_HISAX_TELEINT
1073 #define CARD_TELEINT 1
1074 #ifndef ISDN_CHIP_ISAC
1075 #define ISDN_CHIP_ISAC 1
1078 #define CARD_TELEINT 0
1081 #ifdef CONFIG_HISAX_SEDLBAUER
1082 #define CARD_SEDLBAUER 1
1083 #ifndef ISDN_CHIP_ISAC
1084 #define ISDN_CHIP_ISAC 1
1087 #define CARD_SEDLBAUER 0
1090 #ifdef CONFIG_HISAX_SPORTSTER
1091 #define CARD_SPORTSTER 1
1092 #ifndef ISDN_CHIP_ISAC
1093 #define ISDN_CHIP_ISAC 1
1096 #define CARD_SPORTSTER 0
1099 #ifdef CONFIG_HISAX_MIC
1101 #ifndef ISDN_CHIP_ISAC
1102 #define ISDN_CHIP_ISAC 1
1108 #ifdef CONFIG_HISAX_NETJET
1109 #define CARD_NETJET_S 1
1110 #ifndef ISDN_CHIP_ISAC
1111 #define ISDN_CHIP_ISAC 1
1114 #define CARD_NETJET_S 0
1117 #ifdef CONFIG_HISAX_HFCS
1123 #ifdef CONFIG_HISAX_HFC_PCI
1124 #define CARD_HFC_PCI 1
1126 #define CARD_HFC_PCI 0
1129 #ifdef CONFIG_HISAX_HFC_SX
1130 #define CARD_HFC_SX 1
1132 #define CARD_HFC_SX 0
1135 #ifdef CONFIG_HISAX_NICCY
1136 #define CARD_NICCY 1
1137 #ifndef ISDN_CHIP_ISAC
1138 #define ISDN_CHIP_ISAC 1
1141 #define CARD_NICCY 0
1144 #ifdef CONFIG_HISAX_ISURF
1145 #define CARD_ISURF 1
1146 #ifndef ISDN_CHIP_ISAC
1147 #define ISDN_CHIP_ISAC 1
1150 #define CARD_ISURF 0
1153 #ifdef CONFIG_HISAX_S0BOX
1154 #define CARD_S0BOX 1
1155 #ifndef ISDN_CHIP_ISAC
1156 #define ISDN_CHIP_ISAC 1
1159 #define CARD_S0BOX 0
1162 #ifdef CONFIG_HISAX_HSTSAPHIR
1163 #define CARD_HSTSAPHIR 1
1164 #ifndef ISDN_CHIP_ISAC
1165 #define ISDN_CHIP_ISAC 1
1168 #define CARD_HSTSAPHIR 0
1171 #ifdef CONFIG_HISAX_BKM_A4T
1172 #define CARD_BKM_A4T 1
1173 #ifndef ISDN_CHIP_ISAC
1174 #define ISDN_CHIP_ISAC 1
1177 #define CARD_BKM_A4T 0
1180 #ifdef CONFIG_HISAX_SCT_QUADRO
1181 #define CARD_SCT_QUADRO 1
1182 #ifndef ISDN_CHIP_ISAC
1183 #define ISDN_CHIP_ISAC 1
1186 #define CARD_SCT_QUADRO 0
1189 #ifdef CONFIG_HISAX_GAZEL
1190 #define CARD_GAZEL 1
1191 #ifndef ISDN_CHIP_ISAC
1192 #define ISDN_CHIP_ISAC 1
1195 #define CARD_GAZEL 0
1198 #ifdef CONFIG_HISAX_W6692
1199 #define CARD_W6692 1
1200 #ifndef ISDN_CHIP_W6692
1201 #define ISDN_CHIP_W6692 1
1204 #define CARD_W6692 0
1207 #ifdef CONFIG_HISAX_NETJET_U
1208 #define CARD_NETJET_U 1
1209 #ifndef ISDN_CHIP_ICC
1210 #define ISDN_CHIP_ICC 1
1212 #ifndef HISAX_UINTERFACE
1213 #define HISAX_UINTERFACE 1
1216 #define CARD_NETJET_U 0
1219 #ifdef CONFIG_HISAX_ENTERNOW_PCI
1220 #define CARD_FN_ENTERNOW_PCI 1
1222 #define CARD_FN_ENTERNOW_PCI 0
1225 #define TEI_PER_CARD 1
1228 #define L1_DEB_WARN 0x01
1229 #define L1_DEB_INTSTAT 0x02
1230 #define L1_DEB_ISAC 0x04
1231 #define L1_DEB_ISAC_FIFO 0x08
1232 #define L1_DEB_HSCX 0x10
1233 #define L1_DEB_HSCX_FIFO 0x20
1234 #define L1_DEB_LAPD 0x40
1235 #define L1_DEB_IPAC 0x80
1236 #define L1_DEB_RECEIVE_FRAME 0x100
1237 #define L1_DEB_MONITOR 0x200
1238 #define DEB_DLOG_HEX 0x400
1239 #define DEB_DLOG_VERBOSE 0x800
1241 #define L2FRAME_DEBUG
1243 #ifdef L2FRAME_DEBUG
1244 extern void Logl2Frame(struct IsdnCardState
*cs
, struct sk_buff
*skb
, char *buf
, int dir
);
1247 #include "hisax_cfg.h"
1249 void init_bcstate(struct IsdnCardState
*cs
, int bc
);
1251 void setstack_HiSax(struct PStack
*st
, struct IsdnCardState
*cs
);
1252 void HiSax_addlist(struct IsdnCardState
*sp
, struct PStack
*st
);
1253 void HiSax_rmlist(struct IsdnCardState
*sp
, struct PStack
*st
);
1255 void setstack_l1_B(struct PStack
*st
);
1257 void setstack_tei(struct PStack
*st
);
1258 void setstack_manager(struct PStack
*st
);
1260 void setstack_isdnl2(struct PStack
*st
, char *debug_id
);
1261 void releasestack_isdnl2(struct PStack
*st
);
1262 void setstack_transl2(struct PStack
*st
);
1263 void releasestack_transl2(struct PStack
*st
);
1264 void lli_writewakeup(struct PStack
*st
, int len
);
1266 void setstack_l3dc(struct PStack
*st
, struct Channel
*chanp
);
1267 void setstack_l3bc(struct PStack
*st
, struct Channel
*chanp
);
1268 void releasestack_isdnl3(struct PStack
*st
);
1270 u_char
*findie(u_char
* p
, int size
, u_char ie
, int wanted_set
);
1271 int getcallref(u_char
* p
);
1272 int newcallref(void);
1274 int FsmNew(struct Fsm
*fsm
, struct FsmNode
*fnlist
, int fncount
);
1275 void FsmFree(struct Fsm
*fsm
);
1276 int FsmEvent(struct FsmInst
*fi
, int event
, void *arg
);
1277 void FsmChangeState(struct FsmInst
*fi
, int newstate
);
1278 void FsmInitTimer(struct FsmInst
*fi
, struct FsmTimer
*ft
);
1279 int FsmAddTimer(struct FsmTimer
*ft
, int millisec
, int event
,
1280 void *arg
, int where
);
1281 void FsmRestartTimer(struct FsmTimer
*ft
, int millisec
, int event
,
1282 void *arg
, int where
);
1283 void FsmDelTimer(struct FsmTimer
*ft
, int where
);
1284 int jiftime(char *s
, long mark
);
1286 int HiSax_command(isdn_ctrl
* ic
);
1287 int HiSax_writebuf_skb(int id
, int chan
, int ack
, struct sk_buff
*skb
);
1288 void HiSax_putstatus(struct IsdnCardState
*cs
, char *head
, char *fmt
, ...);
1289 void VHiSax_putstatus(struct IsdnCardState
*cs
, char *head
, char *fmt
, va_list args
);
1290 void HiSax_reportcard(int cardnr
, int sel
);
1291 int QuickHex(char *txt
, u_char
* p
, int cnt
);
1292 void LogFrame(struct IsdnCardState
*cs
, u_char
* p
, int size
);
1293 void dlogframe(struct IsdnCardState
*cs
, struct sk_buff
*skb
, int dir
);
1294 void iecpy(u_char
* dest
, u_char
* iestart
, int ieoffset
);
1295 #endif /* __KERNEL__ */
1298 * Busywait delay for `jiffs' jiffies
1300 #define HZDELAY(jiffs) do { \
1304 int loops = USEC_PER_SEC / HZ; \
1310 int ll_run(struct IsdnCardState
*cs
, int addfeatures
);
1312 void CallcFree(void);
1313 int CallcNewChan(struct IsdnCardState
*cs
);
1314 void CallcFreeChan(struct IsdnCardState
*cs
);
1315 int Isdnl1New(void);
1316 void Isdnl1Free(void);
1317 int Isdnl2New(void);
1318 void Isdnl2Free(void);
1319 int Isdnl3New(void);
1320 void Isdnl3Free(void);
1321 void init_tei(struct IsdnCardState
*cs
, int protocol
);
1322 void release_tei(struct IsdnCardState
*cs
);
1323 char *HiSax_getrev(const char *revision
);
1329 #include <linux/pci.h>
1331 /* adaptation wrapper for old usage
1332 * WARNING! This is unfit for use in a PCI hotplug environment,
1333 * as the returned PCI device can disappear at any moment in time.
1334 * Callers should be converted to use pci_get_device() instead.
1336 static inline struct pci_dev
*hisax_find_pci_device(unsigned int vendor
,
1337 unsigned int device
,
1338 struct pci_dev
*from
)
1340 struct pci_dev
*pdev
;
1343 pdev
= pci_get_subsys(vendor
, device
, PCI_ANY_ID
, PCI_ANY_ID
, from
);