Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Dec 2002 16:52:40 +0100 (CET)
From:      =?ISO-8859-1?Q?G=E9rard_Roudier?= <groudier@free.fr>
To:        Peter Much <pmc@citylink.dinoex.sub.org>
Cc:        freebsd-scsi@FreeBSD.ORG, <freebsd-questions@FreeBSD.ORG>, <sane-devel@www.mostang.com>
Subject:   Re: Getting SCSI Scanner to work (with Symbios 53c810a and FreeBSD 4.4)
Message-ID:  <20021201163916.O195-100000@localhost.my.domain>
In-Reply-To: <200212010221.gB12LZk02947@disp.oper.dinoex.org>

next in thread | previous in thread | raw e-mail | index | archive | help


Hi Peter,

You may ignore my previous minute patch and give a try with the below one.

It makes more sense to ignore the period (synchronous period factor) when
the offset (REQ/ACK offset) is zero, facing synchronous data transfer
negotiation in SCSI. Even if the period should be ignored by SCSI devices
when the offset is zero, I would prefer the driver to behave correctly by
design here (i.e.: ignore the period value when offset is zero).

The below patch just does so in the 2 places the driver checks against a
needed sync. negotiation.

Btw, I would consider as broken any SCSI code that makes decision about
data transfer being asynchronous on period value = 0. ;-)

--- sym_hipd.c.021201	Sun Dec  1 16:09:55 2002
+++ sym_hipd.c	Sun Dec  1 16:13:23 2002
@@ -3074,8 +3074,9 @@
 	/*
 	 *  negotiate synchronous transfers?
 	 */
-	else if (tp->tinfo.current.period != tp->tinfo.goal.period ||
-		 tp->tinfo.current.offset != tp->tinfo.goal.offset)
+	else if (tp->tinfo.current.offset != tp->tinfo.goal.offset ||
+		 (tp->tinfo.goal.offset &&
+		  tp->tinfo.current.period != tp->tinfo.goal.period))
 		nego = NS_SYNC;

 	switch (nego) {
@@ -7838,8 +7839,9 @@
 	 */
 	cp->nego_status = 0;
 	if (tp->tinfo.current.width   != tp->tinfo.goal.width  ||
-	    tp->tinfo.current.period  != tp->tinfo.goal.period ||
 	    tp->tinfo.current.offset  != tp->tinfo.goal.offset ||
+	    (tp->tinfo.goal.offset &&
+	     tp->tinfo.current.period != tp->tinfo.goal.period)||
 	    tp->tinfo.current.options != tp->tinfo.goal.options) {
 		if (!tp->nego_cp && lp)
 			msglen += sym_prepare_nego(np, cp, 0, msgptr + msglen);
------------------------ CUT HERE ------------------------

Let me know if this patch makes the driver work with your
asynchronous-only SCSI scanner.

  Gérard.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021201163916.O195-100000>