/*******************************************************************************
** Document: xmgr_proc_fun.c
** Copyright (c) 2004 R&D Center, Tailyn Communication Company, Ltd.  
** Created by: Chien Chung Lo
** Date: Jan. 26, 2005
** Description: XDSL process function.
** Version: 0.1
*******************************************************************************/
#include <stdio.h>
#include "xmgr_proc_fun.h"
#include "xmgr_proc.h"
#include "xmgr.h"
#include "xmgr_bcm_utils.h"
#include "debug_msg.h"
#include "umap_type.h"
#include "umap_global.h"

#include "bcm_genericOptions.h"

//mm
//----------------------------------------------------------------------
UMAP_S32 SetAccessCardResetFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	UMAP_U32 cardNo;
	UMAP_U32 portNo;
	UMAP_U8 adminStatus;
	UMAP_U32 i;
	
	struct UMAP_Database_S *g_pDb;

	g_pDb = (struct UMAP_Database_S *)open_sharememory(KEY_DATABASE);
	if(g_pDb == NULL)
	{
	   UMAP_TRACE("Open Share Memory Failed!\n");
		return UMAP_ERR;
	}

	MSG("card no:%d\n", pMsg->data.u.pktAccessCardReset.entPhysicalIndex);
	
	cardNo = pMsg->data.u.pktAccessCardReset.entPhysicalIndex - 101; //101~105
	result = ResetAndInitialCard(cardNo);
	if(result != BCM_SUCCESS)
	{
		ret_pMsg->data.Result = UMAP_ERR;
		ret_pMsg->data.CmdId = CmdIdAccessCardResetSetAck;
		result = 0;
		return result;
	}

	for(i = 0; i < CARD_NB_LINES; i++)
	{
		portNo = cardNo * CARD_NB_LINES + i;
		g_pDb->arrayIfEntry[XDSL_PORT_INDEX + portNo].ifAdminStatus = IFADMINSTATUS_UP;// for test
		adminStatus = g_pDb->arrayIfEntry[XDSL_PORT_INDEX + portNo].ifAdminStatus;
		if(adminStatus == IFADMINSTATUS_UP)
		{
			ConfigureProfile(cardNo, portNo);
		}
	}
	
	ret_pMsg->data.Result = UMAP_OK;
	ret_pMsg->data.CmdId = CmdIdAccessCardResetSetAck;
	result = 0;
	return result;
}

//cm
//----------------------------------------------------------------------
UMAP_S32 SetXdslLineConfFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;	

	MSG("CmdIdXdslLineConfSet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslLineConfSetAck;
	result = 0;

	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslXturInventoryFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslXturInventoryGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslXturInventoryGetAck;
	result = 0;	
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslXtucInventoryFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslXtucInventoryGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslXtucInventoryGetAck;
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslLineOperDataFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslLineOperDataGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslLineOperDataGetAck;
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslFarEndLineOperDataFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslFarEndLineOperDataGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslFarEndLineOperDataGetAck;
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslChannelOperDataFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslChannelOperDataGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslChannelOperDataGetAck;
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslFarEndChannelOperDataFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslFarEndChannelOperDataGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslFarEndChannelOperDataGetAck;
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 SetXdslLineCarrierDataFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslLineCarrierDataSet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslLineCarrierDataSetAck;
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslFarEndLineCarrierDataFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslFarEndLineCarrierDataGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslFarEndLineCarrierDataGetAck;
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslLineFailureStatusFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslLineFailureStatusGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslLineFailureStatusGetAck;
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslFarEndLineFailureStatusFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslFarEndLineFailureStatusGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslFarEndLineFailureStatusGetAck;
	result = 0;		
	
	return result;	
}

UMAP_S32 GetXdslTestFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslTestGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslTestGetAck;
	result = 0;		
	
	return result;	
}

UMAP_S32 GetXdslXtucSeltDataFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
	
	MSG("CmdIdXdslXtucSeltDataGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslXtucSeltDataGetAck;
	result = 0;		
	
	return result;	
}


//pm
//----------------------------------------------------------------------
UMAP_S32 GetXdslLineCurrentIntervalFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
/*	
	MSG("CmdIXdslLineCurrentIntervalGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslLineCurrentIntervalGetAck;
*/
	result = 0;		
	
	return result;	

}

//----------------------------------------------------------------------
UMAP_S32 GetXdslFarEndLineCurrentIntervalFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
/*	
	MSG("CmdIdXdslFarEndLineCurrentIntervalGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslFarEndLineCurrentIntervalGetAck;
*/
	result = 0;		
	
	return result;	

}

//----------------------------------------------------------------------
UMAP_S32 GetXdslChannelIntervalFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
/*	
	MSG("CmdIdXdslChannelIntervalGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslChannelIntervalGetAck;
*/
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslFarEndChannelIntervalFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
/*	
	MSG("CmdIdXdslFarEndChannelIntervalGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslFarEndChannelIntervalGetAck;
*/
	result = 0;		
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslLineCurrent1DayFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
/*	
	MSG("CmdIdXdslLineCurrent1DayGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslLineCurrent1DayGetAck;
*/
	result = 0;		
	
	return result;	

}

//----------------------------------------------------------------------
UMAP_S32 GetXdslFarEndLineCurrent1DayFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;
/*	
	MSG("CmdIdXdslFarEndLineCurrent1DayGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslFarEndLineCurrent1DayGetAck;
*/
	result = 0;		
	
	return result;	

}

//----------------------------------------------------------------------
UMAP_S32 GetXdslChannel1DayFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;	
	
	MSG("CmdIdXdslChannel1DayGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslChannel1DayGetAck;
	result = 0;	
	
	return result;	
}

//----------------------------------------------------------------------
UMAP_S32 GetXdslFarEndChannel1DayFun(UMAP_Msg* pMsg,UMAP_Msg* ret_pMsg)
{
	UMAP_S32 result;	
	
	MSG("CmdIdXdslFarEndChannel1DayGet\n\n\n\n");
	ret_pMsg->data.CmdId = CmdIdXdslFarEndChannel1DayGetAck;
	result = 0;	
	
	return result;	
}

//mm

//----------------------------------------------------------------------

