Deleted Added
full compact
amr_pci.c (140340) amr_pci.c (140688)
1/*-
2 * Copyright (c) 1999,2000 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27/*-
28 * Copyright (c) 2002 Eric Moore
1/*-
2 * Copyright (c) 1999,2000 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27/*-
28 * Copyright (c) 2002 Eric Moore
29 * Copyright (c) 2002 LSI Logic Corporation
29 * Copyright (c) 2002, 2004 LSI Logic Corporation
30 * All rights reserved.
31 *
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
34 * are met:
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright

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

50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE.
55 */
56
57#include <sys/cdefs.h>
30 * All rights reserved.
31 *
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
34 * are met:
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright

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

50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE.
55 */
56
57#include <sys/cdefs.h>
58__FBSDID("$FreeBSD: head/sys/dev/amr/amr_pci.c 140340 2005-01-16 07:34:26Z scottl $");
58__FBSDID("$FreeBSD: head/sys/dev/amr/amr_pci.c 140688 2005-01-23 23:25:41Z scottl $");
59
60#include <sys/param.h>
61#include <sys/systm.h>
62#include <sys/kernel.h>
63#include <sys/module.h>
64
65#include <dev/amr/amr_compat.h>
66#include <sys/bus.h>

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

123#define PROBE_SIGNATURE (1<<0)
124} amr_device_ids[] = {
125 {0x101e, 0x9010, 0},
126 {0x101e, 0x9060, 0},
127 {0x8086, 0x1960, PROBE_SIGNATURE},/* generic i960RD, check for signature */
128 {0x101e, 0x1960, 0},
129 {0x1000, 0x1960, PROBE_SIGNATURE},
130 {0x1000, 0x0407, 0},
59
60#include <sys/param.h>
61#include <sys/systm.h>
62#include <sys/kernel.h>
63#include <sys/module.h>
64
65#include <dev/amr/amr_compat.h>
66#include <sys/bus.h>

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

123#define PROBE_SIGNATURE (1<<0)
124} amr_device_ids[] = {
125 {0x101e, 0x9010, 0},
126 {0x101e, 0x9060, 0},
127 {0x8086, 0x1960, PROBE_SIGNATURE},/* generic i960RD, check for signature */
128 {0x101e, 0x1960, 0},
129 {0x1000, 0x1960, PROBE_SIGNATURE},
130 {0x1000, 0x0407, 0},
131 {0x1000, 0x0408, 0},
132 {0x1000, 0x0409, 0},
131 {0x1028, 0x000e, PROBE_SIGNATURE}, /* perc4/di i960 */
132 {0x1028, 0x000f, 0}, /* perc4/di Verde*/
133 {0x1028, 0x0013, 0}, /* perc4/di */
134 {0, 0, 0}
135};
136
137static int
138amr_pci_probe(device_t dev)

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

146 (pci_get_device(dev) == amr_device_ids[i].device)) {
147
148 /* do we need to test for a signature? */
149 if (amr_device_ids[i].flag & PROBE_SIGNATURE) {
150 sig = pci_read_config(dev, AMR_CFG_SIG, 2);
151 if ((sig != AMR_SIGNATURE_1) && (sig != AMR_SIGNATURE_2))
152 continue;
153 }
133 {0x1028, 0x000e, PROBE_SIGNATURE}, /* perc4/di i960 */
134 {0x1028, 0x000f, 0}, /* perc4/di Verde*/
135 {0x1028, 0x0013, 0}, /* perc4/di */
136 {0, 0, 0}
137};
138
139static int
140amr_pci_probe(device_t dev)

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

148 (pci_get_device(dev) == amr_device_ids[i].device)) {
149
150 /* do we need to test for a signature? */
151 if (amr_device_ids[i].flag & PROBE_SIGNATURE) {
152 sig = pci_read_config(dev, AMR_CFG_SIG, 2);
153 if ((sig != AMR_SIGNATURE_1) && (sig != AMR_SIGNATURE_2))
154 continue;
155 }
154 device_set_desc(dev, "LSILogic MegaRAID");
156 device_set_desc(dev, LSI_DESC_PCI);
155 return(-10); /* allow room to be overridden */
156 }
157 }
158 return(ENXIO);
159}
160
161static int
162amr_pci_attach(device_t dev)

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

178 /* assume failure is 'not configured' */
179 error = ENXIO;
180
181 /*
182 * Determine board type.
183 */
184 command = pci_read_config(dev, PCIR_COMMAND, 1);
185 if ((pci_get_device(dev) == 0x1960) || (pci_get_device(dev) == 0x0407) ||
157 return(-10); /* allow room to be overridden */
158 }
159 }
160 return(ENXIO);
161}
162
163static int
164amr_pci_attach(device_t dev)

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

180 /* assume failure is 'not configured' */
181 error = ENXIO;
182
183 /*
184 * Determine board type.
185 */
186 command = pci_read_config(dev, PCIR_COMMAND, 1);
187 if ((pci_get_device(dev) == 0x1960) || (pci_get_device(dev) == 0x0407) ||
188 (pci_get_device(dev) == 0x0408) || (pci_get_device(dev) == 0x0409) ||
186 (pci_get_device(dev) == 0x000e) || (pci_get_device(dev) == 0x000f) ||
187 (pci_get_device(dev) == 0x0013)) {
188 /*
189 * Make sure we are going to be able to talk to this board.
190 */
191 if ((command & PCIM_CMD_MEMEN) == 0) {
192 device_printf(dev, "memory window not available\n");
193 goto out;

--- 425 unchanged lines hidden ---
189 (pci_get_device(dev) == 0x000e) || (pci_get_device(dev) == 0x000f) ||
190 (pci_get_device(dev) == 0x0013)) {
191 /*
192 * Make sure we are going to be able to talk to this board.
193 */
194 if ((command & PCIM_CMD_MEMEN) == 0) {
195 device_printf(dev, "memory window not available\n");
196 goto out;

--- 425 unchanged lines hidden ---