diff options
Diffstat (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm.c')
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 55e0b2875f99..e3892585d7e6 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -621,20 +621,35 @@ ahc_linux_target_alloc(struct scsi_target *starget) | |||
621 | memset(targ, 0, sizeof(*targ)); | 621 | memset(targ, 0, sizeof(*targ)); |
622 | 622 | ||
623 | if (sc) { | 623 | if (sc) { |
624 | int maxsync = AHC_SYNCRATE_DT; | ||
625 | int ultra = 0; | ||
626 | int flags = sc->device_flags[target_offset]; | ||
627 | |||
628 | if (ahc->flags & AHC_NEWEEPROM_FMT) { | ||
629 | if (flags & CFSYNCHISULTRA) | ||
630 | ultra = 1; | ||
631 | } else if (flags & CFULTRAEN) | ||
632 | ultra = 1; | ||
633 | /* AIC nutcase; 10MHz appears as ultra = 1, CFXFER = 0x04 | ||
634 | * change it to ultra=0, CFXFER = 0 */ | ||
635 | if(ultra && (flags & CFXFER) == 0x04) { | ||
636 | ultra = 0; | ||
637 | flags &= ~CFXFER; | ||
638 | } | ||
639 | |||
624 | if ((ahc->features & AHC_ULTRA2) != 0) { | 640 | if ((ahc->features & AHC_ULTRA2) != 0) { |
625 | scsirate = sc->device_flags[target_offset] & CFXFER; | 641 | scsirate = (flags & CFXFER) | (ultra ? 0x8 : 0); |
626 | } else { | 642 | } else { |
627 | scsirate = (sc->device_flags[target_offset] & CFXFER) << 4; | 643 | scsirate = (flags & CFXFER) << 4; |
628 | if (sc->device_flags[target_offset] & CFSYNCH) | 644 | maxsync = ultra ? AHC_SYNCRATE_ULTRA : |
629 | scsirate |= SOFS; | 645 | AHC_SYNCRATE_FAST; |
630 | } | 646 | } |
631 | if (sc->device_flags[target_offset] & CFWIDEB) { | 647 | spi_max_width(starget) = (flags & CFWIDEB) ? 1 : 0; |
632 | scsirate |= WIDEXFER; | 648 | if (!(flags & CFSYNCH)) |
633 | spi_max_width(starget) = 1; | 649 | spi_max_offset(starget) = 0; |
634 | } else | ||
635 | spi_max_width(starget) = 0; | ||
636 | spi_min_period(starget) = | 650 | spi_min_period(starget) = |
637 | ahc_find_period(ahc, scsirate, AHC_SYNCRATE_DT); | 651 | ahc_find_period(ahc, scsirate, maxsync); |
652 | |||
638 | tinfo = ahc_fetch_transinfo(ahc, channel, ahc->our_id, | 653 | tinfo = ahc_fetch_transinfo(ahc, channel, ahc->our_id, |
639 | starget->id, &tstate); | 654 | starget->id, &tstate); |
640 | } | 655 | } |