question about scsi generic behavior

hiren_mehta@agilent.com
Fri, 8 Jun 2001 17:22:56 -0600


Hi List,

I am trying to use sg_dd which goes through the scsi generic driver.
This is how use it.

sg_dd if=/dev/zero of=/dev/sg5 bs=4096 count=1

And sg5 is actually a disk.

The question that I have is, does the scsi generic driver have a knowledge
about what kind of device it is dealing with ? As you know, all disk drives
have block size of 512 bytes. So, according to the above command, I am
suppose
write 4096 bytes of data. But when my driver gets the CDB, I see that
the transfer length is set to 1 block instead of 8 blocks. And to transfer
4096 bytes, obviously we need transfer length=8 in CDB. Since, the transfer
length
is set to 1, the drive comes back with 1 512 byte block and then comes back
with
a good status because of which sg_dd command is not able to transfer all
4096 bytes
of data.

Any input on this ?

Regards,
-hiren
hiren_mehta@agilent.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/