Deleted Added
full compact
bt_pci.c (119690) bt_pci.c (127135)
1/*-
2 * Product specific probe and attach routines for:
3 * Buslogic BT946, BT948, BT956, BT958 SCSI controllers
4 *
5 * Copyright (c) 1995, 1997, 1998 Justin T. Gibbs
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Product specific probe and attach routines for:
3 * Buslogic BT946, BT948, BT956, BT958 SCSI controllers
4 *
5 * Copyright (c) 1995, 1997, 1998 Justin T. Gibbs
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/buslogic/bt_pci.c 119690 2003-09-02 17:30:40Z jhb $");
31__FBSDID("$FreeBSD: head/sys/dev/buslogic/bt_pci.c 127135 2004-03-17 17:50:55Z njl $");
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/kernel.h>
36#include <sys/lock.h>
37#include <sys/mutex.h>
38#include <sys/bus.h>
39

--- 23 unchanged lines hidden (view full) ---

63 struct resource *irq = 0;
64
65 command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1);
66#if 0
67 /* XXX Memory Mapped I/O seems to cause problems */
68 if (command & PCIM_CMD_MEMEN) {
69 type = SYS_RES_MEMORY;
70 rid = BT_PCI_MEMADDR;
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/kernel.h>
36#include <sys/lock.h>
37#include <sys/mutex.h>
38#include <sys/bus.h>
39

--- 23 unchanged lines hidden (view full) ---

63 struct resource *irq = 0;
64
65 command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1);
66#if 0
67 /* XXX Memory Mapped I/O seems to cause problems */
68 if (command & PCIM_CMD_MEMEN) {
69 type = SYS_RES_MEMORY;
70 rid = BT_PCI_MEMADDR;
71 regs = bus_alloc_resource(dev, type, &rid,
72 0, ~0, 1, RF_ACTIVE);
71 regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
73 }
74#else
75 if (!regs && (command & PCIM_CMD_PORTEN)) {
76 type = SYS_RES_IOPORT;
77 rid = BT_PCI_IOADDR;
72 }
73#else
74 if (!regs && (command & PCIM_CMD_PORTEN)) {
75 type = SYS_RES_IOPORT;
76 rid = BT_PCI_IOADDR;
78 regs = bus_alloc_resource(dev, type, &rid,
79 0, ~0, 1, RF_ACTIVE);
77 regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
80 }
81#endif
82 if (!regs)
83 return (ENOMEM);
84
85 zero = 0;
78 }
79#endif
80 if (!regs)
81 return (ENOMEM);
82
83 zero = 0;
86 irq = bus_alloc_resource(dev, SYS_RES_IRQ, &zero,
87 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
84 irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &zero,
85 RF_ACTIVE | RF_SHAREABLE);
88 if (!irq) {
89 bus_release_resource(dev, type, rid, regs);
90 return (ENOMEM);
91 }
92
93 bt_init_softc(dev, regs, irq, 0);
94
95 return (0);

--- 145 unchanged lines hidden ---
86 if (!irq) {
87 bus_release_resource(dev, type, rid, regs);
88 return (ENOMEM);
89 }
90
91 bt_init_softc(dev, regs, irq, 0);
92
93 return (0);

--- 145 unchanged lines hidden ---