hisax.h 28 KB

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