hisax.h 28 KB

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