void HandleAudioEventReqCb(RPC_Msg_t* pMsg, 
						 ResultDataBufHandle_t dataBufHandle, 
						 UInt32 userContextData)
{
	Log_DebugPrintf(LOGID_MISC, "HandleAudioEventRspCb msg=0x%x clientID=%d ", pMsg->msgId, 0);

#if defined(FUSE_COMMS_PROCESSOR) 

	 RPC_SendAckForRequest(dataBufHandle, 0);

	if(pMsg->msgId == MSG_AUDIO_CTRL_GENERIC_REQ)
	{
		Audio_Params_t* p = (Audio_Params_t*)pMsg->dataBuf;
		UInt32 val = audio_control_generic(p->param1,p->param2,p->param3,p->param4,p->param5,p->param6);

		SendAudioRspForRequest(pMsg, MSG_AUDIO_CTRL_GENERIC_RSP, &val);
	}
	else if(pMsg->msgId == MSG_AUDIO_CTRL_DSP_REQ)
	{
		Audio_Params_t* p = (Audio_Params_t*)pMsg->dataBuf;
		UInt32 val = audio_control_dsp(p->param1,p->param2,p->param3,p->param4,p->param5,p->param6);
		
		SendAudioRspForRequest(pMsg, MSG_AUDIO_CTRL_DSP_RSP, &val);
	}
	else
		xassert(0, pMsg->msgId);
#endif

	RPC_SYSFreeResultDataBuffer(dataBufHandle);
}
static void HandleSysReqMsg(RPC_Msg_t* pMsg, 
				  ResultDataBufHandle_t dataBufHandle, 
				  UInt32 userContextData)
{
	Boolean ret;

	SYS_ReqRep_t* req = (SYS_ReqRep_t*)pMsg->dataBuf;

	RPC_SendAckForRequest(dataBufHandle, 0);

#ifndef UNDER_LINUX
	ret = SYS_IsRegisteredClientID(pMsg->clientID);

	SYS_TRACE( "HandleSysReqMsg msg=0x%x clientID=%d ret=%d\n", pMsg->msgId, pMsg->clientID, ret);

	if(pMsg->clientID > 0 && !ret && pMsg->msgId != MSG_SYS_SYNC_REG_EVENT_REQ)
	{
		SYS_RegisterForPredefinedClient(SYS_DefaultRemoteHandler, pMsg->clientID, 0xFFFFFFFF);
	}
#endif

	if(pMsg->msgId == MSG_AT_COMMAND_REQ)
	{
	
	}
	else
	{
		SYS_GenCommsMsgHnd(pMsg,req);
	}

	RPC_SYSFreeResultDataBuffer(dataBufHandle);
}
Exemplo n.º 3
0
void HandleAudioEventrespCb(RPC_Msg_t *pMsg,
			    ResultDataBufHandle_t dataBufHandle,
			    UInt32 userContextData)
{
	if (MSG_AUDIO_CALL_STATUS_IND == pMsg->msgId) {
		UInt32 *codecID = NULL;
		codecID = (UInt32 *) pMsg->dataBuf;

		aTrace(LOG_AUDIO_DRIVER,
				"HandleAudioEventrespCb : codecid=0x%lx \r\n",
				(*codecID));

		if ((*codecID) != 0)	/* Make sure codeid is not 0 */
			AUDDRV_Telephone_RequestRateChange((UInt8) (*codecID));
	}

	if (MSG_AUDIO_START_TUNING_IND == pMsg->msgId) {
		unsigned int addr = *((int *) pMsg->dataBuf);

		aTrace(LOG_AUDIO_DRIVER,
			"HandleAudioEventrespCb : start tuning addr=0x%x\r\n",
			addr);
		AUDDRV_SetTuningFlag(1);
	}

	if (MSG_AUDIO_STOP_TUNING_IND == pMsg->msgId) {
		unsigned int addr = *((int *) pMsg->dataBuf);

		aTrace(LOG_AUDIO_DRIVER,
			"HandleAudioEventrespCb : stop tuning addr=0x%x\r\n",
			addr);
		AUDDRV_SetTuningFlag(0);
	}

	if (MSG_AUDIO_TUNING_SETPARM_IND == pMsg->msgId) {
		struct AudioTuningParamInd_st paramInd =
			*((struct AudioTuningParamInd_st *) pMsg->dataBuf);

		aTrace(LOG_AUDIO_DRIVER,
			"HandleAudioEventrespCb : mode %d, tune param=%d value=%d\r\n",
			(int)paramInd.audioModeApp,
			(int)paramInd.audioParamType,
			*((UInt16 *)&paramInd.param[0]));
	}

	if ((MSG_AUDIO_CTRL_GENERIC_RSP == pMsg->msgId) ||
		(MSG_AUDIO_CTRL_DSP_RSP == pMsg->msgId) ||
		(MSG_AUDIO_COMP_FILTER_RSP == pMsg->msgId)) {
		aTrace(LOG_AUDIO_DRIVER,
			"HandleAudioEventrespCb GENERIC_DSP_RSP: tid=%ld\n",
				pMsg->tid);
	}
	if (dataBufHandle)
		RPC_SYSFreeResultDataBuffer(dataBufHandle);
	else
		aTrace(LOG_AUDIO_DRIVER,
			"HandleAudioEventrespCb : dataBufHandle is NULL \r\n");
}
Exemplo n.º 4
0
static void HandleSysEventRspCb(RPC_Msg_t *pMsg,
				ResultDataBufHandle_t dataBufHandle,
				UInt32 userContextData)
{
	/*SYS_ReqRep_t* rsp; */
	/* SYS_TRACE( "HandleSysEventRspCb msg=0x%x clientID=%d\n", pMsg->msgId, 0); */

	RPC_SYSFreeResultDataBuffer(dataBufHandle);
}
Exemplo n.º 5
0
/**
	Release the response buffer associated with the current task.
**/
void RPC_SyncReleaseResponseBuffer(void)
{
	TaskRequestMap_t *taskMap = GetMapForCurrentTask();
	assert(taskMap);
	assert(taskMap->dataBufHandle);

	RPC_SYSFreeResultDataBuffer(taskMap->dataBufHandle);
	taskMap->dataBufHandle = NULL;
}
static void HandleSysEventRspCb(RPC_Msg_t* pMsg, 
						 ResultDataBufHandle_t dataBufHandle, 
						 UInt32 userContextData)
{
	//SYS_ReqRep_t* rsp;
#ifndef UNDER_LINUX
	SYS_TRACE( "HandleSysEventRspCb msg=0x%x clientID=%d \n", pMsg->msgId, 0);
#endif

	RPC_SYSFreeResultDataBuffer(dataBufHandle);
}
Exemplo n.º 7
0
void HandleAudioEventReqCb(RPC_Msg_t *pMsg,
			   ResultDataBufHandle_t dataBufHandle,
			   UInt32 userContextData)
{
	aTrace(LOG_AUDIO_DRIVER,
			"HandleAudioEventRspCb msg=0x%x clientID=%d ",
			pMsg->msgId, 0);

#if defined(CONFIG_BCM_MODEM)
	RPC_SYSFreeResultDataBuffer(dataBufHandle);
#endif
}
Exemplo n.º 8
0
static void HandleSysReqMsg(RPC_Msg_t *pMsg,
			    ResultDataBufHandle_t dataBufHandle,
			    UInt32 userContextData)
{
	SYS_ReqRep_t *req = (SYS_ReqRep_t *)pMsg->dataBuf;

	RPC_SendAckForRequest(dataBufHandle, 0);

	if (pMsg->msgId == MSG_AT_COMMAND_REQ) {

	} else {
		SYS_GenCommsMsgHnd(pMsg, req);
	}

	RPC_SYSFreeResultDataBuffer(dataBufHandle);
}
void HandleDrxEventRspCb(RPC_Msg_t *pMsg,
			 ResultDataBufHandle_t dataBufHandle,
			 UInt32 userContextData)
{
	_DBG_(RPC_TRACE("HandleDrxEventRspCb %d\r\n", pMsg->msgId));
	if (pMsg->msgId == MSG_ADC_DRX_SYNC_IND) {
		/*Handle event */
	} else if (pMsg->msgId == MSG_RPC_SIMPLE_REQ_RSP) {
		RPC_SimpleMsg_t *pSimpMsg = (RPC_SimpleMsg_t *) pMsg->dataBuf;
		_DBG_(RPC_TRACE
		      ("HandleDrxEventRspCb MSG_RPC_SIMPLE_REQ_RSP %d %d\r\n",
		       pSimpMsg->type, pSimpMsg->param1));

	}
	RPC_SYSFreeResultDataBuffer(dataBufHandle);
}
Exemplo n.º 10
0
void CAPI2_DispatchRequestToServer(RPC_Msg_t* pMsg, 
				  ResultDataBufHandle_t handle)
{
	CAPI2_ReqRep_t* reqRep = (CAPI2_ReqRep_t*)(pMsg->dataBuf);

	//send ack
	RPC_SendAckForRequest(handle, 0);

	switch(reqRep->msgId)
	{
		default:
			CAPI2_GenAppsMsgHnd(pMsg, reqRep);
			RPC_SYSFreeResultDataBuffer(handle);
			break;
	}
}
void KPDP_Capi2HandleRespCbk(UInt32 tid, UInt8 clientID, MsgType_t msgType, Result_t result, void *dataBuf, UInt32 dataLength, ResultDataBufHandle_t dataBufHandle)
{
    Kpdp_CAPI2Info_t *capi2_rsp = NULL;

    //KPDP_DEBUG(DBG_INFO, "tid:%lu msgtype:0x%x result:%d\n", tid, msgType, result);
    capi2_rsp = kmalloc(sizeof(Kpdp_CAPI2Info_t), GFP_KERNEL);
    if(!capi2_rsp)
    {
        KPDP_DEBUG(DBG_ERROR, "Unable to allocate CAPI2 Response memory\n");
        RPC_SYSFreeResultDataBuffer(dataBufHandle);
        return;
    }

    capi2_rsp->tid = tid;
    capi2_rsp->clientID = clientID;    
    capi2_rsp->msgType = msgType;
    capi2_rsp->result = result;
    capi2_rsp->dataBuf = dataBuf;
    capi2_rsp->dataLength = dataLength;
    capi2_rsp->dataBufHandle = dataBufHandle;

    if(capi2_rsp->tid == 0) //notify
    {
        unsigned long irql;
#ifdef CONFIG_HAS_WAKELOCK
        wake_lock(&kpdp_notify_wake_lock);
#endif
        spin_lock_irqsave(&gKpdpNotifyWq.lock, irql);
        list_add_tail(&capi2_rsp->list, &gKpdpNotifyWq.capi2_head.list); 
        spin_unlock_irqrestore(&gKpdpNotifyWq.lock, irql);
        queue_work(gKpdpNotifyWq.notify_wq, &gKpdpNotifyWq.notifyq);
    }
    else //response
    {
        unsigned long irql;
#ifdef CONFIG_HAS_WAKELOCK
        wake_lock(&kpdp_rsp_wake_lock);
#endif
        spin_lock_irqsave(&gKpdpRespWq.lock, irql);
        list_add_tail(&capi2_rsp->list, &gKpdpRespWq.capi2_head.list); 
        spin_unlock_irqrestore(&gKpdpRespWq.lock, irql);
        queue_work(gKpdpRespWq.rsp_wq, &gKpdpRespWq.responseq);
    }
}
Exemplo n.º 12
0
void HandleAudioEventReqCb(RPC_Msg_t *pMsg,
			   ResultDataBufHandle_t dataBufHandle,
			   UInt32 userContextData)
{
	aTrace(LOG_AUDIO_DRIVER,
			"HandleAudioEventRspCb msg=0x%x clientID=%d ",
			pMsg->msgId, 0);

#if defined(FUSE_COMMS_PROCESSOR)

	RPC_SendAckForRequest(dataBufHandle, 0);

	if (pMsg->msgId == MSG_AUDIO_CTRL_GENERIC_REQ) {
		Audio_Params_t *p = (Audio_Params_t *) pMsg->dataBuf;
		UInt32 val =
		    audio_control_generic(p->param1, p->param2, p->param3,
					  p->param4, p->param5, p->param6);

		SendAudioRspForRequest(pMsg, MSG_AUDIO_CTRL_GENERIC_RSP, &val);
	} else if (pMsg->msgId == MSG_AUDIO_CTRL_DSP_REQ) {
		Audio_Params_t *p = (Audio_Params_t *) pMsg->dataBuf;
		UInt32 val = audio_control_dsp(p->param1, p->param2, p->param3,
					       p->param4, p->param5, p->param6);

		SendAudioRspForRequest(pMsg, MSG_AUDIO_CTRL_DSP_RSP, &val);
	} else if (pMsg->msgId == MSG_AUDIO_COMP_FILTER_REQ) {
		AudioCompfilter_t *p = (AudioCompfilter_t *) pMsg->dataBuf;
		UInt32 val = audio_cmf_filter(p);

		SendAudioRspForRequest(pMsg, MSG_AUDIO_COMP_FILTER_RSP, &val);
	} else
		audio_xassert(0, pMsg->msgId);
#endif
#if defined(CONFIG_BCM_MODEM)
	RPC_SYSFreeResultDataBuffer(dataBufHandle);
#endif
}
void HandleAudioEventrespCb(RPC_Msg_t* pMsg,
                            ResultDataBufHandle_t dataBufHandle,
                            UInt32 userContextData)
{
    if ( pMsg->tid == 0 )
    {
        if (MSG_CALL_STATUS_IND == pMsg->msgId )
        {
            UInt32 len;
            void* dataBuf;
            CallStatusMsg_t* p = NULL;
            CAPI2_ReqRep_t * const reqRep = (CAPI2_ReqRep_t*)pMsg->dataBuf;

            Log_DebugPrintf(LOGID_MISC, "HandleAudioEventrespCb : ===pMsg->tid=0x%x, pMsg->clientID=0x%x, pMsg->msgId=0x%x \r\n",(unsigned int)pMsg->tid, pMsg->clientID, pMsg->msgId);

            CAPI2_GetPayloadInfo(reqRep, pMsg->msgId, &dataBuf, &len);

            p = (CallStatusMsg_t*)dataBuf;

            Log_DebugPrintf(LOGID_MISC, "HandleAudioEventrespCb : codecid=0x%x, callstatus=0x%x \r\n",p->codecId, p->callstatus);

            if ( client_call_codecId_handler && p->codecId != 0 && p->callstatus == CC_CALL_SYNC_IND)
            {
                Log_DebugPrintf(LOGID_MISC, "HandleAudioEventrespCb : calling client_call_codecId_handler\r\n");
                client_call_codecId_handler(p->codecId);
            }
        }
    }

    if ( dataBufHandle )
    {
        RPC_SYSFreeResultDataBuffer(dataBufHandle);
    }
    else
        Log_DebugPrintf(LOGID_MISC, "HandleAudioEventrespCb : dataBufHandle is NULL \r\n");
}
Exemplo n.º 14
0
void KRIL_Capi2HandleRespCbk(UInt32 tid, UInt8 clientID, MsgType_t msgType, UInt32 DialogId, Result_t result, void *dataBuf, UInt32 dataLength, ResultDataBufHandle_t dataBufHandle)
{
    Kril_CAPI2Info_t *capi2_rsp = NULL;

    //KRIL_DEBUG(DBG_INFO, "tid:%lu msgtype:0x%x result:%d\n", tid, msgType, result);
    if(MSG_STK_CC_DISPLAY_IND == msgType)
    {
        // KRIL_DEBUG(DBG_TRACE, "temporary discard the message MSG_STK_CC_DISPLAY_IND...!\n");
        // RPC_SYSFreeResultDataBuffer(dataBufHandle);
        //return;
        KRIL_DEBUG(DBG_INFO, "KRIL_Capi2HandleRespCbk::MSG_STK_CC_DISPLAY_IND tid=%lu\n", tid)
        tid = 0;
    }

    capi2_rsp = kmalloc(sizeof(Kril_CAPI2Info_t), GFP_KERNEL);
    if(!capi2_rsp)
    {
        KRIL_DEBUG(DBG_ERROR, "Unable to allocate CAPI2 Response memory\n");
        RPC_SYSFreeResultDataBuffer(dataBufHandle);
        return;
    }

    capi2_rsp->tid = tid;
    capi2_rsp->clientID = clientID;
    capi2_rsp->msgType = msgType;
    capi2_rsp->DialogId = DialogId;
    capi2_rsp->result = result;
    capi2_rsp->dataBuf = dataBuf;
    capi2_rsp->dataLength = dataLength;
    capi2_rsp->dataBufHandle = dataBufHandle;

    if (MSG_SMS_WRITE_RSP_IND == capi2_rsp->msgType && KRIL_GetSMSToSIMTID() != 0) // Change the notify message to response message for the MSG_SMS_WRITE_RSP_IND
    {
        capi2_rsp->tid = KRIL_GetSMSToSIMTID();
        KRIL_SetSMSToSIMTID(0);
    }
    else if (MSG_SERVING_CELL_INFO_IND == capi2_rsp->msgType && KRIL_GetServingCellTID() != 0)  // Change the notify message to response message for the MSG_SERVING_CELL_INFO_IND
    {
        capi2_rsp->tid = KRIL_GetServingCellTID();
        KRIL_SetServingCellTID(0);
    }
    else if ( (MSG_PLMN_SELECT_CNF  == capi2_rsp->msgType) && (0 != KRIL_GetNetworkSelectTID()) )
    {
        capi2_rsp->tid = KRIL_GetNetworkSelectTID();
        KRIL_SetNetworkSelectTID(0);
    }
    else if ( (KRIL_GetHungupForegroundResumeBackgroundEndMPTY() != 0) && (MSG_VOICECALL_RELEASE_CNF  == capi2_rsp->msgType) )
    {
        capi2_rsp->tid = KRIL_GetHungupForegroundResumeBackgroundEndMPTY();
    }

    /*+20110418 BCOM PATCH FOR DebugScreen*/
    else if (MSG_MEASURE_REPORT_PARAM_IND == capi2_rsp->msgType && KRIL_GetMeasureReportTID() != 0)  // Change the notify message to response message for the MSG_MEASURE_REPORT_PARAM_IND
    {
        capi2_rsp->tid = KRIL_GetMeasureReportTID();
        KRIL_SetMeasureReportTID(0);
    }
    /*-20110418 BCOM PATCH FOR DebugScreen*/

    if(capi2_rsp->tid == 0) //notify
    {
        unsigned long irql;
#ifdef CONFIG_HAS_WAKELOCK
        wake_lock(&kril_notify_wake_lock);
#endif
        spin_lock_irqsave(&gKrilNotifyWq.lock, irql);
        list_add_tail(&capi2_rsp->list, &gKrilNotifyWq.capi2_head.list);
        spin_unlock_irqrestore(&gKrilNotifyWq.lock, irql);
        queue_work(gKrilNotifyWq.notify_wq, &gKrilNotifyWq.notifyq);
    }
    else //response
    {
        unsigned long irql;
#ifdef CONFIG_HAS_WAKELOCK
        wake_lock(&kril_rsp_wake_lock);
#endif
        spin_lock_irqsave(&gKrilRespWq.lock, irql);
        list_add_tail(&capi2_rsp->list, &gKrilRespWq.capi2_head.list);
        spin_unlock_irqrestore(&gKrilRespWq.lock, irql);
        queue_work(gKrilRespWq.rsp_wq, &gKrilRespWq.responseq);
    }
}
Exemplo n.º 15
0
void RPC_DispatchMsg(ResultDataBuffer_t* pDataBuf)
{
	UInt8 clientIndex;
	Boolean isUnsolicited = FALSE;
	RPC_Msg_t* pMsg = &(pDataBuf->rsp.rootMsg);
	int i;
	
	pDataBuf->refCount = 1;//set

	//Handle Ack first
	if(pMsg->msgId == MSG_CAPI2_ACK_RSP)
	{
		RPC_Ack_t	*ackRsp = (RPC_Ack_t*)pMsg->dataBuf;
		clientIndex = GetClientIndex(pDataBuf, &isUnsolicited);
		
		if(gClientMap[clientIndex].ackCb)
		{
			gClientMap[clientIndex].ackCb(pMsg->tid, pMsg->clientID, ackRsp->ackResult, ackRsp->ackUsrData);
			RPC_SYSFreeResultDataBuffer((ResultDataBufHandle_t)pDataBuf);
		}
	}
	else
	{
		clientIndex = GetClientIndex(pDataBuf, &isUnsolicited);

		if(pDataBuf->rsp.msgType == RPC_TYPE_REQUEST)
		{
			if(gClientMap[clientIndex].reqCb != NULL)
			{
				(gClientMap[clientIndex].reqCb)(pMsg, (ResultDataBufHandle_t)pDataBuf, gClientMap[clientIndex].userData);
			}
		}
		else //RPC_TYPE_RESPONSE
		{
			if(clientIndex > 0 && (pMsg->tid != 0 || pMsg->clientID != 0) && !(isUnsolicited))
			{
				_DBG_(RPC_TRACE_INFO("RPC_DispatchMsg Unicast msgId=0x%x cIndex=%d tid=%d cid=%d unsol=%d", pMsg->msgId, clientIndex, pMsg->tid, pMsg->clientID, isUnsolicited));
				if(gClientMap[clientIndex].respCb != NULL)
				{
					(gClientMap[clientIndex].respCb)(pMsg, (ResultDataBufHandle_t)pDataBuf,gClientMap[clientIndex].userData);
				}
			}
			else if((pMsg->tid == 0 && pMsg->clientID == 0) || isUnsolicited)//unsolicited
			{
				UInt32 numClients = 0;
				_DBG_(RPC_TRACE_INFO("RPC_DispatchMsg Broadcast msgId=0x%x xdrClient=%d tid=%d cid=%d unsol=%d ", pMsg->msgId, clientIndex, pMsg->tid, pMsg->clientID, isUnsolicited));
				//Set the ref count first
				pDataBuf->refCount = 0;//reset
				for(i=1;i<=gClientIndex;i++)
				{
					if(gClientMap[i].respCb != NULL && (gClientLocalMap[i].notifyUnsolicited || clientIndex == i) )
						pDataBuf->refCount++;
				}
				
				numClients = pDataBuf->refCount;
				//Broadcast the message
				for(i=1;i<=gClientIndex;i++)
				{
					if(gClientMap[i].respCb != NULL && (gClientLocalMap[i].notifyUnsolicited || clientIndex == i) )
					{
						_DBG_(RPC_TRACE_INFO("RPC_DispatchMsg Broadcast Client ( Notify ) msgId=0x%x index=%d tid=%d cid=%d unsol=%d regUnsol=%d", pMsg->msgId, i, pMsg->tid, pMsg->clientID, isUnsolicited, gClientLocalMap[i].notifyUnsolicited));
						(gClientMap[i].respCb)(pMsg, (ResultDataBufHandle_t)pDataBuf,gClientMap[i].userData);
					}
					else
					{
						_DBG_(RPC_TRACE_INFO("RPC_DispatchMsg Broadcast Client ( Skip ) msgId=0x%x index=%d tid=%d cid=%d unsol=%d regUnsol=%d", pMsg->msgId, i, pMsg->tid, pMsg->clientID, isUnsolicited, gClientLocalMap[i].notifyUnsolicited));
					}

				}

				//No clients handle this message?
				if(numClients == 0)
				{
					_DBG_(RPC_TRACE_INFO("RPC_DispatchMsg Broadcast Ignored msgId=0x%x cIndex=%d tid=%d cid=%d unsol=%d regUnsol=%d", pMsg->msgId, i, pMsg->tid, pMsg->clientID, isUnsolicited, gClientLocalMap[i].notifyUnsolicited));
					
					pDataBuf->refCount = 1;
					RPC_SYSFreeResultDataBuffer((ResultDataBufHandle_t)pDataBuf);
				}
			}
			else
			{
				_DBG_(RPC_TRACE_INFO("RPC_DispatchMsg IGNORED msgId=0x%x cIndex=%d tid=%d cid=%d unsol=%d", pMsg->msgId, clientIndex, pMsg->tid, pMsg->clientID, isUnsolicited));
				RPC_SYSFreeResultDataBuffer((ResultDataBufHandle_t)pDataBuf);
			}
		}//RPC_TYPE_RESPONSE
	}
}
Exemplo n.º 16
0
/**
	Handle the response from a RPC function call. 
	@param		tid (in) Transaction id for request.
	@param		cid (in) Client id for request
	@param		msgType (in) Message type of response.
	@param		result (in) Result code of response.
	@param		dataPtr (in) Pointer to response data buffer
	@param		dataSize (in) size of response data buffer
	@param		dataBufHandle (in) handle to response data buffer

    @return		\n TRUE if response handled,
				\n FALSE if response not handled.

**/
void RPC_SyncHandleResponse(RPC_Msg_t *pMsg,
			    ResultDataBufHandle_t dataBufHandle,
			    UInt32 userContextData)
{
	RPC_SyncParams_t *internalParam;
	OSStatus_t semaStatus;
	UInt32 tid = pMsg->tid;
	UInt8 clientID = pMsg->clientID;
	MsgType_t msgType = pMsg->msgId;
	Result_t result = RESULT_OK;
	void *dataBuf = pMsg->dataBuf;
	UInt32 dataLength = pMsg->dataLen;

	TaskRequestMap_t *taskMap = NULL;
	// default is to always release response buffer automatically
	Boolean bReleaseResponseBuffer = TRUE;

	internalParam = (RPC_SyncParams_t *) (void *)userContextData;
	assert(internalParam != NULL);

	if (0 != tid) {
		taskMap = GetMapForTID(tid);
	}

	if (internalParam && internalParam->syncInitParams.copyCb)
		internalParam->syncInitParams.copyCb(msgType, dataBuf,
						     (taskMap) ?
						     taskMap->dataLen : 0,
						     (taskMap) ? taskMap->data :
						     NULL, &dataLength,
						     &result);

	_DBG_(RPC_TRACE
	      ("RPC_SyncHandleResponse tid=%d cid=%d msg=%d res=%d\r\n",
	       (int)tid, clientID, msgType, result));
	_DBG_(RPC_TRACE
	      ("RPC_SyncHandleResponse tlen=%d tmap=%d len=%ld \r\n",
	       (taskMap) ? (int)taskMap->dataLen : 0, (taskMap) ? 1 : 0,
	       dataLength));

	// did we find a pending request with this transaction id?
	if (taskMap) {
		taskMap->result = result;
		taskMap->tid = 0;
		bReleaseResponseBuffer = taskMap->releaseC2Buf;
		taskMap->msgType = msgType;
		taskMap->rspSize = dataLength;

		xassert(!dataBuf || !(taskMap->data)
			|| (taskMap->dataLen >= (Int32) dataLength), msgType);

		// need to keep response buffer around for deep copy
		if (!bReleaseResponseBuffer) {
			taskMap->dataBufHandle = dataBufHandle;
		}
		// notify calling task of receipt of response
		semaStatus = OSSEMAPHORE_Release(taskMap->rspSema);
		if (semaStatus != OSSTATUS_SUCCESS) {
			_DBG_(RPC_TRACE
			      ("WARNING!!!! RPC_SyncHandleResponse: Semaphore release failed\r\n"));
		}
	} else			//Dispatch unsolicited notifications to the client
	{
		if (RESULT_OK != result) {
			_DBG_(RPC_TRACE
			      ("WARNING!!!! RPC_SyncHandleResponse tid %d cid %d result=%d noTaskMap \r\n",
			       (int)tid, clientID, result));
		}

		internalParam = (RPC_SyncParams_t *) (void *)userContextData;
		assert(internalParam && internalParam->clientParams.respCb);
		internalParam->clientParams.respCb(pMsg, dataBufHandle,
						   internalParam->
						   clientParams.userData);

		return;		// The buffer will be freed by the client
	}

	if (bReleaseResponseBuffer) {
		// release response buffer
		RPC_SYSFreeResultDataBuffer(dataBufHandle);
	}
}