[IBBUS] convert old global variable name 'gp_iou_mgr' to match it's local scope as...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 22 May 2009 17:06:26 +0000 (17:06 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 22 May 2009 17:06:26 +0000 (17:06 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2194 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/bus/kernel/bus_iou_mgr.c

index 8164369..d711ee6 100644 (file)
@@ -266,44 +266,44 @@ create_iou_mgr(
 {\r
        ib_api_status_t         status;\r
        cl_status_t                     cl_status;\r
-       iou_mgr_t                       *gp_iou_mgr;\r
+       iou_mgr_t                       *p_iou_mgr;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
        CL_ASSERT( p_bfi->p_iou_mgr == NULL );\r
 \r
-       gp_iou_mgr = cl_zalloc( sizeof(iou_mgr_t) );\r
-       if( !gp_iou_mgr )\r
+       p_iou_mgr = cl_zalloc( sizeof(iou_mgr_t) );\r
+       if( !p_iou_mgr )\r
        {\r
                BUS_TRACE_EXIT( BUS_DBG_ERROR, \r
                        ("Failed to allocate IOU manager.\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
-       p_bfi->p_iou_mgr = gp_iou_mgr;\r
+       p_bfi->p_iou_mgr = p_iou_mgr;\r
 \r
        /* Construct the load service. */\r
-       cl_obj_construct( &gp_iou_mgr->obj, AL_OBJ_TYPE_LOADER );\r
+       cl_obj_construct( &p_iou_mgr->obj, AL_OBJ_TYPE_LOADER );\r
 \r
        p_bfi->p_iou_mgr_obj = &p_bfi->p_iou_mgr->obj; // save for destroy & free\r
 \r
-       cl_mutex_construct( &gp_iou_mgr->pdo_mutex );\r
-       cl_qlist_init( &gp_iou_mgr->iou_list );\r
+       cl_mutex_construct( &p_iou_mgr->pdo_mutex );\r
+       cl_qlist_init( &p_iou_mgr->iou_list );\r
 \r
-       cl_status = cl_mutex_init( &gp_iou_mgr->pdo_mutex );\r
+       cl_status = cl_mutex_init( &p_iou_mgr->pdo_mutex );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               free_iou_mgr( &gp_iou_mgr->obj );\r
+               free_iou_mgr( &p_iou_mgr->obj );\r
                BUS_TRACE_EXIT( BUS_DBG_ERROR, \r
                        ("cl_mutex_init returned %#x.\n", cl_status) );\r
                return ib_convert_cl_status( cl_status );\r
        }\r
 \r
        /* Initialize the load service object. */\r
-       cl_status = cl_obj_init( &gp_iou_mgr->obj, CL_DESTROY_SYNC,\r
+       cl_status = cl_obj_init( &p_iou_mgr->obj, CL_DESTROY_SYNC,\r
                                                         destroying_iou_mgr, NULL, free_iou_mgr );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               free_iou_mgr( &gp_iou_mgr->obj );\r
+               free_iou_mgr( &p_iou_mgr->obj );\r
                BUS_TRACE_EXIT( BUS_DBG_ERROR,\r
                        ("cl_obj_init returned %#x.\n", cl_status) );\r
                return ib_convert_cl_status( cl_status );\r
@@ -313,7 +313,7 @@ create_iou_mgr(
        status = bus_reg_iou_pnp( p_bfi );\r
        if( status != IB_SUCCESS )\r
        {\r
-               free_iou_mgr( &gp_iou_mgr->obj );\r
+               free_iou_mgr( &p_iou_mgr->obj );\r
                BUS_TRACE_EXIT( BUS_DBG_ERROR, \r
                        ("bus_reg_iou_pnp returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
@@ -333,7 +333,7 @@ destroying_iou_mgr(
 {\r
        ib_api_status_t                 status;\r
        bus_filter_t                    *p_bfi;\r
-       iou_mgr_t                               *gp_iou_mgr;\r
+       iou_mgr_t                               *p_iou_mgr;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
@@ -343,12 +343,12 @@ destroying_iou_mgr(
                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
+       p_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
        BUS_PRINT(BUS_DBG_PNP, ("%s obj %p iou_mgr %p iou_mgr_obj %p\n",\r
-                                                       p_bfi->whoami, p_obj,gp_iou_mgr,&gp_iou_mgr->obj));\r
+                                                       p_bfi->whoami, p_obj,p_iou_mgr,&p_iou_mgr->obj));\r
 \r
-       CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj, iou_mgr_t, obj ) );\r
+       CL_ASSERT( p_iou_mgr == PARENT_STRUCT( p_obj, iou_mgr_t, obj ) );\r
 \r
        /* Deregister for iou PnP events. */\r
        if( get_bfi_count() == 1 && bus_globals.h_pnp_iou )\r
@@ -373,7 +373,7 @@ free_iou_mgr(
        bus_pdo_ext_t   *p_ext;\r
        cl_list_item_t  *p_list_item;\r
        bus_filter_t    *p_bfi;\r
-       iou_mgr_t               *gp_iou_mgr;\r
+       iou_mgr_t               *p_iou_mgr;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
@@ -383,14 +383,14 @@ free_iou_mgr(
                BUS_TRACE( BUS_DBG_ERROR, ("Unable to get p_bfi iou_obj %p?\n", p_obj) );\r
                return;\r
        }\r
-       gp_iou_mgr = p_bfi->p_iou_mgr;\r
-       if ( !gp_iou_mgr ) {\r
+       p_iou_mgr = p_bfi->p_iou_mgr;\r
+       if ( !p_iou_mgr ) {\r
                BUS_TRACE_EXIT( BUS_DBG_ERROR, ("%s <null> IOU mgr?\n",p_bfi->whoami) );\r
                // if create fails & then free is called, p_bfi->p_iou_mgr == NULL\r
                return;\r
        }\r
 \r
-       CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj, iou_mgr_t, obj ) );\r
+       CL_ASSERT( p_iou_mgr == PARENT_STRUCT( p_obj, iou_mgr_t, obj ) );\r
 \r
        BUS_PRINT( BUS_DBG_PNP, ("%s Mark all IOU PDOs as no longer present\n",\r
                                                                p_bfi->whoami));\r
@@ -398,11 +398,11 @@ free_iou_mgr(
         * 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
-       p_list_item = cl_qlist_remove_head( &gp_iou_mgr->iou_list );\r
-       while( p_list_item != cl_qlist_end( &gp_iou_mgr->iou_list ) )\r
+       p_list_item = cl_qlist_remove_head( &p_iou_mgr->iou_list );\r
+       while( p_list_item != cl_qlist_end( &p_iou_mgr->iou_list ) )\r
        {\r
                p_ext = PARENT_STRUCT( p_list_item, bus_pdo_ext_t, list_item );\r
-               p_list_item = cl_qlist_remove_head( &gp_iou_mgr->iou_list );\r
+               p_list_item = cl_qlist_remove_head( &p_iou_mgr->iou_list );\r
                if( p_ext->cl_ext.pnp_state == SurpriseRemoved )\r
                {\r
                        CL_ASSERT( !p_ext->b_present );\r
@@ -432,9 +432,9 @@ free_iou_mgr(
                IoDeleteDevice( p_ext->cl_ext.p_self_do );\r
        }\r
 \r
-       cl_mutex_destroy( &gp_iou_mgr->pdo_mutex );\r
+       cl_mutex_destroy( &p_iou_mgr->pdo_mutex );\r
        cl_obj_deinit( p_obj );\r
-       cl_free( gp_iou_mgr );\r
+       cl_free( p_iou_mgr );\r
 \r
        p_bfi->p_iou_mgr = NULL;\r
        p_bfi->p_iou_mgr_obj = NULL;\r
@@ -531,7 +531,7 @@ iou_mgr_get_bus_relations(
 {\r
        NTSTATUS                        status;\r
        bus_filter_t            *p_bfi;\r
-       iou_mgr_t                       *gp_iou_mgr;\r
+       iou_mgr_t                       *p_iou_mgr;\r
        DEVICE_RELATIONS        *p_rel;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
@@ -541,12 +541,12 @@ iou_mgr_get_bus_relations(
        /* special case guid == 0 - walk all bus filter instances */\r
        if ( ca_guid == 0ULL ) {\r
                for(p_bfi=g_bus_filters; p_bfi < &g_bus_filters[MAX_BUS_FILTERS]; p_bfi++) {\r
-                       gp_iou_mgr = p_bfi->p_iou_mgr;\r
-                       if ( !gp_iou_mgr )\r
+                       p_iou_mgr = p_bfi->p_iou_mgr;\r
+                       if ( !p_iou_mgr )\r
                                continue;\r
-                       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
-                       status = bus_get_relations( &gp_iou_mgr->iou_list, ca_guid, p_irp );\r
-                       cl_mutex_release( &gp_iou_mgr->pdo_mutex );\r
+                       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );\r
+                       status = bus_get_relations( &p_iou_mgr->iou_list, ca_guid, p_irp );\r
+                       cl_mutex_release( &p_iou_mgr->pdo_mutex );\r
                }\r
                p_rel = (DEVICE_RELATIONS*)p_irp->IoStatus.Information;\r
                if ( p_rel ) {\r
@@ -562,16 +562,16 @@ iou_mgr_get_bus_relations(
                                                                ("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
+       p_iou_mgr = p_bfi->p_iou_mgr;\r
 \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
+                                                       p_bfi->whoami, ca_guid, p_iou_mgr) );\r
+       if (!p_iou_mgr)\r
                return STATUS_NO_SUCH_DEVICE;\r
 \r
-       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
-       status = bus_get_relations( &gp_iou_mgr->iou_list, ca_guid, p_irp );\r
-       cl_mutex_release( &gp_iou_mgr->pdo_mutex );\r
+       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );\r
+       status = bus_get_relations( &p_iou_mgr->iou_list, ca_guid, p_irp );\r
+       cl_mutex_release( &p_iou_mgr->pdo_mutex );\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
        return status;\r
@@ -588,13 +588,13 @@ __iou_was_hibernated(
        bus_iou_ext_t   *p_iou_ext;\r
        bus_pdo_ext_t   *p_pdo_ext = NULL;\r
        size_t                  n_devs = 0;\r
-       iou_mgr_t               *gp_iou_mgr = p_bfi->p_iou_mgr;\r
-       cl_qlist_t              *p_pdo_list = &gp_iou_mgr->iou_list;\r
+       iou_mgr_t               *p_iou_mgr = p_bfi->p_iou_mgr;\r
+       cl_qlist_t              *p_pdo_list = &p_iou_mgr->iou_list;\r
        iou_pnp_ctx_t   *p_ctx = p_pnp_rec->pnp_rec.context;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
        \r
-       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
+       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );\r
        \r
        /* Count the number of child devices. */\r
        for( p_list_item = cl_qlist_head( p_pdo_list );\r
@@ -655,7 +655,7 @@ __iou_was_hibernated(
                status = IB_NOT_FOUND;\r
        }\r
 \r
-       cl_mutex_release( &gp_iou_mgr->pdo_mutex );\r
+       cl_mutex_release( &p_iou_mgr->pdo_mutex );\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
        return status;\r
@@ -669,7 +669,7 @@ iou_mgr_iou_add(
        DEVICE_OBJECT   *p_pdo;\r
        bus_iou_ext_t   *p_iou_ext;\r
        bus_filter_t    *p_bfi;\r
-       iou_mgr_t               *gp_iou_mgr;\r
+       iou_mgr_t               *p_iou_mgr;\r
        iou_pnp_ctx_t   *p_ctx = p_pnp_rec->pnp_rec.context;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
@@ -702,7 +702,7 @@ iou_mgr_iou_add(
                                        ("%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
+       p_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
        /* Upon hibernating the computer IB_BUS driver doesn't remove PDO, but\r
           marks with a flag. So we first try to find an existing PDO for this port,\r
@@ -774,9 +774,9 @@ iou_mgr_iou_add(
        }\r
 \r
        /* Store the device extension in the PDO list for future queries. */\r
-       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
-       cl_qlist_insert_tail( &gp_iou_mgr->iou_list, &p_iou_ext->pdo.list_item );\r
-       cl_mutex_release( &gp_iou_mgr->pdo_mutex );\r
+       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );\r
+       cl_qlist_insert_tail( &p_iou_mgr->iou_list, &p_iou_ext->pdo.list_item );\r
+       cl_mutex_release( &p_iou_mgr->pdo_mutex );\r
 \r
        /*\r
         * Set the context of the PNP event.  The context is passed in for future\r
@@ -805,7 +805,7 @@ iou_mgr_iou_remove(
        IN                              ib_pnp_iou_rec_t*                       p_pnp_rec )\r
 {\r
        bus_pdo_ext_t   *p_ext;\r
-       iou_mgr_t               *gp_iou_mgr;\r
+       iou_mgr_t               *p_iou_mgr;\r
        bus_filter_t    *p_bfi;\r
        iou_pnp_ctx_t   *p_ctx = p_pnp_rec->pnp_rec.context;\r
 \r
@@ -833,7 +833,7 @@ iou_mgr_iou_remove(
                return;\r
        }\r
 \r
-       gp_iou_mgr = p_bfi->p_iou_mgr;\r
+       p_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
        /* Within the PNP record's context is the IOU extension; see\r
         * was_hibernated().\r
@@ -854,7 +854,7 @@ iou_mgr_iou_remove(
         * reference on the CA object in order to allow the removal of the HCA\r
         * to proceed should it occur before the port's PDO is cleaned up.\r
         */\r
-       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
+       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );\r
        if ( !p_ext->h_ca )\r
        {\r
                BUS_TRACE_EXIT( BUS_DBG_PNP, ("NULL h_ca? p_ext %p\n", p_ext ) );\r
@@ -896,7 +896,7 @@ hca_deref:
        deref_al_obj( &p_ext->h_ca->obj );\r
        p_ext->h_ca = NULL;\r
 \r
-       cl_mutex_release( &gp_iou_mgr->pdo_mutex );\r
+       cl_mutex_release( &p_iou_mgr->pdo_mutex );\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
@@ -965,18 +965,18 @@ iou_release_resources(
 {\r
        bus_iou_ext_t   *p_ext;\r
        POWER_STATE             po_state;\r
-       iou_mgr_t               *gp_iou_mgr;\r
+       iou_mgr_t               *p_iou_mgr;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
        p_ext = p_dev_obj->DeviceExtension;\r
-       gp_iou_mgr = p_ext->pdo.p_parent_ext->bus_filter->p_iou_mgr;\r
+       p_iou_mgr = p_ext->pdo.p_parent_ext->bus_filter->p_iou_mgr;\r
 \r
        /* Remove this PDO from its list. */\r
-       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
+       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );\r
        BUS_TRACE( BUS_DBG_PNP, ("Removing IOU from list.\n") );\r
-       cl_qlist_remove_item( &gp_iou_mgr->iou_list, &p_ext->pdo.list_item );\r
-       cl_mutex_release( &gp_iou_mgr->pdo_mutex );\r
+       cl_qlist_remove_item( &p_iou_mgr->iou_list, &p_ext->pdo.list_item );\r
+       cl_mutex_release( &p_iou_mgr->pdo_mutex );\r
        po_state.DeviceState = PowerDeviceD3;\r
        PoSetPowerState( p_ext->pdo.cl_ext.p_pdo, DevicePowerState, po_state );\r
 \r