OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [uClinux-2.0.x/] [drivers/] [isdn/] [avmb1/] [b1pci.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 * $Id: b1pci.c,v 1.1.1.1 2001-09-10 07:44:18 simons Exp $
3
 *
4
 * Module for AVM B1 PCI-card.
5
 *
6
 * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
7
 *
8
 * $Log: not supported by cvs2svn $
9
 * Revision 1.1.1.1  2001/07/02 17:58:32  simons
10
 * Initial revision
11
 *
12
 * Revision 1.2.2.2  1998/01/23 16:49:30  calle
13
 * added functions for pcmcia cards,
14
 * avmb1_addcard returns now the controller number.
15
 *
16
 * Revision 1.2.2.1  1997/11/26 10:46:57  calle
17
 * prepared for M1 (Mobile) and T1 (PMX) cards.
18
 * prepared to set configuration after load to support other D-channel
19
 * protocols, point-to-point and leased lines.
20
 *
21
 * Revision 1.2  1997/05/18 09:24:13  calle
22
 * added verbose disconnect reason reporting to avmb1.
23
 * some fixes in capi20 interface.
24
 * changed info messages for B1-PCI
25
 *
26
 * Revision 1.1  1997/03/30 17:10:42  calle
27
 * added support for AVM-B1-PCI card.
28
 *
29
 */
30
 
31
#include <linux/config.h>
32
#include <linux/module.h>
33
#include <linux/kernel.h>
34
#include <linux/bios32.h>
35
#include <linux/pci.h>
36
#include <linux/skbuff.h>
37
#include "compat.h"
38
#include <linux/capi.h>
39
#include <linux/b1lli.h>
40
 
41
#ifndef PCI_VENDOR_ID_AVM
42
#define PCI_VENDOR_ID_AVM       0x1244
43
#endif
44
 
45
#ifndef PCI_DEVICE_ID_AVM_B1
46
#define PCI_DEVICE_ID_AVM_B1    0x700
47
#endif
48
 
49
static char *revision = "$Revision: 1.1.1.1 $";
50
 
51
/* ------------------------------------------------------------- */
52
 
53
#ifdef HAS_NEW_SYMTAB
54
MODULE_AUTHOR("Carsten Paeth <calle@calle.in-berlin.de>");
55
#endif
56
 
57
/* ------------------------------------------------------------- */
58
 
59
/* ------------------------------------------------------------- */
60
/* -------- Init & Cleanup ------------------------------------- */
61
/* ------------------------------------------------------------- */
62
 
63
/*
64
 * init / exit functions
65
 */
66
 
67
#ifdef MODULE
68
#define b1pci_init init_module
69
#endif
70
 
71
int b1pci_init(void)
72
{
73
        char *p;
74
        char rev[10];
75
        int rc;
76
        int pci_index;
77
 
78
        if ((p = strchr(revision, ':'))) {
79
                strcpy(rev, p + 1);
80
                p = strchr(rev, '$');
81
                *p = 0;
82
        } else
83
                strcpy(rev, " ??? ");
84
 
85
 
86
#ifdef CONFIG_PCI
87
        if (!pcibios_present()) {
88
                printk(KERN_ERR "b1pci: no PCI-BIOS present\n");
89
                return -EIO;
90
        }
91
 
92
        printk(KERN_INFO "b1pci: revision %s\n", rev);
93
 
94
        for (pci_index = 0; pci_index < 8; pci_index++) {
95
                unsigned char pci_bus, pci_device_fn;
96
                unsigned int ioaddr;
97
                unsigned char irq;
98
 
99
                if (pcibios_find_device (PCI_VENDOR_ID_AVM,
100
                                        PCI_DEVICE_ID_AVM_B1, pci_index,
101
                                        &pci_bus, &pci_device_fn) != 0) {
102
                        continue;
103
                }
104
                pcibios_read_config_byte(pci_bus, pci_device_fn,
105
                                PCI_INTERRUPT_LINE, &irq);
106
                pcibios_read_config_dword(pci_bus, pci_device_fn,
107
                                PCI_BASE_ADDRESS_1, &ioaddr);
108
                /* Strip the I/O address out of the returned value */
109
                ioaddr &= PCI_BASE_ADDRESS_IO_MASK;
110
                printk(KERN_INFO
111
                        "b1pci: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n",
112
                        ioaddr, irq);
113
                if ((rc = avmb1_probecard(ioaddr, irq, AVM_CARDTYPE_B1)) != 0) {
114
                        printk(KERN_ERR
115
                        "b1pci: no AVM-B1 at i/o %#x, irq %d detected\n",
116
                        ioaddr, irq);
117
                        return rc;
118
                }
119
                if ((rc = avmb1_addcard(ioaddr, irq, AVM_CARDTYPE_B1)) < 0)
120
                        return rc;
121
        }
122
        return 0;
123
#else
124
        printk(KERN_ERR "b1pci: kernel not compiled with PCI.\n");
125
        return -EIO;
126
#endif
127
}
128
 
129
#ifdef MODULE
130
void cleanup_module(void)
131
{
132
}
133
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.