t1isa.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. /* $Id: t1isa.c,v 1.1.2.3 2004/02/10 01:07:12 keil Exp $
  2. *
  3. * Module for AVM T1 HEMA-card.
  4. *
  5. * Copyright 1999 by Carsten Paeth <calle@calle.de>
  6. *
  7. * This software may be used and distributed according to the terms
  8. * of the GNU General Public License, incorporated herein by reference.
  9. *
  10. */
  11. #include <linux/module.h>
  12. #include <linux/kernel.h>
  13. #include <linux/skbuff.h>
  14. #include <linux/delay.h>
  15. #include <linux/mm.h>
  16. #include <linux/interrupt.h>
  17. #include <linux/ioport.h>
  18. #include <linux/capi.h>
  19. #include <linux/netdevice.h>
  20. #include <linux/kernelcapi.h>
  21. #include <linux/init.h>
  22. #include <linux/pci.h>
  23. #include <asm/io.h>
  24. #include <linux/isdn/capicmd.h>
  25. #include <linux/isdn/capiutil.h>
  26. #include <linux/isdn/capilli.h>
  27. #include "avmcard.h"
  28. /* ------------------------------------------------------------- */
  29. static char *revision = "$Revision: 1.1.2.3 $";
  30. /* ------------------------------------------------------------- */
  31. MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM T1 HEMA ISA card");
  32. MODULE_AUTHOR("Carsten Paeth");
  33. MODULE_LICENSE("GPL");
  34. /* ------------------------------------------------------------- */
  35. static int hema_irq_table[16] =
  36. {0,
  37. 0,
  38. 0,
  39. 0x80, /* irq 3 */
  40. 0,
  41. 0x90, /* irq 5 */
  42. 0,
  43. 0xA0, /* irq 7 */
  44. 0,
  45. 0xB0, /* irq 9 */
  46. 0xC0, /* irq 10 */
  47. 0xD0, /* irq 11 */
  48. 0xE0, /* irq 12 */
  49. 0,
  50. 0,
  51. 0xF0, /* irq 15 */
  52. };
  53. static int t1_detectandinit(unsigned int base, unsigned irq, int cardnr)
  54. {
  55. unsigned char cregs[8];
  56. unsigned char reverse_cardnr;
  57. unsigned char dummy;
  58. int i;
  59. reverse_cardnr = ((cardnr & 0x01) << 3) | ((cardnr & 0x02) << 1)
  60. | ((cardnr & 0x04) >> 1) | ((cardnr & 0x08) >> 3);
  61. cregs[0] = (HEMA_VERSION_ID << 4) | (reverse_cardnr & 0xf);
  62. cregs[1] = 0x00; /* fast & slow link connected to CON1 */
  63. cregs[2] = 0x05; /* fast link 20MBit, slow link 20 MBit */
  64. cregs[3] = 0;
  65. cregs[4] = 0x11; /* zero wait state */
  66. cregs[5] = hema_irq_table[irq & 0xf];
  67. cregs[6] = 0;
  68. cregs[7] = 0;
  69. /*
  70. * no one else should use the ISA bus in this moment,
  71. * but no function there to prevent this :-(
  72. * save_flags(flags); cli();
  73. */
  74. /* board reset */
  75. t1outp(base, T1_RESETBOARD, 0xf);
  76. mdelay(100);
  77. dummy = t1inp(base, T1_FASTLINK+T1_OUTSTAT); /* first read */
  78. /* write config */
  79. dummy = (base >> 4) & 0xff;
  80. for (i=1;i<=0xf;i++) t1outp(base, i, dummy);
  81. t1outp(base, HEMA_PAL_ID & 0xf, dummy);
  82. t1outp(base, HEMA_PAL_ID >> 4, cregs[0]);
  83. for(i=1;i<7;i++) t1outp(base, 0, cregs[i]);
  84. t1outp(base, ((base >> 4)) & 0x3, cregs[7]);
  85. /* restore_flags(flags); */
  86. mdelay(100);
  87. t1outp(base, T1_FASTLINK+T1_RESETLINK, 0);
  88. t1outp(base, T1_SLOWLINK+T1_RESETLINK, 0);
  89. mdelay(10);
  90. t1outp(base, T1_FASTLINK+T1_RESETLINK, 1);
  91. t1outp(base, T1_SLOWLINK+T1_RESETLINK, 1);
  92. mdelay(100);
  93. t1outp(base, T1_FASTLINK+T1_RESETLINK, 0);
  94. t1outp(base, T1_SLOWLINK+T1_RESETLINK, 0);
  95. mdelay(10);
  96. t1outp(base, T1_FASTLINK+T1_ANALYSE, 0);
  97. mdelay(5);
  98. t1outp(base, T1_SLOWLINK+T1_ANALYSE, 0);
  99. if (t1inp(base, T1_FASTLINK+T1_OUTSTAT) != 0x1) /* tx empty */
  100. return 1;
  101. if (t1inp(base, T1_FASTLINK+T1_INSTAT) != 0x0) /* rx empty */
  102. return 2;
  103. if (t1inp(base, T1_FASTLINK+T1_IRQENABLE) != 0x0)
  104. return 3;
  105. if ((t1inp(base, T1_FASTLINK+T1_FIFOSTAT) & 0xf0) != 0x70)
  106. return 4;
  107. if ((t1inp(base, T1_FASTLINK+T1_IRQMASTER) & 0x0e) != 0)
  108. return 5;
  109. if ((t1inp(base, T1_FASTLINK+T1_IDENT) & 0x7d) != 1)
  110. return 6;
  111. if (t1inp(base, T1_SLOWLINK+T1_OUTSTAT) != 0x1) /* tx empty */
  112. return 7;
  113. if ((t1inp(base, T1_SLOWLINK+T1_IRQMASTER) & 0x0e) != 0)
  114. return 8;
  115. if ((t1inp(base, T1_SLOWLINK+T1_IDENT) & 0x7d) != 0)
  116. return 9;
  117. return 0;
  118. }
  119. static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
  120. {
  121. avmcard *card = devptr;
  122. avmctrl_info *cinfo = &card->ctrlinfo[0];
  123. struct capi_ctr *ctrl = &cinfo->capi_ctrl;
  124. unsigned char b1cmd;
  125. struct sk_buff *skb;
  126. unsigned ApplId;
  127. unsigned MsgLen;
  128. unsigned DataB3Len;
  129. unsigned NCCI;
  130. unsigned WindowSize;
  131. unsigned long flags;
  132. spin_lock_irqsave(&card->lock, flags);
  133. while (b1_rx_full(card->port)) {
  134. b1cmd = b1_get_byte(card->port);
  135. switch (b1cmd) {
  136. case RECEIVE_DATA_B3_IND:
  137. ApplId = (unsigned) b1_get_word(card->port);
  138. MsgLen = t1_get_slice(card->port, card->msgbuf);
  139. DataB3Len = t1_get_slice(card->port, card->databuf);
  140. spin_unlock_irqrestore(&card->lock, flags);
  141. if (MsgLen < 30) { /* not CAPI 64Bit */
  142. memset(card->msgbuf+MsgLen, 0, 30-MsgLen);
  143. MsgLen = 30;
  144. CAPIMSG_SETLEN(card->msgbuf, 30);
  145. }
  146. if (!(skb = alloc_skb(DataB3Len+MsgLen, GFP_ATOMIC))) {
  147. printk(KERN_ERR "%s: incoming packet dropped\n",
  148. card->name);
  149. } else {
  150. memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
  151. memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
  152. capi_ctr_handle_message(ctrl, ApplId, skb);
  153. }
  154. break;
  155. case RECEIVE_MESSAGE:
  156. ApplId = (unsigned) b1_get_word(card->port);
  157. MsgLen = t1_get_slice(card->port, card->msgbuf);
  158. if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
  159. spin_unlock_irqrestore(&card->lock, flags);
  160. printk(KERN_ERR "%s: incoming packet dropped\n",
  161. card->name);
  162. } else {
  163. memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
  164. if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3)
  165. capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
  166. CAPIMSG_NCCI(skb->data),
  167. CAPIMSG_MSGID(skb->data));
  168. spin_unlock_irqrestore(&card->lock, flags);
  169. capi_ctr_handle_message(ctrl, ApplId, skb);
  170. }
  171. break;
  172. case RECEIVE_NEW_NCCI:
  173. ApplId = b1_get_word(card->port);
  174. NCCI = b1_get_word(card->port);
  175. WindowSize = b1_get_word(card->port);
  176. capilib_new_ncci(&cinfo->ncci_head, ApplId, NCCI, WindowSize);
  177. spin_unlock_irqrestore(&card->lock, flags);
  178. break;
  179. case RECEIVE_FREE_NCCI:
  180. ApplId = b1_get_word(card->port);
  181. NCCI = b1_get_word(card->port);
  182. if (NCCI != 0xffffffff)
  183. capilib_free_ncci(&cinfo->ncci_head, ApplId, NCCI);
  184. spin_unlock_irqrestore(&card->lock, flags);
  185. break;
  186. case RECEIVE_START:
  187. b1_put_byte(card->port, SEND_POLLACK);
  188. spin_unlock_irqrestore(&card->lock, flags);
  189. capi_ctr_resume_output(ctrl);
  190. break;
  191. case RECEIVE_STOP:
  192. spin_unlock_irqrestore(&card->lock, flags);
  193. capi_ctr_suspend_output(ctrl);
  194. break;
  195. case RECEIVE_INIT:
  196. cinfo->versionlen = t1_get_slice(card->port, cinfo->versionbuf);
  197. spin_unlock_irqrestore(&card->lock, flags);
  198. b1_parse_version(cinfo);
  199. printk(KERN_INFO "%s: %s-card (%s) now active\n",
  200. card->name,
  201. cinfo->version[VER_CARDTYPE],
  202. cinfo->version[VER_DRIVER]);
  203. capi_ctr_ready(ctrl);
  204. break;
  205. case RECEIVE_TASK_READY:
  206. ApplId = (unsigned) b1_get_word(card->port);
  207. MsgLen = t1_get_slice(card->port, card->msgbuf);
  208. spin_unlock_irqrestore(&card->lock, flags);
  209. card->msgbuf[MsgLen] = 0;
  210. while ( MsgLen > 0
  211. && ( card->msgbuf[MsgLen-1] == '\n'
  212. || card->msgbuf[MsgLen-1] == '\r')) {
  213. card->msgbuf[MsgLen-1] = 0;
  214. MsgLen--;
  215. }
  216. printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
  217. card->name, ApplId, card->msgbuf);
  218. break;
  219. case RECEIVE_DEBUGMSG:
  220. MsgLen = t1_get_slice(card->port, card->msgbuf);
  221. spin_unlock_irqrestore(&card->lock, flags);
  222. card->msgbuf[MsgLen] = 0;
  223. while ( MsgLen > 0
  224. && ( card->msgbuf[MsgLen-1] == '\n'
  225. || card->msgbuf[MsgLen-1] == '\r')) {
  226. card->msgbuf[MsgLen-1] = 0;
  227. MsgLen--;
  228. }
  229. printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
  230. break;
  231. case 0xff:
  232. spin_unlock_irqrestore(&card->lock, flags);
  233. printk(KERN_ERR "%s: card reseted ?\n", card->name);
  234. return IRQ_HANDLED;
  235. default:
  236. spin_unlock_irqrestore(&card->lock, flags);
  237. printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n",
  238. card->name, b1cmd);
  239. return IRQ_NONE;
  240. }
  241. }
  242. return IRQ_HANDLED;
  243. }
  244. /* ------------------------------------------------------------- */
  245. static int t1isa_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
  246. {
  247. avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
  248. avmcard *card = cinfo->card;
  249. unsigned int port = card->port;
  250. unsigned long flags;
  251. int retval;
  252. t1_disable_irq(port);
  253. b1_reset(port);
  254. if ((retval = b1_load_t4file(card, &data->firmware))) {
  255. b1_reset(port);
  256. printk(KERN_ERR "%s: failed to load t4file!!\n",
  257. card->name);
  258. return retval;
  259. }
  260. if (data->configuration.len > 0 && data->configuration.data) {
  261. if ((retval = b1_load_config(card, &data->configuration))) {
  262. b1_reset(port);
  263. printk(KERN_ERR "%s: failed to load config!!\n",
  264. card->name);
  265. return retval;
  266. }
  267. }
  268. if (!b1_loaded(card)) {
  269. printk(KERN_ERR "%s: failed to load t4file.\n", card->name);
  270. return -EIO;
  271. }
  272. spin_lock_irqsave(&card->lock, flags);
  273. b1_setinterrupt(port, card->irq, card->cardtype);
  274. b1_put_byte(port, SEND_INIT);
  275. b1_put_word(port, CAPI_MAXAPPL);
  276. b1_put_word(port, AVM_NCCI_PER_CHANNEL*30);
  277. b1_put_word(port, ctrl->cnr - 1);
  278. spin_unlock_irqrestore(&card->lock, flags);
  279. return 0;
  280. }
  281. static void t1isa_reset_ctr(struct capi_ctr *ctrl)
  282. {
  283. avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
  284. avmcard *card = cinfo->card;
  285. unsigned int port = card->port;
  286. unsigned long flags;
  287. t1_disable_irq(port);
  288. b1_reset(port);
  289. b1_reset(port);
  290. memset(cinfo->version, 0, sizeof(cinfo->version));
  291. spin_lock_irqsave(&card->lock, flags);
  292. capilib_release(&cinfo->ncci_head);
  293. spin_unlock_irqrestore(&card->lock, flags);
  294. capi_ctr_down(ctrl);
  295. }
  296. static void t1isa_remove(struct pci_dev *pdev)
  297. {
  298. avmctrl_info *cinfo = pci_get_drvdata(pdev);
  299. avmcard *card;
  300. if (!cinfo)
  301. return;
  302. card = cinfo->card;
  303. t1_disable_irq(card->port);
  304. b1_reset(card->port);
  305. b1_reset(card->port);
  306. t1_reset(card->port);
  307. detach_capi_ctr(&cinfo->capi_ctrl);
  308. free_irq(card->irq, card);
  309. release_region(card->port, AVMB1_PORTLEN);
  310. b1_free_card(card);
  311. }
  312. /* ------------------------------------------------------------- */
  313. static u16 t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
  314. static char *t1isa_procinfo(struct capi_ctr *ctrl);
  315. static int t1isa_probe(struct pci_dev *pdev, int cardnr)
  316. {
  317. avmctrl_info *cinfo;
  318. avmcard *card;
  319. int retval;
  320. card = b1_alloc_card(1);
  321. if (!card) {
  322. printk(KERN_WARNING "t1isa: no memory.\n");
  323. retval = -ENOMEM;
  324. goto err;
  325. }
  326. cinfo = card->ctrlinfo;
  327. card->port = pci_resource_start(pdev, 0);
  328. card->irq = pdev->irq;
  329. card->cardtype = avm_t1isa;
  330. card->cardnr = cardnr;
  331. sprintf(card->name, "t1isa-%x", card->port);
  332. if (!(((card->port & 0x7) == 0) && ((card->port & 0x30) != 0x30))) {
  333. printk(KERN_WARNING "t1isa: invalid port 0x%x.\n", card->port);
  334. retval = -EINVAL;
  335. goto err_free;
  336. }
  337. if (hema_irq_table[card->irq & 0xf] == 0) {
  338. printk(KERN_WARNING "t1isa: irq %d not valid.\n", card->irq);
  339. retval = -EINVAL;
  340. goto err_free;
  341. }
  342. if (!request_region(card->port, AVMB1_PORTLEN, card->name)) {
  343. printk(KERN_INFO "t1isa: ports 0x%03x-0x%03x in use.\n",
  344. card->port, card->port + AVMB1_PORTLEN);
  345. retval = -EBUSY;
  346. goto err_free;
  347. }
  348. retval = request_irq(card->irq, t1isa_interrupt, 0, card->name, card);
  349. if (retval) {
  350. printk(KERN_INFO "t1isa: unable to get IRQ %d.\n", card->irq);
  351. retval = -EBUSY;
  352. goto err_release_region;
  353. }
  354. if ((retval = t1_detectandinit(card->port, card->irq, card->cardnr)) != 0) {
  355. printk(KERN_INFO "t1isa: NO card at 0x%x (%d)\n",
  356. card->port, retval);
  357. retval = -ENODEV;
  358. goto err_free_irq;
  359. }
  360. t1_disable_irq(card->port);
  361. b1_reset(card->port);
  362. cinfo->capi_ctrl.owner = THIS_MODULE;
  363. cinfo->capi_ctrl.driver_name = "t1isa";
  364. cinfo->capi_ctrl.driverdata = cinfo;
  365. cinfo->capi_ctrl.register_appl = b1_register_appl;
  366. cinfo->capi_ctrl.release_appl = b1_release_appl;
  367. cinfo->capi_ctrl.send_message = t1isa_send_message;
  368. cinfo->capi_ctrl.load_firmware = t1isa_load_firmware;
  369. cinfo->capi_ctrl.reset_ctr = t1isa_reset_ctr;
  370. cinfo->capi_ctrl.procinfo = t1isa_procinfo;
  371. cinfo->capi_ctrl.ctr_read_proc = b1ctl_read_proc;
  372. strcpy(cinfo->capi_ctrl.name, card->name);
  373. retval = attach_capi_ctr(&cinfo->capi_ctrl);
  374. if (retval) {
  375. printk(KERN_INFO "t1isa: attach controller failed.\n");
  376. goto err_free_irq;
  377. }
  378. printk(KERN_INFO "t1isa: AVM T1 ISA at i/o %#x, irq %d, card %d\n",
  379. card->port, card->irq, card->cardnr);
  380. pci_set_drvdata(pdev, cinfo);
  381. return 0;
  382. err_free_irq:
  383. free_irq(card->irq, card);
  384. err_release_region:
  385. release_region(card->port, AVMB1_PORTLEN);
  386. err_free:
  387. b1_free_card(card);
  388. err:
  389. return retval;
  390. }
  391. static u16 t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
  392. {
  393. avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
  394. avmcard *card = cinfo->card;
  395. unsigned int port = card->port;
  396. unsigned long flags;
  397. u16 len = CAPIMSG_LEN(skb->data);
  398. u8 cmd = CAPIMSG_COMMAND(skb->data);
  399. u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
  400. u16 dlen, retval;
  401. spin_lock_irqsave(&card->lock, flags);
  402. if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) {
  403. retval = capilib_data_b3_req(&cinfo->ncci_head,
  404. CAPIMSG_APPID(skb->data),
  405. CAPIMSG_NCCI(skb->data),
  406. CAPIMSG_MSGID(skb->data));
  407. if (retval != CAPI_NOERROR) {
  408. spin_unlock_irqrestore(&card->lock, flags);
  409. return retval;
  410. }
  411. dlen = CAPIMSG_DATALEN(skb->data);
  412. b1_put_byte(port, SEND_DATA_B3_REQ);
  413. t1_put_slice(port, skb->data, len);
  414. t1_put_slice(port, skb->data + len, dlen);
  415. } else {
  416. b1_put_byte(port, SEND_MESSAGE);
  417. t1_put_slice(port, skb->data, len);
  418. }
  419. spin_unlock_irqrestore(&card->lock, flags);
  420. dev_kfree_skb_any(skb);
  421. return CAPI_NOERROR;
  422. }
  423. /* ------------------------------------------------------------- */
  424. static char *t1isa_procinfo(struct capi_ctr *ctrl)
  425. {
  426. avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
  427. if (!cinfo)
  428. return "";
  429. sprintf(cinfo->infobuf, "%s %s 0x%x %d %d",
  430. cinfo->cardname[0] ? cinfo->cardname : "-",
  431. cinfo->version[VER_DRIVER] ? cinfo->version[VER_DRIVER] : "-",
  432. cinfo->card ? cinfo->card->port : 0x0,
  433. cinfo->card ? cinfo->card->irq : 0,
  434. cinfo->card ? cinfo->card->cardnr : 0
  435. );
  436. return cinfo->infobuf;
  437. }
  438. /* ------------------------------------------------------------- */
  439. #define MAX_CARDS 4
  440. static struct pci_dev isa_dev[MAX_CARDS];
  441. static int io[MAX_CARDS];
  442. static int irq[MAX_CARDS];
  443. static int cardnr[MAX_CARDS];
  444. module_param_array(io, int, NULL, 0);
  445. module_param_array(irq, int, NULL, 0);
  446. module_param_array(cardnr, int, NULL, 0);
  447. MODULE_PARM_DESC(io, "I/O base address(es)");
  448. MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)");
  449. MODULE_PARM_DESC(cardnr, "Card number(s) (as jumpered)");
  450. static int t1isa_add_card(struct capi_driver *driver, capicardparams *data)
  451. {
  452. int i;
  453. for (i = 0; i < MAX_CARDS; i++) {
  454. if (isa_dev[i].resource[0].start)
  455. continue;
  456. isa_dev[i].resource[0].start = data->port;
  457. isa_dev[i].irq = data->irq;
  458. if (t1isa_probe(&isa_dev[i], data->cardnr) == 0)
  459. return 0;
  460. }
  461. return -ENODEV;
  462. }
  463. static struct capi_driver capi_driver_t1isa = {
  464. .name = "t1isa",
  465. .revision = "1.0",
  466. .add_card = t1isa_add_card,
  467. };
  468. static int __init t1isa_init(void)
  469. {
  470. char rev[32];
  471. char *p;
  472. int i;
  473. if ((p = strchr(revision, ':')) != NULL && p[1]) {
  474. strlcpy(rev, p + 2, 32);
  475. if ((p = strchr(rev, '$')) != NULL && p > rev)
  476. *(p-1) = 0;
  477. } else
  478. strcpy(rev, "1.0");
  479. for (i = 0; i < MAX_CARDS; i++) {
  480. if (!io[i])
  481. break;
  482. isa_dev[i].resource[0].start = io[i];
  483. isa_dev[i].irq = irq[i];
  484. if (t1isa_probe(&isa_dev[i], cardnr[i]) != 0)
  485. return -ENODEV;
  486. }
  487. strlcpy(capi_driver_t1isa.revision, rev, 32);
  488. register_capi_driver(&capi_driver_t1isa);
  489. printk(KERN_INFO "t1isa: revision %s\n", rev);
  490. return 0;
  491. }
  492. static void __exit t1isa_exit(void)
  493. {
  494. int i;
  495. unregister_capi_driver(&capi_driver_t1isa);
  496. for (i = 0; i < MAX_CARDS; i++) {
  497. if (!io[i])
  498. break;
  499. t1isa_remove(&isa_dev[i]);
  500. }
  501. }
  502. module_init(t1isa_init);
  503. module_exit(t1isa_exit);