1 /* $Id: eicon_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3 * ISDN low-level module for Eicon active ISDN-Cards.
4 * Hardware-specific code for PCI cards.
6 * Copyright 1998-2000 by Armin Schindler (mac@melware.de)
7 * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
9 * This software may be used and distributed according to the terms
10 * of the GNU General Public License, incorporated herein by reference.
12 * Thanks to Eicon Networks for
13 * documents, informations and hardware.
17 #include <linux/config.h>
18 #include <linux/pci.h>
21 #include "eicon_pci.h"
27 char *eicon_pci_revision = "$Revision: 1.1.4.1 $";
29 #if CONFIG_PCI /* intire stuff is only for PCI */
30 #ifdef CONFIG_ISDN_DRV_EICON_PCI
32 int eicon_pci_find_card(char *ID)
43 for (wCardIndex = 0; wCardIndex < MAX_CARDS; wCardIndex++)
45 if ((pCard->hw) && (pCard->hw->in_use))
47 switch(pCard->hw->card_type) {
48 case DIA_CARD_TYPE_DIVA_SERVER:
49 ctype = EICON_CTYPE_MAESTRAP;
53 case DIA_CARD_TYPE_DIVA_SERVER_B:
54 ctype = EICON_CTYPE_MAESTRA;
58 case DIA_CARD_TYPE_DIVA_SERVER_Q:
59 ctype = EICON_CTYPE_MAESTRAQ;
66 printk(KERN_ERR "eicon_pci: unknown card type %d !\n",
67 pCard->hw->card_type);
70 sprintf(did, "%s%d", (strlen(ID) < 1) ? "eicon":ID, pci_cards);
71 if ((!ctype) || (!(eicon_addcard(ctype, 0, pCard->hw->irq, did, card_id)))) {
72 printk(KERN_ERR "eicon_pci: Card could not be added !\n");
75 printk(KERN_INFO "%s: DriverID='%s' CardID=%d\n",
76 eicon_ctype_name[ctype], did, card_id);
86 eicon_pci_init_conf(eicon_card *card)
90 /* initializing some variables */
93 for(j = 0; j < 256; j++)
94 card->IdTable[j] = NULL;
96 for(j = 0; j < (card->d->channels + 1); j++) {
97 card->bch[j].e.busy = 0;
98 card->bch[j].e.D3Id = 0;
99 card->bch[j].e.B2Id = 0;
100 card->bch[j].e.ref = 0;
101 card->bch[j].e.Req = 0;
102 card->bch[j].e.complete = 1;
103 card->bch[j].fsm_state = EICON_STATE_NULL;
108 #endif /* CONFIG_PCI */