Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 142009a3 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley
Browse files

[SCSI] aic7xxx: cap maxsync according to correct card limits



Not doing this can cause cards less than u160 capable to send out PPR
offers to devices they can't then deliver on ... causing some devices to
get a bit confused.  Fix by capping the start syncrate at the
appropriate level according to the card capabilities.

Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 28f85009
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -1702,6 +1702,15 @@ ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,
	 && maxsync < AHC_SYNCRATE_ULTRA2)
		maxsync = AHC_SYNCRATE_ULTRA2;

	/* Now set the maxsync based on the card capabilities
	 * DT is already done above */
	if ((ahc->features & (AHC_DT | AHC_ULTRA2)) == 0
	    && maxsync < AHC_SYNCRATE_ULTRA)
		maxsync = AHC_SYNCRATE_ULTRA;
	if ((ahc->features & (AHC_DT | AHC_ULTRA2 | AHC_ULTRA)) == 0
	    && maxsync < AHC_SYNCRATE_FAST)
		maxsync = AHC_SYNCRATE_FAST;

	for (syncrate = &ahc_syncrates[maxsync];
	     syncrate->rate != NULL;
	     syncrate++) {
@@ -1765,6 +1774,17 @@ ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync)
	else
		scsirate &= SXFR;

	/* now set maxsync based on card capabilities */
	if ((ahc->features & AHC_DT) == 0 && maxsync < AHC_SYNCRATE_ULTRA2)
		maxsync = AHC_SYNCRATE_ULTRA2;
	if ((ahc->features & (AHC_DT | AHC_ULTRA2)) == 0
	    && maxsync < AHC_SYNCRATE_ULTRA)
		maxsync = AHC_SYNCRATE_ULTRA;
	if ((ahc->features & (AHC_DT | AHC_ULTRA2 | AHC_ULTRA)) == 0
	    && maxsync < AHC_SYNCRATE_FAST)
		maxsync = AHC_SYNCRATE_FAST;


	syncrate = &ahc_syncrates[maxsync];
	while (syncrate->rate != NULL) {