On Wed, 8 Sep 1999, Mark Veteikis wrote:
> Small suggestion on cleanup:
>
> I noticed that most busmastering drivers duplicate the logic which determines
> the direction of the data phase. (data out or in).
>
> Each lowlevel driver parses the command descriptor block in their own unique
> way to gain this information. It would be helpful if it was passed in the
> Scsi_Cmnd structure by the mid-layer code. Quite a bit of duplicate code in the
> lowlevel drivers could be removed by adding this. I also noticed that lots of
> the low-level drivers don't fully decode all the possible SCSI opcodes
> properly to determine the direction, potential future bugs can be avoided
> by doing this correctly.
The actual data direction cannot be guessed from the opcode. It depends
also on the device type and some commands may just be vendor-specific.
The transfer direction must be supplied by the part that supplies the
IO request.
This flaw in Linux-SCSI requires driver to be able to handle any transfer
direction required by a device for a command. Usually, the direction is
enforced only for common opcodes as READ*/WRITE* and friends. For non
usual commands the driver/controller pair must wait the first data phase
asked by the device to know about the transfer direction.
G�rard.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]