--- /dev/null
+Bottom: d78eca6ac87c6b053479b9aa7d943c5abe09b17f
+Top: c4ff9fd67b338806c462b101af47f7cc3c1ab265
+Author: U-AMR\MSHEFTY <MSHEFTY@mshefty-MOBL2.amr.corp.intel.com>
+Date: 2009-12-17 12:32:57 -0800
+
+Refresh of debug
+
+---
+
+diff --git a/trunk/core/al/kernel/al_cm_cep.c b/trunk/core/al/kernel/al_cm_cep.c
+index bca10ac..6118420 100644
+--- a/trunk/core/al/kernel/al_cm_cep.c
++++ b/trunk/core/al/kernel/al_cm_cep.c
+@@ -2200,9 +2200,9 @@ __cep_mad_send_cb(
+ IN void *context,\r
+ IN ib_mad_element_t *p_mad )\r
+ {\r
+-ib_wc_status_t mad_status;\r
+-cep_state_t state;\r
+-ib_net16_t attr_id;\r
++//ib_wc_status_t mad_status;\r
++//cep_state_t state;\r
++//ib_net16_t attr_id;\r
+ ib_api_status_t status;\r
+ cep_agent_t *p_port_cep;\r
+ kcep_t *p_cep;\r
+@@ -2234,40 +2234,50 @@ ib_net16_t attr_id;
+ p_mad->context1 = NULL;\r
+ \r
+ KeAcquireInStackQueuedSpinLockAtDpcLevel( &gp_cep_mgr->lock, &hdl );\r
++ if( p_cep->p_send_mad != p_mad || p_mad->status == IB_WCS_SUCCESS)\r
++ {\r
++ KeReleaseInStackQueuedSpinLockFromDpcLevel( &hdl );\r
++ ib_put_mad( p_mad );\r
++ goto done;\r
++ }\r
++\r
+ /* Clear the sent MAD pointer so that we don't try cancelling again. */\r
+ if( p_cep->p_send_mad == p_mad )\r
+ p_cep->p_send_mad = NULL;\r
+ \r
+-attr_id = p_mad->p_mad_buf->attr_id;\r
+-mad_status = p_mad->status;\r
+-state = p_cep->state;\r
+- switch( p_mad->status )\r
++//attr_id = p_mad->p_mad_buf->attr_id;\r
++//mad_status = p_mad->status;\r
++//state = p_cep->state;\r
++ //switch( p_mad->status )\r
++ //{\r
++ //case IB_WCS_SUCCESS:\r
++ // KeReleaseInStackQueuedSpinLockFromDpcLevel( &hdl );\r
++ // ib_put_mad( p_mad );\r
++ // break;\r
++\r
++ //case IB_WCS_CANCELED:\r
++ //if( p_cep->state != CEP_STATE_REQ_SENT &&\r
++ // p_cep->state != CEP_STATE_REQ_MRA_RCVD &&\r
++ // p_cep->state != CEP_STATE_REP_SENT &&\r
++ // p_cep->state != CEP_STATE_REP_MRA_RCVD &&\r
++ // p_cep->state != CEP_STATE_LAP_SENT &&\r
++ // p_cep->state != CEP_STATE_LAP_MRA_RCVD &&\r
++ // p_cep->state != CEP_STATE_DREQ_SENT &&\r
++ // p_cep->state != CEP_STATE_SREQ_SENT )\r
++ //{\r
++ // KeReleaseInStackQueuedSpinLockFromDpcLevel( &hdl );\r
++ // ib_put_mad( p_mad );\r
++ // break;\r
++ //}\r
++ if( p_mad->status == IB_WCS_CANCELED)\r
+ {\r
+- case IB_WCS_SUCCESS:\r
+- KeReleaseInStackQueuedSpinLockFromDpcLevel( &hdl );\r
+- ib_put_mad( p_mad );\r
+- break;\r
+-\r
+- case IB_WCS_CANCELED:\r
+- if( p_cep->state != CEP_STATE_REQ_SENT &&\r
+- p_cep->state != CEP_STATE_REQ_MRA_RCVD &&\r
+- p_cep->state != CEP_STATE_REP_SENT &&\r
+- p_cep->state != CEP_STATE_REP_MRA_RCVD &&\r
+- p_cep->state != CEP_STATE_LAP_SENT &&\r
+- p_cep->state != CEP_STATE_LAP_MRA_RCVD &&\r
+- p_cep->state != CEP_STATE_DREQ_SENT &&\r
+- p_cep->state != CEP_STATE_SREQ_SENT )\r
+- {\r
+- KeReleaseInStackQueuedSpinLockFromDpcLevel( &hdl );\r
+- ib_put_mad( p_mad );\r
+- break;\r
+- }\r
+ /* Treat as a timeout so we don't stall the state machine. */\r
+ p_mad->status = IB_WCS_TIMEOUT_RETRY_ERR;\r
++ }\r
+ \r
+- /* Fall through. */\r
+- case IB_WCS_TIMEOUT_RETRY_ERR:\r
+- default:\r
++ // /* Fall through. */\r
++ //case IB_WCS_TIMEOUT_RETRY_ERR:\r
++ //default:\r
+ /* Timeout. Reject the connection. */\r
+ switch( p_cep->state )\r
+ {\r
+@@ -2282,7 +2292,7 @@ state = p_cep->state;
+ break;\r
+ \r
+ case CEP_STATE_DREQ_DESTROY:\r
+-p_cep->old_state[0] = p_cep->state;\r
++//p_cep->old_state[0] = p_cep->state;\r
+ p_cep->state = CEP_STATE_DESTROY;\r
+ __insert_timewait( p_cep );\r
+ /* Fall through. */\r
+@@ -2299,9 +2309,9 @@ p_cep->old_state[0] = p_cep->state;
+ */\r
+ __format_mad_hdr( &p_cep->mads.drep.hdr, p_cep, CM_DREP_ATTR_ID );\r
+ __format_drep( p_cep, NULL, 0, &p_cep->mads.drep );\r
+-DbgPrintEx(DPFLTR_IHVDRIVER_ID, 0, "__cep_mad_send_cb cid 0x%x, attr 0x%x status 0x%x DREQ_SENT->TIMEWAIT\n",\r
+- p_cep->cid, attr_id, mad_status);\r
+-p_cep->old_state[1] = p_cep->state | 0x30000000;\r
++//DbgPrintEx(DPFLTR_IHVDRIVER_ID, 0, "__cep_mad_send_cb cid 0x%x, attr 0x%x status 0x%x DREQ_SENT->TIMEWAIT\n",\r
++// p_cep->cid, attr_id, mad_status);\r
++//p_cep->old_state[1] = p_cep->state | 0x30000000;\r
+ if( p_cep->p_send_mad )\r
+ {\r
+ ib_cancel_mad(h_mad_svc, p_cep->p_send_mad);\r
+@@ -2328,21 +2338,21 @@ p_cep->old_state[1] = p_cep->state | 0x30000000;
+ \r
+ if( status == IB_SUCCESS )\r
+ __process_cep( p_cep );\r
+- break;\r
+- }\r
++ //break;\r
++ //}\r
+ \r
+ done:\r
+ pfn_destroy_cb = p_cep->pfn_destroy_cb;\r
+ cep_context = p_cep->context;\r
+ \r
+ if( !cl_atomic_dec( &p_cep->ref_cnt ) && pfn_destroy_cb )\r
+-{\r
+-if (mad_status != IB_WCS_CANCELED)\r
+- DbgPrintEx(DPFLTR_IHVDRIVER_ID, 0, "__cep_mad_send_cb cid 0x%x, attr 0x%x status 0x%x state 0x%x old states 0x%x 0x%x\n",\r
+- p_cep->cid, attr_id, mad_status, state, p_cep->old_state[0], p_cep->old_state[1]);\r
+-\r
++//{\r
++//if (mad_status != IB_WCS_CANCELED)\r
++// DbgPrintEx(DPFLTR_IHVDRIVER_ID, 0, "__cep_mad_send_cb cid 0x%x, attr 0x%x status 0x%x state 0x%x old states 0x%x 0x%x\n",\r
++// p_cep->cid, attr_id, mad_status, state, p_cep->old_state[0], p_cep->old_state[1]);\r
++//\r
+ pfn_destroy_cb( cep_context );\r
+-}\r
++//}\r
+ AL_EXIT( AL_DBG_CM );\r
+ }