aac_pci.c (232668) | aac_pci.c (247570) |
---|---|
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 232668 2012-03-07 18:52:46Z jhb $"); | 31__FBSDID("$FreeBSD: head/sys/dev/aac/aac_pci.c 247570 2013-03-01 19:55:10Z marius $"); |
32 33/* 34 * PCI bus interface and resource allocation. 35 */ 36 37#include "opt_aac.h" 38 39#include <sys/param.h> --- 15 unchanged lines hidden (view full) --- 55 56#include <dev/aac/aacreg.h> 57#include <sys/aac_ioctl.h> 58#include <dev/aac/aacvar.h> 59 60static int aac_pci_probe(device_t dev); 61static int aac_pci_attach(device_t dev); 62 | 32 33/* 34 * PCI bus interface and resource allocation. 35 */ 36 37#include "opt_aac.h" 38 39#include <sys/param.h> --- 15 unchanged lines hidden (view full) --- 55 56#include <dev/aac/aacreg.h> 57#include <sys/aac_ioctl.h> 58#include <dev/aac/aacvar.h> 59 60static int aac_pci_probe(device_t dev); 61static int aac_pci_attach(device_t dev); 62 |
63static int aac_enable_msi = 1; 64TUNABLE_INT("hw.aac.enable_msi", &aac_enable_msi); 65SYSCTL_INT(_hw_aac, OID_AUTO, enable_msi, CTLFLAG_RDTUN, &aac_enable_msi, 0, 66 "Enable MSI interrupts"); 67 |
|
63static device_method_t aac_methods[] = { 64 /* Device interface */ 65 DEVMETHOD(device_probe, aac_pci_probe), 66 DEVMETHOD(device_attach, aac_pci_attach), 67 DEVMETHOD(device_detach, aac_detach), 68 DEVMETHOD(device_suspend, aac_suspend), 69 DEVMETHOD(device_resume, aac_resume), 70 71 DEVMETHOD_END 72}; 73 74static driver_t aac_pci_driver = { 75 "aac", 76 aac_methods, 77 sizeof(struct aac_softc) 78}; 79 80static devclass_t aac_devclass; 81 | 68static device_method_t aac_methods[] = { 69 /* Device interface */ 70 DEVMETHOD(device_probe, aac_pci_probe), 71 DEVMETHOD(device_attach, aac_pci_attach), 72 DEVMETHOD(device_detach, aac_detach), 73 DEVMETHOD(device_suspend, aac_suspend), 74 DEVMETHOD(device_resume, aac_resume), 75 76 DEVMETHOD_END 77}; 78 79static driver_t aac_pci_driver = { 80 "aac", 81 aac_methods, 82 sizeof(struct aac_softc) 83}; 84 85static devclass_t aac_devclass; 86 |
82DRIVER_MODULE(aac, pci, aac_pci_driver, aac_devclass, 0, 0); | 87DRIVER_MODULE(aac, pci, aac_pci_driver, aac_devclass, NULL, NULL); |
83MODULE_DEPEND(aac, pci, 1, 1, 1); 84 | 88MODULE_DEPEND(aac, pci, 1, 1, 1); 89 |
85 86struct aac_ident | 90static const struct 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 int quirks; | 91{ 92 u_int16_t vendor; 93 u_int16_t device; 94 u_int16_t subvendor; 95 u_int16_t subdevice; 96 int hwif; 97 int quirks; |
94 char *desc; | 98 const char *desc; |
95} aac_identifiers[] = { 96 {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, 0, 97 "Dell PERC 2/Si"}, 98 {0x1028, 0x0002, 0x1028, 0x0002, AAC_HWIF_I960RX, 0, 99 "Dell PERC 3/Di"}, 100 {0x1028, 0x0003, 0x1028, 0x0003, AAC_HWIF_I960RX, 0, 101 "Dell PERC 3/Si"}, 102 {0x1028, 0x0004, 0x1028, 0x00d0, AAC_HWIF_I960RX, 0, --- 31 unchanged lines hidden (view full) --- 134 {0x9005, 0x0285, 0x9005, 0x0293, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, 135 "Adaptec SATA 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"}, | 99} aac_identifiers[] = { 100 {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, 0, 101 "Dell PERC 2/Si"}, 102 {0x1028, 0x0002, 0x1028, 0x0002, AAC_HWIF_I960RX, 0, 103 "Dell PERC 3/Di"}, 104 {0x1028, 0x0003, 0x1028, 0x0003, AAC_HWIF_I960RX, 0, 105 "Dell PERC 3/Si"}, 106 {0x1028, 0x0004, 0x1028, 0x00d0, AAC_HWIF_I960RX, 0, --- 31 unchanged lines hidden (view full) --- 138 {0x9005, 0x0285, 0x9005, 0x0293, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, 139 "Adaptec SATA RAID 21610SA"}, 140 {0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, 141 "HP ML110 G2 (Adaptec 2610SA)"}, 142 {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, 0, 143 "Adaptec SCSI RAID 2230S"}, 144 {0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0, 145 "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"}, --- 120 unchanged lines hidden (view full) --- 271 {0x9005, 0x0285, 0x15d9, 0x2ca, AAC_HWIF_I960RX, 0, 272 "AOC-USAS-S8iR"}, 273 {0x9005, 0x0285, 0x15d9, 0x2d2, AAC_HWIF_I960RX, 0, 274 "AOC-USAS-S8i-LP"}, 275 {0x9005, 0x0285, 0x15d9, 0x2d3, AAC_HWIF_I960RX, 0, 276 "AOC-USAS-S8iR-LP"}, 277 {0, 0, 0, 0, 0, 0, 0} 278}; | 146 {0x9005, 0x0285, 0x9005, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 147 AAC_FLAGS_256FIBS, "Adaptec SCSI RAID 2200S"}, 148 {0x9005, 0x0285, 0x17aa, 0x0286, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 149 AAC_FLAGS_256FIBS, "Legend S220"}, 150 {0x9005, 0x0285, 0x17aa, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | 151 AAC_FLAGS_256FIBS, "Legend S230"}, 152 {0x9005, 0x0285, 0x9005, 0x0288, AAC_HWIF_I960RX, 0, 153 "Adaptec SCSI RAID 3230S"}, --- 120 unchanged lines hidden (view full) --- 274 {0x9005, 0x0285, 0x15d9, 0x2ca, AAC_HWIF_I960RX, 0, 275 "AOC-USAS-S8iR"}, 276 {0x9005, 0x0285, 0x15d9, 0x2d2, AAC_HWIF_I960RX, 0, 277 "AOC-USAS-S8i-LP"}, 278 {0x9005, 0x0285, 0x15d9, 0x2d3, AAC_HWIF_I960RX, 0, 279 "AOC-USAS-S8iR-LP"}, 280 {0, 0, 0, 0, 0, 0, 0} 281}; |
279struct aac_ident | 282 283static const struct aac_ident |
280aac_family_identifiers[] = { 281 {0x9005, 0x0285, 0, 0, AAC_HWIF_I960RX, 0, 282 "Adaptec RAID Controller"}, 283 {0x9005, 0x0286, 0, 0, AAC_HWIF_RKT, 0, 284 "Adaptec RAID Controller"}, 285 {0, 0, 0, 0, 0, 0, 0} 286}; 287 | 284aac_family_identifiers[] = { 285 {0x9005, 0x0285, 0, 0, AAC_HWIF_I960RX, 0, 286 "Adaptec RAID Controller"}, 287 {0x9005, 0x0286, 0, 0, AAC_HWIF_RKT, 0, 288 "Adaptec RAID Controller"}, 289 {0, 0, 0, 0, 0, 0, 0} 290}; 291 |
288static struct aac_ident * | 292static const struct aac_ident * |
289aac_find_ident(device_t dev) 290{ | 293aac_find_ident(device_t dev) 294{ |
291 struct aac_ident *m; | 295 const struct aac_ident *m; |
292 u_int16_t vendid, devid, sub_vendid, sub_devid; 293 294 vendid = pci_get_vendor(dev); 295 devid = pci_get_device(dev); 296 sub_vendid = pci_get_subvendor(dev); 297 sub_devid = pci_get_subdevice(dev); 298 299 for (m = aac_identifiers; m->vendor != 0; m++) { --- 12 unchanged lines hidden (view full) --- 312} 313 314/* 315 * Determine whether this is one of our supported adapters. 316 */ 317static int 318aac_pci_probe(device_t dev) 319{ | 296 u_int16_t vendid, devid, sub_vendid, sub_devid; 297 298 vendid = pci_get_vendor(dev); 299 devid = pci_get_device(dev); 300 sub_vendid = pci_get_subvendor(dev); 301 sub_devid = pci_get_subdevice(dev); 302 303 for (m = aac_identifiers; m->vendor != 0; m++) { --- 12 unchanged lines hidden (view full) --- 316} 317 318/* 319 * Determine whether this is one of our supported adapters. 320 */ 321static int 322aac_pci_probe(device_t dev) 323{ |
320 struct aac_ident *id; | 324 const struct aac_ident *id; |
321 322 fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); 323 324 if ((id = aac_find_ident(dev)) != NULL) { 325 device_set_desc(dev, id->desc); 326 return(BUS_PROBE_DEFAULT); 327 } 328 return(ENXIO); 329} 330 331/* 332 * Allocate resources for our device, set up the bus interface. 333 */ 334static int 335aac_pci_attach(device_t dev) 336{ 337 struct aac_softc *sc; | 325 326 fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); 327 328 if ((id = aac_find_ident(dev)) != NULL) { 329 device_set_desc(dev, id->desc); 330 return(BUS_PROBE_DEFAULT); 331 } 332 return(ENXIO); 333} 334 335/* 336 * Allocate resources for our device, set up the bus interface. 337 */ 338static int 339aac_pci_attach(device_t dev) 340{ 341 struct aac_softc *sc; |
338 struct aac_ident *id; 339 int error; 340 u_int32_t command; | 342 const struct aac_ident *id; 343 int count, error, reg, rid; |
341 342 fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); 343 344 /* 345 * Initialise softc. 346 */ 347 sc = device_get_softc(dev); | 344 345 fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); 346 347 /* 348 * Initialise softc. 349 */ 350 sc = device_get_softc(dev); |
348 bzero(sc, sizeof(*sc)); | |
349 sc->aac_dev = dev; 350 351 /* assume failure is 'not configured' */ 352 error = ENXIO; 353 354 /* 355 * Verify that the adapter is correctly set up in PCI space. 356 */ | 351 sc->aac_dev = dev; 352 353 /* assume failure is 'not configured' */ 354 error = ENXIO; 355 356 /* 357 * Verify that the adapter is correctly set up in PCI space. 358 */ |
357 command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); 358 command |= PCIM_CMD_BUSMASTEREN; 359 pci_write_config(dev, PCIR_COMMAND, command, 2); 360 command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); 361 if (!(command & PCIM_CMD_BUSMASTEREN)) { 362 device_printf(sc->aac_dev, "can't enable bus-master feature\n"); | 359 pci_enable_busmaster(dev); 360 if (!(pci_read_config(dev, PCIR_COMMAND, 2) & PCIM_CMD_BUSMASTEREN)) { 361 device_printf(dev, "can't enable bus-master feature\n"); |
363 goto out; 364 } | 362 goto out; 363 } |
365 if ((command & PCIM_CMD_MEMEN) == 0) { 366 device_printf(sc->aac_dev, "memory window not available\n"); 367 goto out; 368 } | |
369 370 /* | 364 365 /* |
371 * Allocate the PCI register window. | 366 * Allocate the PCI register window(s). |
372 */ | 367 */ |
373 sc->aac_regs_rid0 = PCIR_BAR(0); 374 if ((sc->aac_regs_res0 = bus_alloc_resource_any(sc->aac_dev, 375 SYS_RES_MEMORY, &sc->aac_regs_rid0, RF_ACTIVE)) == NULL) { 376 device_printf(sc->aac_dev, 377 "couldn't allocate register window 0\n"); | 368 rid = PCIR_BAR(0); 369 if ((sc->aac_regs_res0 = bus_alloc_resource_any(dev, 370 SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { 371 device_printf(dev, "can't allocate register window 0\n"); |
378 goto out; 379 } 380 sc->aac_btag0 = rman_get_bustag(sc->aac_regs_res0); 381 sc->aac_bhandle0 = rman_get_bushandle(sc->aac_regs_res0); 382 383 if (sc->aac_hwif == AAC_HWIF_NARK) { | 372 goto out; 373 } 374 sc->aac_btag0 = rman_get_bustag(sc->aac_regs_res0); 375 sc->aac_bhandle0 = rman_get_bushandle(sc->aac_regs_res0); 376 377 if (sc->aac_hwif == AAC_HWIF_NARK) { |
384 sc->aac_regs_rid1 = PCIR_BAR(1); 385 if ((sc->aac_regs_res1 = bus_alloc_resource_any(sc->aac_dev, 386 SYS_RES_MEMORY, &sc->aac_regs_rid1, RF_ACTIVE)) == NULL) { 387 device_printf(sc->aac_dev, 388 "couldn't allocate register window 1\n"); | 378 rid = PCIR_BAR(1); 379 if ((sc->aac_regs_res1 = bus_alloc_resource_any(dev, 380 SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { 381 device_printf(dev, 382 "can't allocate register window 1\n"); |
389 goto out; 390 } 391 sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1); 392 sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1); 393 } else { 394 sc->aac_regs_res1 = sc->aac_regs_res0; | 383 goto out; 384 } 385 sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1); 386 sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1); 387 } else { 388 sc->aac_regs_res1 = sc->aac_regs_res0; |
395 sc->aac_regs_rid1 = sc->aac_regs_rid0; | |
396 sc->aac_btag1 = sc->aac_btag0; 397 sc->aac_bhandle1 = sc->aac_bhandle0; 398 } 399 400 /* | 389 sc->aac_btag1 = sc->aac_btag0; 390 sc->aac_bhandle1 = sc->aac_bhandle0; 391 } 392 393 /* |
394 * Allocate the interrupt. 395 */ 396 rid = 0; 397 if (aac_enable_msi != 0 && pci_find_cap(dev, PCIY_MSI, ®) == 0) { 398 count = pci_msi_count(dev); 399 if (count > 1) 400 count = 1; 401 else 402 count = 0; 403 if (count == 1 && pci_alloc_msi(dev, &count) == 0) 404 rid = 1; 405 } 406 if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ, 407 &rid, RF_ACTIVE | (count != 0 ? 0 : RF_SHAREABLE))) == NULL) { 408 device_printf(dev, "can't allocate interrupt\n"); 409 goto out; 410 } 411 412 /* |
|
401 * Allocate the parent bus DMA tag appropriate for our PCI interface. 402 * 403 * Note that some of these controllers are 64-bit capable. 404 */ | 413 * Allocate the parent bus DMA tag appropriate for our PCI interface. 414 * 415 * Note that some of these controllers are 64-bit capable. 416 */ |
405 if (bus_dma_tag_create(bus_get_dma_tag(sc->aac_dev), /* parent */ | 417 if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ |
406 PAGE_SIZE, 0, /* algnmnt, boundary */ 407 BUS_SPACE_MAXADDR, /* lowaddr */ 408 BUS_SPACE_MAXADDR, /* highaddr */ 409 NULL, NULL, /* filter, filterarg */ 410 BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ 411 BUS_SPACE_UNRESTRICTED, /* nsegments */ 412 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 413 0, /* flags */ 414 NULL, NULL, /* No locking needed */ 415 &sc->aac_parent_dmat)) { | 418 PAGE_SIZE, 0, /* algnmnt, boundary */ 419 BUS_SPACE_MAXADDR, /* lowaddr */ 420 BUS_SPACE_MAXADDR, /* highaddr */ 421 NULL, NULL, /* filter, filterarg */ 422 BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ 423 BUS_SPACE_UNRESTRICTED, /* nsegments */ 424 BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 425 0, /* flags */ 426 NULL, NULL, /* No locking needed */ 427 &sc->aac_parent_dmat)) { |
416 device_printf(sc->aac_dev, "can't allocate parent DMA tag\n"); | 428 device_printf(dev, "can't allocate parent DMA tag\n"); |
417 goto out; 418 } 419 420 /* 421 * Detect the hardware interface version, set up the bus interface 422 * indirection. 423 */ 424 id = aac_find_ident(dev); 425 sc->aac_hwif = id->hwif; 426 switch(sc->aac_hwif) { 427 case AAC_HWIF_I960RX: 428 case AAC_HWIF_NARK: 429 fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for i960Rx/NARK"); | 429 goto out; 430 } 431 432 /* 433 * Detect the hardware interface version, set up the bus interface 434 * indirection. 435 */ 436 id = aac_find_ident(dev); 437 sc->aac_hwif = id->hwif; 438 switch(sc->aac_hwif) { 439 case AAC_HWIF_I960RX: 440 case AAC_HWIF_NARK: 441 fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for i960Rx/NARK"); |
430 sc->aac_if = aac_rx_interface; | 442 sc->aac_if = &aac_rx_interface; |
431 break; 432 case AAC_HWIF_STRONGARM: 433 fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM"); | 443 break; 444 case AAC_HWIF_STRONGARM: 445 fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM"); |
434 sc->aac_if = aac_sa_interface; | 446 sc->aac_if = &aac_sa_interface; |
435 break; 436 case AAC_HWIF_RKT: 437 fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS"); | 447 break; 448 case AAC_HWIF_RKT: 449 fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS"); |
438 sc->aac_if = aac_rkt_interface; | 450 sc->aac_if = &aac_rkt_interface; |
439 break; 440 default: 441 sc->aac_hwif = AAC_HWIF_UNKNOWN; | 451 break; 452 default: 453 sc->aac_hwif = AAC_HWIF_UNKNOWN; |
442 device_printf(sc->aac_dev, "unknown hardware type\n"); | 454 device_printf(dev, "unknown hardware type\n"); |
443 error = ENXIO; 444 goto out; 445 } 446 447 /* Set up quirks */ 448 sc->flags = id->quirks; 449 450 /* --- 16 unchanged lines hidden (view full) --- 467static int aacch_attach(device_t dev); 468static int aacch_detach(device_t dev); 469 470static device_method_t aacch_methods[] = { 471 /* Device interface */ 472 DEVMETHOD(device_probe, aacch_probe), 473 DEVMETHOD(device_attach, aacch_attach), 474 DEVMETHOD(device_detach, aacch_detach), | 455 error = ENXIO; 456 goto out; 457 } 458 459 /* Set up quirks */ 460 sc->flags = id->quirks; 461 462 /* --- 16 unchanged lines hidden (view full) --- 479static int aacch_attach(device_t dev); 480static int aacch_detach(device_t dev); 481 482static device_method_t aacch_methods[] = { 483 /* Device interface */ 484 DEVMETHOD(device_probe, aacch_probe), 485 DEVMETHOD(device_attach, aacch_attach), 486 DEVMETHOD(device_detach, aacch_detach), |
475 { 0, 0 } | 487 DEVMETHOD_END |
476}; 477 478struct aacch_softc { 479 device_t dev; 480}; 481 482static driver_t aacch_driver = { 483 "aacch", 484 aacch_methods, 485 sizeof(struct aacch_softc) 486}; 487 488static devclass_t aacch_devclass; | 488}; 489 490struct aacch_softc { 491 device_t dev; 492}; 493 494static driver_t aacch_driver = { 495 "aacch", 496 aacch_methods, 497 sizeof(struct aacch_softc) 498}; 499 500static devclass_t aacch_devclass; |
489DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, 0, 0); | 501DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL); |
490 491static int 492aacch_probe(device_t dev) 493{ 494 495 if ((pci_get_vendor(dev) != 0x9005) || 496 (pci_get_device(dev) != 0x00c5)) 497 return (ENXIO); --- 23 unchanged lines hidden --- | 502 503static int 504aacch_probe(device_t dev) 505{ 506 507 if ((pci_get_vendor(dev) != 0x9005) || 508 (pci_get_device(dev) != 0x00c5)) 509 return (ENXIO); --- 23 unchanged lines hidden --- |