Deleted Added
sdiff udiff text old ( 95350 ) new ( 95536 )
full compact
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2001 Scott Long
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001 Adaptec, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/dev/aac/aac_pci.c 95350 2002-04-24 05:12:50Z scottl $
30 */
31
32/*
33 * PCI bus interface and resource allocation.
34 */
35
36#include "opt_aac.h"
37

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

85
86struct aac_ident
87{
88 u_int16_t vendor;
89 u_int16_t device;
90 u_int16_t subvendor;
91 u_int16_t subdevice;
92 int hwif;
93 char *desc;
94} aac_identifiers[] = {
95 {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, "Dell PERC 2/Si"},
96 {0x1028, 0x0002, 0x1028, 0x0002, AAC_HWIF_I960RX, "Dell PERC 3/Di"},
97 {0x1028, 0x0003, 0x1028, 0x0003, AAC_HWIF_I960RX, "Dell PERC 3/Si"},
98 {0x1028, 0x0004, 0x1028, 0x00d0, AAC_HWIF_I960RX, "Dell PERC 3/Si"},
99 {0x1028, 0x0002, 0x1028, 0x00d1, AAC_HWIF_I960RX, "Dell PERC 3/Di"},
100 {0x1028, 0x0002, 0x1028, 0x00d9, AAC_HWIF_I960RX, "Dell PERC 3/Di"},
101 {0x1028, 0x0008, 0x1028, 0x00cf, AAC_HWIF_I960RX, "Dell PERC 3/Di"},
102 {0x1028, 0x000a, 0x1028, 0x0106, AAC_HWIF_I960RX, "Dell PERC 3/Di"},
103 {0x1028, 0x000a, 0x1028, 0x011b, AAC_HWIF_I960RX, "Dell PERC 3/Di"},
104 {0x1028, 0x000a, 0x1028, 0x0121, AAC_HWIF_I960RX, "Dell PERC 3/Di"},
105 {0x1011, 0x0046, 0x9005, 0x0364, AAC_HWIF_STRONGARM, "Adaptec AAC-364"},
106 {0x1011, 0x0046, 0x9005, 0x0365, AAC_HWIF_STRONGARM,
107 "Adaptec SCSI RAID 5400S"},
108 {0x1011, 0x0046, 0x9005, 0x1364, AAC_HWIF_STRONGARM, "Dell PERC 2/QC"},
109 {0x1011, 0x0046, 0x103c, 0x10c2, AAC_HWIF_STRONGARM, "HP NetRaid-4M"},
110 {0x9005, 0x0285, 0x9005, 0x0285, AAC_HWIF_I960RX,
111 "Adaptec SCSI RAID 2200S"},
112 {0x9005, 0x0285, 0x9005, 0x0287, AAC_HWIF_I960RX,
113 "Adaptec SCSI RAID 2200S"},
114 {0x9005, 0x0285, 0x9005, 0x0286, AAC_HWIF_I960RX,
115 "Adaptec SCSI RAID 2120S"},
116 {0, 0, 0, 0, 0, 0}
117};
118
119/*
120 * Determine whether this is one of our supported adapters.
121 */
122static int
123aac_pci_probe(device_t dev)
124{

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

261 BUS_SPACE_MAXADDR, /* lowaddr */
262 BUS_SPACE_MAXADDR, /* highaddr */
263 NULL, NULL, /* filter, filterarg */
264 AAC_FIB_COUNT *
265 sizeof(struct aac_fib), 1, /* maxsize, nsegments */
266 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
267 0, /* flags */
268 &sc->aac_fib_dmat)) {
269 device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n");
270 goto out;
271 }
272
273 /*
274 * Detect the hardware interface version, set up the bus interface
275 * indirection.
276 */
277 sc->aac_hwif = AAC_HWIF_UNKNOWN;
278 for (i = 0; aac_identifiers[i].vendor != 0; i++) {
279 if ((aac_identifiers[i].vendor == pci_get_vendor(dev)) &&
280 (aac_identifiers[i].device == pci_get_device(dev))) {
281 sc->aac_hwif = aac_identifiers[i].hwif;
282 switch(sc->aac_hwif) {
283 case AAC_HWIF_I960RX:
284 debug(2, "set hardware up for i960Rx");
285 sc->aac_if = aac_rx_interface;
286 break;
287
288 case AAC_HWIF_STRONGARM:
289 debug(2, "set hardware up for StrongARM");
290 sc->aac_if = aac_sa_interface;
291 break;
292 case AAC_HWIF_FALCON:
293 debug(2, "set hardware up for Falcon/PPC");
294 sc->aac_if = aac_fa_interface;
295 break;
296 }
297 break;
298 }
299 }
300 if (sc->aac_hwif == AAC_HWIF_UNKNOWN) {
301 device_printf(sc->aac_dev, "unknown hardware type\n");
302 error = ENXIO;
303 goto out;
304 }
305
306
307 /*
308 * Check for quirky hardware
309 */
310 if (pci_get_subdevice(dev) == 0x1364 &&
311 pci_get_subvendor(dev) == 0x9005)
312 sc->quirks |= AAC_QUIRK_PERC2QC;
313
314 /*
315 * Do bus-independent initialisation.
316 */
317 error = aac_attach(sc);
318
319out:
320 if (error)
321 aac_free(sc);
322 return(error);
323}