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