OSDN Git Service

[SCSI] aic7xxx: fix U160 mode
authorJames Bottomley <James.Bottomley@steeleye.com>
Fri, 20 May 2005 02:30:13 +0000 (21:30 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Fri, 20 May 2005 21:43:51 +0000 (16:43 -0500)
The new period/dt setting routines don't get the coupling of these
parameters correct.  This means that Domain Validation never gets DT
set, and thus the drive gets restricted to U80.

Fix this by restoring the couplings in the set routines.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/aic7xxx/aic7xxx_osm.c

index b216de4..f90efa2 100644 (file)
@@ -2679,6 +2679,11 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period)
        if (offset == 0)
                offset = MAX_OFFSET;
 
+       if (period < 9)
+               period = 9;     /* 12.5ns is our minimum */
+       if (period == 9)
+               ppr_options |= MSG_EXT_PPR_DT_REQ;
+
        ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
                            starget->channel + 'A', ROLE_INITIATOR);
 
@@ -2764,6 +2769,12 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt)
        unsigned long flags;
        struct ahc_syncrate *syncrate;
 
+       if (dt) {
+               period = 9;     /* 12.5ns is the only period valid for DT */
+               ppr_options |= MSG_EXT_PPR_DT_REQ;
+       } else if (period == 9)
+               period = 10;    /* if resetting DT, period must be >= 25ns */
+
        ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
                            starget->channel + 'A', ROLE_INITIATOR);
        syncrate = ahc_find_syncrate(ahc, &period, &ppr_options,AHC_SYNCRATE_DT);