Oliver Neukum wrote:
>
> Hi,
>
> this may be a stupid question, but ...
>
> How is a driver who has gotten a *Scsi_Cmnd supposed to know whether the
> data is to be read or written ?
Well it's a good question. In the 2.3 series of development kernels
a flag was added just for this purpose:
/*
* These are the values that the SCpnt->sc_data_direction and
* SRpnt->sr_data_direction can take. These need to be set
* The SCSI_DATA_UNKNOWN value is essentially the default.
* In the event that the command creator didn't bother to
* set a value, you will see SCSI_DATA_UNKNOWN.
*/
#define SCSI_DATA_UNKNOWN 0
#define SCSI_DATA_WRITE 1
#define SCSI_DATA_READ 2
#define SCSI_DATA_NONE 3
So in the lk 2.2 series a driver must either guess on the basis
of the SCSI opcode (probably not a good idea given non-standard
opcodes) or be prepared for a data transfer in either direction.
A combination of both policies may be useful (e.g. if the opcode
is READ(6), READ(10) or READ(12) then ...).
Doug Gilbert
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]