hisax.h 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352
  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, char *fmt, ...);
  1159. __printf(3, 0)
  1160. void VHiSax_putstatus(struct IsdnCardState *cs, char *head, 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