aac_pci.c (148866) | aac_pci.c (151086) |
---|---|
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 --- 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 * 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 --- 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/aac/aac_pci.c 148866 2005-08-08 19:39:58Z ps $"); | 31__FBSDID("$FreeBSD: head/sys/dev/aac/aac_pci.c 151086 2005-10-08 15:55:09Z scottl $"); |
32 33/* 34 * PCI bus interface and resource allocation. 35 */ 36 37#include "opt_aac.h" 38 39#include <sys/param.h> --- 94 unchanged lines hidden (view full) --- 134 {0x9005, 0x0285, 0x9005, 0x0293, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, 135 "Adaptec SCSI RAID 21610SA"}, 136 {0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, 137 "HP ML110 G2 (Adaptec 2610SA)"}, 138 {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, 0, 139 "Adaptec SCSI RAID 2230S"}, 140 {0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0, 141 "Adaptec SCSI RAID 2130S"}, | 32 33/* 34 * PCI bus interface and resource allocation. 35 */ 36 37#include "opt_aac.h" 38 39#include <sys/param.h> --- 94 unchanged lines hidden (view full) --- 134 {0x9005, 0x0285, 0x9005, 0x0293, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, 135 "Adaptec SCSI RAID 21610SA"}, 136 {0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, 137 "HP ML110 G2 (Adaptec 2610SA)"}, 138 {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, 0, 139 "Adaptec SCSI RAID 2230S"}, 140 {0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0, 141 "Adaptec SCSI RAID 2130S"}, |
142 143 {0x9005, 0x0285, 0x9005, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 144 AAC_FLAGS_256FIBS, "Adaptec SCSI RAID 2200S"}, 145 {0x9005, 0x0285, 0x17aa, 0x0286, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 146 AAC_FLAGS_256FIBS, "Legend S220"}, 147 {0x9005, 0x0285, 0x17aa, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 148 AAC_FLAGS_256FIBS, "Legend S230"}, 149 {0x9005, 0x0285, 0x9005, 0x0288, AAC_HWIF_I960RX, 0, 150 "Adaptec SCSI RAID 3230S"}, 151 {0x9005, 0x0285, 0x9005, 0x0289, AAC_HWIF_I960RX, 0, 152 "Adaptec SCSI RAID 3240S"}, 153 {0x9005, 0x0285, 0x9005, 0x028a, AAC_HWIF_I960RX, 0, 154 "Adaptec SCSI RAID 2020ZCR"}, 155 {0x9005, 0x0285, 0x9005, 0x028b, AAC_HWIF_I960RX, 0, 156 "Adaptec SCSI RAID 2025ZCR"}, 157 {0x9005, 0x0286, 0x9005, 0x029b, AAC_HWIF_RKT, 0, 158 "Adaptec SATA RAID 2820SA"}, 159 {0x9005, 0x0286, 0x9005, 0x029c, AAC_HWIF_RKT, 0, 160 "Adaptec SATA RAID 2620SA"}, 161 {0x9005, 0x0286, 0x9005, 0x029d, AAC_HWIF_RKT, 0, 162 "Adaptec SATA RAID 2420SA"}, 163 {0x9005, 0x0286, 0x9005, 0x029e, AAC_HWIF_RKT, 0, 164 "ICP9024RO SATA RAID"}, 165 {0x9005, 0x0286, 0x9005, 0x029f, AAC_HWIF_RKT, 0, 166 "ICP9014RO SATA RAID"}, 167 {0x9005, 0x0285, 0x9005, 0x0294, AAC_HWIF_I960RX, 0, 168 "Adaptec SATA RAID 2026ZCR"}, 169 {0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, 0, 170 "Adaptec SATA RAID 2610SA"}, 171 {0x9005, 0x0285, 0x9005, 0x0296, AAC_HWIF_I960RX, 0, 172 "Adaptec SCSI RAID 2240S"}, 173 {0x9005, 0x0285, 0x9005, 0x0297, AAC_HWIF_I960RX, 0, 174 "Adaptec SAS RAID 4005SAS"}, 175 {0x9005, 0x0285, 0x1014, 0x02f2, AAC_HWIF_I960RX, 0, 176 "IBM ServeRAID 8i"}, 177 {0x9005, 0x0285, 0x9005, 0x0298, AAC_HWIF_I960RX, 0, 178 "Adaptec SAS RAID 4000SAS"}, 179 {0x9005, 0x0285, 0x9005, 0x0299, AAC_HWIF_I960RX, 0, 180 "Adaptec SAS RAID 4800SAS"}, 181 {0x9005, 0x0285, 0x9005, 0x029a, AAC_HWIF_I960RX, 0, 182 "Adaptec SAS RAID 4805SAS"}, 183 {0x9005, 0x0285, 0x9005, 0x028e, AAC_HWIF_I960RX, 0, 184 "Adaptec SATA RAID 2020SA ZCR"}, 185 {0x9005, 0x0285, 0x9005, 0x028f, AAC_HWIF_I960RX, 0, 186 "Adaptec SATA RAID 2025SA ZCR"}, 187 {0x9005, 0x0285, 0x9005, 0x02a4, AAC_HWIF_I960RX, 0, 188 "ICP 9085LI SAS RAID"}, 189 {0x9005, 0x0285, 0x9005, 0x02a5, AAC_HWIF_I960RX, 0, 190 "ICP 5085BR SAS RAID"}, 191 {0x9005, 0x0286, 0x9005, 0x02a0, AAC_HWIF_RKT, 0, 192 "ICP9047MA SATA RAID"}, 193 {0x9005, 0x0286, 0x9005, 0x02a1, AAC_HWIF_RKT, 0, 194 "ICP9087MA SATA RAID"}, |
|
142 {0, 0, 0, 0, 0, 0, 0} 143}; 144 145/* 146 * Determine whether this is one of our supported adapters. 147 */ 148static int 149aac_pci_probe(device_t dev) --- 66 unchanged lines hidden (view full) --- 216 NULL) { 217 device_printf(sc->aac_dev, 218 "couldn't allocate register window\n"); 219 goto out; 220 } 221 sc->aac_btag = rman_get_bustag(sc->aac_regs_resource); 222 sc->aac_bhandle = rman_get_bushandle(sc->aac_regs_resource); 223 | 195 {0, 0, 0, 0, 0, 0, 0} 196}; 197 198/* 199 * Determine whether this is one of our supported adapters. 200 */ 201static int 202aac_pci_probe(device_t dev) --- 66 unchanged lines hidden (view full) --- 269 NULL) { 270 device_printf(sc->aac_dev, 271 "couldn't allocate register window\n"); 272 goto out; 273 } 274 sc->aac_btag = rman_get_bustag(sc->aac_regs_resource); 275 sc->aac_bhandle = rman_get_bushandle(sc->aac_regs_resource); 276 |
224 /* 225 * Allocate and connect our interrupt. 226 */ 227 sc->aac_irq_rid = 0; 228 if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ, 229 &sc->aac_irq_rid, 230 RF_SHAREABLE | 231 RF_ACTIVE)) == NULL) { 232 device_printf(sc->aac_dev, "can't allocate interrupt\n"); 233 goto out; 234 } 235 if (bus_setup_intr(sc->aac_dev, sc->aac_irq, 236 INTR_FAST|INTR_TYPE_BIO, aac_intr, 237 sc, &sc->aac_intr)) { 238 device_printf(sc->aac_dev, "can't set up FAST interrupt\n"); 239 if (bus_setup_intr(sc->aac_dev, sc->aac_irq, 240 INTR_MPSAFE|INTR_ENTROPY|INTR_TYPE_BIO, 241 aac_intr, sc, &sc->aac_intr)) { 242 device_printf(sc->aac_dev, 243 "can't set up MPSAFE interrupt\n"); 244 goto out; 245 } 246 } 247 | |
248 /* assume failure is 'out of memory' */ 249 error = ENOMEM; 250 251 /* 252 * Allocate the parent bus DMA tag appropriate for our PCI interface. 253 * 254 * Note that some of these controllers are 64-bit capable. 255 */ 256 if (bus_dma_tag_create(NULL, /* parent */ 257 PAGE_SIZE, 0, /* algnmnt, boundary */ 258 BUS_SPACE_MAXADDR, /* lowaddr */ 259 BUS_SPACE_MAXADDR, /* highaddr */ 260 NULL, NULL, /* filter, filterarg */ 261 BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ | 277 /* assume failure is 'out of memory' */ 278 error = ENOMEM; 279 280 /* 281 * Allocate the parent bus DMA tag appropriate for our PCI interface. 282 * 283 * Note that some of these controllers are 64-bit capable. 284 */ 285 if (bus_dma_tag_create(NULL, /* parent */ 286 PAGE_SIZE, 0, /* algnmnt, boundary */ 287 BUS_SPACE_MAXADDR, /* lowaddr */ 288 BUS_SPACE_MAXADDR, /* highaddr */ 289 NULL, NULL, /* filter, filterarg */ 290 BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ |
262 AAC_MAXSGENTRIES, /* nsegments */ | 291 BUS_SPACE_UNRESTRICTED, /* nsegments */ |
263 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 264 0, /* flags */ 265 NULL, NULL, /* No locking needed */ 266 &sc->aac_parent_dmat)) { 267 device_printf(sc->aac_dev, "can't allocate parent DMA tag\n"); 268 goto out; 269 } 270 --- 16 unchanged lines hidden (view full) --- 287 debug(2, "set hardware up for StrongARM"); 288 sc->aac_if = aac_sa_interface; 289 break; 290 case AAC_HWIF_FALCON: 291 debug(2, "set hardware up for Falcon/PPC"); 292 sc->aac_if = aac_fa_interface; 293 break; 294 case AAC_HWIF_RKT: | 292 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 293 0, /* flags */ 294 NULL, NULL, /* No locking needed */ 295 &sc->aac_parent_dmat)) { 296 device_printf(sc->aac_dev, "can't allocate parent DMA tag\n"); 297 goto out; 298 } 299 --- 16 unchanged lines hidden (view full) --- 316 debug(2, "set hardware up for StrongARM"); 317 sc->aac_if = aac_sa_interface; 318 break; 319 case AAC_HWIF_FALCON: 320 debug(2, "set hardware up for Falcon/PPC"); 321 sc->aac_if = aac_fa_interface; 322 break; 323 case AAC_HWIF_RKT: |
295 debug(2, "setu hardware up for Rocket/MIPS"); | 324 debug(2, "set hardware up for Rocket/MIPS"); |
296 sc->aac_if = aac_rkt_interface; 297 break; 298 default: 299 sc->aac_hwif = AAC_HWIF_UNKNOWN; 300 break; 301 } 302 303 /* Set up quirks */ --- 8 unchanged lines hidden (view full) --- 312 goto out; 313 } 314 315 316 /* 317 * Do bus-independent initialisation. 318 */ 319 error = aac_attach(sc); | 325 sc->aac_if = aac_rkt_interface; 326 break; 327 default: 328 sc->aac_hwif = AAC_HWIF_UNKNOWN; 329 break; 330 } 331 332 /* Set up quirks */ --- 8 unchanged lines hidden (view full) --- 341 goto out; 342 } 343 344 345 /* 346 * Do bus-independent initialisation. 347 */ 348 error = aac_attach(sc); |
320 | 349 |
321out: 322 if (error) 323 aac_free(sc); 324 return(error); 325} 326 327/* 328 * Do nothing driver that will attach to the SCSI channels of a Dell PERC --- 59 unchanged lines hidden --- | 350out: 351 if (error) 352 aac_free(sc); 353 return(error); 354} 355 356/* 357 * Do nothing driver that will attach to the SCSI channels of a Dell PERC --- 59 unchanged lines hidden --- |