Sending 1394/SBP2/SCSI commands?

I have a 1394/SBP2 scanner and I would like to be able to send
regular SCSI style commands via SBP2 from user mode. Kernel mode is a
last resort.

I have spent many long days combing over the Win2000 DDK, the
Internet, and a book. I have come up with some interesting clues but
but still don’t know what to do. I promised someone a finished
application by Monday (that wasn’t smart) so I really need to get
something together fast. Any help is greatly appreciated.

In the Win2000 DDK Documentation “Graphics Drivers”, section 1.2:

“For devices that support the SBP-2 protocol, user-mode drivers can
call Microsoft’s SBP-2 interface.”

This sounds perfect. Exactly what I need. But after spending many
many hours reading and searching through all the docs and the web I
can’t find any information on this interface.

I can’t even find the information on writing a SBP2 kernel driver. I
see the SBP2 port driver on my computer (“sbp2port.sys”) but I can’t
find any documentation related to it. Microsoft’s SBP2 page is
completely useless as well.


xxxxx@mail.earthlink.net: Current email. Use in the near future.
xxxxx@bigfoot.com: Routes to current email. Permanent use.

> "For devices that support the SBP-2 protocol, user-mode drivers can

call Microsoft’s SBP-2 interface."

IIRC all SCSI miniports have a way for a user app to send SCSI commands
over the bus - by some IOCTL.
Also IIRC the app must have administrative rights to do this.

I can’t even find the information on writing a SBP2 kernel driver. I
see the SBP2 port driver on my computer (“sbp2port.sys”) but I can’t

SBP2 driver must be a SCSI miniport from the upper edge and talk to WDM
1394 stack from the lower edge.
I also think that SBP2 must be registered as bus upper filter for the 1394
bus to
catch device arrival/removal and to ping the newly arrived 1394 devices for
the
SBP2 support. These devices will be reported as SCSI bus devices to the
SCSIPORT then.
IIRC the Win9x sbp2port.sys has a VXD upper edge and WDM lower egde - it
is not a miniport, but a full SCSI driver plugging into IOS.

Max

>IIRC all SCSI miniports have a way for a user app to send SCSI commands

over the bus - by some IOCTL.
Also IIRC the app must have administrative rights to do this.

Thanks for answering my question!

Can you tell me how to get any kind of access to the SBP2 driver? I
tried everything. I used the SetupDi functions on every registered
interface on the computer and could not get a file/device handle to
send SRBs with. I’ve also tried all the normal SCSI approaches such
as using SPTI and I have got nothing.

Thanks,
Kurt


xxxxx@mail.earthlink.net: Current email. Use in the near future.
xxxxx@bigfoot.com: Routes to current email. Permanent use.

>Try opening the SBP port driver and using SPTI.

this is just a suggestion. I haven’t tried it myself.

I attempted this. The first thing that is required for SPTI is to
call CreateFile with the name of the port you want to open. I tried
SCSI0:, SCSI1:, SBP0:. SBP2:, and a few dozen other permutations of
various things but I always got error code 2 (failed to find file).
Additionally, the SPTI docs and code in the latest Win2000 DDK make
absolutely no mention of 1394 or SBP-2. If you could think of a way
to get this to work please let me know.

> >IIRC all SCSI miniports have a way for a user app to send SCSI commands
> >over the bus - by some IOCTL.
> >Also IIRC the app must have administrative rights to do this.
Normally on NT this is done through pass-through ioctl.
I don’t know how its done on 95 or 98 SE.

What does pass-through ioctl mean? ioctl is short for I/O control,
right? Are you referring to the DeviceIoControl function used on a
file handle?


xxxxx@mail.earthlink.net: Current email. Use in the near future.
xxxxx@bigfoot.com: Routes to current email. Permanent use.

hi,
SPTI should work for HBA or a particular class of device to which u want to
send the CDBs. If ur particular device is already claimed by 1394
controller, then u should direct PASSTHROUGH ioctl on the device object
created by the SBP2 driver.U can find the appropriate symbolic name in the
directory ??\ ( like for Disk it is PHYSICALDRIVEn , tape - TAPEn:, where n
is the device number.
Verify their existence before u use them in CreateFile. if u fail to find
something appropraite here look in \Device\ directoroy .

hope it helps
pash

----- Original Message -----
From: “Kurt”
To: “NT Developers Interest List”
Sent: Sunday, July 16, 2000 11:09 AM
Subject: [ntdev] Sending 1394/SBP2/SCSI commands?

> I have a 1394/SBP2 scanner and I would like to be able to send
> regular SCSI style commands via SBP2 from user mode. Kernel mode is a
> last resort.
>
> I have spent many long days combing over the Win2000 DDK, the
> Internet, and a book. I have come up with some interesting clues but
> but still don’t know what to do. I promised someone a finished
> application by Monday (that wasn’t smart) so I really need to get
> something together fast. Any help is greatly appreciated.
>
> In the Win2000 DDK Documentation “Graphics Drivers”, section 1.2:
>
> “For devices that support the SBP-2 protocol, user-mode drivers can
> call Microsoft’s SBP-2 interface.”
>
> This sounds perfect. Exactly what I need. But after spending many
> many hours reading and searching through all the docs and the web I
> can’t find any information on this interface.
>
> I can’t even find the information on writing a SBP2 kernel driver. I
> see the SBP2 port driver on my computer (“sbp2port.sys”) but I can’t
> find any documentation related to it. Microsoft’s SBP2 page is
> completely useless as well.
>
> ----
> xxxxx@mail.earthlink.net: Current email. Use in the near future.
> xxxxx@bigfoot.com: Routes to current email. Permanent use.
>
> —
> You are currently subscribed to ntdev as: xxxxx@Legato.COM
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>

Use OBJDIR \DosDevices – this will show you the device name of anything
created by the miniport driver.
To see the name that the port driver has created, or do as Pash suggests,
and grab the handle to an upper-level device such as a disk or tape (or
whatever device) that you wish to send the IOCTL to…

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Kurt [mailto:xxxxx@mail.earthlink.net]
Sent: Monday, July 17, 2000 11:43 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Sending 1394/SBP2/SCSI commands?

Try opening the SBP port driver and using SPTI.
this is just a suggestion. I haven’t tried it myself.

I attempted this. The first thing that is required for SPTI is to
call CreateFile with the name of the port you want to open. I tried
SCSI0:, SCSI1:, SBP0:. SBP2:, and a few dozen other permutations of
various things but I always got error code 2 (failed to find file).
Additionally, the SPTI docs and code in the latest Win2000 DDK make
absolutely no mention of 1394 or SBP-2. If you could think of a way
to get this to work please let me know.

> >IIRC all SCSI miniports have a way for a user app to send SCSI
commands
> >over the bus - by some IOCTL.
> >Also IIRC the app must have administrative rights to do this.
Normally on NT this is done through pass-through ioctl.
I don’t know how its done on 95 or 98 SE.

What does pass-through ioctl mean? ioctl is short for I/O control,
right? Are you referring to the DeviceIoControl function used on a
file handle?

>Use OBJDIR \DosDevices – this will show you the device name of anything

created by the miniport driver.

That is Win2000 only. I only have access to Windows 98 at the moment
so I can’t use that.

I’ve scanned all devices on my system using the SetupDi functions and
got the following two significant entries:

1394\UMAX&POWERLOOK_1100__\CF0B80052B1000
SBP2\UMAX&POWERLOOK_1100__&LUN0\00102B0005800BCF

I’ve tried to access every available device interface (I found all
the interfaces by looking at the registry) through the SetupDi
functions and didn’t get anything to work. I was surprised to see
that there were no instances under
the ScsiRawInterfaceGuid and GUID_DEVCLASS_1394 interfaces.

I’m really stuck on this problem. Any help is greatly appreciated.


xxxxx@mail.earthlink.net: Current email. Use in the near future.
xxxxx@bigfoot.com: Routes to current email. Permanent use.

> 1394\UMAX&POWERLOOK_1100__\CF0B80052B1000

SBP2\UMAX&POWERLOOK_1100__&LUN0\00102B0005800BCF

Does it appear to be a SCSI scanner to the rest of the OS?

the ScsiRawInterfaceGuid and GUID_DEVCLASS_1394 interfaces.

No, the latter one is 1394 HBA - not a device hanging off the bus.

Max