Determining if the disk is SCSI, ATA, or GKW ...

GKW == God Knows What.

Ok, I’ve just done an IoGetDeviceInterface using GUID_DEVINTERFACE_DISK.
What I get back is a list of all disks in the system, but now I want to know
is this given element in that list a SCSI, an IDE or a GKW type disk?

I’ve scoured the DDK with no joy, and really don’t know how to formulate a
search of the list to find this technique. I use the old trial and error of
doing an op like ATA pass through and assume if rejected that it ain’t ATA,
same for SCSI, or GKW I suppose. But is there an IOCTL that might provide a
cleaner means of doing this?


Gary G. Little
Seagate Technologies, LLC

Will IOCTL_STORAGE_QUERY_PROPERTY help you? It allows to get the bus type.

Alexei.

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
>
> GKW == God Knows What.
>
> Ok, I’ve just done an IoGetDeviceInterface using GUID_DEVINTERFACE_DISK.
> What I get back is a list of all disks in the system, but now I want to
know
> is this given element in that list a SCSI, an IDE or a GKW type disk?
>
> I’ve scoured the DDK with no joy, and really don’t know how to formulate a
> search of the list to find this technique. I use the old trial and error
of
> doing an op like ATA pass through and assume if rejected that it ain’t
ATA,
> same for SCSI, or GKW I suppose. But is there an IOCTL that might provide
a
> cleaner means of doing this?
>
> –
> Gary G. Little
> Seagate Technologies, LLC
>
>
>
>

What we have is documented, if somewhat difficult to find using MSDN.
One good IOCTL to send is IOCTL_STORAGE_QUERY_PROPERTY,
StorageAdapterProperty type. This has a field (STORAGE_BUS_TYPE)BusType
which is the OS’s view of the matter. This is not always accurate, as
some IDE RAID controllers have reported SCSI in the past (because they
used SCSIPORT as their port driver), but it’s a good start. Then again,
if the port driver reports itself as SCSI, it won’t accept ATA pass
through anyways, so this may be sufficient for your needs.

As an aside, don’t all port drivers supporting DISK device types support
IOCTL_SCSI_PASS_THROUGH? (with the notable exceptions of memory stick
and SD-type memory devices?)

Here’s some links to MSDN to help you get started:

Hth,
.

IOCTL_STORAGE_QUERY_PROPERTY:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k307_8z3m.asp

StorageAdapterDescriptor:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k306_2pf6.asp

StorageDeviceDescriptor:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k306_00qa.asp

-----Original Message-----
From: Gary G. Little [mailto:xxxxx@seagate.com]
Sent: Wednesday, September 17, 2003 1:38 PM
Subject: Determining if the disk is SCSI, ATA, or GKW …

GKW == God Knows What.

Ok, I’ve just done an IoGetDeviceInterface using GUID_DEVINTERFACE_DISK.
What I get back is a list of all disks in the system, but now I want to
know
is this given element in that list a SCSI, an IDE or a GKW type disk?

I’ve scoured the DDK with no joy, and really don’t know how to formulate
a
search of the list to find this technique. I use the old trial and error
of
doing an op like ATA pass through and assume if rejected that it ain’t
ATA,
same for SCSI, or GKW I suppose. But is there an IOCTL that might
provide a
cleaner means of doing this?


Gary G. Little
Seagate Technologies, LLC

Thanks to all and also to David Craig. Offline, David mentioned a KB article
that supports the methods discussed here. KB264203.

Here is the link:

http://support.microsoft.com/default.aspx?scid=kb;en-us;264203


Gary G. Little
Seagate Technologies, LLC

“Henry Gabryjelski” wrote in message
news:xxxxx@ntdev…

What we have is documented, if somewhat difficult to find using MSDN.
One good IOCTL to send is IOCTL_STORAGE_QUERY_PROPERTY,
StorageAdapterProperty type. This has a field (STORAGE_BUS_TYPE)BusType
which is the OS’s view of the matter. This is not always accurate, as
some IDE RAID controllers have reported SCSI in the past (because they
used SCSIPORT as their port driver), but it’s a good start. Then again,
if the port driver reports itself as SCSI, it won’t accept ATA pass
through anyways, so this may be sufficient for your needs.

As an aside, don’t all port drivers supporting DISK device types support
IOCTL_SCSI_PASS_THROUGH? (with the notable exceptions of memory stick
and SD-type memory devices?)

Here’s some links to MSDN to help you get started:

Hth,
.

IOCTL_STORAGE_QUERY_PROPERTY:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k307_8z3m.asp

StorageAdapterDescriptor:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k306_2pf6.asp

StorageDeviceDescriptor:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k306_00qa.asp

-----Original Message-----
From: Gary G. Little [mailto:xxxxx@seagate.com]
Sent: Wednesday, September 17, 2003 1:38 PM
Subject: Determining if the disk is SCSI, ATA, or GKW …

GKW == God Knows What.

Ok, I’ve just done an IoGetDeviceInterface using GUID_DEVINTERFACE_DISK.
What I get back is a list of all disks in the system, but now I want to
know
is this given element in that list a SCSI, an IDE or a GKW type disk?

I’ve scoured the DDK with no joy, and really don’t know how to formulate
a
search of the list to find this technique. I use the old trial and error
of
doing an op like ATA pass through and assume if rejected that it ain’t
ATA,
same for SCSI, or GKW I suppose. But is there an IOCTL that might
provide a
cleaner means of doing this?


Gary G. Little
Seagate Technologies, LLC

STORAGE_BUS_TYPE, in general is unreliable for many interfaces. It
should be good for 1394, USB and IDE using the Microsoft drivers. The
reason it’s unreliable is that it has never been properly documented how
to set this (it’s not something a miniport can do in code). Inbox
drivers will set it for FC, RAID and SCSI but drivers installed later
will probably not set this at all and will show BusTypeUnknown. (BTW:
The bus type for iSCSI is 9)

Jeff Goldner

-----Original Message-----
From: Gary G. Little [mailto:xxxxx@seagate.com]
Sent: Thursday, September 18, 2003 5:55 AM
Subject: Re: Determining if the disk is SCSI, ATA, or GKW …

Thanks to all and also to David Craig. Offline, David mentioned a KB
article
that supports the methods discussed here. KB264203.

Here is the link:

http://support.microsoft.com/default.aspx?scid=kb;en-us;264203


Gary G. Little
Seagate Technologies, LLC

“Henry Gabryjelski” wrote in message
news:xxxxx@ntdev…

What we have is documented, if somewhat difficult to find using MSDN.
One good IOCTL to send is IOCTL_STORAGE_QUERY_PROPERTY,
StorageAdapterProperty type. This has a field (STORAGE_BUS_TYPE)BusType
which is the OS’s view of the matter. This is not always accurate, as
some IDE RAID controllers have reported SCSI in the past (because they
used SCSIPORT as their port driver), but it’s a good start. Then again,
if the port driver reports itself as SCSI, it won’t accept ATA pass
through anyways, so this may be sufficient for your needs.

As an aside, don’t all port drivers supporting DISK device types support
IOCTL_SCSI_PASS_THROUGH? (with the notable exceptions of memory stick
and SD-type memory devices?)

Here’s some links to MSDN to help you get started:

Hth,
.

IOCTL_STORAGE_QUERY_PROPERTY:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k307_8z3m.asp

StorageAdapterDescriptor:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k306_2pf6.asp

StorageDeviceDescriptor:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage
/hh/storage/k306_00qa.asp

-----Original Message-----
From: Gary G. Little [mailto:xxxxx@seagate.com]
Sent: Wednesday, September 17, 2003 1:38 PM
Subject: Determining if the disk is SCSI, ATA, or GKW …

GKW == God Knows What.

Ok, I’ve just done an IoGetDeviceInterface using GUID_DEVINTERFACE_DISK.
What I get back is a list of all disks in the system, but now I want to
know
is this given element in that list a SCSI, an IDE or a GKW type disk?

I’ve scoured the DDK with no joy, and really don’t know how to formulate
a
search of the list to find this technique. I use the old trial and error
of
doing an op like ATA pass through and assume if rejected that it ain’t
ATA,
same for SCSI, or GKW I suppose. But is there an IOCTL that might
provide a
cleaner means of doing this?


Gary G. Little
Seagate Technologies, LLC

Jeffrey,

you wrote on Friday, September 19, 2003, 07:12:23:

> http://support.microsoft.com/default.aspx?scid=kb;en-us;264203

JG> STORAGE_BUS_TYPE, in general is unreliable for many interfaces.

Then how about this. After locating the DEVINST devnode of the disk
device using the SetupDi APIs (SetupDiEnumDeviceInterfaces,
SetupDiGetDeviceInterfaceDetail), get the parent devnode with
CM_Get_Parent(). Then use CM_Get_DevNode_Registry_Property() for
CM_DRP_CLASS on the parent devnode which will give you the class name of
the device the disk is attached to such as “hdc”, “ScsiAdapter”,
“PCMCIA” etc.

Ralf.

Hi,

RB> Then use CM_Get_DevNode_Registry_Property() for CM_DRP_CLASS on the
RB> parent devnode which will give you the class name of the device the
RB> disk is attached to such as “hdc”, “ScsiAdapter”, “PCMCIA” etc.

Actually, CM_DRP_CLASSGUID would be better.

Ralf.

Ralf,

You’re out of context. Now you have figured out how to do it this in user
mode, do it in the kernel. My original post deals with determining the types
of busses from kernel, not user mode. Hopefully Jeff’s “many interfaces”
falls under the GKW factor, and all I need to worry about for the
foreseeable future is ATA and SCSI.


Gary G. Little
Seagate Technologies, LLC

“Ralf Buschmann” wrote in message news:xxxxx@ntdev…
>
> Jeffrey,
>
> you wrote on Friday, September 19, 2003, 07:12:23:
>
> >> http://support.microsoft.com/default.aspx?scid=kb;en-us;264203
>
> JG> STORAGE_BUS_TYPE, in general is unreliable for many interfaces.
>
> Then how about this. After locating the DEVINST devnode of the disk
> device using the SetupDi APIs (SetupDiEnumDeviceInterfaces,
> SetupDiGetDeviceInterfaceDetail), get the parent devnode with
> CM_Get_Parent(). Then use CM_Get_DevNode_Registry_Property() for
> CM_DRP_CLASS on the parent devnode which will give you the class name of
> the device the disk is attached to such as “hdc”, “ScsiAdapter”,
> “PCMCIA” etc.
>
> Ralf.
> –
>
>
>

Garry,

not sure why do you need to know the type of the bus hard disk devices are
attached to if you care about the features (command set actually)
particular device supports. What we do – we submit inquiry (SCSI
operation code 0x12) and parse device’s feedback. If the device reports
SCSI version 2 supported – it’s SCSI (or FC that supports SCSI command
set, or SSA that supports SCSI command set or whatever). If it tells you
that the version is 0 – it’s ATA or SATA drive and you’ll be probably
caught dead trying to execute “something very special” with this device’s
firmware. This approach should work from any enviroment.

Hope this will help.

Regards,
Anton Kolomyeytsev

Ralf,

You’re out of context. Now you have figured out how to do it this in user
mode, do it in the kernel. My original post deals with determining the types
of busses from kernel, not user mode. Hopefully Jeff’s “many interfaces”
falls under the GKW factor, and all I need to worry about for the
foreseeable future is ATA and SCSI.


Gary G. Little
Seagate Technologies, LLC

“Ralf Buschmann” wrote in message news:xxxxx@ntdev…
> >
> > Jeffrey,
> >
> > you wrote on Friday, September 19, 2003, 07:12:23:
> >
> > >> http://support.microsoft.com/default.aspx?scid=kb;en-us;264203
> >
> > JG> STORAGE_BUS_TYPE, in general is unreliable for many interfaces.
> >
> > Then how about this. After locating the DEVINST devnode of the disk
> > device using the SetupDi APIs (SetupDiEnumDeviceInterfaces,
> > SetupDiGetDeviceInterfaceDetail), get the parent devnode with
> > CM_Get_Parent(). Then use CM_Get_DevNode_Registry_Property() for
> > CM_DRP_CLASS on the parent devnode which will give you the class name of
> > the device the disk is attached to such as “hdc”, “ScsiAdapter”,
> > “PCMCIA” etc.
> >
> > Ralf.
> > –
> >
> >
> >