[IBBUS] remove overzealous and redundant use of __FUNCTION__ in debug prints; get...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 15 Sep 2008 17:54:03 +0000 (17:54 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 15 Sep 2008 17:54:03 +0000 (17:54 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1601 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/bus/kernel/bus_driver.c
core/bus/kernel/bus_iou_mgr.c
core/bus/kernel/bus_pnp.c
core/bus/kernel/bus_port_mgr.c

index addc2f9..bf261b0 100644 (file)
@@ -490,7 +490,7 @@ __read_registry(
        if( g_al_dbg_flags & AL_DBG_ERR )\r
                g_al_dbg_flags |= CL_DBG_ERROR;\r
 \r
        if( g_al_dbg_flags & AL_DBG_ERR )\r
                g_al_dbg_flags |= CL_DBG_ERROR;\r
 \r
-       //bus_globals.dbg_lvl |= BUS_DBG_DRV | BUS_DBG_PNP;\r
+       bus_globals.dbg_lvl |= BUS_DBG_DRV | BUS_DBG_PNP;\r
 #endif\r
 \r
        BUS_TRACE(BUS_DBG_DRV ,\r
 #endif\r
 \r
        BUS_TRACE(BUS_DBG_DRV ,\r
index 96605d9..5811dec 100644 (file)
@@ -363,14 +363,13 @@ destroying_iou_mgr(
        CL_ASSERT( p_obj );\r
        p_bfi = get_bfi_by_obj( BFI_IOU_MGR_OBJ, p_obj );\r
        if (p_bfi == NULL) {\r
        CL_ASSERT( p_obj );\r
        p_bfi = get_bfi_by_obj( BFI_IOU_MGR_OBJ, p_obj );\r
        if (p_bfi == NULL) {\r
-               BUS_PRINT(BUS_DBG_PNP, ("%s() failed to find p_bfi by obj %p?\n",\r
-                       __FUNCTION__,p_obj));\r
+               BUS_PRINT(BUS_DBG_PNP, ("Failed to find p_bfi by obj %p?\n", p_obj));\r
                return;\r
        }\r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
                return;\r
        }\r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
-       BUS_PRINT(BUS_DBG_PNP, ("%s(%s) obj %p port_mgr %p\n",\r
-                       __FUNCTION__, p_bfi->whoami, p_obj, gp_iou_mgr));\r
+       BUS_PRINT(BUS_DBG_PNP, ("%s obj %p port_mgr %p\n",\r
+                                                       p_bfi->whoami, p_obj, gp_iou_mgr));\r
 \r
        CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj, iou_mgr_t, obj ) );\r
 \r
 \r
        CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj, iou_mgr_t, obj ) );\r
 \r
@@ -404,8 +403,7 @@ free_iou_mgr(
        CL_ASSERT( p_obj );\r
        p_bfi = get_bfi_by_obj( BFI_IOU_MGR_OBJ, p_obj );\r
        if ( p_bfi == NULL ) {\r
        CL_ASSERT( p_obj );\r
        p_bfi = get_bfi_by_obj( BFI_IOU_MGR_OBJ, p_obj );\r
        if ( p_bfi == NULL ) {\r
-               BUS_PRINT( BUS_DBG_PNP, ("%s: unable to get p_bfi iou_obj %p?\n",\r
-                                       __FUNCTION__,p_obj) );\r
+               BUS_PRINT( BUS_DBG_PNP, ("Unable to get p_bfi iou_obj %p?\n", p_obj) );\r
                return;\r
        }\r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
                return;\r
        }\r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
@@ -416,8 +414,8 @@ free_iou_mgr(
 \r
        CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj, iou_mgr_t, obj ) );\r
 \r
 \r
        CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj, iou_mgr_t, obj ) );\r
 \r
-       BUS_PRINT( BUS_DBG_PNP, ("%s(%s) Mark all IOU PDOs as no longer present\n",\r
-                               __FUNCTION__, p_bfi->whoami));\r
+       BUS_PRINT( BUS_DBG_PNP, ("%s Mark all IOU PDOs as no longer present\n",\r
+                                                               p_bfi->whoami));\r
        /*\r
         * Mark all IOU PDOs as no longer present.  This will cause them\r
         * to be removed when they process the IRP_MN_REMOVE_DEVICE.\r
        /*\r
         * Mark all IOU PDOs as no longer present.  This will cause them\r
         * to be removed when they process the IRP_MN_REMOVE_DEVICE.\r
@@ -450,8 +448,8 @@ free_iou_mgr(
                                        p_bfi->whoami, p_ext->cl_ext.vfptr_pnp_po->identity,\r
                                        p_ext->cl_ext.p_self_do, p_ext ) );\r
 \r
                                        p_bfi->whoami, p_ext->cl_ext.vfptr_pnp_po->identity,\r
                                        p_ext->cl_ext.p_self_do, p_ext ) );\r
 \r
-               BUS_TRACE( BUS_DBG_PNP,("%s(%s) p_ext->h_ca->obj.state %d ref_cnt %d\n",\r
-                                       __FUNCTION__, p_bfi->whoami,\r
+               BUS_TRACE( BUS_DBG_PNP,("%s p_ext->h_ca->obj.state %d ref_cnt %d\n",\r
+                                       p_bfi->whoami,\r
                                        p_ext->h_ca->obj.state,\r
                                        p_ext->h_ca->obj.ref_cnt));\r
 \r
                                        p_ext->h_ca->obj.state,\r
                                        p_ext->h_ca->obj.ref_cnt));\r
 \r
@@ -538,8 +536,8 @@ iou_mgr_pnp_cb(
                break;\r
 \r
        default:\r
                break;\r
 \r
        default:\r
-               BUS_PRINT( BUS_DBG_PNP, ("%s() Unhandled PNP Event %s\n",\r
-                                       __FUNCTION__, ib_get_pnp_event_str(p_pnp_rec->pnp_event) ));\r
+               BUS_PRINT( BUS_DBG_PNP, ("Unhandled PNP Event %s\n",\r
+                                       ib_get_pnp_event_str(p_pnp_rec->pnp_event) ));\r
                break;\r
        }\r
        BUS_EXIT( BUS_DBG_PNP );\r
                break;\r
        }\r
        BUS_EXIT( BUS_DBG_PNP );\r
@@ -562,7 +560,7 @@ iou_mgr_get_bus_relations(
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
-       BUS_PRINT(BUS_DBG_PNP, ("%s() ca_guid %I64x\n",__FUNCTION__,ca_guid));\r
+       BUS_PRINT(BUS_DBG_PNP, ("CA_guid %I64x\n",ca_guid));\r
 \r
        /* special case guid == 0 - walk all bus filter instances */\r
        if ( ca_guid == 0ULL ) {\r
 \r
        /* special case guid == 0 - walk all bus filter instances */\r
        if ( ca_guid == 0ULL ) {\r
@@ -576,8 +574,7 @@ iou_mgr_get_bus_relations(
                }\r
                p_rel = (DEVICE_RELATIONS*)p_irp->IoStatus.Information;\r
                if ( p_rel ) {\r
                }\r
                p_rel = (DEVICE_RELATIONS*)p_irp->IoStatus.Information;\r
                if ( p_rel ) {\r
-                       BUS_PRINT(BUS_DBG_PNP, ("%s() ca_guid 0 Reports %d\n",\r
-                                               __FUNCTION__,p_rel->Count));\r
+                       BUS_PRINT(BUS_DBG_PNP, ("CA_guid 0 Reports %d\n", p_rel->Count));\r
                }\r
                BUS_EXIT( BUS_DBG_PNP );\r
                return STATUS_SUCCESS;\r
                }\r
                BUS_EXIT( BUS_DBG_PNP );\r
                return STATUS_SUCCESS;\r
@@ -585,15 +582,14 @@ iou_mgr_get_bus_relations(
 \r
        p_bfi = get_bfi_by_ca_guid(ca_guid);\r
        if (p_bfi == NULL) {\r
 \r
        p_bfi = get_bfi_by_ca_guid(ca_guid);\r
        if (p_bfi == NULL) {\r
-               BUS_PRINT(BUS_DBG_PNP,\r
-                       ("%s() Null p_bfi from ca_guid %I64x ?\n",__FUNCTION__,ca_guid));\r
-               BUS_EXIT( BUS_DBG_PNP );\r
+               BUS_TRACE_EXIT(BUS_DBG_PNP,\r
+                                                               ("NULL p_bfi from ca_guid %I64x ?\n",ca_guid));\r
                return STATUS_UNSUCCESSFUL;\r
        }\r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
                return STATUS_UNSUCCESSFUL;\r
        }\r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
-       BUS_PRINT(BUS_DBG_PNP, ("%s(%s) for ca_guid %I64x iou_mgr %p\n",\r
-                               __FUNCTION__, p_bfi->whoami, ca_guid, gp_iou_mgr) );\r
+       BUS_PRINT(BUS_DBG_PNP, ("%s for ca_guid %I64x iou_mgr %p\n",\r
+                                                       p_bfi->whoami, ca_guid, gp_iou_mgr) );\r
        if (!gp_iou_mgr)\r
                return STATUS_NO_SUCH_DEVICE;\r
 \r
        if (!gp_iou_mgr)\r
                return STATUS_NO_SUCH_DEVICE;\r
 \r
@@ -704,8 +700,8 @@ iou_mgr_iou_add(
 \r
        p_bfi = get_set_bfi_by_ca_guid( p_pnp_rec->ca_guid );\r
        if ( !p_bfi ) {\r
 \r
        p_bfi = get_set_bfi_by_ca_guid( p_pnp_rec->ca_guid );\r
        if ( !p_bfi ) {\r
-               BUS_TRACE_EXIT( BUS_DBG_PNP,("%s() NULL p_bfi? ca_guid 0x%I64x\n",\r
-                                                                       __FUNCTION__, p_pnp_rec->ca_guid ) );\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP,("NULL p_bfi? ca_guid 0x%I64x\n",\r
+                                                                       p_pnp_rec->ca_guid ) );\r
                return IB_ERROR;\r
        }\r
 \r
                return IB_ERROR;\r
        }\r
 \r
@@ -717,9 +713,9 @@ iou_mgr_iou_add(
                p_ctx = cl_zalloc( sizeof(*p_ctx) );\r
                if( !p_ctx )\r
                {\r
                p_ctx = cl_zalloc( sizeof(*p_ctx) );\r
                if( !p_ctx )\r
                {\r
-                       BUS_TRACE_EXIT(BUS_DBG_PNP, ("%s(%s) ca_guid %I64x iou_guid(%I64x) "\r
-                                       "BAD alloc for PNP context\n", __FUNCTION__,\r
-                                       p_bfi->whoami, p_bfi->ca_guid, p_pnp_rec->guid ));\r
+                       BUS_TRACE_EXIT(BUS_DBG_PNP, ("%s ca_guid %I64x iou_guid(%I64x) "\r
+                                       "BAD alloc for PNP context\n", p_bfi->whoami,\r
+                                       p_bfi->ca_guid, p_pnp_rec->guid ));\r
 \r
                        return IB_ERROR;\r
                }\r
 \r
                        return IB_ERROR;\r
                }\r
@@ -727,9 +723,8 @@ iou_mgr_iou_add(
                p_pnp_rec->pnp_rec.context = p_ctx;\r
 \r
                BUS_PRINT(BUS_DBG_PNP,\r
                p_pnp_rec->pnp_rec.context = p_ctx;\r
 \r
                BUS_PRINT(BUS_DBG_PNP,\r
-                                       ("%s(%s) ca_guid %I64x iou_guid(%I64x) ALLOC p_ctx @ %p\n",\r
-                                       __FUNCTION__, p_bfi->whoami, p_bfi->ca_guid, \r
-                                       p_pnp_rec->guid,p_ctx));\r
+                                       ("%s ca_guid %I64x iou_guid(%I64x) ALLOC p_ctx @ %p\n",\r
+                                       p_bfi->whoami, p_bfi->ca_guid, p_pnp_rec->guid,p_ctx));\r
        }\r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
        }\r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
@@ -846,8 +841,8 @@ iou_mgr_iou_remove(
        p_bfi = p_ctx->p_bus_filter;\r
        CL_ASSERT( p_bfi );\r
 \r
        p_bfi = p_ctx->p_bus_filter;\r
        CL_ASSERT( p_bfi );\r
 \r
-       BUS_PRINT(BUS_DBG_PNP,("%s(%s) ca_guid 0x%I64x iou_mgr %p\n",\r
-                               __FUNCTION__, p_bfi->whoami, p_bfi->ca_guid, p_bfi->p_iou_mgr));\r
+       BUS_PRINT(BUS_DBG_PNP,("%s ca_guid 0x%I64x iou_mgr %p\n",\r
+                               p_bfi->whoami, p_bfi->ca_guid, p_bfi->p_iou_mgr));\r
 \r
        /* fdo_release_resources() has destroyed the IOU mgr, all that needs to be\r
         * done is cleanup the PNP IOU context; one per port.\r
 \r
        /* fdo_release_resources() has destroyed the IOU mgr, all that needs to be\r
         * done is cleanup the PNP IOU context; one per port.\r
@@ -869,9 +864,8 @@ iou_mgr_iou_remove(
 \r
        if (p_bfi != p_ext->p_parent_ext->bus_filter) {\r
                BUS_PRINT(BUS_DBG_PNP,\r
 \r
        if (p_bfi != p_ext->p_parent_ext->bus_filter) {\r
                BUS_PRINT(BUS_DBG_PNP,\r
-                       ("%s() p_bfi(%p) != p_ext->bus_filter(%p) line %d file %s\n",\r
-                       __FUNCTION__,p_bfi,p_ext->p_parent_ext->bus_filter,\r
-                       __LINE__,__FILE__));\r
+                       ("p_bfi(%p) != p_ext->bus_filter(%p) line %d file %s\n",\r
+                       p_bfi,p_ext->p_parent_ext->bus_filter, __LINE__,__FILE__));\r
                CL_ASSERT (p_bfi == p_ext->p_parent_ext->bus_filter);\r
        }\r
 \r
                CL_ASSERT (p_bfi == p_ext->p_parent_ext->bus_filter);\r
        }\r
 \r
@@ -884,8 +878,7 @@ iou_mgr_iou_remove(
        cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
        if ( !p_ext->h_ca )\r
        {\r
        cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
        if ( !p_ext->h_ca )\r
        {\r
-               BUS_TRACE_EXIT( BUS_DBG_PNP, ("%s() NULL h_ca? p_ext %p\n",\r
-                                       __FUNCTION__, p_ext ) );\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP, ("NULL h_ca? p_ext %p\n", p_ext ) );\r
                return;\r
        }\r
 \r
                return;\r
        }\r
 \r
index af842ee..0c2fc9e 100644 (file)
@@ -289,15 +289,13 @@ bus_add_device(
        }\r
 \r
 adxit:\r
        }\r
 \r
 adxit:\r
-       BUS_PRINT( BUS_DBG_PNP, ("%s(%s) exit status 0\n",\r
-                               __FUNCTION__, p_bfi->whoami) );\r
+       BUS_PRINT( BUS_DBG_PNP, ("%s exit status 0\n", p_bfi->whoami) );\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
        return STATUS_SUCCESS;\r
 \r
 bail:\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
        return STATUS_SUCCESS;\r
 \r
 bail:\r
-       BUS_PRINT( BUS_DBG_PNP, ("%s(%s) exit status 0x%x\n",\r
-                                                               __FUNCTION__,p_bfi->whoami,status) );\r
+       BUS_PRINT( BUS_DBG_PNP, ("%s exit status 0x%x\n", p_bfi->whoami,status) );\r
        ic = free_bfi(p_bfi);\r
        /* if last Bus filter, then cleanup */\r
        if ( ic == 0 )\r
        ic = free_bfi(p_bfi);\r
        /* if last Bus filter, then cleanup */\r
        if ( ic == 0 )\r
@@ -379,7 +377,7 @@ fdo_start(
        }\r
 \r
        BUS_PRINT(BUS_DBG_PNP,\r
        }\r
 \r
        BUS_PRINT(BUS_DBG_PNP,\r
-                               ("%s() %s exit %x\n",__FUNCTION__,p_bfi->whoami,status));\r
+                               ("%s exit %x\n",p_bfi->whoami,status));\r
        BUS_EXIT( BUS_DBG_PNP );\r
 \r
        return status;\r
        BUS_EXIT( BUS_DBG_PNP );\r
 \r
        return status;\r
@@ -399,10 +397,13 @@ fdo_query_remove(
 \r
        p_ext = p_dev_obj->DeviceExtension;\r
 \r
 \r
        p_ext = p_dev_obj->DeviceExtension;\r
 \r
+       CL_ASSERT(p_ext->bus_filter);\r
        BUS_PRINT( BUS_DBG_PNP,\r
        BUS_PRINT( BUS_DBG_PNP,\r
-               ("%s() IRP_MN_QUERY_REMOVE_DEVICE %s @ %p refs CI %d AL %d\n", \r
-               __FUNCTION__, p_ext->cl_ext.vfptr_pnp_po->identity, p_ext,\r
-               p_ext->n_ci_ifc_ref,p_ext->n_al_ifc_ref ) );\r
+               ("IRP_MN_QUERY_REMOVE_DEVICE %s @ FDO %p refs(CI %d AL %d)\n"\r
+               "   %s CA %I64x\n", \r
+               p_ext->cl_ext.vfptr_pnp_po->identity, p_ext, p_ext->n_ci_ifc_ref,\r
+               p_ext->n_al_ifc_ref,\r
+               p_ext->bus_filter->whoami, p_ext->bus_filter->ca_guid) );\r
 \r
        if( p_ext->n_ci_ifc_ref )\r
        {\r
 \r
        if( p_ext->n_ci_ifc_ref )\r
        {\r
@@ -473,8 +474,7 @@ fdo_release_resources(
        if ( p_ext->p_iou_mgr && p_bfi->p_iou_mgr )\r
                cl_obj_destroy( &p_ext->p_iou_mgr->obj );\r
 \r
        if ( p_ext->p_iou_mgr && p_bfi->p_iou_mgr )\r
                cl_obj_destroy( &p_ext->p_iou_mgr->obj );\r
 \r
-       BUS_PRINT( BUS_DBG_PNP, ("%s() Releasing BusFilter %s\n",\r
-                                                       __FUNCTION__, p_bfi->whoami ));\r
+       BUS_PRINT( BUS_DBG_PNP, ("Releasing BusFilter %s\n", p_bfi->whoami ));\r
        if (p_bfi) {\r
                p_ext->bus_filter = NULL;\r
                p_bfi->p_bus_ext = NULL;\r
        if (p_bfi) {\r
                p_ext->bus_filter = NULL;\r
                p_bfi->p_bus_ext = NULL;\r
@@ -484,8 +484,7 @@ fdo_release_resources(
 \r
        /* if not last Buf Filter Instance, then exit, otherwise cleanup/shutdown */\r
        if ( ic > 0 ) {\r
 \r
        /* if not last Buf Filter Instance, then exit, otherwise cleanup/shutdown */\r
        if ( ic > 0 ) {\r
-               BUS_PRINT( BUS_DBG_PNP, ("%s() %d remaining BusFilters\n",\r
-                                               __FUNCTION__, ic ));\r
+               BUS_PRINT( BUS_DBG_PNP, (" %d remaining BusFilters\n", ic ));\r
                return;\r
        }\r
 \r
                return;\r
        }\r
 \r
@@ -563,7 +562,7 @@ fdo_query_bus_relations(
        {\r
                /* BFI has already been released */\r
                *p_action = IrpComplete;\r
        {\r
                /* BFI has already been released */\r
                *p_action = IrpComplete;\r
-               BUS_TRACE_EXIT( BUS_DBG_PNP, ("%s() NULL BFI\n", __FUNCTION__) );\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP, ("NULL BFI\n") );\r
                return STATUS_SUCCESS;\r
        }\r
 \r
                return STATUS_SUCCESS;\r
        }\r
 \r
@@ -576,6 +575,8 @@ fdo_query_bus_relations(
                 * relations yet.\r
                 */\r
                status = STATUS_SUCCESS;\r
                 * relations yet.\r
                 */\r
                status = STATUS_SUCCESS;\r
+               BUS_PRINT(BUS_DBG_PNP, ("%s ca_guid %I64x\n",p_bfi->whoami,\r
+                                                               p_bfi->ca_guid));\r
        }\r
        else\r
        {\r
        }\r
        else\r
        {\r
@@ -640,6 +641,11 @@ al_deref_ifc(
        cl_atomic_dec( &p_ext->n_al_ifc_ref );\r
        ObDereferenceObject( p_dev_obj );\r
 \r
        cl_atomic_dec( &p_ext->n_al_ifc_ref );\r
        ObDereferenceObject( p_dev_obj );\r
 \r
+       CL_ASSERT(p_ext->bus_filter);\r
+       BUS_PRINT( BUS_DBG_PNP, ("%s CA_guid %I64x al_ifc_ref %d\n",\r
+                                       p_ext->bus_filter->whoami, p_ext->bus_filter->ca_guid,\r
+                                       p_ext->n_al_ifc_ref) );\r
+\r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
 \r
@@ -674,6 +680,11 @@ al_deref_ci_ifc(
        cl_atomic_dec( &p_ext->n_ci_ifc_ref );\r
        ObDereferenceObject( p_dev_obj );\r
 \r
        cl_atomic_dec( &p_ext->n_ci_ifc_ref );\r
        ObDereferenceObject( p_dev_obj );\r
 \r
+       CL_ASSERT(p_ext->bus_filter);\r
+       BUS_PRINT( BUS_DBG_PNP, ("%s CA_guid %I64x ci_ifc_ref %d\n",\r
+                                               p_ext->bus_filter->whoami, p_ext->bus_filter->ca_guid,\r
+                                               p_ext->n_ci_ifc_ref) );\r
+\r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
 \r
@@ -837,10 +848,11 @@ __get_relations(
        IN              const   net64_t                                         ca_guid,\r
        IN                              IRP* const                                      p_irp )\r
 {\r
        IN              const   net64_t                                         ca_guid,\r
        IN                              IRP* const                                      p_irp )\r
 {\r
-       BUS_ENTER( BUS_DBG_PNP );\r
        UNUSED_PARAM( ca_guid );\r
        UNUSED_PARAM( p_irp );\r
 \r
        UNUSED_PARAM( ca_guid );\r
        UNUSED_PARAM( p_irp );\r
 \r
+       BUS_ENTER( BUS_DBG_PNP );\r
+\r
        /*\r
         * Now that ibbus is in the same device stack as the HCA driver, skip\r
         * returning relations here as ibbus has already done the deed.\r
        /*\r
         * Now that ibbus is in the same device stack as the HCA driver, skip\r
         * returning relations here as ibbus has already done the deed.\r
@@ -1175,11 +1187,11 @@ bus_get_relations(
 \r
        if( !n_devs )\r
        {\r
 \r
        if( !n_devs )\r
        {\r
-               BUS_EXIT( BUS_DBG_PNP );\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP, ("Found 0 PDOs ca_guid %I64x\n", ca_guid));\r
                return STATUS_NO_SUCH_DEVICE;\r
        }\r
 \r
                return STATUS_NO_SUCH_DEVICE;\r
        }\r
 \r
-       BUS_TRACE( BUS_DBG_PNP, ("Found %d PDOs .\n", n_devs ));\r
+       BUS_TRACE( BUS_DBG_PNP, ("Found %d PDOs ca_guid %I64x\n", n_devs, ca_guid));\r
 \r
        /* Add space for our child IOUs. */\r
        status = cl_alloc_relations( p_irp, n_devs );\r
 \r
        /* Add space for our child IOUs. */\r
        status = cl_alloc_relations( p_irp, n_devs );\r
@@ -1305,11 +1317,13 @@ get_bfi_by_ca_guid( IN net64_t ca_guid )
        }\r
        ExReleaseFastMutexUnsafe(&ControlMutex);\r
 \r
        }\r
        ExReleaseFastMutexUnsafe(&ControlMutex);\r
 \r
-       BUS_PRINT( BUS_DBG_PNP,\r
-                               ("%s() guid 0x%I64x -> bfi[%d] %p\n",\r
-                               __FUNCTION__, ca_guid,\r
-                               (matched ? (matched - bus_filters) : (-1)), matched ) );\r
-\r
+#if DBG\r
+       if ( !matched )\r
+       {\r
+               BUS_PRINT( BUS_DBG_PNP, ("No Match ca_guid 0x%I64x -> bfi[%d] %p\n",\r
+                                                                       ca_guid, -1, matched ) );\r
+       }\r
+#endif\r
        return matched;\r
 }\r
 \r
        return matched;\r
 }\r
 \r
index bd8fab3..11cf6ae 100644 (file)
@@ -363,15 +363,13 @@ destroying_port_mgr(
        CL_ASSERT( p_obj );\r
        p_bfi = get_bfi_by_obj(BFI_PORT_MGR_OBJ, p_obj);\r
        if (p_bfi == NULL) {\r
        CL_ASSERT( p_obj );\r
        p_bfi = get_bfi_by_obj(BFI_PORT_MGR_OBJ, p_obj);\r
        if (p_bfi == NULL) {\r
-               BUS_PRINT(BUS_DBG_PNP, ("%s() failed to find p_bfi by obj %p?\n",\r
-                       __FUNCTION__,p_obj));\r
+               BUS_PRINT(BUS_DBG_PNP, ("Failed to find p_bfi by obj %p?\n", p_obj));\r
                return;\r
        }\r
        gp_port_mgr = p_bfi->p_port_mgr;\r
 \r
                return;\r
        }\r
        gp_port_mgr = p_bfi->p_port_mgr;\r
 \r
-       BUS_PRINT(BUS_DBG_PNP, ("%s(%s) obj %p port_mgr %p port_mgr_obj %p\n",\r
-                       __FUNCTION__,p_bfi->whoami,p_obj,gp_port_mgr,\r
-                       p_bfi->p_port_mgr_obj) );\r
+       BUS_PRINT(BUS_DBG_PNP, ("%s obj %p port_mgr %p port_mgr_obj %p\n",\r
+                       p_bfi->whoami,p_obj,gp_port_mgr, p_bfi->p_port_mgr_obj) );\r
 \r
        CL_ASSERT( (void*)p_bfi->p_port_mgr == (void*)p_bfi->p_port_mgr_obj );\r
        CL_ASSERT( gp_port_mgr == PARENT_STRUCT( p_obj, port_mgr_t, obj ) );\r
 \r
        CL_ASSERT( (void*)p_bfi->p_port_mgr == (void*)p_bfi->p_port_mgr_obj );\r
        CL_ASSERT( gp_port_mgr == PARENT_STRUCT( p_obj, port_mgr_t, obj ) );\r
@@ -405,8 +403,7 @@ free_port_mgr(
        CL_ASSERT( p_obj );\r
        p_bfi = get_bfi_by_obj(BFI_PORT_MGR_OBJ, p_obj);\r
        if (p_bfi == NULL) {\r
        CL_ASSERT( p_obj );\r
        p_bfi = get_bfi_by_obj(BFI_PORT_MGR_OBJ, p_obj);\r
        if (p_bfi == NULL) {\r
-               BUS_PRINT(BUS_DBG_PNP, ("%s: unable to get p_bfi for port obj %p?\n",\r
-                       __FUNCTION__,p_obj));\r
+               BUS_PRINT(BUS_DBG_PNP, ("No p_bfi for port obj %p?\n", p_obj));\r
                return;\r
        }\r
        gp_port_mgr = p_bfi->p_port_mgr;\r
                return;\r
        }\r
        gp_port_mgr = p_bfi->p_port_mgr;\r
@@ -416,13 +413,12 @@ free_port_mgr(
        }\r
        CL_ASSERT( gp_port_mgr == PARENT_STRUCT( p_obj, port_mgr_t, obj ) );\r
 \r
        }\r
        CL_ASSERT( gp_port_mgr == PARENT_STRUCT( p_obj, port_mgr_t, obj ) );\r
 \r
-       BUS_PRINT(BUS_DBG_PNP, ("%s(%s) obj %p port_mgr %p port_mgr_obj %p\n",\r
-                       __FUNCTION__, p_bfi->whoami, p_obj,gp_port_mgr,\r
+       BUS_PRINT(BUS_DBG_PNP, ("%s obj %p port_mgr %p port_mgr_obj %p\n",\r
+                       p_bfi->whoami, p_obj,gp_port_mgr,\r
                        p_bfi->p_port_mgr_obj) );\r
 \r
        BUS_PRINT( BUS_DBG_PNP,\r
                        p_bfi->p_port_mgr_obj) );\r
 \r
        BUS_PRINT( BUS_DBG_PNP,\r
-                               ("%s(%s) Mark all IPoIB PDOs as no longer present\n",\r
-                               __FUNCTION__, p_bfi->whoami));\r
+                               ("%s Mark all IPoIB PDOs no longer present\n", p_bfi->whoami));\r
        /*\r
         * Mark all IPoIB PDOs as no longer present.  This will cause them\r
         * to be removed when they process the IRP_MN_REMOVE_DEVICE.\r
        /*\r
         * Mark all IPoIB PDOs as no longer present.  This will cause them\r
         * to be removed when they process the IRP_MN_REMOVE_DEVICE.\r
@@ -539,8 +535,8 @@ port_mgr_pnp_cb(
                break;\r
 \r
        default:\r
                break;\r
 \r
        default:\r
-               XBUS_PRINT( BUS_DBG_PNP, ("%s() Unhandled PNP Event %s\n",\r
-                                       __FUNCTION__, ib_get_pnp_event_str(p_pnp_rec->pnp_event) ));\r
+               XBUS_PRINT( BUS_DBG_PNP, ("Unhandled PNP Event %s\n",\r
+                                       ib_get_pnp_event_str(p_pnp_rec->pnp_event) ));\r
                break;\r
        }\r
        BUS_EXIT( BUS_DBG_PNP );\r
                break;\r
        }\r
        BUS_EXIT( BUS_DBG_PNP );\r
@@ -564,25 +560,25 @@ port_mgr_get_bus_relations(
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
-       BUS_PRINT(BUS_DBG_PNP, ("%s() ca_guid %I64x\n",__FUNCTION__,ca_guid));\r
+       BUS_PRINT(BUS_DBG_PNP, ("CA_guid %I64x\n",ca_guid));\r
 \r
        /* special case guid == 0 - walk all bus filter instances */\r
        if ( ca_guid == 0ULL ) {\r
 \r
        /* special case guid == 0 - walk all bus filter instances */\r
        if ( ca_guid == 0ULL ) {\r
+               BUS_PRINT(BUS_DBG_PNP, ("CA_guid 0\n"));\r
                for(p_bfi=bus_filters; p_bfi < &bus_filters[MAX_BUS_FILTERS]; p_bfi++) {\r
                        gp_port_mgr = p_bfi->p_port_mgr;\r
                        if ( !gp_port_mgr )\r
                                continue;\r
                        cl_mutex_acquire( &gp_port_mgr->pdo_mutex );\r
                        status = bus_get_relations( &gp_port_mgr->port_list,\r
                for(p_bfi=bus_filters; p_bfi < &bus_filters[MAX_BUS_FILTERS]; p_bfi++) {\r
                        gp_port_mgr = p_bfi->p_port_mgr;\r
                        if ( !gp_port_mgr )\r
                                continue;\r
                        cl_mutex_acquire( &gp_port_mgr->pdo_mutex );\r
                        status = bus_get_relations( &gp_port_mgr->port_list,\r
-                                                                               ca_guid,\r
+                                                                               p_bfi->ca_guid,\r
                                                                                p_irp );\r
                        cl_mutex_release( &gp_port_mgr->pdo_mutex );\r
                }\r
 \r
                p_rel = (DEVICE_RELATIONS*)p_irp->IoStatus.Information;\r
                if ( p_rel ) {\r
                                                                                p_irp );\r
                        cl_mutex_release( &gp_port_mgr->pdo_mutex );\r
                }\r
 \r
                p_rel = (DEVICE_RELATIONS*)p_irp->IoStatus.Information;\r
                if ( p_rel ) {\r
-                       BUS_PRINT(BUS_DBG_PNP, ("%s() ca_guid 0 Reports %d\n",\r
-                                               __FUNCTION__,p_rel->Count));\r
+                       BUS_PRINT(BUS_DBG_PNP, ("CA_guid 0 Reports %d\n", p_rel->Count));\r
                }\r
                BUS_EXIT( BUS_DBG_PNP );\r
                return STATUS_SUCCESS;\r
                }\r
                BUS_EXIT( BUS_DBG_PNP );\r
                return STATUS_SUCCESS;\r
@@ -591,14 +587,14 @@ port_mgr_get_bus_relations(
        p_bfi = get_bfi_by_ca_guid(ca_guid);\r
        if (p_bfi == NULL) {\r
                BUS_PRINT(BUS_DBG_PNP,\r
        p_bfi = get_bfi_by_ca_guid(ca_guid);\r
        if (p_bfi == NULL) {\r
                BUS_PRINT(BUS_DBG_PNP,\r
-                       ("%s() Null *p_bfi from ca_guid %I64x\n",__FUNCTION__,ca_guid));\r
+                       ("Null *p_bfi from ca_guid %I64x\n",ca_guid));\r
                BUS_EXIT( BUS_DBG_PNP );\r
                return STATUS_NO_SUCH_DEVICE;\r
        }\r
        gp_port_mgr = p_bfi->p_port_mgr;\r
 \r
                BUS_EXIT( BUS_DBG_PNP );\r
                return STATUS_NO_SUCH_DEVICE;\r
        }\r
        gp_port_mgr = p_bfi->p_port_mgr;\r
 \r
-       BUS_PRINT(BUS_DBG_PNP, ("%s(%s) for ca_guid %I64x port_mgr %p\n",\r
-                               __FUNCTION__, p_bfi->whoami, ca_guid, gp_port_mgr) );\r
+       BUS_PRINT(BUS_DBG_PNP, ("%s for ca_guid %I64x port_mgr %p\n",\r
+                                                       p_bfi->whoami, ca_guid, gp_port_mgr) );\r
        if (!gp_port_mgr)\r
                return STATUS_NO_SUCH_DEVICE;\r
 \r
        if (!gp_port_mgr)\r
                return STATUS_NO_SUCH_DEVICE;\r
 \r
@@ -780,8 +776,8 @@ port_mgr_port_add(
 \r
        p_bfi = get_set_bfi_by_ca_guid( p_pnp_rec->p_ca_attr->ca_guid );\r
        if ( !p_bfi ) {\r
 \r
        p_bfi = get_set_bfi_by_ca_guid( p_pnp_rec->p_ca_attr->ca_guid );\r
        if ( !p_bfi ) {\r
-               BUS_TRACE_EXIT( BUS_DBG_PNP,("%s() NULL p_bfi? ca_guid 0x%I64x\n",\r
-                                                               __FUNCTION__, p_pnp_rec->p_ca_attr->ca_guid ) );\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP,("NULL p_bfi? ca_guid 0x%I64x\n",\r
+                                                               p_pnp_rec->p_ca_attr->ca_guid ) );\r
                return IB_ERROR;\r
        }\r
 \r
                return IB_ERROR;\r
        }\r
 \r
@@ -793,8 +789,8 @@ port_mgr_port_add(
                if( !p_ctx )\r
                {\r
                        BUS_TRACE_EXIT(BUS_DBG_PNP,\r
                if( !p_ctx )\r
                {\r
                        BUS_TRACE_EXIT(BUS_DBG_PNP,\r
-                                       ("%s(%s) ca_guid %I64x port(%d) BAD alloc PNP context\n",\r
-                                       __FUNCTION__, p_bfi->whoami, p_bfi->ca_guid, \r
+                                       ("%s ca_guid %I64x port(%d) BAD alloc PNP context\n",\r
+                                       p_bfi->whoami, p_bfi->ca_guid, \r
                                        p_pnp_rec->p_port_attr->port_num));\r
                        return IB_ERROR;\r
                }\r
                                        p_pnp_rec->p_port_attr->port_num));\r
                        return IB_ERROR;\r
                }\r
@@ -803,8 +799,8 @@ port_mgr_port_add(
                p_pnp_rec->pnp_rec.context = p_ctx;\r
 \r
                BUS_PRINT(BUS_DBG_PNP,\r
                p_pnp_rec->pnp_rec.context = p_ctx;\r
 \r
                BUS_PRINT(BUS_DBG_PNP,\r
-                                       ("%s(%s) ca_guid %I64x port %d ALLOC p_ctx @ %p\n",\r
-                                       __FUNCTION__, p_bfi->whoami, p_bfi->ca_guid, \r
+                                       ("%s ca_guid %I64x port %d ALLOC p_ctx @ %p\n",\r
+                                       p_bfi->whoami, p_bfi->ca_guid, \r
                                        p_pnp_rec->p_port_attr->port_num,p_ctx));\r
        }\r
        gp_port_mgr = p_bfi->p_port_mgr;\r
                                        p_pnp_rec->p_port_attr->port_num,p_ctx));\r
        }\r
        gp_port_mgr = p_bfi->p_port_mgr;\r
@@ -1178,8 +1174,8 @@ port_mgr_port_remove(
        p_bfi = p_ctx->p_bus_filter;\r
        CL_ASSERT( p_bfi );\r
 \r
        p_bfi = p_ctx->p_bus_filter;\r
        CL_ASSERT( p_bfi );\r
 \r
-       BUS_PRINT(BUS_DBG_PNP,("%s(%s) ca_guid 0x%I64x port_num %d port_mgr %p\n",\r
-                                               __FUNCTION__, p_bfi->whoami, p_bfi->ca_guid,\r
+       BUS_PRINT(BUS_DBG_PNP,("%s ca_guid 0x%I64x port_num %d port_mgr %p\n",\r
+                                               p_bfi->whoami, p_bfi->ca_guid,\r
                                                p_ctx->port_num, p_bfi->p_port_mgr));\r
 \r
        /* in the process of device remove, port_mgr has been destroyed.\r
                                                p_ctx->port_num, p_bfi->p_port_mgr));\r
 \r
        /* in the process of device remove, port_mgr has been destroyed.\r
@@ -1211,8 +1207,8 @@ port_mgr_port_remove(
         */\r
        if ( !p_ext->h_ca )\r
        {\r
         */\r
        if ( !p_ext->h_ca )\r
        {\r
-               BUS_TRACE_EXIT( BUS_DBG_PNP, ("%s() %s NULL h_ca? p_ext %p\n",\r
-                                       __FUNCTION__, p_bfi->whoami, p_ext ) );\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP,\r
+                                               ("%s NULL h_ca? p_ext %p\n", p_bfi->whoami, p_ext ) );\r
                return;\r
        }\r
 \r
                return;\r
        }\r
 \r
@@ -1295,6 +1291,7 @@ port_query_remove(
        p_ext = p_dev_obj->DeviceExtension;\r
 \r
        *p_action = IrpComplete;\r
        p_ext = p_dev_obj->DeviceExtension;\r
 \r
        *p_action = IrpComplete;\r
+\r
        if( p_ext->n_ifc_ref )\r
        {\r
                /*\r
        if( p_ext->n_ifc_ref )\r
        {\r
                /*\r
@@ -1309,7 +1306,12 @@ port_query_remove(
                return STATUS_UNSUCCESSFUL;\r
        }\r
 \r
                return STATUS_UNSUCCESSFUL;\r
        }\r
 \r
-       BUS_EXIT( BUS_DBG_PNP );\r
+       CL_ASSERT(p_ext->pdo.p_parent_ext->bus_filter);\r
+       BUS_TRACE_EXIT( BUS_DBG_PNP,\r
+                       ("OK IRP_MN_QUERY_REMOVE_DEVICE:\n  %s HCA guid %I64x port %d\n",\r
+                       p_ext->pdo.p_parent_ext->bus_filter->whoami,\r
+                       p_ext->pdo.ca_guid, p_ext->n_port ) );\r
+\r
        return STATUS_SUCCESS;\r
 }\r
 \r
        return STATUS_SUCCESS;\r
 }\r
 \r