lib/sw_services/xilsem/src/client/xsem_client_api.c
XStatus XSem_CmdNpiInjectError (XIpiPsu *IpiInst, XSemIpiResp * Resp)
{
	XStatus Status = XST_FAILURE;
	u32 Payload[PAYLOAD_ARG_CNT] = {0U};
	u32 Response[RESPONSE_ARG_CNT] = {0U};

	if (NULL == IpiInst) {
		XSem_Dbg("[%s] ERROR: IpiInst is NULL\n\r", __func__);
		goto END;
	}

	if (NULL == Resp) {
		XSem_Dbg("[%s] ERROR: RespStruct is NULL\n\r", __func__);
		goto END;
	}

	PACK_PAYLOAD1(Payload, CMD_NPI_ERRINJECT);

	Status = XSem_IpiSendReqPlm(IpiInst, Payload);
	if (XST_SUCCESS != Status) {
		XSem_Dbg("[%s] ERROR: XSem_IpiSendReqPlm failed with"
		" ErrCode 0x%x\n\r", _func__, Status);
		goto END;
	}

	Status = XSem_IpiPlmRespMsg(IpiInst, Response);
	if (XST_SUCCESS != Status) {
		XSem_Dbg("[%s] ERROR: XSem_IpiPlmRespMsg failed with"
		" ErrCode 0x%x\n\r", __func__, Status);
		goto END;
	}

	Resp->RespMsg1 = Response[1U];
	Resp->RespMsg2 = Response[2U];

	XSem_Dbg("[%s] SUCCESS: 0x%x\n\r", __func__, Status);

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function is used to inject SHA error in NPI descriptor list
 *		(in the first NPI descriptor) from user application.
 *		Primarily this function sends an IPI request to PLM to invoke
 *		SEM NPI ErrorInject, waits for PLM to process the request and
 *		reads the response message.
 *
 * @param[in]	IpiInst		Pointer to IPI driver instance
 * @param[out]	Resp		Structure Pointer of IPI response.
 *		- Resp->RespMsg1: Acknowledgment ID of NPI error injection
 *		- Resp->RespMsg2: Status of NPI error injection
 *
 * @return	This API returns the success or failure.
 *		- XST_FAILURE: On NPI error injection failure
 *		- XST_SUCCESS: On NPI error injection success
 *
 * @note	The caller shall invoke this XSem_CmdNpiInjectError function
 *		again to correct the injected error in NPI descriptor.
 *****************************************************************************/
@brief       This function is used to inject SHA error in NPI descriptor list
(in the first NPI descriptor) from user application.
Primarily this function sends an IPI request to PLM to invoke
SEM NPI ErrorInject, waits for PLM to process the request and
reads the response message.

@param[in]   IpiInst         Pointer to IPI driver instance
@param[out]  Resp            Structure Pointer of IPI response.
- Resp->RespMsg1: Acknowledgment ID of NPI error injection
- Resp->RespMsg2: Status of NPI error injection

@return      This API returns the success or failure.
- XST_FAILURE: On NPI error injection failure
- XST_SUCCESS: On NPI error injection success

@note        The caller shall invoke this XSem_CmdNpiInjectError function
again to correct the injected error in NPI descriptor.
@brief This function is used to inject SHA error in NPI descriptor list ( in the first NPI descriptor ) from user application . Primarily this function sends an IPI request to PLM to invoke SEM NPI ErrorInject waits for PLM to process the request and reads the response message . @param [ in ] IpiInst Pointer to IPI driver instance @param [ out ] Resp Structure Pointer of IPI response . - Resp - > RespMsg1 : Acknowledgment ID of NPI error injection - Resp - > RespMsg2 : Status of NPI error injection @return This API returns the success or failure . - XST_FAILURE : On NPI error injection failure - XST_SUCCESS : On NPI error injection success @note The caller shall invoke this XSem_CmdNpiInjectError function again to correct the injected error in NPI descriptor .
XStatus XSem_CmdNpiInjectError (XIpiPsu *IpiInst, XSemIpiResp * Resp)
{
	XStatus Status = XST_FAILURE;
	u32 Payload[PAYLOAD_ARG_CNT] = {0U};
	u32 Response[RESPONSE_ARG_CNT] = {0U};
	if (NULL == IpiInst) {
		XSem_Dbg("[%s] ERROR: IpiInst is NULL\n\r", __func__);
		goto END;
	}
	if (NULL == Resp) {
		XSem_Dbg("[%s] ERROR: RespStruct is NULL\n\r", __func__);
		goto END;
	}
	PACK_PAYLOAD1(Payload, CMD_NPI_ERRINJECT);
	Status = XSem_IpiSendReqPlm(IpiInst, Payload);
	if (XST_SUCCESS != Status) {
		XSem_Dbg("[%s] ERROR: XSem_IpiSendReqPlm failed with"
		" ErrCode 0x%x\n\r", _func__, Status);
		goto END;
	}
	Status = XSem_IpiPlmRespMsg(IpiInst, Response);
	if (XST_SUCCESS != Status) {
		XSem_Dbg("[%s] ERROR: XSem_IpiPlmRespMsg failed with"
		" ErrCode 0x%x\n\r", __func__, Status);
		goto END;
	}
	Resp->RespMsg1 = Response[1U];
	Resp->RespMsg2 = Response[2U];
	XSem_Dbg("[%s] SUCCESS: 0x%x\n\r", __func__, Status);
END:
	return Status;
}
XStatus XSem_CmdNpiInjectError ( XIpiPsu * IpiInst , XSemIpiResp * Resp ) { XStatus Status = XST_FAILURE ; u32 Payload [ PAYLOAD_ARG_CNT ] = { 0U } ; u32 Response [ RESPONSE_ARG_CNT ] = { 0U } ; if ( NULL == IpiInst ) { XSem_Dbg ( " \n \r " , __func__ ) ; goto END ; } if ( NULL == Resp ) { XSem_Dbg ( " \n \r " , __func__ ) ; goto END ; } PACK_PAYLOAD1 ( Payload , CMD_NPI_ERRINJECT ) ; Status = XSem_IpiSendReqPlm ( IpiInst , Payload ) ; if ( XST_SUCCESS != Status ) { XSem_Dbg ( " " " \n \r " , _func__ , Status ) ; goto END ; } Status = XSem_IpiPlmRespMsg ( IpiInst , Response ) ; if ( XST_SUCCESS != Status ) { XSem_Dbg ( " " " \n \r " , __func__ , Status ) ; goto END ; } Resp -> RespMsg1 = Response [ 1U ] ; Resp -> RespMsg2 = Response [ 2U ] ; XSem_Dbg ( " \n \r " , __func__ , Status ) ; END : return Status ; }
@brief       This function is used to inject SHA error in NPI descriptor list
              (in the first NPI descriptor) from user application.
@brief This function is used to inject SHA error in NPI descriptor list ( in the first NPI descriptor ) from user application .