pEndpoint->Attributes.Param.Connect.RnrRetryCount = pReply->rep.rnr_retry_cnt;\r
}\r
\r
+static void WvEpSaveReject(WV_ENDPOINT *pEndpoint, iba_cm_rej_event *pReject)\r
+{\r
+ UINT8 len;\r
+\r
+ len = sizeof(pEndpoint->Attributes.Param.Connect.Data);\r
+ RtlCopyMemory(pEndpoint->Attributes.Param.Connect.Data, pReject->p_pdata, len);\r
+ pEndpoint->Attributes.Param.Connect.DataLength = len;\r
+}\r
+\r
static NTSTATUS WvEpIbCmHandler(iba_cm_id *pId, iba_cm_event *pEvent)\r
{\r
WV_ENDPOINT *ep;\r
break;\r
case iba_cm_rej_received:\r
WdfObjectAcquireLock(ep->Queue);\r
- ep->State = WvEpDisconnected;\r
- WvCompleteRequests(ep->Queue, STATUS_REQUEST_NOT_ACCEPTED);\r
+ if (ep->State == WvEpPassiveConnect || ep->State == WvEpActiveConnect) {\r
+ ep->State = WvEpDisconnected;\r
+ WvEpSaveReject(ep, &pEvent->data.rej);\r
+ WvCompleteRequests(ep->Queue, STATUS_REQUEST_NOT_ACCEPTED);\r
+ }\r
WdfObjectReleaseLock(ep->Queue);\r
break;\r
case iba_cm_mra_received:\r