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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [isdn/] [avmb1/] [b1pci.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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