[9023] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: direction table?

daemon@ATHENA.MIT.EDU (Douglas Gilbert)
Tue Jun 20 10:33:39 2000

Message-ID: <394EB534.5A4E5D1C@interlog.com>
Date:	Mon, 19 Jun 2000 20:05:08 -0400
From: Douglas Gilbert <dgilbert@interlog.com>
MIME-Version: 1.0
To: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
Cc: Linux SCSI list <linux-scsi@vger.rutgers.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Matthew Dharm wrote:
> 
> A while back, there seemed to be a general agreement that the mechanism for
> determining the setting of the direction flag needed an overhaul.  If my
> memory serves, the general consensus seemed to be that either (a) the
> mid-layer should have a direction table for all commands, or (b) there were
> some inferrence rules which could be used to derive the information.
> 
> This change was only needed for the scsi-generic interface, as userspace
> programs (i.e. cdrecord, cdparanoia, etc) wound up causing Scsi_Cmnd
> structures with a direction of UNKNOWN to be sent to the HBAs -- this
> causes problems with the USB SCSI emulation.
> 
> My question is this: Has anyone managed to implement this?

Matt,

This was fixed (i.e reverted to 2.3.99-pre3 behaviour) in a
2.4.0-test1-ac9 patch to sg. So you should no longer see
UNKNOWN data direction coming from any existing sg based
applications (i.e. SANE, cdrecord, paranoia, etc).
[My post to this newsgroup on 2000/04/21 titled: 
"Re: sc_data_direction -- will we require it?" outlined
the reasoning.]

So as far as I can see, UNKNOWN data direction will only
occur when _explicitly_ asked for in 2 situations:
  - CDROM_SEND_PACKET ioctl
  - sg's new sg_io_hdr interface
In both cases applications have the ability to set specific
direction flags. I am not aware of any applications that 
(will) use UNKNOWN data direction but it's there since it 
isn't the business of pass-through mechanisms to dictate 
policy.

Doug Gilbert

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post