diff options
Diffstat (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm.c')
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 75 |
1 files changed, 20 insertions, 55 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index cf37e8c07601..f94a67be0be4 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -338,13 +338,6 @@ static uint32_t aic7xxx_pci_parity = ~0; | |||
338 | uint32_t aic7xxx_allow_memio = ~0; | 338 | uint32_t aic7xxx_allow_memio = ~0; |
339 | 339 | ||
340 | /* | 340 | /* |
341 | * aic7xxx_detect() has been run, so register all device arrivals | ||
342 | * immediately with the system rather than deferring to the sorted | ||
343 | * attachment performed by aic7xxx_detect(). | ||
344 | */ | ||
345 | int aic7xxx_detect_complete; | ||
346 | |||
347 | /* | ||
348 | * So that we can set how long each device is given as a selection timeout. | 341 | * So that we can set how long each device is given as a selection timeout. |
349 | * The table of values goes like this: | 342 | * The table of values goes like this: |
350 | * 0 - 256ms | 343 | * 0 - 256ms |
@@ -476,48 +469,6 @@ ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb, | |||
476 | } | 469 | } |
477 | 470 | ||
478 | /* | 471 | /* |
479 | * Try to detect an Adaptec 7XXX controller. | ||
480 | */ | ||
481 | static int | ||
482 | ahc_linux_detect(struct scsi_host_template *template) | ||
483 | { | ||
484 | struct ahc_softc *ahc; | ||
485 | int found = 0; | ||
486 | |||
487 | /* | ||
488 | * If we've been passed any parameters, process them now. | ||
489 | */ | ||
490 | if (aic7xxx) | ||
491 | aic7xxx_setup(aic7xxx); | ||
492 | |||
493 | template->proc_name = "aic7xxx"; | ||
494 | |||
495 | /* | ||
496 | * Initialize our softc list lock prior to | ||
497 | * probing for any adapters. | ||
498 | */ | ||
499 | ahc_list_lockinit(); | ||
500 | |||
501 | found = ahc_linux_pci_init(); | ||
502 | if (!ahc_linux_eisa_init()) | ||
503 | found++; | ||
504 | |||
505 | /* | ||
506 | * Register with the SCSI layer all | ||
507 | * controllers we've found. | ||
508 | */ | ||
509 | TAILQ_FOREACH(ahc, &ahc_tailq, links) { | ||
510 | |||
511 | if (ahc_linux_register_host(ahc, template) == 0) | ||
512 | found++; | ||
513 | } | ||
514 | |||
515 | aic7xxx_detect_complete++; | ||
516 | |||
517 | return (found); | ||
518 | } | ||
519 | |||
520 | /* | ||
521 | * Return a string describing the driver. | 472 | * Return a string describing the driver. |
522 | */ | 473 | */ |
523 | static const char * | 474 | static const char * |
@@ -848,6 +799,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd) | |||
848 | struct scsi_host_template aic7xxx_driver_template = { | 799 | struct scsi_host_template aic7xxx_driver_template = { |
849 | .module = THIS_MODULE, | 800 | .module = THIS_MODULE, |
850 | .name = "aic7xxx", | 801 | .name = "aic7xxx", |
802 | .proc_name = "aic7xxx", | ||
851 | .proc_info = ahc_linux_proc_info, | 803 | .proc_info = ahc_linux_proc_info, |
852 | .info = ahc_linux_info, | 804 | .info = ahc_linux_info, |
853 | .queuecommand = ahc_linux_queue, | 805 | .queuecommand = ahc_linux_queue, |
@@ -2717,18 +2669,31 @@ static struct spi_function_template ahc_linux_transport_functions = { | |||
2717 | static int __init | 2669 | static int __init |
2718 | ahc_linux_init(void) | 2670 | ahc_linux_init(void) |
2719 | { | 2671 | { |
2720 | ahc_linux_transport_template = spi_attach_transport(&ahc_linux_transport_functions); | 2672 | /* |
2673 | * If we've been passed any parameters, process them now. | ||
2674 | */ | ||
2675 | if (aic7xxx) | ||
2676 | aic7xxx_setup(aic7xxx); | ||
2677 | |||
2678 | ahc_linux_transport_template = | ||
2679 | spi_attach_transport(&ahc_linux_transport_functions); | ||
2721 | if (!ahc_linux_transport_template) | 2680 | if (!ahc_linux_transport_template) |
2722 | return -ENODEV; | 2681 | return -ENODEV; |
2682 | |||
2723 | scsi_transport_reserve_target(ahc_linux_transport_template, | 2683 | scsi_transport_reserve_target(ahc_linux_transport_template, |
2724 | sizeof(struct ahc_linux_target)); | 2684 | sizeof(struct ahc_linux_target)); |
2725 | scsi_transport_reserve_device(ahc_linux_transport_template, | 2685 | scsi_transport_reserve_device(ahc_linux_transport_template, |
2726 | sizeof(struct ahc_linux_device)); | 2686 | sizeof(struct ahc_linux_device)); |
2727 | if (ahc_linux_detect(&aic7xxx_driver_template)) | 2687 | |
2728 | return 0; | 2688 | /* |
2729 | spi_release_transport(ahc_linux_transport_template); | 2689 | * Initialize our softc list lock prior to |
2730 | ahc_linux_exit(); | 2690 | * probing for any adapters. |
2731 | return -ENODEV; | 2691 | */ |
2692 | ahc_list_lockinit(); | ||
2693 | |||
2694 | ahc_linux_pci_init(); | ||
2695 | ahc_linux_eisa_init(); | ||
2696 | return 0; | ||
2732 | } | 2697 | } |
2733 | 2698 | ||
2734 | static void | 2699 | static void |