t1isa.c 15 KB

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