Reputation: 37
Windows 7
C Programming
Visual C++ 2008 (in a VMWare)
I'd like to send some ATA commands (IDENTIFY DEVICE, READ NATIVE MAX ADDRESS, SET MAX ADDRESS) with DeviceIOContro
l to a USB hard drive. Therefore I have some questions.
As I understood, USBSTOR cannot handle ATA-commands directly (with IOCTL_ATA_PASS_THROUGH
). I tried this and it worked with the native IDE hard drive but not with USB.
Is it correct that applications send SCSI-commands to the device and they are forwarded to the device? So I need to create a SCSI command with the respective ATA command encapsulated?
With what dwIoControlCode
can I do that? I tried it with IOCTL_SCSI_MINIPORT
but the error was ERROR_NOT_SUPPORTED
. Could it work with minport? Is miniport still up to date?
Upvotes: 1
Views: 3077
Reputation: 121649
Look at this link:
Q: howto send ATA spec. command to USB HDD?
A: You are limited to whatever the USB->ATA tailgate (bridge) chip supports. If you control the bridge, you can implement whatever you want. If you don't, you'll have to ask the bridge vendor to reveal what they do support. See my replies in the thread on 1394->ATA on NTDEV for more information.
Q: Once more question: whether probably to get access to everyone disk in SCSI RAID?
A: No.
You can only send SCSI commands to the bridge/enclosure at the end of the USB cable. How they are translated to ATA commands - is not under your control.
I assume El Cheapo enclosures to only translate the essential SCSI commands. In this case, you will only have 1) SCSI INQUIRY emulated by ATA IDENTIFY 2) SCSI READ CAPACITY emulated by ATA IDENTIFY 2) READ and WRITE 3) VERIFY.
And that's all. In this case, you will have zero chances sending any non-trivial ATA commands, since the USB-to-ATA bridge on other side provides no ways of doing such.
Upvotes: 1