[Openib-windows] Getting the HCA pdo

Jan Bottorff jbottorff at xsigo.com
Fri Sep 22 02:02:03 PDT 2006


I have a kernel driver that uses the IB stack but is not instantiated by
the IB bus driver, so in not in the PnP tree of the hca.

 

One of the little details that took some head scratching was how to
correctly get the physical address of buffers while correctly doing
Windows DMA. Currently, I have a piece of code that looks something
like:

 

            al_obj_t * internalHCAHandle;

 

            internalHCAHandle = (al_obj_t *)hcaHandle;

            nextLowerDevice =
IoGetAttachedDeviceReference((PDEVICE_OBJECT)(internalHCAHandle->p_ci_ca
->verbs.p_hca_dev));

 

This basically does an ugly cast of a hca handle to its internal data
structure to retrieve the hca pdo device object. This all works fine
except for the little details that the shape of al_obj_t changes between
a checked build and free build. I'd love to remove this ugly code and
use something more "supported".

 

Can someone suggest a better way to obtain the actual hca device pdo (or
appropriate lower device object) to pass to IoGetDMAAdapter. It offhand
seems like the IBAL interface is missing important functionality, as you
need physical addresses in QP work requests but don't offhand see any
calls to get a dma adapter object given an hca/port? Drivers that are
instantiated by the IB bus driver automagically get put into the PnP
tree of their hca, so can just call IoGetDMAAdapter on the lower device
passed to AddDevice (or the miniport wrapper does all this on behalf of
the driver for the IPoIB and SRP drivers).

 

Thanks.

 

Jan

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060922/7f1b2dad/attachment.html>


More information about the ofw mailing list