|
@@ -73,6 +73,8 @@ void *UDSIfcTask(void* pArg)
|
|
|
MsgPkt_T Req;
|
|
|
prctl(PR_SET_NAME,__FUNCTION__,0,0,0);
|
|
|
|
|
|
+ printf("UDSIfcTask start...\n");
|
|
|
+
|
|
|
//create UDS_IFC_Q
|
|
|
if(-1 != access(UDS_IFC_Q, F_OK))
|
|
|
{
|
|
@@ -133,7 +135,7 @@ void *UDSIfcTask(void* pArg)
|
|
|
printf("UDSIfc.c: Error Fetching Data from UDSIfcQ\n");
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
ProcessUDSReq(&Req);
|
|
|
}
|
|
|
|
|
@@ -208,6 +210,8 @@ void *RecvUDSPkt(void *pArg)
|
|
|
int curThreadIndex = 0;
|
|
|
fd_set fds;
|
|
|
|
|
|
+ printf("RecvUDSPkt start...\n");
|
|
|
+
|
|
|
memset(&local,0,sizeof(local));
|
|
|
|
|
|
locallen=sizeof(local);
|
|
@@ -289,11 +293,11 @@ int ReadUDSData(MsgPkt_T *MsgPkt,int Socket )
|
|
|
return UDS_FAILURE;
|
|
|
}
|
|
|
|
|
|
- int i;
|
|
|
- printf("---> server recv1 %#x: ", Len);
|
|
|
- for(i=0;i<Len;i++)
|
|
|
- printf("%#x ", pData[RecvdLen+i]);
|
|
|
- printf("\n");
|
|
|
+ // int i;
|
|
|
+ // printf("---> server recv1 %#x: ", Len);
|
|
|
+ // for(i=0;i<Len;i++)
|
|
|
+ // printf("%#x ", pData[RecvdLen+i]);
|
|
|
+ // printf("\n");
|
|
|
|
|
|
RecvdLen += Len;
|
|
|
}
|
|
@@ -308,11 +312,11 @@ int ReadUDSData(MsgPkt_T *MsgPkt,int Socket )
|
|
|
return UDS_FAILURE;
|
|
|
}
|
|
|
|
|
|
- int i;
|
|
|
- printf("---> server recv2 %#x: ", Len);
|
|
|
- for(i=0;i<Len;i++)
|
|
|
- printf("%#x ", pData[RecvdLen+i]);
|
|
|
- printf("\n");
|
|
|
+ // int i;
|
|
|
+ // printf("---> server recv2 %#x: ", Len);
|
|
|
+ // for(i=0;i<Len;i++)
|
|
|
+ // printf("%#x ", pData[RecvdLen+i]);
|
|
|
+ // printf("\n");
|
|
|
|
|
|
RecvdLen += Len;
|
|
|
RemLen -= Len;
|
|
@@ -324,10 +328,10 @@ int ReadUDSData(MsgPkt_T *MsgPkt,int Socket )
|
|
|
MsgPkt->Privilege = pIPMIUDSMsg->Privilege;
|
|
|
MsgPkt->Socket = Socket;
|
|
|
MsgPkt->Size = RecvdLen;
|
|
|
- // MsgPkt->Param = UDS_SMB_PARAM;
|
|
|
- MsgPkt->Channel = pIPMIUDSMsg->ChannelNum;
|
|
|
- // MsgPkt->SessionType = UDS_SESSION_TYPE;
|
|
|
- strcpy ((char *)MsgPkt->SrcQ, UDS_RES_Q);
|
|
|
+ MsgPkt->Param = PARAM_IFC;
|
|
|
+ MsgPkt->Channel = pIPMIUDSMsg->ChannelNum;
|
|
|
+ MsgPkt->SessionType = UDS_SESSION_TYPE;
|
|
|
+ MsgPkt->SrcQ = gFdUdsRes;
|
|
|
|
|
|
return UDS_SUCCESS;
|
|
|
}
|
|
@@ -358,35 +362,33 @@ static int ProcessUDSReq(MsgPkt_T *pReq )
|
|
|
// }
|
|
|
// else if((pReq->SessionID == 0) && CheckReservedCmd(pReq->Cmd))
|
|
|
// {
|
|
|
- // FillUDSResponsePacket(pReq,&pRes,CC_INV_DATA_FIELD,BMCInst);
|
|
|
+ // FillUDSResponsePacket(pReq,&pRes,CC_INV_DATA_FIELD);
|
|
|
// SendUDSPkt(&pRes,BMCInst);
|
|
|
// return UDS_FAILURE;
|
|
|
// }
|
|
|
|
|
|
- // /*Posting the request to Msg Handler for processing the command */
|
|
|
- // if (UDS_SUCCESS != PostMsg (pReq, MSG_HNDLR_Q, BMCInst))
|
|
|
- // {
|
|
|
- // IPMI_ASSERT (FALSE);
|
|
|
- // return UDS_FAILURE;
|
|
|
- // }
|
|
|
+ /*Posting the request to Msg Handler for processing the command */
|
|
|
+ if (UDS_SUCCESS != PostMsg (gFd_MsgHndlrIfc, pReq))
|
|
|
+ {
|
|
|
+ return UDS_FAILURE;
|
|
|
+ }
|
|
|
|
|
|
- // /* Get the response from the Message handler Task */
|
|
|
- // memset(&pRes,0,sizeof(MsgPkt_T));
|
|
|
- // if (UDS_SUCCESS != GetMsg (&pRes, UDS_RES_Q, WAIT_INFINITE, BMCInst))
|
|
|
- // {
|
|
|
- // IPMI_ASSERT (FALSE);
|
|
|
- // return UDS_FAILURE;
|
|
|
- // }
|
|
|
+ /* Get the response from the Message handler Task */
|
|
|
+ memset(&pRes,0,sizeof(MsgPkt_T));
|
|
|
+ if (UDS_SUCCESS != GetMsg (gFdUdsRes, &pRes, WAIT_INFINITE))
|
|
|
+ {
|
|
|
+ return UDS_FAILURE;
|
|
|
+ }
|
|
|
|
|
|
// if(!CheckReservedCmd(pRes.Cmd) && (pRes.SessionID == 0) && (pRes.Cmd != ReservedCmd[1]))
|
|
|
// {
|
|
|
// RetVal = AddUDSInfo(pReq,&pRes,BMCInst);
|
|
|
// }
|
|
|
|
|
|
- FillUDSResponsePacket(pReq,&pRes,CC_NORMAL);
|
|
|
+ //FillUDSResponsePacket(pReq,&pRes,CC_NORMAL);
|
|
|
|
|
|
/* Sending the Packet to the corresponding client*/
|
|
|
- //if((UDS_SUCCESS == RetVal) || (UDS_FAILURE == RetVal))
|
|
|
+ if((UDS_SUCCESS == RetVal) || (UDS_FAILURE == RetVal))
|
|
|
{
|
|
|
SendUDSPkt(&pRes);
|
|
|
}
|
|
@@ -401,11 +403,11 @@ static int ProcessUDSReq(MsgPkt_T *pReq )
|
|
|
**/
|
|
|
int SendUDSPkt (MsgPkt_T *pRes)
|
|
|
{
|
|
|
- int i;
|
|
|
- printf("---> server Send %#x: ", pRes->Size);
|
|
|
- for(i=0;i<pRes->Size;i++)
|
|
|
- printf("%#x ", pRes->Data[i]);
|
|
|
- printf("\n");
|
|
|
+ // int i;
|
|
|
+ // printf("---> server Send %#x: ", pRes->Size);
|
|
|
+ // for(i=0;i<pRes->Size;i++)
|
|
|
+ // printf("%#x ", pRes->Data[i]);
|
|
|
+ // printf("\n");
|
|
|
/* Send the UDS response packet */
|
|
|
if(UDS_FAILURE == send(pRes->Socket,pRes->Data,pRes->Size,MSG_NOSIGNAL))
|
|
|
{
|