1 /* $Id: hisax.h,v 1.1.4.1.2.1 2001/12/09 20:18:40 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.
13 #include <linux/config.h>
14 #include <linux/errno.h>
16 #include <linux/major.h>
18 #include <linux/delay.h>
19 #include <linux/kernel.h>
20 #include <linux/signal.h>
21 #include <linux/slab.h>
23 #include <linux/mman.h>
24 #include <linux/ioport.h>
25 #include <linux/timer.h>
26 #include <linux/wait.h>
27 #include <linux/isdnif.h>
28 #include <linux/tty.h>
29 #include <linux/serial_reg.h>
30 #include <linux/netdevice.h>
31 #include <linux/interrupt.h>
33 #define ERROR_STATISTIC
40 #define HW_ENABLE 0x0000
41 #define HW_RESET 0x0004
42 #define HW_POWERUP 0x0008
43 #define HW_ACTIVATE 0x0010
44 #define HW_DEACTIVATE 0x0018
46 #define HW_INFO1 0x0010
47 #define HW_INFO2 0x0020
48 #define HW_INFO3 0x0030
49 #define HW_INFO4 0x0040
50 #define HW_INFO4_P8 0x0040
51 #define HW_INFO4_P10 0x0048
52 #define HW_RSYNC 0x0060
53 #define HW_TESTLOOP 0x0070
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_ASSIGN 0x0280
72 #define MDL_REMOVE 0x0284
73 #define MDL_ERROR 0x0288
75 #define CC_SETUP 0x0300
76 #define CC_RESUME 0x0304
77 #define CC_MORE_INFO 0x0310
78 #define CC_IGNORE 0x0320
79 #define CC_REJECT 0x0324
80 #define CC_SETUP_COMPL 0x0330
81 #define CC_PROCEEDING 0x0340
82 #define CC_ALERTING 0x0344
83 #define CC_PROGRESS 0x0348
84 #define CC_CONNECT 0x0350
85 #define CC_CHARGE 0x0354
86 #define CC_NOTIFY 0x0358
87 #define CC_DISCONNECT 0x0360
88 #define CC_RELEASE 0x0368
89 #define CC_SUSPEND 0x0370
90 #define CC_PROCEED_SEND 0x0374
91 #define CC_REDIR 0x0378
92 #define CC_T302 0x0382
93 #define CC_T303 0x0383
94 #define CC_T304 0x0384
95 #define CC_T305 0x0385
96 #define CC_T308_1 0x0388
97 #define CC_T308_2 0x038A
98 #define CC_T309 0x0309
99 #define CC_T310 0x0390
100 #define CC_T313 0x0393
101 #define CC_T318 0x0398
102 #define CC_T319 0x0399
103 #define CC_TSPID 0x03A0
104 #define CC_NOSETUP_RSP 0x03E0
105 #define CC_SETUP_ERR 0x03E1
106 #define CC_SUSPEND_ERR 0x03E2
107 #define CC_RESUME_ERR 0x03E3
108 #define CC_CONNECT_ERR 0x03E4
109 #define CC_RELEASE_ERR 0x03E5
110 #define CC_RESTART 0x03F4
111 #define CC_TDSS1_IO 0x13F4 /* DSS1 IO user timer */
112 #define CC_TNI1_IO 0x13F5 /* NI1 IO user timer */
114 /* define maximum number of possible waiting incoming calls */
115 #define MAX_WAITING_CALLS 2
120 /* include l3dss1 & ni1 specific process structures, but no other defines */
121 #ifdef CONFIG_HISAX_EURO
122 #define l3dss1_process
124 #undef l3dss1_process
125 #endif /* CONFIG_HISAX_EURO */
127 #ifdef CONFIG_HISAX_NI1
128 #define l3ni1_process
131 #endif /* CONFIG_HISAX_NI1 */
133 #define MAX_DFRAME_LEN 260
134 #define MAX_DFRAME_LEN_L1 300
135 #define HSCX_BUFMAX 4096
136 #define MAX_DATA_SIZE (HSCX_BUFMAX - 4)
137 #define MAX_DATA_MEM (HSCX_BUFMAX + 64)
138 #define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)
139 #define MAX_HEADER_LEN 4
141 #define MAX_MON_FRAME 32
142 #define MAX_DLOG_SPACE 2048
143 #define MAX_BLOG_SPACE 256
145 /* #define I4L_IRQ_FLAG SA_INTERRUPT */
146 #define I4L_IRQ_FLAG 0
149 struct list_head node
;
151 unsigned long start
, end
;
159 struct list_head res_head
;
163 resources_init(struct resources
*rs
);
166 resources_release(struct resources
*rs
);
169 request_io(struct resources
*rs
, unsigned long start
, int len
,
173 request_mmio(struct resources
*rs
, unsigned long start
, int len
,
183 typedef void (* FSMFNPTR
)(struct FsmInst
*, int, void *);
186 FSMFNPTR
*jumpmatrix
;
187 int state_count
, event_count
;
188 char **strEvent
, **strState
;
197 void (*printdebug
) (struct FsmInst
*, char *, ...);
202 void (*routine
) (struct FsmInst
*, int, void *);
207 struct timer_list tl
;
213 struct l3_process
*pc
;
214 struct timer_list tl
;
218 #define FLG_L1_ACTIVATING 1
219 #define FLG_L1_ACTIVATED 2
220 #define FLG_L1_DEACTTIMER 3
221 #define FLG_L1_ACTTIMER 4
222 #define FLG_L1_T3RUN 5
223 #define FLG_L1_PULL_REQ 6
224 #define FLG_L1_UINT 7
229 struct PStack
**stlistp
;
232 struct FsmTimer timer
;
233 void (*l1hw
) (struct PStack
*, int, void *);
234 void (*l1tei
) (struct PStack
*, int, void *);
235 void (*l2l1
) (struct PStack
*, int, void *);
240 #define GROUP_TEI 127
243 #define PACKET_NOACK 250
251 #define FLG_PEND_REL 4
252 #define FLG_L3_INIT 5
253 #define FLG_T200_RUN 6
254 #define FLG_ACK_PEND 7
256 #define FLG_OWN_BUSY 9
257 #define FLG_PEER_BUSY 10
258 #define FLG_DCHAN_BUSY 11
259 #define FLG_L1_ACTIV 12
260 #define FLG_ESTAB_PEND 13
262 #define FLG_FIXED_TEI 15
263 #define FLG_L2BLOCK 16
270 unsigned int vs
, va
, vr
;
274 struct sk_buff
*windowar
[MAX_WINDOW
];
275 struct sk_buff_head i_queue
;
276 struct sk_buff_head ui_queue
;
277 void (*l3l2
) (struct PStack
*, int, void *);
278 void (*l1l2
) (struct PStack
*, int, void *);
279 void (*l2tei
) (struct PStack
*, int, void *);
281 struct FsmTimer t200
, t203
;
282 int T200
, N200
, T203
;
288 void (*l4l3
) (struct PStack
*, int, void *);
289 int (*l4l3_proto
) (struct PStack
*, isdn_ctrl
*);
290 void (*l3ml3
) (struct PStack
*, int, void *);
291 void (*l2l3
) (struct PStack
*, int, void *);
293 struct FsmTimer l3m_timer
;
294 struct sk_buff_head squeue
;
295 struct l3_process
*proc
;
296 struct l3_process
*global
;
303 void (*l3l4
) (struct PStack
*, int, void *);
310 struct FsmInst tei_m
;
311 struct FsmTimer t202
;
312 int T202
, N202
, debug
;
313 void (*layer
) (struct PStack
*, int, void *);
324 int spv
; /* SPV Flag */
325 setup_parm setup
; /* from isdnif.h numbers and Serviceindicator */
326 u8 moderate
; /* transfer mode and rate (bearer octet 4) */
335 struct LLInterface lli
;
336 struct Management ma
;
337 int protocol
; /* EDSS1, 1TR6 or NI1 */
339 /* protocol specific data fields */
341 { u8 uuuu
; /* only as dummy */
342 #ifdef CONFIG_HISAX_EURO
343 dss1_stk_priv dss1
; /* private dss1 data */
344 #endif /* CONFIG_HISAX_EURO */
345 #ifdef CONFIG_HISAX_NI1
346 ni1_stk_priv ni1
; /* private ni1 data */
347 #endif /* CONFIG_HISAX_NI1 */
354 struct L3Timer timer
;
358 struct Channel
*chan
;
360 struct l3_process
*next
;
363 /* protocol specific data fields */
365 { u8 uuuu
; /* only when euro not defined, avoiding empty union */
366 #ifdef CONFIG_HISAX_EURO
367 dss1_proc_priv dss1
; /* private dss1 data */
368 #endif /* CONFIG_HISAX_EURO */
369 #ifdef CONFIG_HISAX_NI1
370 ni1_proc_priv ni1
; /* private ni1 data */
371 #endif /* CONFIG_HISAX_NI1 */
403 struct timer_list ftimer
;
404 u8
*rcvbuf
; /* B-Channel receive Buffer */
406 struct isar_reg
*reg
;
409 struct hdlc_stat_reg
{
411 u8 fill
__attribute__((packed
));
412 u8 mode
__attribute__((packed
));
413 u8 xml
__attribute__((packed
));
414 u8 cmd
__attribute__((packed
));
416 u8 cmd
__attribute__((packed
));
417 u8 xml
__attribute__((packed
));
418 u8 mode
__attribute__((packed
));
419 u8 fill
__attribute__((packed
));
426 struct hdlc_stat_reg sr
;
465 struct sk_buff
*rv_skb
;
466 struct hdlc_state
*hdlc_state
;
467 struct work_struct rcv_work
;
468 struct work_struct xmt_work
;
471 #define BC_FLG_INIT 1
472 #define BC_FLG_ACTIV 2
473 #define BC_FLG_BUSY 3
474 #define BC_FLG_NOFRAME 4
475 #define BC_FLG_HALF 5
476 #define BC_FLG_EMPTY 6
477 #define BC_FLG_ORIG 7
478 #define BC_FLG_DLEETX 8
479 #define BC_FLG_LASTDLE 9
480 #define BC_FLG_FIRST 10
481 #define BC_FLG_LASTDATA 11
482 #define BC_FLG_NMD_DATA 12
483 #define BC_FLG_FTI_RUN 13
484 #define BC_FLG_LL_OK 14
485 #define BC_FLG_LL_CONN 15
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 unit
; /* first or second unit (e.g. HSCX) */
503 u8
*rcvbuf
; /* B-Channel receive Buffer */
504 int tx_cnt
; /* B-Channel transmit counter */
505 struct sk_buff
*tx_skb
; /* B-Channel transmit Buffer */
506 struct sk_buff_head rqueue
; /* B-Channel receive queue */
507 struct sk_buff_head squeue
; /* B-Channel send queue */
508 struct sk_buff_head cmpl_queue
; /* B-Channel send complete queue */
512 struct timer_list transbusy
;
513 struct work_struct work
;
515 #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 long Flags
; /* for remembering action done in l4 */
549 /* long req'd for set_bit --RR */
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 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
;
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
;
620 struct timer_list tl
;
625 unsigned int cfg_reg
;
636 unsigned int fifosize
;
641 struct timer_list timer
;
645 unsigned int cfg_reg
;
649 unsigned int reset_on
;
650 unsigned int reset_off
;
651 struct isar_reg isar
;
657 unsigned int cfg_reg
;
659 unsigned int hscx
[2];
660 unsigned char res_irq
;
664 unsigned int cfg_reg
;
675 unsigned char dmactrl
;
676 unsigned char ctrl_reg
;
677 unsigned char irqmask0
;
678 unsigned char irqstat0
;
679 unsigned char last_is0
;
680 struct pci_dev
*pdev
;
681 void (*bc_activate
)(struct IsdnCardState
*cs
, int bc
);
682 void (*bc_deactivate
)(struct IsdnCardState
*cs
, int bc
);
690 unsigned char int_m1
;
691 unsigned char int_m2
;
692 unsigned char int_s1
;
694 unsigned char sctrl_r
;
695 unsigned char sctrl_e
;
699 unsigned char fifo_en
;
700 unsigned char bswapped
;
701 unsigned char nt_mode
;
703 unsigned char *pci_io
; /* start of PCI IO memory */
704 void *fifos
; /* FIFO memory */
705 dma_addr_t fifos_dma
;
706 struct pci_dev
* pdev
;
707 int last_bfifo_cnt
[2]; /* marker saving last b-fifo frame count */
708 struct timer_list timer
;
717 unsigned char int_m1
;
718 unsigned char int_m2
;
719 unsigned char int_s1
;
721 unsigned char sctrl_r
;
722 unsigned char sctrl_e
;
726 unsigned char bswapped
;
727 unsigned char nt_mode
;
730 unsigned char last_fifo
;
733 struct timer_list timer
;
738 unsigned int bfifosize
;
739 unsigned int dfifosize
;
745 unsigned char int_m1
;
746 unsigned char int_m2
;
747 unsigned char int_s1
;
754 struct timer_list timer
;
761 struct isar_reg isar_r
;
765 unsigned int cfg_reg
;
769 struct timer_list timer
;
775 unsigned long isac_adr
;
776 unsigned int isac_ale
;
777 unsigned long jade_adr
;
778 unsigned int jade_ale
;
779 /* Scitel Quadro stuff */
780 unsigned long plx_adr
;
781 unsigned long data_adr
;
785 unsigned int cfg_reg
;
790 signed int hscxfifo
[2];
791 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
*, u8
, char *);
860 void (*setIrqMask
) (struct IsdnCardState
*, u8
);
870 struct arcofi_msg
*arcofi_list
;
871 struct timer_list arcofitimer
;
872 wait_queue_head_t arcofi_wait
;
879 struct IsdnCardState
;
881 /* Methods provided by driver for a specific card */
884 void (*init
) (struct IsdnCardState
*);
885 void (*test
) (struct IsdnCardState
*);
886 int (*reset
) (struct IsdnCardState
*);
887 void (*release
) (struct IsdnCardState
*);
888 void (*aux_ind
) (struct IsdnCardState
*, void *);
889 void (*led_handler
)(struct IsdnCardState
*);
890 irqreturn_t (*irq_func
) (int, void *, struct pt_regs
*);
893 /* Card specific drivers provide methods to access the
894 * chips to the chip drivers */
897 u8 (*read_reg
) (struct IsdnCardState
*, int, u8
);
898 void (*write_reg
) (struct IsdnCardState
*, int, u8
, u8
);
899 void (*read_fifo
) (struct IsdnCardState
*, int, u8
*, int);
900 void (*write_fifo
) (struct IsdnCardState
*, int, u8
*, int);
904 u8 (*read_reg
) (struct IsdnCardState
*, u8
);
905 void (*write_reg
) (struct IsdnCardState
*, u8
, u8
);
906 void (*read_fifo
) (struct IsdnCardState
*, u8
*, int);
907 void (*write_fifo
) (struct IsdnCardState
*, u8
*, int);
910 /* Methods provided to shared B-channel FIFO handling */
913 void (*fill_fifo
) (struct BCState
*);
914 int (*open
) (struct PStack
*, struct BCState
*);
915 void (*close
) (struct BCState
*);
918 /* Methods provided to shared D-channel FIFO handling */
921 void (*fill_fifo
) (struct IsdnCardState
*);
922 int (*open
) (struct PStack
*, struct IsdnCardState
*);
923 void (*close
) (struct IsdnCardState
*);
925 void (*bh_func
) (void *);
926 void (*dbusy_func
) (struct IsdnCardState
*);
933 #define FLG_TWO_DCHAN 4
934 #define FLG_L1_DBUSY 5
935 #define FLG_DBUSY_TIMER 6
936 #define FLG_ARCOFI_TIMER 8
937 #define FLG_ARCOFI_ERROR 9
938 #define FLG_HW_L1_UINT 10
939 #define FLG_BUGGY_PLX9050 11
941 struct IsdnCardState
{
943 unsigned char subtyp
;
945 struct card_ops
*card_ops
;
949 unsigned long irq_flags
;
953 int chanlimit
; /* limited number of B-chans to use */
954 int logecho
; /* log echo if supported by card */
957 struct teles0_hw teles0
;
958 struct teles3_hw teles3
;
969 struct hfcPCI_hw hfcpci
;
970 struct hfcSX_hw hfcsx
;
972 struct isurf_hw isurf
;
973 struct saphir_hw saphir
;
974 #ifdef CONFIG_HISAX_TESTEMU
978 struct gazel_hw gazel
;
979 struct w6692_hw w6692
;
980 struct hisax_d_if
*hisax_d_if
;
988 struct dc_hw_ops
*dc_hw_ops
;
989 struct bc_hw_ops
*bc_hw_ops
;
990 struct dc_l1_ops
*dc_l1_ops
;
991 struct bc_l1_ops
*bc_l1_ops
;
992 int (*cardmsg
) (struct IsdnCardState
*, int, void *);
993 int (*auxcmd
) (struct IsdnCardState
*, isdn_ctrl
*);
994 struct Channel channel
[2+MAX_WAITING_CALLS
];
995 struct BCState bcs
[2+MAX_WAITING_CALLS
];
996 struct PStack
*stlist
;
997 struct sk_buff_head rq
, sq
; /* D-channel queues */
1002 struct isac_chip isac
;
1003 struct hfcd_chip hfcd
;
1004 struct hfcpci_chip hfcpci
;
1005 struct hfcsx_chip hfcsx
;
1006 struct w6692_chip w6692
;
1007 struct amd7930_chip amd7930
;
1008 struct icc_chip icc
;
1012 struct sk_buff
*tx_skb
;
1015 struct work_struct work
;
1016 struct timer_list dbusytimer
;
1017 #ifdef ERROR_STATISTIC
1025 hisax_release_resources(struct IsdnCardState
*cs
);
1032 #define ISDN_CTYPE_16_0 1
1033 #define ISDN_CTYPE_8_0 2
1034 #define ISDN_CTYPE_16_3 3
1035 #define ISDN_CTYPE_PNP 4
1036 #define ISDN_CTYPE_A1 5
1037 #define ISDN_CTYPE_ELSA 6
1038 #define ISDN_CTYPE_ELSA_PNP 7
1039 #define ISDN_CTYPE_TELESPCMCIA 8
1040 #define ISDN_CTYPE_IX1MICROR2 9
1041 #define ISDN_CTYPE_ELSA_PCMCIA 10
1042 #define ISDN_CTYPE_DIEHLDIVA 11
1043 #define ISDN_CTYPE_ASUSCOM 12
1044 #define ISDN_CTYPE_TELEINT 13
1045 #define ISDN_CTYPE_TELES3C 14
1046 #define ISDN_CTYPE_SEDLBAUER 15
1047 #define ISDN_CTYPE_SPORTSTER 16
1048 #define ISDN_CTYPE_MIC 17
1049 #define ISDN_CTYPE_ELSA_PCI 18
1050 #define ISDN_CTYPE_COMPAQ_ISA 19
1051 #define ISDN_CTYPE_NETJET_S 20
1052 #define ISDN_CTYPE_TELESPCI 21
1053 #define ISDN_CTYPE_SEDLBAUER_PCMCIA 22
1054 #define ISDN_CTYPE_AMD7930 23
1055 #define ISDN_CTYPE_NICCY 24
1056 #define ISDN_CTYPE_S0BOX 25
1057 #define ISDN_CTYPE_A1_PCMCIA 26
1058 #define ISDN_CTYPE_FRITZPCI 27
1059 #define ISDN_CTYPE_SEDLBAUER_FAX 28
1060 #define ISDN_CTYPE_ISURF 29
1061 #define ISDN_CTYPE_ACERP10 30
1062 #define ISDN_CTYPE_HSTSAPHIR 31
1063 #define ISDN_CTYPE_BKM_A4T 32
1064 #define ISDN_CTYPE_SCT_QUADRO 33
1065 #define ISDN_CTYPE_GAZEL 34
1066 #define ISDN_CTYPE_HFC_PCI 35
1067 #define ISDN_CTYPE_W6692 36
1068 #define ISDN_CTYPE_HFC_SX 37
1069 #define ISDN_CTYPE_NETJET_U 38
1070 #define ISDN_CTYPE_HFC_SP_PCMCIA 39
1071 #define ISDN_CTYPE_DYNAMIC 40
1072 #define ISDN_CTYPE_ENTERNOW 41
1073 #define ISDN_CTYPE_COUNT 41
1076 #ifdef CONFIG_HISAX_TESTEMU
1077 #define ISDN_CTYPE_TESTEMU 99
1078 #undef ISDN_CTYPE_COUNT
1079 #define ISDN_CTYPE_COUNT ISDN_CTYPE_TESTEMU
1082 #ifdef CONFIG_HISAX_NETJET_U
1083 #ifndef HISAX_UINTERFACE
1084 #define HISAX_UINTERFACE 1
1089 #define TEI_PER_CARD 1
1092 #define L1_DEB_WARN 0x01
1093 #define L1_DEB_INTSTAT 0x02
1094 #define L1_DEB_ISAC 0x04
1095 #define L1_DEB_ISAC_FIFO 0x08
1096 #define L1_DEB_HSCX 0x10
1097 #define L1_DEB_HSCX_FIFO 0x20
1098 #define L1_DEB_LAPD 0x40
1099 #define L1_DEB_IPAC 0x80
1100 #define L1_DEB_RECEIVE_FRAME 0x100
1101 #define L1_DEB_MONITOR 0x200
1102 #define DEB_DLOG_HEX 0x400
1103 #define DEB_DLOG_VERBOSE 0x800
1105 #define L2FRAME_DEBUG
1107 #ifdef L2FRAME_DEBUG
1108 extern void Logl2Frame(struct IsdnCardState
*cs
, struct sk_buff
*skb
, char *buf
, int dir
);
1113 int protocol
; /* EDSS1, 1TR6 or NI1 */
1114 unsigned long para
[4];
1115 struct IsdnCardState
*cs
;
1118 void init_bcstate(struct IsdnCardState
*cs
, int bc
);
1120 void setstack_HiSax(struct PStack
*st
, struct IsdnCardState
*cs
);
1121 unsigned int random_ri(void);
1122 void HiSax_addlist(struct IsdnCardState
*sp
, struct PStack
*st
);
1123 void HiSax_rmlist(struct IsdnCardState
*sp
, struct PStack
*st
);
1125 void setstack_l1_B(struct PStack
*st
);
1127 void setstack_tei(struct PStack
*st
);
1128 void setstack_manager(struct PStack
*st
);
1130 void setstack_isdnl2(struct PStack
*st
, char *debug_id
);
1131 void releasestack_isdnl2(struct PStack
*st
);
1132 void setstack_transl2(struct PStack
*st
);
1133 void releasestack_transl2(struct PStack
*st
);
1135 void setstack_l3dc(struct PStack
*st
, struct Channel
*chanp
);
1136 void setstack_l3bc(struct PStack
*st
, struct Channel
*chanp
);
1137 void releasestack_isdnl3(struct PStack
*st
);
1139 u8
*findie(u8
* p
, int size
, u8 ie
, int wanted_set
);
1140 int getcallref(u8
* p
);
1141 int newcallref(void);
1143 int FsmNew(struct Fsm
*fsm
, struct FsmNode
*fnlist
, int fncount
);
1144 void FsmFree(struct Fsm
*fsm
);
1145 int FsmEvent(struct FsmInst
*fi
, int event
, void *arg
);
1146 void FsmChangeState(struct FsmInst
*fi
, int newstate
);
1147 void FsmInitTimer(struct FsmInst
*fi
, struct FsmTimer
*ft
);
1148 int FsmAddTimer(struct FsmTimer
*ft
, int millisec
, int event
,
1149 void *arg
, int where
);
1150 void FsmRestartTimer(struct FsmTimer
*ft
, int millisec
, int event
,
1151 void *arg
, int where
);
1152 void FsmDelTimer(struct FsmTimer
*ft
, int where
);
1153 int jiftime(char *s
, long mark
);
1155 int HiSax_command(isdn_ctrl
* ic
);
1156 int HiSax_writebuf_skb(int id
, int chan
, int ack
, struct sk_buff
*skb
);
1157 void HiSax_putstatus(struct IsdnCardState
*cs
, char *head
, char *fmt
, ...);
1158 void VHiSax_putstatus(struct IsdnCardState
*cs
, char *head
, const char *fmt
, va_list args
);
1159 void HiSax_reportcard(int cardnr
, int sel
);
1160 int QuickHex(char *txt
, u8
* p
, int cnt
);
1161 void LogFrame(struct IsdnCardState
*cs
, u8
* p
, int size
);
1162 void dlogframe(struct IsdnCardState
*cs
, struct sk_buff
*skb
, int dir
);
1163 void iecpy(u8
* dest
, u8
* iestart
, int ieoffset
);
1164 #endif /* __KERNEL__ */
1166 #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);}
1168 int ll_run(struct IsdnCardState
*cs
, int addfeatures
);
1169 void ll_stop(struct IsdnCardState
*cs
);
1171 void CallcFree(void);
1172 int CallcNewChan(struct IsdnCardState
*cs
);
1173 void CallcFreeChan(struct IsdnCardState
*cs
);
1174 int Isdnl1New(void);
1175 void Isdnl1Free(void);
1176 int Isdnl2New(void);
1177 void Isdnl2Free(void);
1178 int Isdnl3New(void);
1179 void Isdnl3Free(void);
1180 void init_tei(struct IsdnCardState
*cs
, int protocol
);
1181 void release_tei(struct IsdnCardState
*cs
);
1182 char *HiSax_getrev(const char *revision
);
1185 int certification_check(int output
);
1188 L2L1(struct PStack
*st
, int pr
, void *arg
)
1190 st
->l1
.l2l1(st
, pr
, arg
);
1194 L1L2(struct PStack
*st
, int pr
, void *arg
)
1196 st
->l2
.l1l2(st
, pr
, arg
);
1200 L3L2(struct PStack
*st
, int pr
, void *arg
)
1202 st
->l2
.l3l2(st
, pr
, arg
);
1206 L2L3(struct PStack
*st
, int pr
, void *arg
)
1208 st
->l3
.l2l3(st
, pr
, arg
);
1212 L3L4(struct PStack
*st
, int pr
, void *arg
)
1214 st
->lli
.l3l4(st
, pr
, arg
);
1218 L4L3(struct PStack
*st
, int pr
, void *arg
)
1220 st
->l3
.l4l3(st
, pr
, arg
);