<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=064374415-25032009>This patch removes 
p_hca_dev field of the upper CA interface (ci_interface_t), which contains PDO 
of HCA device.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=064374415-25032009>IBBUS, now sitting 
over HCA, gets this PDO in add_device function and stores it (in this patch) in 
new p_hca_dev field in IBAL CA object.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=064374415-25032009>All the usages of 
ci_interface_t.p_hca_dev  field is replaced by usage of p_hca_dev in IBAL 
CA object.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=064374415-25032009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=064374415-25032009>p_hca_obj field, 
added in 2019 patch in RDMA_INTERFACE_VERBS, removed and placed instead of 
p_hca_dev in ci_interface_t.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=064374415-25032009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=064374415-25032009>Removing of PDO 
filed from the interface required changing of ib_register_ca prototype (for 
technical reasons).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=064374415-25032009>It is - an interface 
function, so the interface version number was increased 
(IB_CI_INTERFACE_VERSION=5).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Index: 
core/al/al_ca.h<BR>===================================================================<BR>--- 
core/al/al_ca.h (revision 2055)<BR>+++ core/al/al_ca.h (working 
copy)<BR>@@ -50,6 +50,7 
@@<BR>  cl_list_item_t   list_item;<BR> #if 
defined(CL_KERNEL)<BR>  ib_ca_handle_t   h_um_ca;<BR>+ PDEVICE_OBJECT   p_hca_dev;<BR> #endif<BR> <BR> } ib_ca_t;<BR>Index: 
core/al/al_ci_ca.h<BR>===================================================================<BR>--- 
core/al/al_ci_ca.h (revision 2055)<BR>+++ core/al/al_ci_ca.h (working 
copy)<BR>@@ -56,7 +56,9 
@@<BR> ib_api_status_t<BR> create_ci_ca(<BR>  IN    al_obj_t     *p_parent_obj,<BR>- IN  const ci_interface_t*    p_ci 
);<BR>+ IN  const ci_interface_t*    p_ci,<BR>+ IN  const PDEVICE_OBJECT    p_hca_dev<BR>+ );<BR> <BR> DEVICE_OBJECT*<BR> get_ca_dev(<BR>Index: 
core/al/kernel/al_ci_ca.c<BR>===================================================================<BR>--- 
core/al/kernel/al_ci_ca.c (revision 2055)<BR>+++ 
core/al/kernel/al_ci_ca.c (working copy)<BR>@@ -84,7 +84,9 
@@<BR> ib_api_status_t<BR> create_ci_ca(<BR>  IN    al_obj_t     *p_parent_obj,<BR>- IN  const ci_interface_t*    p_ci 
)<BR>+ IN  const ci_interface_t*    p_ci,<BR>+ IN  const PDEVICE_OBJECT    p_hca_dev<BR>+ )<BR> {<BR>  ib_api_status_t   status;<BR>  cl_status_t    cl_status;<BR>@@ 
-185,6 +187,9 @@<BR>   return 
status;<BR>  }<BR> <BR>+ /* store HCA device object into CA 
object */<BR>+ p_ci_ca->h_ca->p_hca_dev = 
p_hca_dev;<BR>+ <BR>  /* Get a list of the port GUIDs on this CI 
CA. */<BR>  status = get_port_info( p_ci_ca );<BR>  if( 
status != IB_SUCCESS )<BR>@@ -516,6 +521,6 @@<BR> {<BR>  ASSERT( 
h_ca );<BR> <BR>- ObReferenceObject( 
h_ca->obj.p_ci_ca->verbs.p_hca_dev );<BR>- return 
h_ca->obj.p_ci_ca->verbs.p_hca_dev;<BR>-}<BR>\ No newline at end of 
file<BR>+ ObReferenceObject( h_ca->p_hca_dev );<BR>+ return 
h_ca->p_hca_dev;<BR>+}<BR>Index: 
core/al/kernel/al_mgr.c<BR>===================================================================<BR>--- 
core/al/kernel/al_mgr.c (revision 2055)<BR>+++ 
core/al/kernel/al_mgr.c (working copy)<BR>@@ -256,7 +256,9 @@<BR>  
*/<BR> ib_api_status_t<BR> ib_register_ca(<BR>- IN  const ci_interface_t*    p_ci 
)<BR>+ IN  const ci_interface_t*    p_ci,<BR>+ IN  const PDEVICE_OBJECT    p_hca_dev<BR>+ )<BR> {<BR>  ib_api_status_t  status;<BR> <BR>@@ 
-283,7 +285,7 @@<BR>  }<BR> <BR>  /* Construct and 
initialize the CA structure. */<BR>- status = create_ci_ca( 
&gp_al_mgr->obj, p_ci );<BR>+ status = create_ci_ca( 
&gp_al_mgr->obj, p_ci, p_hca_dev );<BR>  if( status != 
IB_SUCCESS )<BR>  {<BR>   AL_PRINT( TRACE_LEVEL_ERROR, 
AL_DBG_ERROR,<BR>Index: 
core/bus/kernel/bus_iou_mgr.c<BR>===================================================================<BR>--- 
core/bus/kernel/bus_iou_mgr.c (revision 2055)<BR>+++ 
core/bus/kernel/bus_iou_mgr.c (working copy)<BR>@@ -417,7 +417,7 
@@<BR>   {<BR>    /* Invalidate bus relations 
for the HCA. 
*/<BR>    IoInvalidateDeviceRelations(<BR>-    p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
BusRelations );<BR>+    p_ext->h_ca->p_hca_dev, 
BusRelations );<BR> <BR>    /* Release the reference on 
the CA object. */<BR>    deref_al_obj( 
&p_ext->h_ca->obj );<BR>@@ -787,7 +787,7 
@@<BR> <BR>  /* Tell the PnP Manager to rescan for the HCA's bus 
relations. 
*/<BR>  IoInvalidateDeviceRelations(<BR>-   p_iou_ext->pdo.h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
BusRelations );<BR>+   p_iou_ext->pdo.h_ca->p_hca_dev, 
BusRelations );<BR> <BR>  /* Invalidate removal relations for the 
bus driver. */<BR>  IoInvalidateDeviceRelations(<BR>@@ -885,7 +885,7 
@@<BR> <BR>  /* Invalidate bus relations for the HCA. 
*/<BR>  IoInvalidateDeviceRelations(<BR>-  p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
BusRelations );<BR>+  p_ext->h_ca->p_hca_dev, BusRelations 
);<BR> <BR>  /* free PNP context */<BR>  cl_free( p_ctx 
);<BR>@@ -1561,7 +1561,7 @@<BR>   p_ext = 
p_dev_obj->DeviceExtension;<BR>   if( !p_ext->h_ca 
||<BR>    !p_ext->b_present 
||<BR>-   !p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev 
||<BR>+   !p_ext->h_ca->p_hca_dev 
||<BR>    p_ext->b_reported_missing 
)<BR>   {<BR>    return 
STATUS_NO_SUCH_DEVICE;<BR>@@ -1569,7 +1569,7 
@@<BR> <BR> <BR>   status = 
cl_fwd_query_ifc(<BR>-   p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
p_io_stack );<BR>+   p_ext->h_ca->p_hca_dev, p_io_stack 
);<BR>  }<BR>  else<BR>  {<BR>Index: 
core/bus/kernel/bus_pnp.c<BR>===================================================================<BR>--- 
core/bus/kernel/bus_pnp.c (revision 2055)<BR>+++ 
core/bus/kernel/bus_pnp.c (working copy)<BR>@@ -47,6 +47,7 
@@<BR> #include "iba/ib_ci_ifc.h"<BR> #include 
"iba/ib_cm_ifc.h"<BR> #include "al_cm_cep.h"<BR>+#include 
"al_mgr.h"<BR> <BR> <BR> /* Interface names are generated by 
IoRegisterDeviceInterface. */<BR>@@ -460,8 +461,11 
@@<BR>  }<BR>  p_ext->hca_ifc_taken = 
TRUE;<BR> <BR>+ /* bind BFI to HCA by CA GUID. Have to be before 
ib_register_ca */<BR>+ p_bfi->ca_guid = 
p_ext->hca_ifc.Verbs.guid;<BR>+<BR>  /* register HCA 
*/<BR>- ib_status = ib_register_ca( &p_ext->hca_ifc.Verbs 
);<BR>+ ib_status = ib_register_ca( &p_ext->hca_ifc.Verbs, 
p_ext->cl_ext.p_pdo );<BR>  if( ib_status != IB_SUCCESS 
)<BR>  {<BR>   BUS_TRACE_EXIT( BUS_DBG_ERROR, 
("ib_register_ca returned %s.\n",<BR>@@ -469,9 +473,6 
@@<BR>   return 
STATUS_UNSUCCESSFUL;<BR>  }<BR> <BR>- /* bind BFI to HCA by 
CA GUID */<BR>- p_bfi->ca_guid = 
p_ext->hca_ifc.Verbs.guid;<BR>-<BR>  BUS_TRACE_EXIT(BUS_DBG_PNP, 
("%s bound to CA guid 
%I64x\n",<BR>          p_bfi->whoami,p_bfi->ca_guid));<BR>  return 
status;<BR>Index: 
core/bus/kernel/bus_port_mgr.c<BR>===================================================================<BR>--- 
core/bus/kernel/bus_port_mgr.c (revision 2055)<BR>+++ 
core/bus/kernel/bus_port_mgr.c (working copy)<BR>@@ -415,7 +415,7 
@@<BR>   {<BR>    /* Invalidate bus relations 
for the HCA. 
*/<BR>    IoInvalidateDeviceRelations(<BR>-    p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
BusRelations );<BR>+    p_ext->h_ca->p_hca_dev, 
BusRelations );<BR> <BR>    /* Release the reference on 
the CA object. */<BR>    deref_al_obj( 
&p_ext->h_ca->obj );<BR>@@ -925,7 +925,7 
@@<BR> <BR>   /* Tell the PnP Manager to rescan for the 
HCA's bus relations. 
*/<BR>   IoInvalidateDeviceRelations(<BR>-   p_port_ext->pdo.h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
BusRelations );<BR>+   p_port_ext->pdo.h_ca->p_hca_dev, 
BusRelations );<BR>  }<BR> <BR>  /* Invalidate removal 
relations for the bus driver. */<BR>@@ -985,7 +985,7 
@@<BR> <BR>  /* Tell the PnP Manager to rescan for the HCA's bus 
relations. 
*/<BR>  IoInvalidateDeviceRelations(<BR>-  p_port_ext->pdo.h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
BusRelations );<BR>+  p_port_ext->pdo.h_ca->p_hca_dev, 
BusRelations );<BR> <BR>  BUS_EXIT( BUS_DBG_PNP 
);<BR>  return CL_SUCCESS;<BR>@@ -1125,7 +1125,7 
@@<BR> <BR>  /* Tell the PnP Manager to rescan for the HCA's bus 
relations. 
*/<BR>  IoInvalidateDeviceRelations(<BR>-  pmatched_guid_ext->pdo.h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
BusRelations );<BR>+  pmatched_guid_ext->pdo.h_ca->p_hca_dev, 
BusRelations );<BR> <BR>  /* Invalidate removal relations for the 
bus driver. */<BR>  IoInvalidateDeviceRelations(<BR>@@ -1267,7 +1267,7 
@@<BR> <BR>  /* Invalidate bus relations for the HCA. 
*/<BR>  IoInvalidateDeviceRelations(<BR>-  p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
BusRelations );<BR>+  p_ext->h_ca->p_hca_dev, BusRelations 
);<BR> <BR>  /* Free PNP context memory 
*/<BR>  cl_free( p_ctx );<BR>@@ -1796,7 +1796,7 
@@<BR>   return 
STATUS_NO_SUCH_DEVICE;<BR>  }<BR> <BR>- p_hca_dev = 
p_ext->pdo.h_ca->obj.p_ci_ca->verbs.p_hca_dev;<BR>+ p_hca_dev = 
p_ext->pdo.h_ca->p_hca_dev;<BR> <BR>  /* Get the length of 
the HCA's location. */<BR>  status = IoGetDeviceProperty( 
p_hca_dev,<BR>@@ -2017,14 +2017,14 @@<BR>   p_ext = 
p_dev_obj->DeviceExtension;<BR>   if( !p_ext->h_ca 
||<BR>    !p_ext->b_present 
||<BR>-   !p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev 
||<BR>+   !p_ext->h_ca->p_hca_dev 
||<BR>    p_ext->b_reported_missing 
)<BR>   {<BR>    return 
STATUS_NO_SUCH_DEVICE;<BR>   }<BR> <BR>   status 

cl_fwd_query_ifc(<BR>-   p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev, 
p_io_stack );<BR>+   p_ext->h_ca->p_hca_dev, p_io_stack 
);<BR>  }<BR>  else<BR>  {<BR>Index: 
core/winmad/kernel/wm_driver.c<BR>===================================================================<BR>--- 
core/winmad/kernel/wm_driver.c (revision 2055)<BR>+++ 
core/winmad/kernel/wm_driver.c (working copy)<BR>@@ -233,7 +233,7 
@@<BR> <BR>  size = 0;<BR>  ib_status = 
pDevice->VerbsInterface.Verbs.<BR>-    query_ca(pDevice->VerbsInterface.p_hca_obj, 
NULL, &size, 
NULL);<BR>+    query_ca(pDevice->VerbsInterface.Verbs.p_hca_obj, 
NULL, &size, NULL);<BR>  if (ib_status != IB_INSUFFICIENT_MEMORY) 
{<BR>   attr = NULL;<BR>   goto out;<BR>@@ -245,7 
+245,7 @@<BR>  }<BR> <BR>  ib_status = 
pDevice->VerbsInterface.Verbs.<BR>-    query_ca(pDevice->VerbsInterface.p_hca_obj, 
attr, &size, 
NULL);<BR>+    query_ca(pDevice->VerbsInterface.Verbs.p_hca_obj, 
attr, &size, NULL);<BR>  if (ib_status != IB_SUCCESS) 
{<BR>   ExFreePool(attr);<BR>   attr = 
NULL;<BR>Index: 
core/winverbs/kernel/wv_driver.c<BR>===================================================================<BR>--- 
core/winverbs/kernel/wv_driver.c (revision 2055)<BR>+++ 
core/winverbs/kernel/wv_driver.c (working copy)<BR>@@ -477,7 +477,7 
@@<BR>  if (!NT_SUCCESS(status)) {<BR>   return 
status;<BR>  }<BR>- dev->hDevice = 
dev->Interface.p_hca_obj;<BR>+ dev->hDevice = 
dev->Interface.Verbs.p_hca_obj;<BR> <BR>  KeAcquireGuardedMutex(&Lock);<BR>  create 
= IsListEmpty(&DevList);<BR>Index: 
hw/mlx4/kernel/hca/drv.c<BR>===================================================================<BR>--- 
hw/mlx4/kernel/hca/drv.c (revision 2055)<BR>+++ 
hw/mlx4/kernel/hca/drv.c (working copy)<BR>@@ -282,8 +102,7 
@@<BR> <BR>  setup_ci_interface( p_fdo->hca.guid, 
!!hca_is_livefish(p_fdo), pIfc );<BR> <BR>- pIfc->p_hca_dev = 
WdfDeviceWdmGetPhysicalDevice(p_fdo->FdoDevice);<BR>- ASSERT(pIfc->p_hca_dev);<BR>+ pIfc->p_hca_obj 
= &p_fdo->hca;<BR>  pIfc->vend_id = 
(uint32_t)p_fdo->bus_ib_ifc.pdev->ven_id;<BR>  pIfc->dev_id = 
(uint16_t)p_fdo->bus_ib_ifc.pdev->dev_id;<BR>  pIfc->dev_revision 
= (uint16_t)p_fdo->hca.hw_ver;<BR>@@ -1215,8 +868,7 
@@<BR> <BR>  setup_ci_interface( p_fdo->hca.guid, 
!!hca_is_livefish(p_fdo), pIfc );<BR> <BR>- pIfc->p_hca_dev = 
p_fdo->cl_ext.p_pdo;<BR>- ASSERT(pIfc->p_hca_dev);    
<BR>+ pIfc->p_hca_obj = 
&p_fdo->hca;<BR>  pIfc->vend_id = 
(uint32_t)p_fdo->bus_ib_ifc.pdev->ven_id;<BR>  pIfc->dev_id = 
(uint16_t)p_fdo->bus_ib_ifc.pdev->dev_id;<BR>  pIfc->dev_revision 
= (uint16_t)p_fdo->hca.hw_ver;<BR>@@ -1641,7 +1293,6 
@@<BR>  p_ifc->InterfaceHeader.InterfaceReference = 
__ref_ifc;<BR>  p_ifc->InterfaceHeader.InterfaceDereference = 
__deref_ifc;<BR>  p_ifc->Verbs = 
*p_hca_ifc;<BR>- p_ifc->p_hca_obj = 
&p_fdo->hca;<BR> <BR>  /* take the reference before 
returning. */<BR>  __ref_ifc( p_dev_obj );<BR>Index: 
hw/mthca/kernel/hca_pnp.c<BR>===================================================================<BR>--- 
hw/mthca/kernel/hca_pnp.c (revision 2055)<BR>+++ 
hw/mthca/kernel/hca_pnp.c (working copy)<BR>@@ -242,7 +242,7 
@@<BR>   !!mthca_is_livefish(p_ext->hca.mdev),<BR>   pIfc 
);<BR> <BR>- pIfc->p_hca_dev = 
p_ext->cl_ext.p_pdo;<BR>+ pIfc->p_hca_obj = 
&p_ext->hca.hob;<BR>  pIfc->vend_id = 
(uint32_t)p_ext->hcaConfig.VendorID;<BR>  pIfc->dev_id = 
(uint16_t)p_ext->hcaConfig.DeviceID;<BR>  pIfc->dev_revision = 
(uint16_t)p_ext->hca.hw_ver;<BR>@@ -877,7 +877,6 
@@<BR>  p_ifc->InterfaceHeader.InterfaceReference = 
__ref_ifc;<BR>  p_ifc->InterfaceHeader.InterfaceDereference = 
__deref_ifc;<BR>  p_ifc->Verbs = 
*p_hca_ifc;<BR>- p_ifc->p_hca_obj = 
&p_ext->hca.hob;<BR> <BR>  /* take the reference before 
returning. */<BR>  __ref_ifc( p_dev_obj );<BR>Index: 
inc/iba/ib_ci.h<BR>===================================================================<BR>--- 
inc/iba/ib_ci.h (revision 2055)<BR>+++ inc/iba/ib_ci.h (working 
copy)<BR>@@ -2793,10 +2793,10 
@@<BR>  net64_t    guid;<BR> <BR>  /*<BR>-  
* Device object of the HCA.  In Windows, this is a pointer to the 
PDO<BR>-  * for the HCA device.<BR>+  * Handle, returned by open_ca 
function of HCA upper interface (ci_interface_t)<BR>+  * It has 
ib_ca_handle_t type<BR>   
*/<BR>- void    *p_hca_dev;<BR>+ void    *p_hca_obj;<BR> <BR>  /*<BR>   
* Vendor ID, Device ID, Device Revision of the HCA<BR>@@ -2936,7 +2936,9 
@@<BR> */<BR> AL_EXPORT ib_api_status_t<BR> ib_register_ca 
(<BR>- IN  const ci_interface_t    *p_ci 
);<BR>+ IN  const ci_interface_t*    p_ci,<BR>+ IN  const PDEVICE_OBJECT    p_hca_dev<BR>+ );<BR> /*<BR> * 
DESCRIPTION<BR> * This routine is called by a HCA kernel mode driver 
to inform the<BR>@@ -2950,6 +2952,8 
@@<BR> * p_ci<BR> *  [in] Pointer to the ci_interface_t 
structure that has the function<BR> *  vector to support verbs 
functionality.<BR>+* p_hca_dev<BR>+*  PDO of HCA 
device<BR> *<BR> * RETURN VALUE<BR> * IB_SUCCESS<BR>Index: 
inc/kernel/iba/ib_ci_ifc.h<BR>===================================================================<BR>--- 
inc/kernel/iba/ib_ci_ifc.h (revision 2055)<BR>+++ 
inc/kernel/iba/ib_ci_ifc.h (working copy)<BR>@@ -49,13 +49,15 
@@<BR> *********/<BR> <BR> <BR>-#define 
IB_CI_INTERFACE_VERSION  (4)<BR>+#define 
IB_CI_INTERFACE_VERSION  (5)<BR> <BR> <BR> /* Function 
type for ib_register_ca.  Match the definition in ib_ci.h 
*/<BR> typedef 
ib_api_status_t<BR> (*ib_pfn_register_ca_t)(<BR>- IN  const ci_interface_t* 
const  p_ci );<BR>+ IN  const ci_interface_t* 
const  p_ci,<BR>+ IN  const PDEVICE_OBJECT    p_hca_dev<BR>+ );<BR> <BR> <BR> /* 
Function type for ib_deregister_ca.  Matches the definition in ib_ci.h 
*/<BR>Index: 
inc/kernel/rdma/verbs.h<BR>===================================================================<BR>--- 
inc/kernel/rdma/verbs.h (revision 2055)<BR>+++ 
inc/kernel/rdma/verbs.h (working copy)<BR>@@ -57,7 +57,6 
@@<BR> {<BR>  INTERFACE  InterfaceHeader;<BR>  ci_interface_t Verbs;<BR>- void 
*   p_hca_obj;<BR> <BR> } RDMA_INTERFACE_VERBS;<BR> <BR></FONT></DIV></BODY></HTML>