Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | /* $Id: eicon_pci.c,v 1.15.6.2 2001/02/16 09:09:50 armin Exp $ * * ISDN low-level module for Eicon active ISDN-Cards. * Hardware-specific code for PCI cards. * * Copyright 1998-2000 by Armin Schindler (mac@melware.de) * Copyright 1999,2000 Cytronics & Melware (info@melware.de) * * Thanks to Eicon Networks for * documents, informations and hardware. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include <linux/config.h> #include <linux/pci.h> #include "eicon.h" #include "eicon_pci.h" #undef N_DATA #include "adapter.h" #include "uxio.h" char *eicon_pci_revision = "$Revision: 1.15.6.2 $"; #if CONFIG_PCI /* intire stuff is only for PCI */ #ifdef CONFIG_ISDN_DRV_EICON_PCI int eicon_pci_find_card(char *ID) { int pci_cards = 0; int card_id = 0; int had_q = 0; int ctype = 0; char did[20]; card_t *pCard; word wCardIndex; pCard = DivasCards; for (wCardIndex = 0; wCardIndex < MAX_CARDS; wCardIndex++) { if ((pCard->hw) && (pCard->hw->in_use)) { switch(pCard->hw->card_type) { case DIA_CARD_TYPE_DIVA_SERVER: ctype = EICON_CTYPE_MAESTRAP; card_id++; had_q = 0; break; case DIA_CARD_TYPE_DIVA_SERVER_B: ctype = EICON_CTYPE_MAESTRA; card_id++; had_q = 0; break; case DIA_CARD_TYPE_DIVA_SERVER_Q: ctype = EICON_CTYPE_MAESTRAQ; if (!had_q) card_id++; if (++had_q >=4) had_q = 0; break; default: printk(KERN_ERR "eicon_pci: unknown card type %d !\n", pCard->hw->card_type); goto err; } sprintf(did, "%s%d", (strlen(ID) < 1) ? "eicon":ID, pci_cards); if ((!ctype) || (!(eicon_addcard(ctype, 0, pCard->hw->irq, did, card_id)))) { printk(KERN_ERR "eicon_pci: Card could not be added !\n"); } else { pci_cards++; printk(KERN_INFO "%s: DriverID='%s' CardID=%d\n", eicon_ctype_name[ctype], did, card_id); } err:; } pCard++; } return pci_cards; } void eicon_pci_init_conf(eicon_card *card) { int j; /* initializing some variables */ card->ReadyInt = 0; for(j = 0; j < 256; j++) card->IdTable[j] = NULL; for(j = 0; j < (card->d->channels + 1); j++) { card->bch[j].e.busy = 0; card->bch[j].e.D3Id = 0; card->bch[j].e.B2Id = 0; card->bch[j].e.ref = 0; card->bch[j].e.Req = 0; card->bch[j].e.complete = 1; card->bch[j].fsm_state = EICON_STATE_NULL; } } #endif #endif /* CONFIG_PCI */ |