hisax.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:29k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* $Id: hisax.h,v 1.1.4.2 2001/12/09 19:15:28 kai Exp $
  2.  *
  3.  * Basic declarations, defines and prototypes
  4.  *
  5.  * This software may be used and distributed according to the terms
  6.  * of the GNU General Public License, incorporated herein by reference.
  7.  *
  8.  */
  9. #include <linux/config.h>
  10. #include <linux/errno.h>
  11. #include <linux/fs.h>
  12. #include <linux/major.h>
  13. #include <asm/segment.h>
  14. #include <asm/io.h>
  15. #include <linux/delay.h>
  16. #include <linux/kernel.h>
  17. #include <linux/signal.h>
  18. #include <linux/slab.h>
  19. #include <linux/mm.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>
  28. #define ERROR_STATISTIC
  29. #define REQUEST 0
  30. #define CONFIRM 1
  31. #define INDICATION 2
  32. #define RESPONSE 3
  33. #define HW_ENABLE 0x0000
  34. #define HW_RESET 0x0004
  35. #define HW_POWERUP 0x0008
  36. #define HW_ACTIVATE 0x0010
  37. #define HW_DEACTIVATE 0x0018
  38. #define HW_INFO1 0x0010
  39. #define HW_INFO2 0x0020
  40. #define HW_INFO3 0x0030
  41. #define HW_INFO4 0x0040
  42. #define HW_INFO4_P8 0x0040
  43. #define HW_INFO4_P10 0x0048
  44. #define HW_RSYNC 0x0060
  45. #define HW_TESTLOOP 0x0070
  46. #define CARD_RESET 0x00F0
  47. #define CARD_INIT 0x00F2
  48. #define CARD_RELEASE 0x00F3
  49. #define CARD_TEST 0x00F4
  50. #define CARD_AUX_IND 0x00F5
  51. #define PH_ACTIVATE 0x0100
  52. #define PH_DEACTIVATE 0x0110
  53. #define PH_DATA 0x0120
  54. #define PH_PULL 0x0130
  55. #define PH_TESTLOOP 0x0140
  56. #define PH_PAUSE 0x0150
  57. #define MPH_ACTIVATE 0x0180
  58. #define MPH_DEACTIVATE 0x0190
  59. #define MPH_INFORMATION 0x01A0
  60. #define DL_ESTABLISH 0x0200
  61. #define DL_RELEASE 0x0210
  62. #define DL_DATA 0x0220
  63. #define DL_FLUSH 0x0224
  64. #define DL_UNIT_DATA 0x0230
  65. #define MDL_BC_RELEASE  0x0278  // Formula-n enter:now
  66. #define MDL_BC_ASSIGN   0x027C  // Formula-n enter:now
  67. #define MDL_ASSIGN 0x0280
  68. #define MDL_REMOVE 0x0284
  69. #define MDL_ERROR 0x0288
  70. #define MDL_INFO_SETUP 0x02E0
  71. #define MDL_INFO_CONN 0x02E4
  72. #define MDL_INFO_REL 0x02E8
  73. #define CC_SETUP 0x0300
  74. #define CC_RESUME 0x0304
  75. #define CC_MORE_INFO 0x0310
  76. #define CC_IGNORE 0x0320
  77. #define CC_REJECT 0x0324
  78. #define CC_SETUP_COMPL 0x0330
  79. #define CC_PROCEEDING 0x0340
  80. #define CC_ALERTING 0x0344
  81. #define CC_PROGRESS 0x0348
  82. #define CC_CONNECT 0x0350
  83. #define CC_CHARGE 0x0354
  84. #define CC_NOTIFY 0x0358
  85. #define CC_DISCONNECT 0x0360
  86. #define CC_RELEASE 0x0368
  87. #define CC_SUSPEND 0x0370
  88. #define CC_PROCEED_SEND 0x0374
  89. #define CC_REDIR        0x0378
  90. #define CC_T302 0x0382
  91. #define CC_T303 0x0383
  92. #define CC_T304 0x0384
  93. #define CC_T305 0x0385
  94. #define CC_T308_1 0x0388
  95. #define CC_T308_2 0x038A
  96. #define CC_T309         0x0309
  97. #define CC_T310 0x0390
  98. #define CC_T313 0x0393
  99. #define CC_T318 0x0398
  100. #define CC_T319 0x0399
  101. #define CC_TSPID 0x03A0
  102. #define CC_NOSETUP_RSP 0x03E0
  103. #define CC_SETUP_ERR 0x03E1
  104. #define CC_SUSPEND_ERR 0x03E2
  105. #define CC_RESUME_ERR 0x03E3
  106. #define CC_CONNECT_ERR 0x03E4
  107. #define CC_RELEASE_ERR 0x03E5
  108. #define CC_RESTART 0x03F4
  109. #define CC_TDSS1_IO     0x13F4    /* DSS1 IO user timer */
  110. #define CC_TNI1_IO      0x13F5    /* NI1 IO user timer */
  111. /* define maximum number of possible waiting incoming calls */
  112. #define MAX_WAITING_CALLS 2
  113. #ifdef __KERNEL__
  114. /* include l3dss1 & ni1 specific process structures, but no other defines */
  115. #ifdef CONFIG_HISAX_EURO
  116.   #define l3dss1_process
  117.   #include "l3dss1.h" 
  118.   #undef  l3dss1_process
  119. #endif /* CONFIG_HISAX_EURO */
  120. #ifdef CONFIG_HISAX_NI1
  121.   #define l3ni1_process
  122.   #include "l3ni1.h" 
  123.   #undef  l3ni1_process
  124. #endif /* CONFIG_HISAX_NI1 */
  125. #define MAX_DFRAME_LEN 260
  126. #define MAX_DFRAME_LEN_L1 300
  127. #define HSCX_BUFMAX 4096
  128. #define MAX_DATA_SIZE (HSCX_BUFMAX - 4)
  129. #define MAX_DATA_MEM (HSCX_BUFMAX + 64)
  130. #define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)
  131. #define MAX_HEADER_LEN 4
  132. #define MAX_WINDOW 8
  133. #define MAX_MON_FRAME 32
  134. #define MAX_DLOG_SPACE 2048
  135. #define MAX_BLOG_SPACE 256
  136. /* #define I4L_IRQ_FLAG SA_INTERRUPT */
  137. #define I4L_IRQ_FLAG    0
  138. /*
  139.  * Statemachine
  140.  */
  141. struct FsmInst;
  142. typedef void (* FSMFNPTR)(struct FsmInst *, int, void *);
  143. struct Fsm {
  144. FSMFNPTR *jumpmatrix;
  145. int state_count, event_count;
  146. char **strEvent, **strState;
  147. };
  148. struct FsmInst {
  149. struct Fsm *fsm;
  150. int state;
  151. int debug;
  152. void *userdata;
  153. int userint;
  154. void (*printdebug) (struct FsmInst *, char *, ...);
  155. };
  156. struct FsmNode {
  157. int state, event;
  158. void (*routine) (struct FsmInst *, int, void *);
  159. };
  160. struct FsmTimer {
  161. struct FsmInst *fi;
  162. struct timer_list tl;
  163. int event;
  164. void *arg;
  165. };
  166. struct L3Timer {
  167. struct l3_process *pc;
  168. struct timer_list tl;
  169. int event;
  170. };
  171. #define FLG_L1_ACTIVATING 1
  172. #define FLG_L1_ACTIVATED 2
  173. #define FLG_L1_DEACTTIMER 3
  174. #define FLG_L1_ACTTIMER 4
  175. #define FLG_L1_T3RUN 5
  176. #define FLG_L1_PULL_REQ 6
  177. #define FLG_L1_UINT 7
  178. struct Layer1 {
  179. void *hardware;
  180. struct BCState *bcs;
  181. struct PStack **stlistp;
  182. long Flags;
  183. struct FsmInst l1m;
  184. struct FsmTimer timer;
  185. void (*l1l2) (struct PStack *, int, void *);
  186. void (*l1hw) (struct PStack *, int, void *);
  187. void (*l1tei) (struct PStack *, int, void *);
  188. int mode, bc;
  189. int delay;
  190. };
  191. #define GROUP_TEI 127
  192. #define TEI_SAPI 63
  193. #define CTRL_SAPI 0
  194. #define PACKET_NOACK 250
  195. /* Layer2 Flags */
  196. #define FLG_LAPB 0
  197. #define FLG_LAPD 1
  198. #define FLG_ORIG 2
  199. #define FLG_MOD128 3
  200. #define FLG_PEND_REL 4
  201. #define FLG_L3_INIT 5
  202. #define FLG_T200_RUN 6
  203. #define FLG_ACK_PEND 7
  204. #define FLG_REJEXC 8
  205. #define FLG_OWN_BUSY 9
  206. #define FLG_PEER_BUSY 10
  207. #define FLG_DCHAN_BUSY 11
  208. #define FLG_L1_ACTIV 12
  209. #define FLG_ESTAB_PEND 13
  210. #define FLG_PTP 14
  211. #define FLG_FIXED_TEI 15
  212. #define FLG_L2BLOCK 16
  213. struct Layer2 {
  214. int tei;
  215. int sap;
  216. int maxlen;
  217. unsigned long flag;
  218. unsigned int vs, va, vr;
  219. int rc;
  220. unsigned int window;
  221. unsigned int sow;
  222. struct sk_buff *windowar[MAX_WINDOW];
  223. struct sk_buff_head i_queue;
  224. struct sk_buff_head ui_queue;
  225. void (*l2l1) (struct PStack *, int, void *);
  226. void (*l2l3) (struct PStack *, int, void *);
  227. void (*l2tei) (struct PStack *, int, void *);
  228. struct FsmInst l2m;
  229. struct FsmTimer t200, t203;
  230. int T200, N200, T203;
  231. int debug;
  232. char debug_id[16];
  233. };
  234. struct Layer3 {
  235. void (*l3l4) (struct PStack *, int, void *);
  236.         void (*l3ml3) (struct PStack *, int, void *);
  237. void (*l3l2) (struct PStack *, int, void *);
  238. struct FsmInst l3m;
  239.         struct FsmTimer l3m_timer;
  240. struct sk_buff_head squeue;
  241. struct l3_process *proc;
  242. struct l3_process *global;
  243. int N303;
  244. int debug;
  245. char debug_id[8];
  246. };
  247. struct LLInterface {
  248. void (*l4l3) (struct PStack *, int, void *);
  249.         int  (*l4l3_proto) (struct PStack *, isdn_ctrl *);
  250. void *userdata;
  251. void (*l1writewakeup) (struct PStack *, int);
  252. void (*l2writewakeup) (struct PStack *, int);
  253. };
  254. struct Management {
  255. int ri;
  256. struct FsmInst tei_m;
  257. struct FsmTimer t202;
  258. int T202, N202, debug;
  259. void (*layer) (struct PStack *, int, void *);
  260. };
  261. #define NO_CAUSE 254
  262. struct Param {
  263. u_char cause;
  264. u_char loc;
  265. u_char diag[6];
  266. int bchannel;
  267. int chargeinfo;
  268. int spv; /* SPV Flag */
  269. setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
  270. u_char moderate; /* transfer mode and rate (bearer octet 4) */
  271. };
  272. struct PStack {
  273. struct PStack *next;
  274. struct Layer1 l1;
  275. struct Layer2 l2;
  276. struct Layer3 l3;
  277. struct LLInterface lli;
  278. struct Management ma;
  279. int protocol; /* EDSS1, 1TR6 or NI1 */
  280.         /* protocol specific data fields */
  281.         union
  282.  { u_char uuuu; /* only as dummy */
  283. #ifdef CONFIG_HISAX_EURO
  284.            dss1_stk_priv dss1; /* private dss1 data */
  285. #endif /* CONFIG_HISAX_EURO */              
  286. #ifdef CONFIG_HISAX_NI1
  287.            ni1_stk_priv ni1; /* private ni1 data */
  288. #endif /* CONFIG_HISAX_NI1 */             
  289.  } prot;
  290. };
  291. struct l3_process {
  292. int callref;
  293. int state;
  294. struct L3Timer timer;
  295. int N303;
  296. int debug;
  297. struct Param para;
  298. struct Channel *chan;
  299. struct PStack *st;
  300. struct l3_process *next;
  301.         ulong redir_result;
  302.         /* protocol specific data fields */
  303.         union 
  304.  { u_char uuuu; /* only when euro not defined, avoiding empty union */
  305. #ifdef CONFIG_HISAX_EURO 
  306.            dss1_proc_priv dss1; /* private dss1 data */
  307. #endif /* CONFIG_HISAX_EURO */            
  308. #ifdef CONFIG_HISAX_NI1
  309.            ni1_proc_priv ni1; /* private ni1 data */
  310. #endif /* CONFIG_HISAX_NI1 */             
  311.  } prot;
  312. };
  313. struct hscx_hw {
  314. int hscx;
  315. int rcvidx;
  316. int count;              /* Current skb sent count */
  317. u_char *rcvbuf;         /* B-Channel receive Buffer */
  318. u_char tsaxr0;
  319. u_char tsaxr1;
  320. };
  321. struct w6692B_hw {
  322. int bchan;
  323. int rcvidx;
  324. int count;              /* Current skb sent count */
  325. u_char *rcvbuf;         /* B-Channel receive Buffer */
  326. };
  327. struct isar_reg {
  328. unsigned long Flags;
  329. volatile u_char bstat;
  330. volatile u_char iis;
  331. volatile u_char cmsb;
  332. volatile u_char clsb;
  333. volatile u_char par[8];
  334. };
  335. struct isar_hw {
  336. int dpath;
  337. int rcvidx;
  338. int txcnt;
  339. int mml;
  340. u_char state;
  341. u_char cmd;
  342. u_char mod;
  343. u_char newcmd;
  344. u_char newmod;
  345. char try_mod;
  346. struct timer_list ftimer;
  347. u_char *rcvbuf;         /* B-Channel receive Buffer */
  348. u_char conmsg[16];
  349. struct isar_reg *reg;
  350. };
  351. struct hdlc_stat_reg {
  352. #ifdef __BIG_ENDIAN
  353. u_char fill __attribute__((packed));
  354. u_char mode __attribute__((packed));
  355. u_char xml  __attribute__((packed));
  356. u_char cmd  __attribute__((packed));
  357. #else
  358. u_char cmd  __attribute__((packed));
  359. u_char xml  __attribute__((packed));
  360. u_char mode __attribute__((packed));
  361. u_char fill __attribute__((packed));
  362. #endif
  363. };
  364. struct hdlc_hw {
  365. union {
  366. u_int ctrl;
  367. struct hdlc_stat_reg sr;
  368. } ctrl;
  369. u_int stat;
  370. int rcvidx;
  371. int count;              /* Current skb sent count */
  372. u_char *rcvbuf;         /* B-Channel receive Buffer */
  373. };
  374. struct hfcB_hw {
  375. unsigned int *send;
  376. int f1;
  377. int f2;
  378. };
  379. struct tiger_hw {
  380. u_int *send;
  381. u_int *s_irq;
  382. u_int *s_end;
  383. u_int *sendp;
  384. u_int *rec;
  385. int free;
  386. u_char *rcvbuf;
  387. u_char *sendbuf;
  388. u_char *sp;
  389. int sendcnt;
  390. u_int s_tot;
  391. u_int r_bitcnt;
  392. u_int r_tot;
  393. u_int r_err;
  394. u_int r_fcs;
  395. u_char r_state;
  396. u_char r_one;
  397. u_char r_val;
  398. u_char s_state;
  399. };
  400. struct amd7930_hw {
  401. u_char *tx_buff;
  402. u_char *rv_buff;
  403. int rv_buff_in;
  404. int rv_buff_out;
  405. struct sk_buff *rv_skb;
  406. struct hdlc_state *hdlc_state;
  407. struct tq_struct tq_rcv;
  408. struct tq_struct tq_xmt;
  409. };
  410. #define BC_FLG_INIT 1
  411. #define BC_FLG_ACTIV 2
  412. #define BC_FLG_BUSY 3
  413. #define BC_FLG_NOFRAME 4
  414. #define BC_FLG_HALF 5
  415. #define BC_FLG_EMPTY 6
  416. #define BC_FLG_ORIG 7
  417. #define BC_FLG_DLEETX 8
  418. #define BC_FLG_LASTDLE 9
  419. #define BC_FLG_FIRST 10
  420. #define BC_FLG_LASTDATA 11
  421. #define BC_FLG_NMD_DATA 12
  422. #define BC_FLG_FTI_RUN 13
  423. #define BC_FLG_LL_OK 14
  424. #define BC_FLG_LL_CONN 15
  425. #define L1_MODE_NULL 0
  426. #define L1_MODE_TRANS 1
  427. #define L1_MODE_HDLC 2
  428. #define L1_MODE_EXTRN 3
  429. #define L1_MODE_HDLC_56K 4
  430. #define L1_MODE_MODEM 7
  431. #define L1_MODE_V32 8
  432. #define L1_MODE_FAX 9
  433. struct BCState {
  434. int channel;
  435. int mode;
  436. long Flag; /* long req'd for set_bit --RR */
  437. struct IsdnCardState *cs;
  438. int tx_cnt; /* B-Channel transmit counter */
  439. struct sk_buff *tx_skb; /* B-Channel transmit Buffer */
  440. struct sk_buff_head rqueue; /* B-Channel receive Queue */
  441. struct sk_buff_head squeue; /* B-Channel send Queue */
  442. struct PStack *st;
  443. u_char *blog;
  444. u_char *conmsg;
  445. struct timer_list transbusy;
  446. struct tq_struct tqueue;
  447. int event;
  448. int  (*BC_SetStack) (struct PStack *, struct BCState *);
  449. void (*BC_Close) (struct BCState *);
  450. #ifdef ERROR_STATISTIC
  451. int err_crc;
  452. int err_tx;
  453. int err_rdo;
  454. int err_inv;
  455. #endif
  456. union {
  457. struct hscx_hw hscx;
  458. struct hdlc_hw hdlc;
  459. struct isar_hw isar;
  460. struct hfcB_hw hfc;
  461. struct tiger_hw tiger;
  462. struct amd7930_hw  amd7930;
  463. struct w6692B_hw w6692;
  464. struct hisax_b_if *b_if;
  465. } hw;
  466. };
  467. struct Channel {
  468. struct PStack *b_st, *d_st;
  469. struct IsdnCardState *cs;
  470. struct BCState *bcs;
  471. int chan;
  472. int incoming;
  473. struct FsmInst fi;
  474. struct FsmTimer drel_timer, dial_timer;
  475. int debug;
  476. int l2_protocol, l2_active_protocol;
  477. int l3_protocol;
  478. int data_open;
  479. struct l3_process *proc;
  480. setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
  481. long Flags; /* for remembering action done in l4 */
  482. /* long req'd for set_bit --RR */
  483. int leased;
  484. };
  485. struct elsa_hw {
  486. unsigned long base;
  487. unsigned int cfg;
  488. unsigned int ctrl;
  489. unsigned int ale;
  490. unsigned int isac;
  491. unsigned int itac;
  492. unsigned int hscx;
  493. unsigned int trig;
  494. unsigned int timer;
  495. unsigned int counter;
  496. unsigned int status;
  497. struct timer_list tl;
  498. unsigned int MFlag;
  499. struct BCState *bcs;
  500. u_char *transbuf;
  501. u_char *rcvbuf;
  502. unsigned int transp;
  503. unsigned int rcvp;
  504. unsigned int transcnt;
  505. unsigned int rcvcnt;
  506. u_char IER;
  507. u_char FCR;
  508. u_char LCR;
  509. u_char MCR;
  510. u_char ctrl_reg;
  511. };
  512. struct teles3_hw {
  513. unsigned int cfg_reg;
  514. signed   int isac;
  515. signed   int hscx[2];
  516. signed   int isacfifo;
  517. signed   int hscxfifo[2];
  518. };
  519. struct teles0_hw {
  520. unsigned int cfg_reg;
  521. unsigned long membase;
  522. unsigned long phymem;
  523. };
  524. struct avm_hw {
  525. unsigned int cfg_reg;
  526. unsigned int isac;
  527. unsigned int hscx[2];
  528. unsigned int isacfifo;
  529. unsigned int hscxfifo[2];
  530. unsigned int counter;
  531. };
  532. struct ix1_hw {
  533. unsigned int cfg_reg;
  534. unsigned int isac_ale;
  535. unsigned int isac;
  536. unsigned int hscx_ale;
  537. unsigned int hscx;
  538. };
  539. struct diva_hw {
  540. unsigned long cfg_reg;
  541. unsigned long pci_cfg;
  542. unsigned int ctrl;
  543. unsigned long isac_adr;
  544. unsigned int isac;
  545. unsigned long hscx_adr;
  546. unsigned int hscx;
  547. unsigned int status;
  548. struct timer_list tl;
  549. u_char ctrl_reg;
  550. };
  551. struct asus_hw {
  552. unsigned int cfg_reg;
  553. unsigned int adr;
  554. unsigned int isac;
  555. unsigned int hscx;
  556. unsigned int u7;
  557. unsigned int pots;
  558. };
  559. struct hfc_hw {
  560. unsigned int addr;
  561. unsigned int fifosize;
  562. unsigned char cirm;
  563. unsigned char ctmt;
  564. unsigned char cip;
  565. u_char isac_spcr;
  566. struct timer_list timer;
  567. };
  568. struct sedl_hw {
  569. unsigned int cfg_reg;
  570. unsigned int adr;
  571. unsigned int isac;
  572. unsigned int hscx;
  573. unsigned int reset_on;
  574. unsigned int reset_off;
  575. struct isar_reg isar;
  576. unsigned int chip;
  577. unsigned int bus;
  578. };
  579. struct spt_hw {
  580. unsigned int cfg_reg;
  581. unsigned int isac;
  582. unsigned int hscx[2];
  583. unsigned char res_irq;
  584. };
  585. struct mic_hw {
  586. unsigned int cfg_reg;
  587. unsigned int adr;
  588. unsigned int isac;
  589. unsigned int hscx;
  590. };
  591. struct njet_hw {
  592. unsigned long base;
  593. unsigned int isac;
  594. unsigned int auxa;
  595. unsigned char auxd;
  596. unsigned char dmactrl;
  597. unsigned char ctrl_reg;
  598. unsigned char irqmask0;
  599. unsigned char irqstat0;
  600. unsigned char last_is0;
  601. };
  602. struct hfcPCI_hw {
  603. unsigned char cirm;
  604. unsigned char ctmt;
  605. unsigned char conn;
  606. unsigned char mst_m;
  607. unsigned char int_m1;
  608. unsigned char int_m2;
  609. unsigned char int_s1;
  610. unsigned char sctrl;
  611.         unsigned char sctrl_r;
  612.         unsigned char sctrl_e;
  613.         unsigned char trm;
  614. unsigned char stat;
  615. unsigned char fifo;
  616.         unsigned char fifo_en;
  617.         unsigned char bswapped;
  618.         unsigned char nt_mode;
  619.         int nt_timer;
  620. unsigned char pci_bus;
  621.         unsigned char pci_device_fn;
  622.         unsigned char *pci_io; /* start of PCI IO memory */
  623.         void *share_start; /* shared memory for Fifos start */
  624.         void *fifos; /* FIFO memory */ 
  625.         int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
  626. struct timer_list timer;
  627. };
  628. struct hfcSX_hw {
  629.         unsigned long base;
  630. unsigned char cirm;
  631. unsigned char ctmt;
  632. unsigned char conn;
  633. unsigned char mst_m;
  634. unsigned char int_m1;
  635. unsigned char int_m2;
  636. unsigned char int_s1;
  637. unsigned char sctrl;
  638.         unsigned char sctrl_r;
  639.         unsigned char sctrl_e;
  640.         unsigned char trm;
  641. unsigned char stat;
  642. unsigned char fifo;
  643.         unsigned char bswapped;
  644.         unsigned char nt_mode;
  645.         unsigned char chip;
  646.         int b_fifo_size;
  647.         unsigned char last_fifo;
  648.         void *extra;
  649.         int nt_timer;
  650. struct timer_list timer;
  651. };
  652. struct hfcD_hw {
  653. unsigned int addr;
  654. unsigned int bfifosize;
  655. unsigned int dfifosize;
  656. unsigned char cirm;
  657. unsigned char ctmt;
  658. unsigned char cip;
  659. unsigned char conn;
  660. unsigned char mst_m;
  661. unsigned char int_m1;
  662. unsigned char int_m2;
  663. unsigned char int_s1;
  664. unsigned char sctrl;
  665. unsigned char stat;
  666. unsigned char fifo;
  667. unsigned char f1;
  668. unsigned char f2;
  669. unsigned int *send;
  670. struct timer_list timer;
  671. };
  672. struct isurf_hw {
  673. unsigned int reset;
  674. unsigned long phymem;
  675. unsigned long isac;
  676. unsigned long isar;
  677. struct isar_reg isar_r;
  678. };
  679. struct saphir_hw {
  680. unsigned int cfg_reg;
  681. unsigned int ale;
  682. unsigned int isac;
  683. unsigned int hscx;
  684. struct timer_list timer;
  685. };
  686. struct bkm_hw {
  687. unsigned long base;
  688. /* A4T stuff */
  689. unsigned long isac_adr;
  690. unsigned int isac_ale;
  691. unsigned long jade_adr;
  692. unsigned int jade_ale;
  693. /* Scitel Quadro stuff */
  694. unsigned long plx_adr;
  695. unsigned long data_adr;
  696. };
  697. struct gazel_hw {
  698. unsigned int cfg_reg;
  699. unsigned int pciaddr[2];
  700.         signed   int ipac;
  701. signed   int isac;
  702. signed   int hscx[2];
  703. signed   int isacfifo;
  704. signed   int hscxfifo[2];
  705. unsigned char timeslot;
  706. unsigned char iom2;
  707. };
  708. struct w6692_hw {
  709. unsigned int iobase;
  710. struct timer_list timer;
  711. };
  712. #ifdef  CONFIG_HISAX_TESTEMU
  713. struct te_hw {
  714. unsigned char *sfifo;
  715. unsigned char *sfifo_w;
  716. unsigned char *sfifo_r;
  717. unsigned char *sfifo_e;
  718. int sfifo_cnt;
  719. unsigned int stat;
  720. wait_queue_head_t rwaitq;
  721. wait_queue_head_t swaitq;
  722. };
  723. #endif
  724. struct arcofi_msg {
  725. struct arcofi_msg *next;
  726. u_char receive;
  727. u_char len;
  728. u_char msg[10];
  729. };
  730. struct isac_chip {
  731. int ph_state;
  732. u_char *mon_tx;
  733. u_char *mon_rx;
  734. int mon_txp;
  735. int mon_txc;
  736. int mon_rxp;
  737. struct arcofi_msg *arcofi_list;
  738. struct timer_list arcofitimer;
  739. wait_queue_head_t arcofi_wait;
  740. u_char arcofi_bc;
  741. u_char arcofi_state;
  742. u_char mocr;
  743. u_char adf2;
  744. };
  745. struct hfcd_chip {
  746. int ph_state;
  747. };
  748. struct hfcpci_chip {
  749. int ph_state;
  750. };
  751. struct hfcsx_chip {
  752. int ph_state;
  753. };
  754. struct w6692_chip {
  755. int ph_state;
  756. };
  757. struct amd7930_chip {
  758. u_char lmr1;
  759. u_char ph_state;
  760. u_char old_state;
  761. u_char flg_t3;
  762. unsigned int tx_xmtlen;
  763. struct timer_list timer3;
  764. void (*ph_command) (struct IsdnCardState *, u_char, char *);
  765. void (*setIrqMask) (struct IsdnCardState *, u_char);
  766. };
  767. struct icc_chip {
  768. int ph_state;
  769. u_char *mon_tx;
  770. u_char *mon_rx;
  771. int mon_txp;
  772. int mon_txc;
  773. int mon_rxp;
  774. struct arcofi_msg *arcofi_list;
  775. struct timer_list arcofitimer;
  776. wait_queue_head_t arcofi_wait;
  777. u_char arcofi_bc;
  778. u_char arcofi_state;
  779. u_char mocr;
  780. u_char adf2;
  781. };
  782. #define HW_IOM1 0
  783. #define HW_IPAC 1
  784. #define HW_ISAR 2
  785. #define HW_ARCOFI 3
  786. #define FLG_TWO_DCHAN 4
  787. #define FLG_L1_DBUSY 5
  788. #define FLG_DBUSY_TIMER  6
  789. #define FLG_LOCK_ATOMIC  7
  790. #define FLG_ARCOFI_TIMER 8
  791. #define FLG_ARCOFI_ERROR 9
  792. #define FLG_HW_L1_UINT 10
  793. struct IsdnCardState {
  794. unsigned char typ;
  795. unsigned char subtyp;
  796. int protocol;
  797. unsigned int irq;
  798. unsigned long irq_flags;
  799. long HW_Flags;
  800. int *busy_flag;
  801.         int chanlimit; /* limited number of B-chans to use */
  802.         int logecho; /* log echo if supported by card */
  803. union {
  804. struct elsa_hw elsa;
  805. struct teles0_hw teles0;
  806. struct teles3_hw teles3;
  807. struct avm_hw avm;
  808. struct ix1_hw ix1;
  809. struct diva_hw diva;
  810. struct asus_hw asus;
  811. struct hfc_hw hfc;
  812. struct sedl_hw sedl;
  813. struct spt_hw spt;
  814. struct mic_hw mic;
  815. struct njet_hw njet;
  816. struct hfcD_hw hfcD;
  817. struct hfcPCI_hw hfcpci;
  818. struct hfcSX_hw hfcsx;
  819. struct ix1_hw niccy;
  820. struct isurf_hw isurf;
  821. struct saphir_hw saphir;
  822. #ifdef CONFIG_HISAX_TESTEMU
  823. struct te_hw te;
  824. #endif
  825. struct bkm_hw ax;
  826. struct gazel_hw gazel;
  827. struct w6692_hw w6692;
  828. struct hisax_d_if *hisax_d_if;
  829. } hw;
  830. int myid;
  831. isdn_if iif;
  832. u_char *status_buf;
  833. u_char *status_read;
  834. u_char *status_write;
  835. u_char *status_end;
  836. u_char (*readisac) (struct IsdnCardState *, u_char);
  837. void   (*writeisac) (struct IsdnCardState *, u_char, u_char);
  838. void   (*readisacfifo) (struct IsdnCardState *, u_char *, int);
  839. void   (*writeisacfifo) (struct IsdnCardState *, u_char *, int);
  840. u_char (*BC_Read_Reg) (struct IsdnCardState *, int, u_char);
  841. void   (*BC_Write_Reg) (struct IsdnCardState *, int, u_char, u_char);
  842. void   (*BC_Send_Data) (struct BCState *);
  843. int    (*cardmsg) (struct IsdnCardState *, int, void *);
  844. void   (*setstack_d) (struct PStack *, struct IsdnCardState *);
  845. void   (*DC_Close) (struct IsdnCardState *);
  846. void   (*irq_func) (int, void *, struct pt_regs *);
  847. int    (*auxcmd) (struct IsdnCardState *, isdn_ctrl *);
  848. struct Channel channel[2+MAX_WAITING_CALLS];
  849. struct BCState bcs[2+MAX_WAITING_CALLS];
  850. struct PStack *stlist;
  851. struct sk_buff_head rq, sq; /* D-channel queues */
  852. int cardnr;
  853. char *dlog;
  854. int debug;
  855. union {
  856. struct isac_chip isac;
  857. struct hfcd_chip hfcd;
  858. struct hfcpci_chip hfcpci;
  859. struct hfcsx_chip hfcsx;
  860. struct w6692_chip w6692;
  861. struct amd7930_chip amd7930;
  862. struct icc_chip icc;
  863. } dc;
  864. u_char *rcvbuf;
  865. int rcvidx;
  866. struct sk_buff *tx_skb;
  867. int tx_cnt;
  868. long event;
  869. struct tq_struct tqueue;
  870. struct timer_list dbusytimer;
  871. #ifdef ERROR_STATISTIC
  872. int err_crc;
  873. int err_tx;
  874. int err_rx;
  875. #endif
  876. };
  877. #define  MON0_RX 1
  878. #define  MON1_RX 2
  879. #define  MON0_TX 4
  880. #define  MON1_TX 8
  881. #define  ISDN_CTYPE_16_0 1
  882. #define  ISDN_CTYPE_8_0 2
  883. #define  ISDN_CTYPE_16_3 3
  884. #define  ISDN_CTYPE_PNP 4
  885. #define  ISDN_CTYPE_A1 5
  886. #define  ISDN_CTYPE_ELSA 6
  887. #define  ISDN_CTYPE_ELSA_PNP 7
  888. #define  ISDN_CTYPE_TELESPCMCIA 8
  889. #define  ISDN_CTYPE_IX1MICROR2 9
  890. #define  ISDN_CTYPE_ELSA_PCMCIA 10
  891. #define  ISDN_CTYPE_DIEHLDIVA 11
  892. #define  ISDN_CTYPE_ASUSCOM 12
  893. #define  ISDN_CTYPE_TELEINT 13
  894. #define  ISDN_CTYPE_TELES3C 14
  895. #define  ISDN_CTYPE_SEDLBAUER 15
  896. #define  ISDN_CTYPE_SPORTSTER 16
  897. #define  ISDN_CTYPE_MIC 17
  898. #define  ISDN_CTYPE_ELSA_PCI 18
  899. #define  ISDN_CTYPE_COMPAQ_ISA 19
  900. #define  ISDN_CTYPE_NETJET_S 20
  901. #define  ISDN_CTYPE_TELESPCI 21
  902. #define  ISDN_CTYPE_SEDLBAUER_PCMCIA 22
  903. #define  ISDN_CTYPE_AMD7930 23
  904. #define  ISDN_CTYPE_NICCY 24
  905. #define  ISDN_CTYPE_S0BOX 25
  906. #define  ISDN_CTYPE_A1_PCMCIA 26
  907. #define  ISDN_CTYPE_FRITZPCI 27
  908. #define  ISDN_CTYPE_SEDLBAUER_FAX     28
  909. #define  ISDN_CTYPE_ISURF 29
  910. #define  ISDN_CTYPE_ACERP10 30
  911. #define  ISDN_CTYPE_HSTSAPHIR 31
  912. #define  ISDN_CTYPE_BKM_A4T 32
  913. #define  ISDN_CTYPE_SCT_QUADRO 33
  914. #define  ISDN_CTYPE_GAZEL 34
  915. #define  ISDN_CTYPE_HFC_PCI 35
  916. #define  ISDN_CTYPE_W6692 36
  917. #define  ISDN_CTYPE_HFC_SX      37
  918. #define  ISDN_CTYPE_NETJET_U 38
  919. #define  ISDN_CTYPE_HFC_SP_PCMCIA      39
  920. #define  ISDN_CTYPE_DYNAMIC     40
  921. #define  ISDN_CTYPE_ENTERNOW 41
  922. #define  ISDN_CTYPE_COUNT 41
  923. #ifdef ISDN_CHIP_ISAC
  924. #undef ISDN_CHIP_ISAC
  925. #endif
  926. #ifdef CONFIG_HISAX_16_0
  927. #define  CARD_TELES0 1
  928. #ifndef ISDN_CHIP_ISAC
  929. #define ISDN_CHIP_ISAC 1
  930. #endif
  931. #else
  932. #define  CARD_TELES0  0
  933. #endif
  934. #ifdef CONFIG_HISAX_16_3
  935. #define  CARD_TELES3 1
  936. #ifndef ISDN_CHIP_ISAC
  937. #define ISDN_CHIP_ISAC 1
  938. #endif
  939. #else
  940. #define  CARD_TELES3  0
  941. #endif
  942. #ifdef CONFIG_HISAX_TELESPCI
  943. #define  CARD_TELESPCI 1
  944. #ifndef ISDN_CHIP_ISAC
  945. #define ISDN_CHIP_ISAC 1
  946. #endif
  947. #else
  948. #define  CARD_TELESPCI  0
  949. #endif
  950. #ifdef CONFIG_HISAX_AVM_A1
  951. #define  CARD_AVM_A1 1
  952. #ifndef ISDN_CHIP_ISAC
  953. #define ISDN_CHIP_ISAC 1
  954. #endif
  955. #else
  956. #define  CARD_AVM_A1  0
  957. #endif
  958. #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
  959. #define  CARD_AVM_A1_PCMCIA 1
  960. #ifndef ISDN_CHIP_ISAC
  961. #define ISDN_CHIP_ISAC 1
  962. #endif
  963. #else
  964. #define  CARD_AVM_A1_PCMCIA  0
  965. #endif
  966. #ifdef CONFIG_HISAX_FRITZPCI
  967. #define  CARD_FRITZPCI 1
  968. #ifndef ISDN_CHIP_ISAC
  969. #define ISDN_CHIP_ISAC 1
  970. #endif
  971. #else
  972. #define  CARD_FRITZPCI  0
  973. #endif
  974. #ifdef CONFIG_HISAX_ELSA
  975. #define  CARD_ELSA 1
  976. #ifndef ISDN_CHIP_ISAC
  977. #define ISDN_CHIP_ISAC 1
  978. #endif
  979. #else
  980. #define  CARD_ELSA  0
  981. #endif
  982. #ifdef CONFIG_HISAX_IX1MICROR2
  983. #define CARD_IX1MICROR2 1
  984. #ifndef ISDN_CHIP_ISAC
  985. #define ISDN_CHIP_ISAC 1
  986. #endif
  987. #else
  988. #define CARD_IX1MICROR2 0
  989. #endif
  990. #ifdef  CONFIG_HISAX_DIEHLDIVA
  991. #define CARD_DIEHLDIVA 1
  992. #ifndef ISDN_CHIP_ISAC
  993. #define ISDN_CHIP_ISAC 1
  994. #endif
  995. #else
  996. #define CARD_DIEHLDIVA 0
  997. #endif
  998. #ifdef  CONFIG_HISAX_ASUSCOM
  999. #define CARD_ASUSCOM 1
  1000. #ifndef ISDN_CHIP_ISAC
  1001. #define ISDN_CHIP_ISAC 1
  1002. #endif
  1003. #else
  1004. #define CARD_ASUSCOM 0
  1005. #endif
  1006. #ifdef  CONFIG_HISAX_TELEINT
  1007. #define CARD_TELEINT 1
  1008. #ifndef ISDN_CHIP_ISAC
  1009. #define ISDN_CHIP_ISAC 1
  1010. #endif
  1011. #else
  1012. #define CARD_TELEINT 0
  1013. #endif
  1014. #ifdef  CONFIG_HISAX_SEDLBAUER
  1015. #define CARD_SEDLBAUER 1
  1016. #ifndef ISDN_CHIP_ISAC
  1017. #define ISDN_CHIP_ISAC 1
  1018. #endif
  1019. #else
  1020. #define CARD_SEDLBAUER 0
  1021. #endif
  1022. #ifdef  CONFIG_HISAX_SPORTSTER
  1023. #define CARD_SPORTSTER 1
  1024. #ifndef ISDN_CHIP_ISAC
  1025. #define ISDN_CHIP_ISAC 1
  1026. #endif
  1027. #else
  1028. #define CARD_SPORTSTER 0
  1029. #endif
  1030. #ifdef  CONFIG_HISAX_MIC
  1031. #define CARD_MIC 1
  1032. #ifndef ISDN_CHIP_ISAC
  1033. #define ISDN_CHIP_ISAC 1
  1034. #endif
  1035. #else
  1036. #define CARD_MIC 0
  1037. #endif
  1038. #ifdef  CONFIG_HISAX_NETJET
  1039. #define CARD_NETJET_S 1
  1040. #ifndef ISDN_CHIP_ISAC
  1041. #define ISDN_CHIP_ISAC 1
  1042. #endif
  1043. #else
  1044. #define CARD_NETJET_S 0
  1045. #endif
  1046. #ifdef CONFIG_HISAX_HFCS
  1047. #define  CARD_HFCS 1
  1048. #else
  1049. #define  CARD_HFCS 0
  1050. #endif
  1051. #ifdef CONFIG_HISAX_HFC_PCI
  1052. #define  CARD_HFC_PCI 1
  1053. #else
  1054. #define  CARD_HFC_PCI 0
  1055. #endif
  1056. #ifdef CONFIG_HISAX_HFC_SX
  1057. #define  CARD_HFC_SX 1
  1058. #else
  1059. #define  CARD_HFC_SX 0
  1060. #endif
  1061. #ifdef  CONFIG_HISAX_AMD7930
  1062. #define CARD_AMD7930 1
  1063. #else
  1064. #define CARD_AMD7930 0
  1065. #endif
  1066. #ifdef CONFIG_HISAX_NICCY
  1067. #define CARD_NICCY 1
  1068. #ifndef ISDN_CHIP_ISAC
  1069. #define ISDN_CHIP_ISAC 1
  1070. #endif
  1071. #else
  1072. #define CARD_NICCY 0
  1073. #endif
  1074. #ifdef CONFIG_HISAX_ISURF
  1075. #define CARD_ISURF 1
  1076. #ifndef ISDN_CHIP_ISAC
  1077. #define ISDN_CHIP_ISAC 1
  1078. #endif
  1079. #else
  1080. #define CARD_ISURF 0
  1081. #endif
  1082. #ifdef CONFIG_HISAX_S0BOX
  1083. #define CARD_S0BOX 1
  1084. #ifndef ISDN_CHIP_ISAC
  1085. #define ISDN_CHIP_ISAC 1
  1086. #endif
  1087. #else
  1088. #define CARD_S0BOX 0
  1089. #endif
  1090. #ifdef CONFIG_HISAX_HSTSAPHIR
  1091. #define CARD_HSTSAPHIR 1
  1092. #ifndef ISDN_CHIP_ISAC
  1093. #define ISDN_CHIP_ISAC 1
  1094. #endif
  1095. #else
  1096. #define CARD_HSTSAPHIR 0
  1097. #endif
  1098. #ifdef CONFIG_HISAX_TESTEMU
  1099. #define CARD_TESTEMU 1
  1100. #define ISDN_CTYPE_TESTEMU 99
  1101. #undef ISDN_CTYPE_COUNT
  1102. #define  ISDN_CTYPE_COUNT ISDN_CTYPE_TESTEMU
  1103. #else
  1104. #define CARD_TESTEMU 0
  1105. #endif
  1106. #ifdef CONFIG_HISAX_BKM_A4T
  1107. #define CARD_BKM_A4T 1
  1108. #ifndef ISDN_CHIP_ISAC
  1109. #define ISDN_CHIP_ISAC 1
  1110. #endif
  1111. #else
  1112. #define CARD_BKM_A4T 0
  1113. #endif
  1114. #ifdef CONFIG_HISAX_SCT_QUADRO
  1115. #define CARD_SCT_QUADRO 1
  1116. #ifndef ISDN_CHIP_ISAC
  1117. #define ISDN_CHIP_ISAC 1
  1118. #endif
  1119. #else
  1120. #define CARD_SCT_QUADRO 0
  1121. #endif
  1122. #ifdef CONFIG_HISAX_GAZEL
  1123. #define  CARD_GAZEL 1
  1124. #ifndef ISDN_CHIP_ISAC
  1125. #define ISDN_CHIP_ISAC 1
  1126. #endif
  1127. #else
  1128. #define  CARD_GAZEL  0
  1129. #endif
  1130. #ifdef CONFIG_HISAX_W6692
  1131. #define CARD_W6692 1
  1132. #ifndef ISDN_CHIP_W6692
  1133. #define ISDN_CHIP_W6692 1
  1134. #endif
  1135. #else
  1136. #define CARD_W6692 0
  1137. #endif
  1138. #ifdef  CONFIG_HISAX_NETJET_U
  1139. #define CARD_NETJET_U 1
  1140. #ifndef ISDN_CHIP_ICC
  1141. #define ISDN_CHIP_ICC 1
  1142. #endif
  1143. #ifndef HISAX_UINTERFACE
  1144. #define HISAX_UINTERFACE 1
  1145. #endif
  1146. #else
  1147. #define CARD_NETJET_U 0
  1148. #endif
  1149. #ifdef CONFIG_HISAX_ENTERNOW_PCI
  1150. #define CARD_FN_ENTERNOW_PCI 1
  1151. #endif
  1152. #define TEI_PER_CARD 1
  1153. /* L1 Debug */
  1154. #define L1_DEB_WARN 0x01
  1155. #define L1_DEB_INTSTAT 0x02
  1156. #define L1_DEB_ISAC 0x04
  1157. #define L1_DEB_ISAC_FIFO 0x08
  1158. #define L1_DEB_HSCX 0x10
  1159. #define L1_DEB_HSCX_FIFO 0x20
  1160. #define L1_DEB_LAPD         0x40
  1161. #define L1_DEB_IPAC         0x80
  1162. #define L1_DEB_RECEIVE_FRAME    0x100
  1163. #define L1_DEB_MONITOR 0x200
  1164. #define DEB_DLOG_HEX 0x400
  1165. #define DEB_DLOG_VERBOSE 0x800
  1166. #define L2FRAME_DEBUG
  1167. #ifdef L2FRAME_DEBUG
  1168. extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, int dir);
  1169. #endif
  1170. struct IsdnCard {
  1171. int typ;
  1172. int protocol; /* EDSS1, 1TR6 or NI1 */
  1173. unsigned long para[4];
  1174. struct IsdnCardState *cs;
  1175. };
  1176. void init_bcstate(struct IsdnCardState *cs, int bc);
  1177. void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs);
  1178. unsigned int random_ri(void);
  1179. void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st);
  1180. void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st);
  1181. void setstack_l1_B(struct PStack *st);
  1182. void setstack_tei(struct PStack *st);
  1183. void setstack_manager(struct PStack *st);
  1184. void setstack_isdnl2(struct PStack *st, char *debug_id);
  1185. void releasestack_isdnl2(struct PStack *st);
  1186. void setstack_transl2(struct PStack *st);
  1187. void releasestack_transl2(struct PStack *st);
  1188. void setstack_l3dc(struct PStack *st, struct Channel *chanp);
  1189. void setstack_l3bc(struct PStack *st, struct Channel *chanp);
  1190. void releasestack_isdnl3(struct PStack *st);
  1191. u_char *findie(u_char * p, int size, u_char ie, int wanted_set);
  1192. int getcallref(u_char * p);
  1193. int newcallref(void);
  1194. int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
  1195. void FsmFree(struct Fsm *fsm);
  1196. int FsmEvent(struct FsmInst *fi, int event, void *arg);
  1197. void FsmChangeState(struct FsmInst *fi, int newstate);
  1198. void FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft);
  1199. int FsmAddTimer(struct FsmTimer *ft, int millisec, int event,
  1200. void *arg, int where);
  1201. void FsmRestartTimer(struct FsmTimer *ft, int millisec, int event,
  1202. void *arg, int where);
  1203. void FsmDelTimer(struct FsmTimer *ft, int where);
  1204. int jiftime(char *s, long mark);
  1205. int HiSax_command(isdn_ctrl * ic);
  1206. int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
  1207. void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
  1208. void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
  1209. void HiSax_reportcard(int cardnr, int sel);
  1210. int QuickHex(char *txt, u_char * p, int cnt);
  1211. void LogFrame(struct IsdnCardState *cs, u_char * p, int size);
  1212. void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir);
  1213. void iecpy(u_char * dest, u_char * iestart, int ieoffset);
  1214. #ifdef ISDN_CHIP_ISAC
  1215. void setstack_isac(struct PStack *st, struct IsdnCardState *cs);
  1216. #endif /* ISDN_CHIP_ISAC */
  1217. #endif /* __KERNEL__ */
  1218. #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);}
  1219. int ll_run(struct IsdnCardState *cs, int addfeatures);
  1220. void ll_stop(struct IsdnCardState *cs);
  1221. int CallcNew(void);
  1222. void CallcFree(void);
  1223. int CallcNewChan(struct IsdnCardState *cs);
  1224. void CallcFreeChan(struct IsdnCardState *cs);
  1225. int Isdnl1New(void);
  1226. void Isdnl1Free(void);
  1227. int Isdnl2New(void);
  1228. void Isdnl2Free(void);
  1229. int Isdnl3New(void);
  1230. void Isdnl3Free(void);
  1231. void init_tei(struct IsdnCardState *cs, int protocol);
  1232. void release_tei(struct IsdnCardState *cs);
  1233. char *HiSax_getrev(const char *revision);
  1234. int TeiNew(void);
  1235. void TeiFree(void);
  1236. int certification_check(int output);