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 =3D 0. ;-)

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

 =09switch (nego) {
@@ -7838,8 +7839,9 @@
 =09 */
 =09cp->nego_status =3D 0;
 =09if (tp->tinfo.current.width   !=3D tp->tinfo.goal.width  ||
-=09    tp->tinfo.current.period  !=3D tp->tinfo.goal.period ||
 =09    tp->tinfo.current.offset  !=3D tp->tinfo.goal.offset ||
+=09    (tp->tinfo.goal.offset &&
+=09     tp->tinfo.current.period !=3D tp->tinfo.goal.period)||
 =09    tp->tinfo.current.options !=3D tp->tinfo.goal.options) {
 =09=09if (!tp->nego_cp && lp)
 =09=09=09msglen +=3D 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=E9rard.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" 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>