aac_pci.c (111979) | aac_pci.c (112679) |
---|---|
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 * | 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 111979 2003-03-08 08:01:31Z phk $ | 29 * $FreeBSD: head/sys/dev/aac/aac_pci.c 112679 2003-03-26 17:50:11Z scottl $ |
30 */ 31 32/* 33 * PCI bus interface and resource allocation. 34 */ 35 36#include "opt_aac.h" 37 --- 49 unchanged lines hidden (view full) --- 87 u_int16_t vendor; 88 u_int16_t device; 89 u_int16_t subvendor; 90 u_int16_t subdevice; 91 int hwif; 92 int quirks; 93 char *desc; 94} aac_identifiers[] = { | 30 */ 31 32/* 33 * PCI bus interface and resource allocation. 34 */ 35 36#include "opt_aac.h" 37 --- 49 unchanged lines hidden (view full) --- 87 u_int16_t vendor; 88 u_int16_t device; 89 u_int16_t subvendor; 90 u_int16_t subdevice; 91 int hwif; 92 int quirks; 93 char *desc; 94} aac_identifiers[] = { |
95 {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 95 {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, 0, |
96 "Dell PERC 2/Si"}, | 96 "Dell PERC 2/Si"}, |
97 {0x1028, 0x0002, 0x1028, 0x0002, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 97 {0x1028, 0x0002, 0x1028, 0x0002, AAC_HWIF_I960RX, 0, |
98 "Dell PERC 3/Di"}, | 98 "Dell PERC 3/Di"}, |
99 {0x1028, 0x0003, 0x1028, 0x0003, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 99 {0x1028, 0x0003, 0x1028, 0x0003, AAC_HWIF_I960RX, 0, |
100 "Dell PERC 3/Si"}, | 100 "Dell PERC 3/Si"}, |
101 {0x1028, 0x0004, 0x1028, 0x00d0, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 101 {0x1028, 0x0004, 0x1028, 0x00d0, AAC_HWIF_I960RX, 0, |
102 "Dell PERC 3/Si"}, | 102 "Dell PERC 3/Si"}, |
103 {0x1028, 0x0002, 0x1028, 0x00d1, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 103 {0x1028, 0x0002, 0x1028, 0x00d1, AAC_HWIF_I960RX, 0, |
104 "Dell PERC 3/Di"}, | 104 "Dell PERC 3/Di"}, |
105 {0x1028, 0x0002, 0x1028, 0x00d9, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 105 {0x1028, 0x0002, 0x1028, 0x00d9, AAC_HWIF_I960RX, 0, |
106 "Dell PERC 3/Di"}, | 106 "Dell PERC 3/Di"}, |
107 {0x1028, 0x0008, 0x1028, 0x00cf, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 107 {0x1028, 0x0008, 0x1028, 0x00cf, AAC_HWIF_I960RX, 0, |
108 "Dell PERC 3/Di"}, | 108 "Dell PERC 3/Di"}, |
109 {0x1028, 0x000a, 0x1028, 0x0106, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 109 {0x1028, 0x000a, 0x1028, 0x0106, AAC_HWIF_I960RX, 0, |
110 "Dell PERC 3/Di"}, | 110 "Dell PERC 3/Di"}, |
111 {0x1028, 0x000a, 0x1028, 0x011b, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 111 {0x1028, 0x000a, 0x1028, 0x011b, AAC_HWIF_I960RX, 0, |
112 "Dell PERC 3/Di"}, | 112 "Dell PERC 3/Di"}, |
113 {0x1028, 0x000a, 0x1028, 0x0121, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM, | 113 {0x1028, 0x000a, 0x1028, 0x0121, AAC_HWIF_I960RX, 0, |
114 "Dell PERC 3/Di"}, | 114 "Dell PERC 3/Di"}, |
115 {0x1011, 0x0046, 0x9005, 0x0364, AAC_HWIF_STRONGARM, AAC_QUIRK_NOCAM, | 115 {0x1011, 0x0046, 0x9005, 0x0364, AAC_HWIF_STRONGARM, 0, |
116 "Adaptec AAC-364"}, | 116 "Adaptec AAC-364"}, |
117 {0x1011, 0x0046, 0x9005, 0x0365, AAC_HWIF_STRONGARM, AAC_QUIRK_NOCAM, | 117 {0x1011, 0x0046, 0x9005, 0x0365, AAC_HWIF_STRONGARM, 0, |
118 "Adaptec SCSI RAID 5400S"}, | 118 "Adaptec SCSI RAID 5400S"}, |
119 {0x1011, 0x0046, 0x9005, 0x1364, AAC_HWIF_STRONGARM, AAC_QUIRK_NOCAM | 120 AAC_QUIRK_PERC2QC, "Dell PERC 2/QC"}, 121 {0x1011, 0x0046, 0x103c, 0x10c2, AAC_HWIF_STRONGARM, AAC_QUIRK_NOCAM, | 119 {0x1011, 0x0046, 0x9005, 0x1364, AAC_HWIF_STRONGARM, AAC_FLAGS_PERC2QC, 120 "Dell PERC 2/QC"}, 121 {0x1011, 0x0046, 0x103c, 0x10c2, AAC_HWIF_STRONGARM, 0, |
122 "HP NetRaid-4M"}, | 122 "HP NetRaid-4M"}, |
123 {0x9005, 0x0285, 0x9005, 0x0285, AAC_HWIF_I960RX, 0, 124 "Adaptec SCSI RAID 2200S"}, 125 {0x9005, 0x0285, 0x1028, 0x0287, AAC_HWIF_I960RX, 0, 126 "Dell PERC 320/DC"}, 127 {0x9005, 0x0285, 0x9005, 0x0286, AAC_HWIF_I960RX, 0, 128 "Adaptec SCSI RAID 2120S"}, | 123 {0x9005, 0x0285, 0x9005, 0x0285, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 124 AAC_FLAGS_256FIBS, "Adaptec SCSI RAID 2200S"}, 125 {0x9005, 0x0285, 0x1028, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 126 AAC_FLAGS_256FIBS, "Dell PERC 320/DC"}, 127 {0x9005, 0x0285, 0x9005, 0x0286, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 128 AAC_FLAGS_256FIBS, "Adaptec SCSI RAID 2120S"}, |
129 {0, 0, 0, 0, 0, 0, 0} 130}; 131 132/* 133 * Determine whether this is one of our supported adapters. 134 */ 135static int 136aac_pci_probe(device_t dev) --- 97 unchanged lines hidden (view full) --- 234 235 /* 236 * Allocate the parent bus DMA tag appropriate for our PCI interface. 237 * 238 * Note that some of these controllers are 64-bit capable. 239 */ 240 if (bus_dma_tag_create(NULL, /* parent */ 241 PAGE_SIZE, 0, /* algnmnt, boundary */ | 129 {0, 0, 0, 0, 0, 0, 0} 130}; 131 132/* 133 * Determine whether this is one of our supported adapters. 134 */ 135static int 136aac_pci_probe(device_t dev) --- 97 unchanged lines hidden (view full) --- 234 235 /* 236 * Allocate the parent bus DMA tag appropriate for our PCI interface. 237 * 238 * Note that some of these controllers are 64-bit capable. 239 */ 240 if (bus_dma_tag_create(NULL, /* parent */ 241 PAGE_SIZE, 0, /* algnmnt, boundary */ |
242 BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ | 242 BUS_SPACE_MAXADDR, /* lowaddr */ |
243 BUS_SPACE_MAXADDR, /* highaddr */ 244 NULL, NULL, /* filter, filterarg */ | 243 BUS_SPACE_MAXADDR, /* highaddr */ 244 NULL, NULL, /* filter, filterarg */ |
245 MAXBSIZE, /* maxsize */ | 245 BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ |
246 AAC_MAXSGENTRIES, /* nsegments */ 247 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ | 246 AAC_MAXSGENTRIES, /* nsegments */ 247 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ |
248 BUS_DMA_ALLOCNOW, /* flags */ | 248 0, /* flags */ |
249 &sc->aac_parent_dmat)) { 250 device_printf(sc->aac_dev, "can't allocate parent DMA tag\n"); 251 goto out; 252 } 253 | 249 &sc->aac_parent_dmat)) { 250 device_printf(sc->aac_dev, "can't allocate parent DMA tag\n"); 251 goto out; 252 } 253 |
254 /* 255 * Create DMA tag for mapping buffers into controller-addressable space. 256 */ 257 if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */ 258 1, 0, /* algnmnt, boundary */ 259 BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ 260 BUS_SPACE_MAXADDR, /* highaddr */ 261 NULL, NULL, /* filter, filterarg */ 262 MAXBSIZE, AAC_MAXSGENTRIES, /* maxsize, nsegments */ 263 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 264 0, /* flags */ 265 &sc->aac_buffer_dmat)) { 266 device_printf(sc->aac_dev, "can't allocate buffer DMA tag\n"); 267 goto out; 268 } 269 270 /* 271 * Create DMA tag for mapping FIBs into controller-addressable space.. 272 */ 273 if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */ 274 1, 0, /* algnmnt, boundary */ 275 BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ 276 BUS_SPACE_MAXADDR, /* highaddr */ 277 NULL, NULL, /* filter, filterarg */ 278 AAC_FIB_COUNT * 279 sizeof(struct aac_fib), 1, /* maxsize, nsegments */ 280 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 281 0, /* flags */ 282 &sc->aac_fib_dmat)) { 283 device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n");; 284 goto out; 285 } 286 | |
287 /* 288 * Detect the hardware interface version, set up the bus interface 289 * indirection. 290 */ 291 sc->aac_hwif = AAC_HWIF_UNKNOWN; 292 for (i = 0; aac_identifiers[i].vendor != 0; i++) { 293 if ((aac_identifiers[i].vendor == pci_get_vendor(dev)) && 294 (aac_identifiers[i].device == pci_get_device(dev)) && --- 12 unchanged lines hidden (view full) --- 307 break; 308 case AAC_HWIF_FALCON: 309 debug(2, "set hardware up for Falcon/PPC"); 310 sc->aac_if = aac_fa_interface; 311 break; 312 } 313 314 /* Set up quirks */ | 254 /* 255 * Detect the hardware interface version, set up the bus interface 256 * indirection. 257 */ 258 sc->aac_hwif = AAC_HWIF_UNKNOWN; 259 for (i = 0; aac_identifiers[i].vendor != 0; i++) { 260 if ((aac_identifiers[i].vendor == pci_get_vendor(dev)) && 261 (aac_identifiers[i].device == pci_get_device(dev)) && --- 12 unchanged lines hidden (view full) --- 274 break; 275 case AAC_HWIF_FALCON: 276 debug(2, "set hardware up for Falcon/PPC"); 277 sc->aac_if = aac_fa_interface; 278 break; 279 } 280 281 /* Set up quirks */ |
315 sc->quirks = aac_identifiers[i].quirks; | 282 sc->flags = aac_identifiers[i].quirks; |
316 317 break; 318 } 319 } 320 if (sc->aac_hwif == AAC_HWIF_UNKNOWN) { 321 device_printf(sc->aac_dev, "unknown hardware type\n"); 322 error = ENXIO; 323 goto out; --- 13 unchanged lines hidden --- | 283 284 break; 285 } 286 } 287 if (sc->aac_hwif == AAC_HWIF_UNKNOWN) { 288 device_printf(sc->aac_dev, "unknown hardware type\n"); 289 error = ENXIO; 290 goto out; --- 13 unchanged lines hidden --- |