Ejemplo n.º 1
0
RPC_Handle_t RPC_SYS_RegisterClient(const RPC_InitParams_t *params) 
{
	UInt8 userClientID;
	UInt8 clientIndex = 0;

	gClientIndex++;

	clientIndex = gClientIndex;

	if(clientIndex >= MAX_RPC_CLIENTS)
		return (RPC_Handle_t)NULL;

	gClientMap[clientIndex] = *params;

	RPC_PACKET_RegisterDataInd(0, (PACKET_InterfaceType_t)(gClientMap[clientIndex].iType), RPC_BufferDelivery, params->flowCb);

	rpc_internal_xdr_init();
	rpc_register_xdr(clientIndex, params->xdrtbl, params->table_size);

	userClientID = SYS_GenClientID();

	gClientIDs[userClientID] = clientIndex;
	gClientIDMap[clientIndex] = userClientID;
	gClientLocalMap[clientIndex].notifyUnsolicited = FALSE;

	_DBG_(RPC_TRACE("RPC_SYS_RegisterClient index=%d userClientID=%d", clientIndex, userClientID));

	return (RPC_Handle_t)clientIndex;
}
Ejemplo n.º 2
0
void Audio_InitRpc(void)
{
	if (!audioRpcInited) {
		RPC_Handle_t handle;
		RPC_InitParams_t params = { 0 };
		RPC_SyncInitParams_t syncParams;

		params.iType = INTERFACE_RPC_DEFAULT;
		params.table_size =
		    (sizeof(AUDIO_Prim_dscrm) / sizeof(RPC_XdrInfo_t));
		params.xdrtbl = AUDIO_Prim_dscrm;
		params.respCb = HandleAudioEventrespCb;
		params.reqCb = HandleAudioEventReqCb;
		params.cpResetCb = HandleAudioCPResetCb;
		syncParams.copyCb = AudioCopyPayload;

		handle = RPC_SyncRegisterClient(&params, &syncParams);
		audioClientId = RPC_SYS_GetClientID(handle);

#if defined(AUDIO_RPC_END_POINT)
		/* Initialize the Audio RPC thread's message queue.
		 */
		Audio_MsgQueueInit();

		/* Register message handler to
		 * RPC-IPC layer
		 */
		RPC_PACKET_RegisterDataInd(0, INTERFACE_AUDIO,
				AUDIO_RPC_MsgCb, NULL);
#endif

		audioRpcInited = TRUE;
		aTrace(LOG_AUDIO_DRIVER, "Audio_InitRpc %d", audioClientId);
	}
}
Ejemplo n.º 3
0
void EEM_Init(void)
{
    RPC_Result_t result;

    result = RPC_PACKET_RegisterDataInd (0,INTERFACE_USB_EEM, EEM_DataIndCb, EEM_FlowControlCb);
    Log_DebugPrintf(LOGID_SYSEEMRPC, "AP EEM_Init result:%d", result);    
	
	eem_data_Queue = OSQUEUE_Create(QUEUESIZE_EEM, sizeof(EEM_QueueEntry_t), OSSUSPEND_PRIORITY);
	OSQUEUE_ChangeName (eem_data_Queue, "EEMQ");
	OSTASK_Create( eemDataTask_Entry, (TName_t)"EEMT", NORMAL, STACKSIZE_MSC*2);

}
Ejemplo n.º 4
0
static int bcm_fuse_net_open(struct net_device *dev)
{
    int i;
    net_drvr_info_t ndrvr_info_ptr;
    unsigned long flags;
    uint8_t idx = BCM_NET_MAX_PDP_CNTXS;//0;
    int ret = 0;
    static int IsFirstCall = 0;

    ndrvr_info_ptr.dev_ptr = dev;

    /**
       Register callbacks with the RPC Proxy server
    */
    if (0 == IsFirstCall)
    {
        g_NetClientId = SYS_GenClientID();
        ret = RPC_PACKET_RegisterDataInd (g_NetClientId, INTERFACE_PACKET, bcm_fuse_net_bd_cb, bcm_fuse_net_fc_cb);
        if (RPC_RESULT_OK != ret)
        {
            BNET_DEBUG(DBG_ERROR,"%s: first call client ID[%d] FAIL\n", __FUNCTION__, g_NetClientId);
            return(-1);
        }
        IsFirstCall++;
        BNET_DEBUG(DBG_INFO,"%s: first call client ID[%d]\n", __FUNCTION__, g_NetClientId);
    }

    for (i = 0; i < BCM_NET_MAX_PDP_CNTXS; i++)
    {
        BNET_DEBUG(DBG_INFO,"%s: g_net_dev_tbl[%d]=0x%x,dev_ptr 0x%x, dev 0x%x, 0x%x \n", __FUNCTION__,
            i, (unsigned int)(&g_net_dev_tbl[i]), (unsigned int)(g_net_dev_tbl[i].dev_ptr),
            (unsigned int)dev, (unsigned int)(&ndrvr_info_ptr));
    }

    idx = bcm_fuse_net_find_entry(&ndrvr_info_ptr);
    if (idx == BCM_NET_MAX_PDP_CNTXS)
    {
        BNET_DEBUG(DBG_ERROR,"%s: No free device interface to assign for pdp_cid[%d]\n", __FUNCTION__, idx);
        return(-EISCONN);
    }

    spin_lock_irqsave(&g_dev_lock, flags);
    //g_net_dev_tbl[idx].pdp_context_id = idx+1;
    g_net_dev_tbl[idx].pdp_context_id = RMNET_TO_CID(idx);

    spin_unlock_irqrestore(&g_dev_lock, flags);
    BNET_DEBUG(DBG_INFO,"%s: BCM_FUSE_NET_ACTIVATE_PDP: rmnet[%d] pdp_info.cid=%d\n", __FUNCTION__, idx, g_net_dev_tbl[idx].pdp_context_id);

    netif_start_queue(dev);
    return 0;
}
Ejemplo n.º 5
0
RPC_Handle_t RPC_SYS_RegisterClient(const RPC_InitParams_t *params)
{
	UInt8 userClientID;
	UInt8 clientIndex = 0;
	int index;

	_DBG_(RPC_TRACE("RPC_SYS_RegisterClient gRpcInit=%d tblSize=%d",
			gRpcInit, params->table_size));

	if (!gRpcInit)
		RPC_SYS_Init(NULL);

	RPC_USER_LOCK(gRpcLock);

	index = RPC_FindUnsedSlot();
	if (index == -1) {
		_DBG_(RPC_TRACE
		      ("RPC_SYS_RegisterClient ERROR Max clients reached"));

		RPC_USER_UNLOCK(gRpcLock);
		return (RPC_Handle_t) 0;
	}

	gClientIndex++;

	clientIndex = index;

	gClientMap[clientIndex] = *params;

	userClientID = SYS_GenClientID();

	if (userClientID == 0) {
		_DBG_(RPC_TRACE
		      ("RPC_SYS_RegisterClient client ID allocation fail"));

		RPC_USER_UNLOCK(gRpcLock);
		return (RPC_Handle_t) 0;
	}

	_DBG_(RPC_TRACE
	      ("RPC_SYS_RegisterClient index=%d userClientID=%d gClientIndex=%d",
	       clientIndex, userClientID, gClientIndex));

	RPC_PACKET_RegisterDataInd(userClientID,
				   (PACKET_InterfaceType_t)(gClientMap
							    [clientIndex].
							    iType),
				   RPC_BufferDelivery, params->flowCb,
				   RPC_Handle_CPReset);

	rpc_internal_xdr_init();
	rpc_register_xdr(clientIndex, params->xdrtbl, params->table_size);

	gClientIDs[userClientID] = clientIndex;
	gClientIDMap[clientIndex] = userClientID;
	gClientLocalMap[clientIndex].notifyUnsolicited = FALSE;
	gClientLocalMap[clientIndex].ackdCPReset = FALSE;

	RPC_USER_UNLOCK(gRpcLock);
	return (RPC_Handle_t) clientIndex;
}