hisax.h 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337
  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. #else
  1125. #define CARD_FN_ENTERNOW_PCI 0
  1126. #endif
  1127. #define TEI_PER_CARD 1
  1128. /* L1 Debug */
  1129. #define L1_DEB_WARN 0x01
  1130. #define L1_DEB_INTSTAT 0x02
  1131. #define L1_DEB_ISAC 0x04
  1132. #define L1_DEB_ISAC_FIFO 0x08
  1133. #define L1_DEB_HSCX 0x10
  1134. #define L1_DEB_HSCX_FIFO 0x20
  1135. #define L1_DEB_LAPD 0x40
  1136. #define L1_DEB_IPAC 0x80
  1137. #define L1_DEB_RECEIVE_FRAME 0x100
  1138. #define L1_DEB_MONITOR 0x200
  1139. #define DEB_DLOG_HEX 0x400
  1140. #define DEB_DLOG_VERBOSE 0x800
  1141. #define L2FRAME_DEBUG
  1142. #ifdef L2FRAME_DEBUG
  1143. extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, int dir);
  1144. #endif
  1145. #include "hisax_cfg.h"
  1146. void init_bcstate(struct IsdnCardState *cs, int bc);
  1147. void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs);
  1148. void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st);
  1149. void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st);
  1150. void setstack_l1_B(struct PStack *st);
  1151. void setstack_tei(struct PStack *st);
  1152. void setstack_manager(struct PStack *st);
  1153. void setstack_isdnl2(struct PStack *st, char *debug_id);
  1154. void releasestack_isdnl2(struct PStack *st);
  1155. void setstack_transl2(struct PStack *st);
  1156. void releasestack_transl2(struct PStack *st);
  1157. void lli_writewakeup(struct PStack *st, int len);
  1158. void setstack_l3dc(struct PStack *st, struct Channel *chanp);
  1159. void setstack_l3bc(struct PStack *st, struct Channel *chanp);
  1160. void releasestack_isdnl3(struct PStack *st);
  1161. u_char *findie(u_char * p, int size, u_char ie, int wanted_set);
  1162. int getcallref(u_char * p);
  1163. int newcallref(void);
  1164. int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
  1165. void FsmFree(struct Fsm *fsm);
  1166. int FsmEvent(struct FsmInst *fi, int event, void *arg);
  1167. void FsmChangeState(struct FsmInst *fi, int newstate);
  1168. void FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft);
  1169. int FsmAddTimer(struct FsmTimer *ft, int millisec, int event,
  1170. void *arg, int where);
  1171. void FsmRestartTimer(struct FsmTimer *ft, int millisec, int event,
  1172. void *arg, int where);
  1173. void FsmDelTimer(struct FsmTimer *ft, int where);
  1174. int jiftime(char *s, long mark);
  1175. int HiSax_command(isdn_ctrl * ic);
  1176. int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
  1177. void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
  1178. void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
  1179. void HiSax_reportcard(int cardnr, int sel);
  1180. int QuickHex(char *txt, u_char * p, int cnt);
  1181. void LogFrame(struct IsdnCardState *cs, u_char * p, int size);
  1182. void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir);
  1183. void iecpy(u_char * dest, u_char * iestart, int ieoffset);
  1184. #endif /* __KERNEL__ */
  1185. #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);}
  1186. int ll_run(struct IsdnCardState *cs, int addfeatures);
  1187. int CallcNew(void);
  1188. void CallcFree(void);
  1189. int CallcNewChan(struct IsdnCardState *cs);
  1190. void CallcFreeChan(struct IsdnCardState *cs);
  1191. int Isdnl1New(void);
  1192. void Isdnl1Free(void);
  1193. int Isdnl2New(void);
  1194. void Isdnl2Free(void);
  1195. int Isdnl3New(void);
  1196. void Isdnl3Free(void);
  1197. void init_tei(struct IsdnCardState *cs, int protocol);
  1198. void release_tei(struct IsdnCardState *cs);
  1199. char *HiSax_getrev(const char *revision);
  1200. int TeiNew(void);
  1201. void TeiFree(void);