[ofw] patch: [IBBUS] g_stat: added threads for handling SET POWER IRP.

Tzachi Dar tzachid at mellanox.co.il
Tue Aug 31 08:31:27 PDT 2010


Signed off by: leonid
Mlnx 5271

Index: B:/users/tzachid/projinf9/trunk/core/bus/kernel/bus_pnp.c
===================================================================
--- B:/users/tzachid/projinf9/trunk/core/bus/kernel/bus_pnp.c               (revision 5270)
+++ B:/users/tzachid/projinf9/trunk/core/bus/kernel/bus_pnp.c            (revision 5271)
@@ -1330,6 +1330,12 @@
                BUS_PRINT( BUS_DBG_POWER,
                                ("***** re-register CA, IRQL %d\n", KeGetCurrentIrql()));

+             // stat
+             if ( p_ext->p_stat ) {
+                             p_ext->p_stat->thread[BUS_ST_THREAD_POWER_UP].p_thread = KeGetCurrentThread();
+                             memcpy( p_ext->p_stat->thread[BUS_ST_THREAD_POWER_UP].thread_name, "PowerUp", 8 );
+             }
+
                status = __register_ca( p_dev_obj );
                if( !NT_SUCCESS( status ) ) {
                                BUS_PRINT( BUS_DBG_POWER,
@@ -1349,6 +1355,11 @@
                                ("Power increased to: device %d, system %d.\n",
                                (int)p_ext->device_power_state, (int)p_ext->system_power_state));

+             if ( p_ext->p_stat ) {
+                             p_ext->p_stat->thread[BUS_ST_THREAD_POWER_UP].p_thread = NULL;
+                             *p_ext->p_stat->thread[BUS_ST_THREAD_POWER_UP].thread_name = '\0';
+             }
+
                goto exit;

 err_fdo_start:
@@ -1431,6 +1442,12 @@
                PoStartNextPowerIrp( p_irp );
                IoReleaseRemoveLock( &p_ext->cl_ext.remove_lock, p_irp );

+             // stat
+             if ( p_ext->p_stat ) {
+                             p_ext->p_stat->thread[BUS_ST_THREAD_POWER_DOWN].p_thread = NULL;
+                             *p_ext->p_stat->thread[BUS_ST_THREAD_POWER_DOWN].thread_name = '\0';
+             }
+
                BUS_EXIT( BUS_DBG_POWER );
                return STATUS_SUCCESS;
 }
@@ -1470,6 +1487,12 @@
                BUS_PRINT( BUS_DBG_POWER,
                                ("***** deregister CA \n"));

+             // stat
+             if ( p_ext->p_stat ) {
+                             p_ext->p_stat->thread[BUS_ST_THREAD_POWER_DOWN].p_thread = KeGetCurrentThread();
+                             memcpy( p_ext->p_stat->thread[BUS_ST_THREAD_POWER_DOWN].thread_name, "PowerDown", 10 );
+             }
+
                __deregister_ca( p_dev_obj );

                IoCopyCurrentIrpStackLocationToNext( p_irp );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100831/498abfa3/attachment.html>


More information about the ofw mailing list