/**************************************************************
$Workfile:   elmsys.c  $
***************************************************************
**
** FIRMWARE, Copyright (C) 2000-2002
** Ikanos Communications, Fremont, CA
** All rights reserved. 
**
** The information and contents of this file are the
** proprietary information of Ikanos Communication and may not
** be disclosed or used without the formal written approval of
** Ikanos Communication
**
$Revision: 1.1 $
$Date: 2006/10/16 04:34:50 $
***************************************************************/

/*  ELM programming that is dependent on the host environment  */

/*  The amount of SRAM available determines the size of the event log buffer.
    For the CO modem, one could allocate multiple event log buffers, for example,
    one for each remote port and a local buffer for the local BME(s).  Thus the
    added entry points for CO and for CPE, and the port number parameter.	*/

#include "apitype.h"

static U8	eventLogBuf[ 0x20000 ];		/* 128K */

#ifdef VTU_R

/* it is anticipated a CPE modem will have exactly 1 port */

static U8 *
cpeGetEventLogAddr( int portNum )
{

/* for now, ignore the port number.  All event logs are stored in the same place */

	return( &eventLogBuf[ 0 ] );
}
#endif

#ifdef VTU_O

/* the CO side could have its local event log and an event log for each remote port */

static U8 *
coGetEventLogAddr( int portNum )
{

/* for now, ignore the port number.  All event logs are stored in the same place */

	return( &eventLogBuf[ 0 ] );
}
#endif

U8 *
sysGetEventLogAddr( int portNum )
{
	U8	*retaddr = &eventLogBuf[ 0 ];

#ifdef VTU_O
	retaddr = coGetEventLogAddr( portNum );
#endif
#ifdef VTU_R
	retaddr = cpeGetEventLogAddr( portNum );
#endif

	return( retaddr );
}
