[Openib-windows] Any ideas on how to get the IB Bus driver to create a PDO for my custom kernel driver

Fab Tillier ftillier at silverstorm.com
Fri Nov 11 22:17:40 PST 2005


Hi Jan,

> Sent: Friday, November 11, 2005 9:25 PM
> 
> I need to have my custom driver loaded via PnP enumeration exactly like
> the IPoIB driver does. I need to be in the PnP tree of actual hardware,
> so things like IRP_MN_QUERY_INTERFACE can find a BUS_INTERFACE_STANDARD
> interface.
> 
> I've looked at the core\bus driver, and don't offhand see any easy way
> to get it to create a PDO with my PnP id. Ideally, I would like one PDO
> per port. Offhand, the easiest route I see to make this happen would be
> to take bus_port_mgr.c, and clone it, replacing the details about IPoIB
> with my PnP id's and other info. Even better would be to make new
> devices definable by reading info from the registry, so the next person
> who needs to do this can just add a registry entry with their
> appropriate PnP info.

Either way we need to make the bus driver's port manager a little more abstract
and then deriving the IPoIB and any other device form that might make sense.
With this, you'd be able to easily add a new "device X manager" without
duplicating all the code.  Doing the generic/device specific split and adding
code to explicitly create your devices is likely the quickest way of doing
things.  However, making this change means that all users will end up with
everybody's devices reported.

Allowing devices to be defined via registry entries is probably the way to go
though, as it lets customization be driven via registry entries without
requiring code changes.  I think we might want some helper app to populate the
registry, depending on how many parameters there are, and also to prod the bus
driver to re-read the registry and update the device list without having to
stop/start the driver or reboot.

Do we want to allow devices to be reported on specific HCAs, or just a blanket
"report this device on every port of every HCA"?  What about reporting a device
per HCA rather than per port - should we support that?

> Am I missing an easier solution?

I don't know if it's easier, but you could load your driver and use the PnP
notification mechanisms from the OS to trap remove/stop notifications as if you
were part of the device hierarchy.  You'd have to manage all device
relationships yourself, though.  For example, you'd have to forward
BUS_INTERFACE_STANDARD queries to the appropriate HCA yourself.  If you need to
have an instance of your device per HCA port, then changing the bus driver to
automatically create your PDOs is probably the easiest way.

Out of curiosity, what kind of device are you writing a driver for?  Would you
want this device to be reported by default by the OpenIB drivers, just like
IPoIB is reported by default?

Thanks,

- Fab 




More information about the ofw mailing list