<!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.6000.16587" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=982595514-27102008>Renaming of 
variables only checkin.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Index: 
Q:/projinf3/trunk/core/bus/kernel/bus_port_mgr.c<BR>===================================================================<BR>--- 
Q:/projinf3/trunk/core/bus/kernel/bus_port_mgr.c (revision 3371)<BR>+++ 
Q:/projinf3/trunk/core/bus/kernel/bus_port_mgr.c (revision 3372)<BR>@@ 
-288,43 +288,43 
@@<BR> {<BR>  ib_api_status_t  status;<BR>  cl_status_t   cl_status;<BR>- port_mgr_t   *gp_port_mgr;<BR>+ port_mgr_t   *p_port_mgr;<BR> <BR>  BUS_ENTER( 
BUS_DBG_PNP );<BR> <BR>  CL_ASSERT( p_bfi->p_port_mgr == NULL 
);<BR> <BR>- gp_port_mgr = cl_zalloc( sizeof( port_mgr_t ) 
);<BR>- if( !gp_port_mgr )<BR>+ p_port_mgr = cl_zalloc( sizeof( 
port_mgr_t ) );<BR>+ if( !p_port_mgr 
)<BR>  {<BR>   BUS_TRACE_EXIT( 
BUS_DBG_ERROR,<BR>    ("Failed to allocate port manager.\n") 
);<BR>   return 
IB_INSUFFICIENT_MEMORY;<BR>  }<BR>- p_bfi->p_port_mgr = 
gp_port_mgr;<BR>+ p_bfi->p_port_mgr = 
p_port_mgr;<BR> <BR>  /* Construct the load service. 
*/<BR>- cl_obj_construct( &gp_port_mgr->obj, AL_OBJ_TYPE_LOADER 
);<BR>- p_bfi->p_port_mgr_obj = 
&gp_port_mgr->obj;<BR>- cl_mutex_construct( 
&gp_port_mgr->pdo_mutex );<BR>- cl_qlist_init( 
&gp_port_mgr->port_list );<BR>+ cl_obj_construct( 
&p_port_mgr->obj, AL_OBJ_TYPE_LOADER 
);<BR>+ p_bfi->p_port_mgr_obj = 
&p_port_mgr->obj;<BR>+ cl_mutex_construct( 
&p_port_mgr->pdo_mutex );<BR>+ cl_qlist_init( 
&p_port_mgr->port_list );<BR> <BR>- cl_status = cl_mutex_init( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_status = cl_mutex_init( 
&p_port_mgr->pdo_mutex );<BR>  if( cl_status != CL_SUCCESS 
)<BR>  {<BR>-  free_port_mgr( &gp_port_mgr->obj 
);<BR>+  free_port_mgr( &p_port_mgr->obj 
);<BR>   BUS_TRACE_EXIT( 
BUS_DBG_ERROR,<BR>    ("cl_mutex_init returned %#x.\n", 
cl_status) );<BR>   return ib_convert_cl_status( cl_status 
);<BR>  }<BR> <BR>  /* Initialize the load service 
object. */<BR>- cl_status = cl_obj_init( &gp_port_mgr->obj, 
CL_DESTROY_SYNC,<BR>+ cl_status = cl_obj_init( &p_port_mgr->obj, 
CL_DESTROY_SYNC,<BR>         
destroying_port_mgr, NULL, free_port_mgr );<BR> <BR>  if( 
cl_status != CL_SUCCESS )<BR>  {<BR>-  free_port_mgr( 
&gp_port_mgr->obj );<BR>+  free_port_mgr( 
&p_port_mgr->obj );<BR>   BUS_TRACE_EXIT( 
BUS_DBG_ERROR,<BR>    ("cl_obj_init returned %#x.\n", 
cl_status) );<BR>   return ib_convert_cl_status( cl_status 
);<BR>@@ -336,11 +336,11 
@@<BR>  {<BR>   BUS_TRACE_EXIT( 
BUS_DBG_ERROR,<BR>    ("bus_reg_port_pnp returned %s.\n", 
ib_get_err_str(status)) );<BR>-  free_port_mgr( 
&gp_port_mgr->obj );<BR>+  free_port_mgr( 
&p_port_mgr->obj );<BR>   return 
status;<BR>  }<BR> <BR>- *pp_port_mgr = 
gp_port_mgr;<BR>+ *pp_port_mgr = 
p_port_mgr;<BR> <BR>  BUS_EXIT( BUS_DBG_PNP 
);<BR>  return IB_SUCCESS;<BR>@@ -356,7 +356,7 
@@<BR> {<BR>  ib_api_status_t   status;<BR>  bus_filter_t   *p_bfi;<BR>- port_mgr_t    *gp_port_mgr;<BR>+ port_mgr_t    *p_port_mgr;<BR> <BR>  BUS_ENTER( 
BUS_DBG_PNP );<BR> <BR>@@ -366,13 +366,13 
@@<BR>   BUS_PRINT(BUS_DBG_PNP, ("Failed to find p_bfi by obj 
%p?\n", 
p_obj));<BR>   return;<BR>  }<BR>- gp_port_mgr = 
p_bfi->p_port_mgr;<BR>+ p_port_mgr = 
p_bfi->p_port_mgr;<BR> <BR>  BUS_PRINT(BUS_DBG_PNP, ("%s obj 
%p port_mgr %p port_mgr_obj 
%p\n",<BR>-   p_bfi->whoami,p_obj,gp_port_mgr, 
p_bfi->p_port_mgr_obj) 
);<BR>+   p_bfi->whoami,p_obj,p_port_mgr, 
p_bfi->p_port_mgr_obj) );<BR> <BR>  CL_ASSERT( 
(void*)p_bfi->p_port_mgr == (void*)p_bfi->p_port_mgr_obj 
);<BR>- CL_ASSERT( gp_port_mgr == PARENT_STRUCT( p_obj, port_mgr_t, obj ) 
);<BR>+ CL_ASSERT( p_port_mgr == PARENT_STRUCT( p_obj, port_mgr_t, obj ) 
);<BR> <BR>  /* Deregister for port PnP events if this is the 
last Port manager. */<BR>  if ( get_bfi_count() == 1 && 
bus_globals.h_pnp_port ) {<BR>@@ -396,7 +396,7 
@@<BR>  bus_pdo_ext_t *p_ext;<BR>  cl_list_item_t *p_list_item;<BR>  bus_filter_t *p_bfi;<BR>- port_mgr_t  *gp_port_mgr;<BR>+ port_mgr_t  *p_port_mgr;<BR> <BR>  BUS_ENTER( 
BUS_DBG_PNP );<BR> <BR>@@ -406,15 +406,15 
@@<BR>   BUS_PRINT(BUS_DBG_PNP, ("No p_bfi for port obj %p?\n", 
p_obj));<BR>   return;<BR>  }<BR>- gp_port_mgr = 
p_bfi->p_port_mgr;<BR>- if ( !gp_port_mgr ) {<BR>+ p_port_mgr = 
p_bfi->p_port_mgr;<BR>+ if ( !p_port_mgr ) {<BR>   // if 
create fails & then free is called, p_bfi->p_port_mgr == 
NULL<BR>   return;<BR>  }<BR>- CL_ASSERT( 
gp_port_mgr == PARENT_STRUCT( p_obj, port_mgr_t, obj ) );<BR>+ CL_ASSERT( 
p_port_mgr == PARENT_STRUCT( p_obj, port_mgr_t, obj ) 
);<BR> <BR>  BUS_PRINT(BUS_DBG_PNP, ("%s obj %p port_mgr %p 
port_mgr_obj %p\n",<BR>-   p_bfi->whoami, 
p_obj,gp_port_mgr,<BR>+   p_bfi->whoami, 
p_obj,p_port_mgr,<BR>    p_bfi->p_port_mgr_obj) 
);<BR> <BR>  BUS_PRINT( BUS_DBG_PNP,<BR>@@ -423,11 +423,11 
@@<BR>   * Mark all IPoIB PDOs as no longer present.  This will 
cause them<BR>   * to be removed when they process the 
IRP_MN_REMOVE_DEVICE.<BR>   */<BR>- p_list_item = 
cl_qlist_remove_head( &gp_port_mgr->port_list );<BR>- while( 
p_list_item != cl_qlist_end( &gp_port_mgr->port_list ) 
)<BR>+ p_list_item = cl_qlist_remove_head( &p_port_mgr->port_list 
);<BR>+ while( p_list_item != cl_qlist_end( &p_port_mgr->port_list ) 
)<BR>  {<BR>   p_ext = PARENT_STRUCT( p_list_item, 
bus_pdo_ext_t, list_item );<BR>-  p_list_item = cl_qlist_remove_head( 
&gp_port_mgr->port_list );<BR>+  p_list_item = 
cl_qlist_remove_head( &p_port_mgr->port_list );<BR>   if( 
p_ext->cl_ext.pnp_state == SurpriseRemoved 
)<BR>   {<BR>    CL_ASSERT( 
!p_ext->b_present );<BR>@@ -456,9 +456,9 
@@<BR>   IoDeleteDevice( p_ext->cl_ext.p_self_do 
);<BR>  }<BR> <BR>- cl_mutex_destroy( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_destroy( 
&p_port_mgr->pdo_mutex );<BR>  cl_obj_deinit( p_obj 
);<BR>- cl_free( gp_port_mgr );<BR>+ cl_free( p_port_mgr 
);<BR> <BR>  p_bfi->p_port_mgr = 
NULL;<BR>  p_bfi->p_port_mgr_obj = NULL;<BR>@@ -483,12 +483,12 
@@<BR>   */<BR>  if ( !bus_globals.h_pnp_port 
)<BR>  {<BR>-  ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+  ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR>   if 
( !bus_globals.h_pnp_port ) {<BR>    bus_globals.h_pnp_port 
= (ib_pnp_handle_t)1; /* block others */<BR>    need_pnp_reg 

TRUE;<BR>   }<BR>-  ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+  ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR> <BR>   if 
( need_pnp_reg )<BR>   {<BR>@@ -555,7 +555,7 
@@<BR> {<BR>  NTSTATUS   status;<BR>  bus_filter_t  *p_bfi;<BR>- port_mgr_t   *gp_port_mgr;<BR>+ port_mgr_t   *p_port_mgr;<BR>  DEVICE_RELATIONS *p_rel;<BR> <BR>  BUS_ENTER( 
BUS_DBG_PNP );<BR>@@ -565,15 +565,15 @@<BR>  /* special case guid == 0 
- walk all bus filter instances */<BR>  if ( ca_guid == 0ULL ) 
{<BR>   BUS_PRINT(BUS_DBG_PNP, ("CA_guid 
0\n"));<BR>-  for(p_bfi=bus_filters; p_bfi < 
&bus_filters[MAX_BUS_FILTERS]; p_bfi++) {<BR>-   gp_port_mgr 
= p_bfi->p_port_mgr;<BR>-   if ( !gp_port_mgr 
)<BR>+  for(p_bfi=g_bus_filters; p_bfi < 
&g_bus_filters[MAX_BUS_FILTERS]; p_bfi++) {<BR>+   p_port_mgr 
= p_bfi->p_port_mgr;<BR>+   if ( !p_port_mgr 
)<BR>     continue;<BR>-   cl_mutex_acquire( 
&gp_port_mgr->pdo_mutex );<BR>-   status = 
bus_get_relations( 
&gp_port_mgr->port_list,<BR>+   cl_mutex_acquire( 
&p_port_mgr->pdo_mutex );<BR>+   status = 
bus_get_relations( 
&p_port_mgr->port_list,<BR>           p_bfi->ca_guid,<BR>           p_irp 
);<BR>-   cl_mutex_release( &gp_port_mgr->pdo_mutex 
);<BR>+   cl_mutex_release( &p_port_mgr->pdo_mutex 
);<BR>   }<BR> <BR>   p_rel = 
(DEVICE_RELATIONS*)p_irp->IoStatus.Information;<BR>@@ -591,16 +591,16 
@@<BR>   BUS_EXIT( BUS_DBG_PNP );<BR>   return 
STATUS_NO_SUCH_DEVICE;<BR>  }<BR>- gp_port_mgr = 
p_bfi->p_port_mgr;<BR>+ p_port_mgr = 
p_bfi->p_port_mgr;<BR> <BR>  BUS_PRINT(BUS_DBG_PNP, ("%s for 
ca_guid %I64x port_mgr 
%p\n",<BR>-       p_bfi->whoami, ca_guid, 
gp_port_mgr) );<BR>- if 
(!gp_port_mgr)<BR>+       p_bfi->whoami, 
ca_guid, p_port_mgr) );<BR>+ if (!p_port_mgr)<BR>   return 
STATUS_NO_SUCH_DEVICE;<BR> <BR>- cl_mutex_acquire( 
&gp_port_mgr->pdo_mutex );<BR>- status = bus_get_relations( 
&gp_port_mgr->port_list, ca_guid, p_irp );<BR>- cl_mutex_release( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_acquire( 
&p_port_mgr->pdo_mutex );<BR>+ status = bus_get_relations( 
&p_port_mgr->port_list, ca_guid, p_irp );<BR>+ cl_mutex_release( 
&p_port_mgr->pdo_mutex );<BR> <BR>  BUS_EXIT( BUS_DBG_PNP 
);<BR>  return STATUS_SUCCESS;<BR>@@ -616,13 +616,13 
@@<BR>  bus_port_ext_t *p_port_ext;<BR>  bus_pdo_ext_t *p_pdo_ext 
= NULL;<BR>  size_t   n_devs = 
0;<BR>- port_mgr_t  *gp_port_mgr = 
p_bfi->p_port_mgr;<BR>- cl_qlist_t  *p_pdo_list = 
&gp_port_mgr->port_list;<BR>+ port_mgr_t  *p_port_mgr = 
p_bfi->p_port_mgr;<BR>+ cl_qlist_t  *p_pdo_list = 
&p_port_mgr->port_list;<BR>  port_pnp_ctx_t *p_ctx = 
p_pnp_rec->pnp_rec.context;<BR> <BR>  BUS_ENTER( BUS_DBG_PNP 
);<BR> <BR>- if ( !gp_port_mgr ) {<BR>+ if ( !p_port_mgr ) 
{<BR>   // if free_port_mgr has been called , 
p_bfi->p_port_mgr == NULL <BR>   // this will cause crash on 
cl_mutex_acquire<BR>   // (leo) i'm not sure when it happens, but 
i saw it happened<BR>@@ -630,7 +630,7 @@<BR>   goto 
end;<BR>  }<BR> <BR>- cl_mutex_acquire( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_acquire( 
&p_port_mgr->pdo_mutex );<BR>  <BR>  /* Count the 
number of child devices. */<BR>  for( p_list_item = cl_qlist_head( 
p_pdo_list );<BR>@@ -692,7 +692,7 @@<BR>   status = 
IB_NOT_FOUND;<BR>  }<BR> <BR>- cl_mutex_release( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_release( 
&p_port_mgr->pdo_mutex 
);<BR> <BR> end:<BR>  BUS_EXIT( BUS_DBG_PNP );<BR>@@ -776,7 
+776,7 @@<BR>  pkey_conf_t  *cur_conf; 
<BR>  pkey_array_t *cur_pkeys = 
NULL;<BR>  bus_filter_t *p_bfi;<BR>- port_mgr_t  *gp_port_mgr;<BR>+ port_mgr_t  *p_port_mgr;<BR>  port_pnp_ctx_t *p_ctx 
= p_pnp_rec->pnp_rec.context;<BR> <BR>  BUS_ENTER( BUS_DBG_PNP 
);<BR>@@ -812,7 +812,7 
@@<BR>      p_bfi->whoami, p_bfi->ca_guid, 
<BR>      p_pnp_rec->p_port_attr->port_num,p_ctx));<BR>  }<BR>- gp_port_mgr 
= p_bfi->p_port_mgr;<BR>+ p_port_mgr = 
p_bfi->p_port_mgr;<BR> <BR>  if( 
!bus_globals.b_report_port_nic )<BR>  {<BR>@@ -914,10 +914,10 
@@<BR>    p_port_ext->port_guid.pkey = 
cur_pkeys->pkey_array[num_pdo -1];<BR> <BR>   /* Store 
the device extension in the port vector for future queries. 
*/<BR>-  cl_mutex_acquire( &gp_port_mgr->pdo_mutex 
);<BR>-  cl_qlist_insert_tail( 
&gp_port_mgr->port_list,<BR>+  cl_mutex_acquire( 
&p_port_mgr->pdo_mutex );<BR>+  cl_qlist_insert_tail( 
&p_port_mgr->port_list,<BR>          
&p_port_ext->pdo.list_item );<BR>-  cl_mutex_release( 
&gp_port_mgr->pdo_mutex );<BR>+  cl_mutex_release( 
&p_port_mgr->pdo_mutex 
);<BR> <BR>   /*<BR>    * Set the context of 
the PNP event. The context is passed in for future<BR>@@ -947,19 +947,19 
@@<BR> * 
return: cl_status<BR> *************************************************************************************/<BR> cl_status_t 
_port_mgr_pkey_rem( IN pkey_array_t *pkeys,<BR>-        IN port_mgr_t  *gp_port_mgr 
)<BR>+        IN port_mgr_t  *p_port_mgr 
)<BR> {<BR> <BR>  uint16_t 
   cnt;<BR>  cl_list_item_t  *p_list_item;<BR>  bus_port_ext_t  *p_port_ext;<BR>  bus_pdo_ext_t  *p_pdo_ext 
= NULL;<BR>- cl_qlist_t*   p_pdo_list = 
&gp_port_mgr->port_list;<BR>+ cl_qlist_t*   p_pdo_list 
= &p_port_mgr->port_list;<BR> <BR>  BUS_ENTER( BUS_DBG_PNP 
);<BR> <BR>  p_port_ext = NULL;<BR>- cl_mutex_acquire( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_acquire( 
&p_port_mgr->pdo_mutex );<BR>  <BR>  /* Count the 
number of child devices. */<BR>  for( p_list_item = cl_qlist_head( 
p_pdo_list );<BR>@@ -982,7 +982,7 
@@<BR>    }<BR>   }<BR>  }<BR>- cl_mutex_release( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_release( 
&p_port_mgr->pdo_mutex );<BR> <BR>  /* Tell the PnP 
Manager to rescan for the HCA's bus relations. 
*/<BR>  IoInvalidateDeviceRelations(<BR>@@ -1000,15 +1000,15 
@@<BR>  boolean_t  GO;<BR>  int    success_cnt=0;<BR> <BR>- for(p_bfi=&bus_filters[0]; 
p_bfi < &bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>+ for(p_bfi=&g_bus_filters[0]; p_bfi < 
&g_bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>  {<BR>   if ( !p_bfi->p_bus_ext 
)<BR>    continue;<BR>   GO = 
FALSE;<BR>-  ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+  ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR>   if 
( p_bfi->ca_guid && p_bfi->p_port_mgr 
)<BR>    GO = 
TRUE;<BR>-  ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+  ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR>   if 
( GO == FALSE )<BR>    continue;<BR>   status 
= _port_mgr_pkey_rem( pkeys, p_bfi->p_port_mgr );<BR>@@ -1028,20 +1028,20 
@@<BR> *************************************************************************************/<BR> cl_status_t 
_port_mgr_pkey_add( 
IN pkey_array_t *req_pkeys,<BR>         IN bus_filter_t *p_bfi,<BR>-        IN port_mgr_t  *gp_port_mgr 
)<BR>+        IN port_mgr_t  *p_port_mgr 
)<BR> {<BR>  uint16_t 
   cnt;<BR>  NTSTATUS            
status;<BR>  cl_list_item_t  *p_list_item;<BR>  bus_port_ext_t  *p_port_ext, 
*pkey_port_ext, 
*pmatched_guid_ext;<BR>  DEVICE_OBJECT       
*p_pdo[MAX_NUM_PKEY];<BR>- cl_qlist_t*   p_pdo_list = 
&gp_port_mgr->port_list;<BR>+ cl_qlist_t*   p_pdo_list 
= &p_port_mgr->port_list;<BR> <BR>  BUS_ENTER( BUS_DBG_PNP 
);<BR> <BR>  pmatched_guid_ext = NULL;<BR>  p_port_ext 
= NULL;<BR>- cl_mutex_acquire( &gp_port_mgr->pdo_mutex 
);<BR>+ cl_mutex_acquire( &p_port_mgr->pdo_mutex 
);<BR>  <BR>  /* Count the number of child devices. 
*/<BR>  for( p_list_item = cl_qlist_head( p_pdo_list );<BR>@@ -1067,7 
+1067,7 @@<BR>     pmatched_guid_ext = 
p_port_ext;<BR>   }<BR>  }<BR>- cl_mutex_release( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_release( 
&p_port_mgr->pdo_mutex );<BR> <BR>  if 
(!pmatched_guid_ext)<BR>  {<BR>@@ -1119,10 +1119,10 
@@<BR>   pkey_port_ext->port_guid.pkey = 
req_pkeys->pkey_array[cnt];<BR>   pkey_port_ext->pdo.is_partition_pdo 
= TRUE;<BR>   /* Store the device extension in the port vector 
for future queries. */<BR>-  cl_mutex_acquire( 
&gp_port_mgr->pdo_mutex );<BR>-  cl_qlist_insert_tail( 
&gp_port_mgr->port_list,<BR>+  cl_mutex_acquire( 
&p_port_mgr->pdo_mutex );<BR>+  cl_qlist_insert_tail( 
&p_port_mgr->port_list,<BR>    &pkey_port_ext->pdo.list_item 
);<BR>-  cl_mutex_release( &gp_port_mgr->pdo_mutex 
);<BR>+  cl_mutex_release( &p_port_mgr->pdo_mutex 
);<BR>  }<BR> <BR>  /* Tell the PnP Manager to rescan 
for the HCA's bus relations. */<BR>@@ -1144,15 +1144,15 
@@<BR>  boolean_t  GO;<BR>  int    success_cnt=0;<BR> <BR>- for(p_bfi=&bus_filters[0]; 
p_bfi < &bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>+ for(p_bfi=&g_bus_filters[0]; p_bfi < 
&g_bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>  {<BR>   if ( !p_bfi->p_bus_ext 
)<BR>    continue;<BR>   GO = 
FALSE;<BR>-  ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+  ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR>   if 
( p_bfi->ca_guid && p_bfi->p_port_mgr 
)<BR>    GO = 
TRUE;<BR>-  ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+  ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR>   if 
( GO == FALSE )<BR>    continue;<BR>   status 
= _port_mgr_pkey_add( pkeys, p_bfi, p_bfi->p_port_mgr );<BR>@@ -1168,7 
+1168,7 
@@<BR>  IN    ib_pnp_port_rec_t*  p_pnp_rec 
)<BR> {<BR>  bus_pdo_ext_t *p_ext;<BR>- port_mgr_t  *gp_port_mgr;<BR>+ port_mgr_t  *p_port_mgr;<BR>  bus_filter_t *p_bfi;<BR>  port_pnp_ctx_t *p_ctx 
= p_pnp_rec->pnp_rec.context;<BR> <BR>@@ -1199,7 +1199,7 
@@<BR>   return;<BR>  }<BR> <BR>- gp_port_mgr 
= p_bfi->p_port_mgr;<BR>+ p_port_mgr = 
p_bfi->p_port_mgr;<BR> <BR>  /* Within the PNP record's 
context is the port extension ptr;<BR>   * see 
port_was_hibernated().<BR>@@ -1223,7 +1223,7 @@<BR>  // Don't crash if 
p_ext->p_parent_ext is NULL<BR>  CL_ASSERT((p_ext->p_parent_ext 
== NULL) || p_bfi == 
p_ext->p_parent_ext->bus_filter);<BR>  <BR>- cl_mutex_acquire( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_acquire( 
&p_port_mgr->pdo_mutex );<BR>  CL_ASSERT( p_ext->h_ca 
);<BR> <BR>  if( p_ext->b_hibernating )<BR>@@ -1258,7 +1258,7 
@@<BR> <BR> hca_deref:<BR>  deref_al_obj( 
&p_ext->h_ca->obj );<BR>- cl_mutex_release( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_release( 
&p_port_mgr->pdo_mutex );<BR> <BR>  BUS_EXIT( BUS_DBG_PNP 
);<BR> }<BR>@@ -1333,19 +1333,19 
@@<BR> {<BR>  bus_port_ext_t *p_ext;<BR>  POWER_STATE  po_state;<BR>- port_mgr_t  *gp_port_mgr;<BR>+ port_mgr_t  *p_port_mgr;<BR> <BR>  BUS_ENTER( 
BUS_DBG_PNP );<BR> <BR>  p_ext = 
p_dev_obj->DeviceExtension;<BR>- gp_port_mgr = 
p_ext->pdo.p_parent_ext->bus_filter->p_port_mgr;<BR>+ p_port_mgr = 
p_ext->pdo.p_parent_ext->bus_filter->p_port_mgr;<BR> <BR>  /* 
Remove this PDO from its list. */<BR>- cl_mutex_acquire( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_mutex_acquire( 
&p_port_mgr->pdo_mutex );<BR>  BUS_TRACE( BUS_DBG_PNP, 
("Removing port from vector: PDO %p, ext 
%p\n",<BR>     p_dev_obj, p_ext) 
);<BR>- cl_qlist_remove_item( &gp_port_mgr->port_list, 
&p_ext->pdo.list_item );<BR>- cl_mutex_release( 
&gp_port_mgr->pdo_mutex );<BR>+ cl_qlist_remove_item( 
&p_port_mgr->port_list, &p_ext->pdo.list_item 
);<BR>+ cl_mutex_release( &p_port_mgr->pdo_mutex 
);<BR>  po_state.DeviceState = 
PowerDeviceD3;<BR>  PoSetPowerState( p_ext->pdo.cl_ext.p_pdo, 
DevicePowerState, po_state );<BR> <BR>Index: 
Q:/projinf3/trunk/core/bus/kernel/bus_driver.c<BR>===================================================================<BR>--- 
Q:/projinf3/trunk/core/bus/kernel/bus_driver.c (revision 3371)<BR>+++ 
Q:/projinf3/trunk/core/bus/kernel/bus_driver.c (revision 3372)<BR>@@ 
-799,10 +799,10 @@<BR>  // Mutex to synchronize multiple threads 
creating & deleting <BR>  // control deviceobjects. 
<BR> <BR>- ExInitializeFastMutex(&ControlMutex);<BR>- bfi_InstanceCount 
= 0;<BR>- memset(  __out_bcount(sizeof(bus_filters)) 
(void*)bus_filters, 0,<BR>-   sizeof(bus_filters) 
);<BR>+ ExInitializeFastMutex(&g_ControlMutex);<BR>+ g_bfi_InstanceCount 
= 0;<BR>+ memset(  __out_bcount(sizeof(g_bus_filters)) 
(void*)g_bus_filters, 0,<BR>+   sizeof(g_bus_filters) 
);<BR> <BR>  BUS_EXIT( BUS_DBG_DRV );<BR>  return 
STATUS_SUCCESS;<BR>Index: 
Q:/projinf3/trunk/core/bus/kernel/bus_pnp.c<BR>===================================================================<BR>--- 
Q:/projinf3/trunk/core/bus/kernel/bus_pnp.c (revision 3371)<BR>+++ 
Q:/projinf3/trunk/core/bus/kernel/bus_pnp.c (revision 3372)<BR>@@ -51,9 
+51,9 @@<BR> static UNICODE_STRING al_ifc_name;<BR> static 
UNICODE_STRING ci_ifc_name;<BR> <BR>-FAST_MUTEX    ControlMutex;<BR>-ULONG     bfi_InstanceCount;<BR>-bus_filter_t   bus_filters[MAX_BUS_FILTERS];<BR>+FAST_MUTEX    g_ControlMutex;<BR>+ULONG     g_bfi_InstanceCount;<BR>+bus_filter_t   g_bus_filters[MAX_BUS_FILTERS];<BR> <BR> extern 
ib_al_handle_t gh_al; // NULL if AL needs init.<BR> <BR>@@ -334,7 
+334,7 @@<BR>   return 
status;<BR>  }<BR> <BR>- ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+ ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR>  if 
( !gh_al ) {<BR>   /* Initialize AL 
*/<BR>   ib_status = al_initialize();<BR>@@ -343,12 +343,12 
@@<BR>    al_cleanup();<BR>    BUS_TRACE_EXIT( 
BUS_DBG_ERROR, ("al_initialize returned 
%s.\n",<BR>        ib_get_err_str(ib_status)) 
);<BR>-   ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+   ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR>    return 
STATUS_UNSUCCESSFUL;<BR>   }<BR>   AL_init_here = 
TRUE;<BR>  }<BR>- ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+ ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR> <BR>  /* 
Initialize the port manager. */<BR>  ib_status = create_port_mgr( 
p_ext->bus_filter, &p_ext->p_port_mgr );<BR>@@ -1252,9 +1252,9 
@@<BR> <BR>  CL_ASSERT((obj_type == BFI_PORT_MGR_OBJ) || 
(obj_type == BFI_IOU_MGR_OBJ));<BR> <BR>-    
ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+    
ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR> <BR>- for(p_bfi=bus_filters; 
p_bfi < &bus_filters[MAX_BUS_FILTERS]; p_bfi++) 
{<BR>+ for(p_bfi=g_bus_filters; p_bfi < 
&g_bus_filters[MAX_BUS_FILTERS]; p_bfi++) 
{<BR> <BR>   if ( !p_bfi->p_bus_ext 
)<BR>    continue;<BR>@@ -1272,13 +1272,13 
@@<BR>    }<BR>   }<BR>  }<BR>- ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+ ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR> <BR>  BUS_PRINT( 
BUS_DBG_PNP,<BR>     ("%s() cl_obj %p type %s_MGR_OBJ 
--> bfi[%d] 
%p\n",<BR>     __FUNCTION__,p_obj,<BR>     (obj_type 
== BFI_PORT_MGR_OBJ ? "PORT": "IOU"),<BR>-    (matched ? 
(matched - bus_filters) : (-1)), matched ) 
);<BR>+    (matched ? (matched - g_bus_filters) : (-1)), 
matched ) );<BR> <BR>  return matched;<BR> }<BR>@@ -1295,16 
+1295,16 @@<BR> <BR>  if ( ca_guid == 0ULL 
)<BR>  {<BR>-  matched = 
bus_filters;<BR>+  matched = 
g_bus_filters;<BR>   BUS_PRINT( BUS_DBG_PNP, ("%s() ERR guid 
%I64x -> bfi[0] 
%p\n",<BR>         __FUNCTION__, 
ca_guid, matched) );<BR>   CL_ASSERT( ca_guid 
);<BR>   return 
matched;<BR>  }<BR> <BR>- ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+ ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR> <BR>- for(p_bfi=bus_filters; 
p_bfi < &bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>+ for(p_bfi=g_bus_filters; p_bfi < 
&g_bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>  {<BR>   if ( !p_bfi->p_bus_ext 
)<BR>    continue;<BR>@@ -1315,7 +1315,7 
@@<BR>    break;<BR>   }<BR>  }<BR>- ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+ ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR> <BR> #if 
DBG<BR>  if ( !matched )<BR>@@ -1351,14 +1351,14 
@@<BR> <BR>  if ( ca_guid == 0ULL 
)<BR>  {<BR>-  matched = 
bus_filters;<BR>+  matched = 
g_bus_filters;<BR>   BUS_PRINT( BUS_DBG_PNP, ("%s() ERR guid 
0x%I64x -> bfi[0] %p\n",<BR>      __FUNCTION__, 
ca_guid, matched) );<BR>   CL_ASSERT( ca_guid 
);<BR>   return 
matched;<BR>  }<BR> <BR>- for(p_bfi=bus_filters; p_bfi < 
&bus_filters[MAX_BUS_FILTERS]; p_bfi++)<BR>+ for(p_bfi=g_bus_filters; 
p_bfi < &g_bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>  {<BR>   if ( !p_bfi->p_bus_ext 
)<BR>    continue;<BR>@@ -1376,9 +1376,9 @@<BR>   
*/<BR>  if ( !matched 
)<BR>  {<BR>-  ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+  ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR> <BR>-  for(p_bfi=bus_filters; 
p_bfi < &bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>+  for(p_bfi=g_bus_filters; p_bfi < 
&g_bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>   {<BR>    if ( 
!p_bfi->p_bus_ext )<BR>     continue; // not 
allocated.<BR>@@ -1391,13 +1391,13 
@@<BR>     break;<BR>    }<BR>   }<BR>-  ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+  ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR>  }<BR> <BR>  BUS_PRINT( 
BUS_DBG_PNP,<BR>     ("%s()%sguid 0x%I64x @ bfi[%d] %p 
\n",<BR>     __FUNCTION__, (ca_bound ? "SET ":" "), 
ca_guid,<BR>-    (matched ? (matched - bus_filters) : (-1)), 
matched ) );<BR>+    (matched ? (matched - g_bus_filters) : 
(-1)), matched ) );<BR> <BR>  return matched;<BR> }<BR>@@ 
-1413,10 +1413,10 @@<BR>      * IoCreateDeviceSecure 
& IoCreateSymbolicLink must be called at<BR>      * 
PASSIVE_LEVEL.<BR>   
*/<BR>- ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+ ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR> <BR>  // 
find 1st unused bfi slot.<BR>- for(p_bfi=bus_filters; p_bfi < 
&bus_filters[MAX_BUS_FILTERS]; p_bfi++)<BR>+ for(p_bfi=g_bus_filters; 
p_bfi < &g_bus_filters[MAX_BUS_FILTERS]; 
p_bfi++)<BR>  {<BR>   if ( !p_bfi->p_bus_ext 
)<BR>   {<BR>@@ -1426,17 +1426,17 @@<BR>     
*/<BR>    p_bfi->p_bus_ext = 
(bus_fdo_ext_t*)p_driver_obj;<BR>    matched = 
p_bfi;<BR>-   *p_instance_count = ++bfi_InstanceCount; // record 
in-use<BR>+   *p_instance_count = ++g_bfi_InstanceCount; // 
record 
in-use<BR>    break;<BR>   }<BR>  }<BR>- ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+ ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR> <BR> #if 
DBG<BR>  RtlStringCbPrintfA ( 
p_bfi->whoami,<BR>        
sizeof(p_bfi->whoami),<BR>        
"bfi-%d",<BR>-       (bfi_InstanceCount - 1) 
);<BR>+       (g_bfi_InstanceCount - 1) 
);<BR> <BR>  p_bfi->magic = BFI_MAGIC;<BR> #endif<BR>@@ 
-1453,11 +1453,11 
@@<BR> {<BR>  int remaining;<BR> <BR>- ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+ ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR>  p_bfi->p_bus_ext 
= NULL;<BR>  p_bfi->ca_guid = 0ULL;<BR>- remaining = 
--bfi_InstanceCount; // one less bfi 
in-use<BR>- ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+ remaining 
= --g_bfi_InstanceCount; // one less bfi 
in-use<BR>+ ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR> <BR>  return 
remaining;<BR> }<BR>@@ -1467,9 +1467,9 
@@<BR> {<BR>  int ic;<BR> <BR>- ExAcquireFastMutexUnsafe(&ControlMutex);<BR>- ic 

bfi_InstanceCount;<BR>- ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+ ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR>+ ic 

g_bfi_InstanceCount;<BR>+ ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR> <BR>  return 
ic;<BR> }<BR>Index: 
Q:/projinf3/trunk/core/bus/kernel/bus_driver.h<BR>===================================================================<BR>--- 
Q:/projinf3/trunk/core/bus/kernel/bus_driver.h (revision 3371)<BR>+++ 
Q:/projinf3/trunk/core/bus/kernel/bus_driver.h (revision 3372)<BR>@@ -218,7 
+218,7 @@<BR> <BR> /*<BR>  * Each instance of a bus filter on an 
HCA device stack (InfiniBandController)<BR>- * populates a bus_filter_t slot in 
bus_filters[MAX_BUS_FILTERS]; see<BR>+ * populates a bus_filter_t slot in 
g_bus_filters[MAX_BUS_FILTERS]; see<BR>  * bus_add_device(). Therefore 
MAX_BUS_FILTERS represents the MAX number of<BR>  * HCA's supported in a 
single system.<BR>  */<BR>@@ -253,9 +253,9 
@@<BR> <BR> } bus_filter_t;<BR> <BR>-extern 
bus_filter_t bus_filters[MAX_BUS_FILTERS];<BR>-extern ULONG 
bfi_InstanceCount;<BR>-extern FAST_MUTEX ControlMutex; // serializes 
InstanceCount & bus_filters<BR>+extern 
bus_filter_t g_bus_filters[MAX_BUS_FILTERS];<BR>+extern ULONG 
g_bfi_InstanceCount;<BR>+extern FAST_MUTEX g_ControlMutex; // serializes 
InstanceCount & g_bus_filters<BR> <BR> extern bus_filter_t 
*alloc_bfi( IN DRIVER_OBJECT *, OUT int * );<BR> extern int free_bfi( IN 
bus_filter_t *p_bfi );<BR>Index: 
Q:/projinf3/trunk/core/bus/kernel/bus_iou_mgr.c<BR>===================================================================<BR>--- 
Q:/projinf3/trunk/core/bus/kernel/bus_iou_mgr.c (revision 3371)<BR>+++ 
Q:/projinf3/trunk/core/bus/kernel/bus_iou_mgr.c (revision 3372)<BR>@@ 
-483,13 +483,13 @@<BR>   */<BR>  if ( !bus_globals.h_pnp_iou 
)<BR>  {<BR>-  ExAcquireFastMutexUnsafe(&ControlMutex);<BR>+  ExAcquireFastMutexUnsafe(&g_ControlMutex);<BR>   if 
( !bus_globals.h_pnp_iou 
)<BR>   {<BR>    bus_globals.h_pnp_iou = 
(ib_pnp_handle_t)1; /* block others */ <BR>    need_pnp_reg 

TRUE;<BR>   }<BR>-  ExReleaseFastMutexUnsafe(&ControlMutex);<BR>+  ExReleaseFastMutexUnsafe(&g_ControlMutex);<BR> <BR>   if 
( need_pnp_reg )<BR>   {<BR>@@ -564,7 +564,7 
@@<BR> <BR>  /* special case guid == 0 - walk all bus filter 
instances */<BR>  if ( ca_guid == 0ULL ) 
{<BR>-  for(p_bfi=bus_filters; p_bfi < 
&bus_filters[MAX_BUS_FILTERS]; p_bfi++) 
{<BR>+  for(p_bfi=g_bus_filters; p_bfi < 
&g_bus_filters[MAX_BUS_FILTERS]; p_bfi++) 
{<BR>    gp_iou_mgr = 
p_bfi->p_iou_mgr;<BR>    if ( !gp_iou_mgr 
)<BR>     continue;<BR></DIV></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>