USB mass storage and SCSI emulation

Hello,

When you mount a DiskOnKey in Linux, you mount it on /dev/sda. As I look at the code of usb.c under drivers/usb/storage/usb.c I see that there is a layer of Scsi Emulation. To give only 2 example, I see that in usb_stor_control_thread() , for example, there is a creation of a Scsi_Host instance (which is always performed).Also there is a file under storage named scsiglue.h.

There is a known use from the past of SCSI emulation in ATAPI (for CD-RW devices, for example).

But the fact is ,as far as I know,that the DiskOnKey is not a SCSI device. Also when you connect a USB hard disk you use this SCSI emulation. Again , as far as I know , the disk is nothing to do with SCSI but is a regular IDE disk.

My question is: is this SCSI emulation a MUST ? Why couldn't we bypass it and use the usual IDE layer? Or is the SCSI emulation better? I apprecaite if anyone can give a short explanation.

The dedicated usb blog:

formatting link

USBLOG

Reply to
usblog
Loading thread data ...

I've never wondered too much about this. My reasoning for this is that USB mass storage devices can be hot plugged much like SCSI devices. IDEs can't so SCSI is a better match. Well that's what I've always assumed.

Reply to
Harold Chu

It is not really SCSI, but are reduced block commands (plus some extra commands here and there) - whjich is a small subset. And in a way ATA/ATAPI is also derived from SCSI.

So forget about SCSI in the sense of SCSI harddisks, SCSI CDROM players etc. Those USB Mass Storage things are not SCSI in that way. Only a few commands have to be implemented.

Reply to
Armin Gerritsen

extra

ATA/ATAPI

players etc.

commands

First don't confuse the *pipe* with the protocol. Logically, USB Flash Drives are SCSI, but it's just a variant of the SCSI protocol over a USB Cable. Just like Serial SCSI and iSCSI are other variants of the SCSI protocol over other serialized *pipes*.

As far as the ATA question, no problem. The original Lexar JumpShots, USB enabled CF Cards, used ATA over USB /w a vendor unique device driver. If you look in the Linux kernal under Storage you will see notes as such.

Then why is it SCSI today? Because the USB Mass Storage Bulk-Only Class specification defines it as SCSI and if you follow that then no Vendor Unique driver is required.

Reply to
yaipa

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.