Where to insert a filter to make a device of one class look like another?

I’m just starting into a project to make a SCSI disk appear to the system as
if it is a different class of SCSI device. The type of device I am going to
make it emulate has a Windows class driver for which the source is included
in the DDK. Sorry, I’d love to tell you what I’m trying to emulate, but I
can’t, yet. :slight_smile:

My question is, where is the best place to intercept the IOs to translate
them? The obvious place would be between the port and the class drivers,
but that can have multiple meanings, I think. If attach as an upper filter
for the Port driver, then I have to filter all of the SRBs into the Port,
just to redirect the IOs to the single device I’m fiddling with, and that
seems overly invasive. A (possible?) alternative is a lower filter to the
both class drivers, which would redirect the single device to the other
class driver. That seems more complex than the upper filter for the Port.

Anything obvious I’ve overlooked? Suggestions? Comments? Think I’m nuts?
:slight_smile:

Thanks,

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842

Mark,

Thanks for the response. Your pondering mirrored mine, regarding approach
2, and I’m not sure that can be done, though I think it can. For now, I
agree that #1 is preferable, even though it is undocumented, as you
mentioned. You are referring to the perfdisk example, are you not? If you
are not, I’m in deeper doo-doo than I already know, and it looks pretty deep
already. :slight_smile:


I prefer the structured approach of the Windows NT architecture to the
“Stucture? I don’t got no Structure! I don’t NEED no steenking
Structure!” approach of some other OS’s that are popular among the digerati,
but I have spent the last 2.5 years doing things at (or outside) the
boundaries of what Microsoft supports, and I’m pretty well bruised by
running into all the unmarked fences.

*sigh*

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842

“Mark Roddy” wrote in message news:xxxxx@ntdev…
>
> I think these are the alternatives.
>
> 1) scsiport bus filter driver: sits ontop of port FDO, attaches to port-
> enumerated PDOs, translates verbs to french as appropriate.
>
> 2) class lower filter: claims FDOs of interest preventing their claimage
> by the class driver. (You might have to also generate new dev objects of
> some other class, and as you say you might have to also be a lower filter
> driver for that class, but I don’t really understand your requirements
> here.)
>
> I vote for #1. While bus filter drivers are undocumented, they are
> definately supported as microsoft has at least one of them. This route
> also is least invasive. Unless your other class is not even SCSI-
> whatever, your filter driver just has to change the reported PDO hardware
> ids from GENDISK to GENWHATEVER and you are done (at least you are done
> in terms of getting the PDOs attached to the right stack.)
>
> ===========================
> Mark Roddy
> Consultant, Microsoft DDK MVP
> Hollis Technology Solutions
> xxxxx@hollistech.com
> www.hollistech.com
> 603-321-1032
>
>
> -----Original Message-----
> From: “Phil Barila”
> To: “NT Developers Interest List”
> Date: Tue, 20 Aug 2002 16:09:41 -0600
> Subject: [ntdev] Where to insert a filter to make a device of one class
> look like another?
>
> > I’m just starting into a project to make a SCSI disk appear to the
> > system as
> > if it is a different class of SCSI device. The type of device I am
> > going to
> > make it emulate has a Windows class driver for which the source is
> > included
> > in the DDK. Sorry, I’d love to tell you what I’m trying to emulate,
> > but I
> > can’t, yet. :slight_smile:
> >
> > My question is, where is the best place to intercept the IOs to
> > translate
> > them? The obvious place would be between the port and the class
> > drivers,
> > but that can have multiple meanings, I think. If attach as an upper
> > filter
> > for the Port driver, then I have to filter all of the SRBs into the
> > Port,
> > just to redirect the IOs to the single device I’m fiddling with, and
> > that
> > seems overly invasive. A (possible?) alternative is a lower filter to
> > the
> > both class drivers, which would redirect the single device to the other
> > class driver. That seems more complex than the upper filter for the
> > Port.
> >
> > Anything obvious I’ve overlooked? Suggestions? Comments? Think I’m
> > nuts?
> > :slight_smile:
> >
> > Thanks,
> >
> > Phil
> > –
> > Philip D. Barila
> > Seagate Technology, LLC
> > (720) 684-1842
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@hollistech.com
> > To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>