hisax.h 28 KB

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