I need to send various SCSI commands to a SAS disk enclosure connected with
LSI SCSI HBA. I read the SPTI sample in DDK and realize I need to use
CreateFile with device name such as \\.\PhysicalDrive0, \\.\scsi1: to get a
handle of the device and then use the handle in the SCSI_PASS_THROUGH IOCTL
call to send SCSI command to the specific SCSI device. But I could not find
the name for the SAS Disk Enclosure. Can anyone give me a hint on the disk
enclosure name and how to discover a disk enclosure?
Thanks,
Ken
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com
"KenH" <KenH...@newsgroup.nospam> wrote in message
news:19C229A9-D772-46A6...@microsoft.com...
Thanks but I didn't get it. As I learned from the ddk spti sample I will
need to use the device name in the CreateFile function call to get the
Windows handle. And then use the handle in the SCSI_PASS_THROUGH,
SCSIOP_INQUIRY IOCTL to get the Inquiry data back. You mentioned get the
enclosure name from the Inquiry data. But I'll need the device name first in
order to use the IOCTL. Or you're talking about discovering? Am I missing
something?
Ken
You can also enumerate \\.\PhysicalDrive%d incrementing the counter, but
this is lesser correct.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com
"KenH" <KenH...@newsgroup.nospam> wrote in message
news:3D2B345D-EB52-4CF6...@microsoft.com...
You may not have the granularity you need to acquire what you need using
standard SCSI pass through. To get and manage the enclosure, you need to
send an LSI MPI formatted message to the IOC, and there is no way, that I
know of, via standard pass through to do that. If you have the MPI 1.5.4
spec you will see the mesasages you need in the IOC Config section detailing
the messages that you need to send to the IOC. There are only two ways I
know of that you can send those messages to the IOC: 1. write your own port
driver, not recommended. 2. use the "back door", IOCTL_SCSI_MINIPORT. #2
allows you to send any formatted MPI message to the IOC and get the IOC
reply back in your application. To use that "back door" you must go to your
LSI rep and get their specifications and development kit.
It is doable. I currently use both 1 and 2 for a hard drive diagnostic
application.
--
The personal opinion of
Gary G. Little
"KenH" <KenH...@newsgroup.nospam> wrote in message
news:19C229A9-D772-46A6...@microsoft.com...
Thanks and that's what I am afraid of. Because the program I'm working on
needs to work with multiple vendors HBA/Enclosure. By using LSI MPI then I'll
need to re-write for other vendors due to they have different SDK. That's why
I'm trying to find a single solution for multiple vendors product. But it
seems like I may not be able to save the effort. Or I have a wrong assumption?
Thanks,
Ken
Every vendor may or may not support the IOCTL_SCSI_MINIPORT, and if they do
you have to go to them to get the information you need. However, that said
... there is a lot of commonality. For instance, SRB_IO_CONTROL is fixed as
to format. You need specific vendor information for two fields within that
structure, but handling it and passing it to a DeviceIoControl call won't
change from vendor to vendor. The fact that it is the header portion of the
total buffer you send via that interface won't change. Thus all you really
need is a class that defines the common header and then overloads the
methods needed to build the vendor control area and the data portion. Don't
expect blinding speed since you are not going to define really huge buffers
since your using METHOD_BUFFERED and everything gets copied. However, for
mode pages, IOC control config for LSI, or another vendors control and
config, the speed is going to be negligible since your dealing with less
than 1 page. For most mode pages, you should be using the system defined
IOCTLs or at a minimum standard pass through. The backdoor lets you control
a RAID, look at a disc in a RAID, or do what you want to do which is look at
or control the SAS topology using a specific set of LSI messages to the IOC.
--
The personal opinion of
Gary G. Little
"KenH" <KenH...@newsgroup.nospam> wrote in message
news:98AE2A2D-C715-4579...@microsoft.com...