This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

System_linkControl No effect



Hi, TIers

I'm using DM8168, with RDK3.0, one problem occured to me.

"System_linkControl" function does not affect, codes are shown below:

UInt32 SwMsMapChtoWin(UInt32 swMsId, UInt32 win, UInt32 channel, SwMsLink_CreateParams * swMsPrm)
{
	if (NULL == GetHCHANNELFromID(&channels, MapIDFromUsrToPhy(channel)))
		return ERR_CHNUM_INVALID;

	if (FALSE == ChannelIsVisible(GetHCHANNELFromID(&channels, MapIDFromUsrToPhy(channel))))
		return ERR_CHNUM_INVISIBLE;

    SwMsLink_LayoutPrm * layoutInfo = &swMsPrm->layoutPrm;
    System_linkControl(swMsId, SYSTEM_SW_MS_LINK_CMD_GET_LAYOUT_PARAMS,
    		layoutInfo, sizeof(*layoutInfo), TRUE);

    if (win >= layoutInfo->numWin)
    	return ERR_WINNUM_INVALID;

    UInt32 swmsIndex = swMsId - SYSTEM_LINK_ID_SW_MS_MULTI_INST_0;
    HCHANNEL_NODE * hChannelNode = NULL;
    HCHANNEL hChannel = NULL;
    if ((0 != swmsIndex) && (1 != swmsIndex))
    {
    	hChannelNode = NULL;
    	hChannel = NULL;
    }
    else
    {
    	if (0 == swmsIndex)
    		hChannelNode = channels.hChannelList[CHANNEL_CLS_SWMS]->next;
    	if (1 == swmsIndex)
    		hChannelNode = channels.hChannelList[CHANNEL_CLS_SWMS]->next->next;
    	hChannel = hChannelNode->body.hChannel;
    }

	UInt32 winindex 	= 0;
	UInt32 bfound		= FALSE;
	while ((winindex<layoutInfo->numWin) && (!bfound))
    {
		if (GetSwmsChannel(GetHCHANNELFromID(&channels, MapIDFromUsrToPhy(channel))) == layoutInfo->winInfo[winindex].channelNum)
    	{
    		bfound = TRUE;
    	}
    	else
    	{
    		winindex ++;
    	}
    }
    if (bfound)
    {
    	layoutInfo->winInfo[winindex].channelNum	=	SYSTEM_SW_MS_INVALID_ID;
    	layoutInfo->winInfo[winindex].bypass		=	TRUE;
    	if (hChannel)
    		hChannel->entity.swms.info.hd_info.ch2win[hChannel->entity.swms.info.hd_info.currlayout][winindex] = SYSTEM_SW_MS_INVALID_ID;
    }

    layoutInfo->winInfo[win].channelNum	= GetSwmsChannel(GetHCHANNELFromID(&channels, MapIDFromUsrToPhy(channel)));
	if (CHANNEL_CLS_PCIE == GET_CHANNEL_CLS(MapIDFromUsrToPhy(channel)))
	{
		layoutInfo->winInfo[winindex].bypass = FALSE;	//good
	}
	else
	{
		layoutInfo->winInfo[winindex].bypass = TRUE;	//low cost
	}
    if (hChannel)
    	hChannel->entity.swms.info.hd_info.ch2win[hChannel->entity.swms.info.hd_info.currlayout][win] = channel;

    layoutInfo->onlyCh2WinMapChanged = FALSE;

    // does not affect
    System_linkControl(swMsId, SYSTEM_SW_MS_LINK_CMD_SWITCH_LAYOUT,
    		&(swMsPrm->layoutPrm), sizeof(swMsPrm->layoutPrm), TRUE);

    SwMsSetLayout(swMsId, hChannelNode->body.hChannel->entity.swms.info.hd_info.currlayout, swMsPrm);

    if ((0 == swmsIndex) && (0 == win))
    {
		SelectLink_OutQueChInfo	selqueinfo;
		selqueinfo.outQueId	=	0;
		unsigned char swmschinwin0	=	GetSwmsChannel(GetHCHANNELFromID(&channels, MapIDFromUsrToPhy(channel)));
		selqueinfo.inChNum[0]	=	swmschinwin0;

        // does not affect
    	System_linkControl(esselId3, SELECT_LINK_CMD_SET_OUT_QUE_CH_INFO,
    			&selqueinfo, sizeof(SelectLink_OutQueChInfo), TRUE);

    	System_linkControl(esselId3, SELECT_LINK_CMD_GET_OUT_QUE_CH_INFO,
    			&selqueinfo, sizeof(SelectLink_OutQueChInfo), TRUE);

    	printf("Que ID = %d\n", selqueinfo.outQueId);
    	unsigned char quechindex;
    	for (quechindex = 0; quechindex < selqueinfo.numOutCh; quechindex ++)
    	{
    		printf("[%d] = %d\n", quechindex, selqueinfo.inChNum[quechindex]);
    	}
    }

    return SUCCEED;
}

System_linkControl function calling in Line69 & 82 does not affect(there return value is 0--Succeed).

I want to know how to fix this issue.

Best Regards!

YU Ri-Ping