/*******************************************************************************
 * (c) Copyright 2015 Microsemi Corporation.  All rights reserved.
 *
 *
 *
 * SVN $Revision: $
 * SVN $Date: $
 */

#ifndef __MR_ERROR_CODES_H_
#define __MR_ERROR_CODES_H_

/* -----------------------------------------------------------------------------------------*/
/* Define Error Code Constants*/
/* -----------------------------------------------------------------------------------------*/
#define NO_ERR							0
#define MR_ERR_READING_REG					1	// There was a problem reading a HW register
#define MR_ERR_WRITING_REG					2	// There was a problem writing to a HW register
#define MR_ERR_READING_RAM					3	// There was a problem reading from an indirect RAM
#define MR_ERR_WRITING_RAM					4	// There was a problem writing to an indirect RAM
#define ERR_INSUFFICIENT_SYS_RAM		5	// A call to malloc returned NULL
#define ERR_INVALID_MD_HNDL				6	// The supplied MD Handle was invalid
#define ERR_INVALID_MA_HNDL				7	// The supplied MA Handle was invalid
#define ERR_INVALID_LMEP_HNDL			8	// The supplied lMEP Handle was invalid
#define ERR_INVALID_RMEP_HNDL			9	// The supplied rMEP Handle was invalid
#define ERR_INVALID_MD_LEVEL			10	// The MD Level value supplied was outside the range 0-7
#define ERR_INVALID_MD_NTL				11	// The MD Name-Type-Length properties were inconsistent
#define ERR_INVALID_MA_NTL				12	// The MA Name-Type-Length properties were inconsistent
#define ERR_MD_NAME_NOT_UNIQUE			13	// The MD Name supplied was not unique
#define ERR_MA_NAME_NOT_UNIQUE			14	// The MA Name supplied was not unique
#define ERR_DELETING_CHILD_OBJ			15	// A child object could not be deleted e.g. rMEP child of a lMEP
#define ERR_STALE_HNDL					16	// The handle supplied addresses an corrupt object
#define ERR_INVALID_CCM_INTERVAL		17	// The CCM Interval was not in the valid range 1-7
#define ERR_MEPID_IN_USE				18	// The MEP ID supplied is already used in the current scope
#define ERR_INVALID_PORT				19	// The port number supplied is invalid
#define ERR_INVALID_VLAN				20	// The VLan provided is invalid
#define ERR_INVALID_PM_NUM				21	// The PM Number supplied has no associated serrvices
#define ERR_ENABLING_CCM_SVC			22	// There was a problem enabling the CCM service
#define ERR_DISABLING_CCM_SVC			23	// There was a problem disabling the CCM service
#define ERR_ENABLING_CCMLOSS_SVC		24	// There was a problem enabling the CCMLOSS service
#define ERR_DISABLING_CCMLOSS_SVC		25	// There was a problem disabling the CCMLOSS service
#define	ERR_ENABLING_LOSS_SVC			26	// There was a problem enabling the LOSS service
#define ERR_DISABLING_LOSS_SVC			27	// There was a problem disabling the LOSS service
#define	ERR_ENABLING_DELAY_SVC			28	// There was a problem enabling the DELAY service
#define ERR_DISABLING_DELAY_SVC			29	// There was a problem disabling the DELAY service
#define ERR_ALLOCATING_RAM				30	// There was a problem allocating internal RAM
#define ERR_CLEARING_VLAN_TBL			31	// There was a problem clearing entries in the VLAN table
#define ERR_CLEARING_PVID_TBL			32	// There was a problem clearing the port VID table
#define ERR_CLEARING_PMAC_TBL			33	// There was a problem clearing the port MAC table
#define ERR_INITIALISING_MACS			34	// There was a initialising the Gigabit Ethernet MACs
#define ERR_FILE_NOT_FOUND				35	// The specified file was not found
#define ERR_OPENING_FILE				36	// There was a problem opening the specified file
#define ERR_INVALID_TLV					37	// The content of the tlv data type is invalid
#define ERR_INVALID_LB_CHNL				38	// The loopback channel provided is invalid
#define ERR_DELETING_OBJ				39	// Failed to delete an object
#define ERR_CREATING_LMEP				40	// Failed to create a local MEP. Error log must be examined for further details
#define ERR_CREATING_RMEP				41	// Failed to create a remote MEP. Error log must be examined for further details
#define ERR_REMOVING_LOSS_SVC			42	// There was a problem removing the LOSS service
#define	ERR_REMOVING_DELAY_SVC			43	// There was a problem removing the DELAY service
#define ERR_REMOVING_CCM_SVC			44	// There was a problem removing the CCM service
#define	ERR_REMOVING_CCMLOSS_SVC		45	// There was a problem removing the CCMLOSS service
#define	ERR_SVC_CONFLICT				46	// There was a problem removing the CCMLOSS service
#define	ERR_NO_SVC_ON_LMEP				47	// There was no PM service configured on the selected Local MEP
#define	ERR_SAVING_FILE					48	// There was problem saving the file
#define	ERR_LOADING_FILE				49	// There was problem loading the file
#define	ERR_SVC_MISCONFIG				50	// A service mis-configuration was encountered
#define	ERR_MALFORMED_PKT				51	// The packet read from the CPU capture FIFO did not matche the expected format
#define	ERR_EFM_NOT_EN					52	// An attempt was made to enable EFM tx but EFM Mode was not enabled
#define	ERR_EFM_NOT_IN_SEND_ANY			53	// An attempt was made to send EFM commands but discovery SM was not in Send_any
#define	ERR_EFM_IN_PASSIVE_MODE			54	// An attempt was made to send LB or VAR request EFM commands but device is in passive mode
#define	ERR_EFM_CRIT_OR_DG_MODE			55	// A local critical event or dying gasp flag is set so no other efm PDUs can be sent
#define	ERR_EFM_LB_EN_RESP_PEND			56	// The Loopback Enable Info PDU response was not yet received
#define	ERR_EFM_LB_DIS_RESP_PEND		57	// The Loopback Disable Info PDU response was not yet received
#define	ERR_EFM_LOCAL_LB_ACTIVE			58	// The Loopback is already enabled
#define	ERR_SENDING_CMD_PACKET			59	// There was an error sending the Ethernet/serial command packet
#define	ERR_EMPTY_CMD_RESP_PACKET		60	//
#define	ERR_CMD_RESP_PACKET_SIZE		61	//
#define	ERR_CMD_RESP_HEADER_MISMATCH	62	//
#define	ERR_INVALID_IF_MODE				63	//
#define	ERR_SOCKET_OPEN_FAILED			64	//
#define	ERR_ALREADY_CLOSED				65	//
#define	ERR_INVALID_CMD_PKT				66	//
#define	ERR_INVALID_CMD					67	//
#define	ERR_UNKNOWN_SOCKET_RX			68	//
#define	ERR_UNKNOWN_SOCKET_TX			69	//
#define	ERR_INVALID_PARM_VALUE			70	//
#define	ERR_UNKNOWN_ERR					71	// An unknown error occurred
#define ERR_CCM_ALREADY_ACTIVE_ON_LMEP	72	// This is more a warning, it will occur if more than one RMep is added to a LMep
#define	ERR_HTTP_CMD_PARSE				73	// There was a problem parsing the XMLHttpRequest text.
#define	ERR_NO_EOP						74	// No EOP found in CPU Packet Buffer
#define	ERR_PKT_LEN_INVALID				75	// The CPU packet Length Exceeded a MAX or MIN value for the CPU Packet Buffer
#define	ERR_SYS_PKT_TX_BUSY				76	// The System Side (LAN) tx packet FIFO is busy sending a packet
#define ERR_HW_RAM_FULL					77	// The HW limited RAM is full
#define ERR_INVALID_ADDRESS				78	// The address passed to a memory read/write function was outside the valid range
#define ERR_CONFIGURATION_VALUE			79	// A value used for the configuration of a MEP or service is invalid
#define ERR_TABLE_MISCONFIG				80	// A mis-configuration has been detected in a table
#define ERR_DUPLICATE_ENTRY				81	// There was an attempt to add a duplicate entry to the table
#define ERR_SVC_IN_USE					82	// A parameter could not be changed because the service was active
#define	ERR_CPU_PKT_TX_BUSY			83	// A packet cannot be sent on the WAN because it is busy sending a packet.
#define ERR_HAL_RAM_READ_TIMEOUT		84	// Indicates that a Indirect RAM read timed out
#define ERR_HAL_RAM_WRITE_TIMEOUT		85	// Indicates that a Indirect RAM write timed out
#define ERR_HAL_RAM_READ				86	// Indicates that a Indirect RAM read failed
#define ERR_HAL_RAM_WRITE				87	// Indicates that a Indirect RAM write failed
#define ERR_HAL_REG_READ				86	// Indicates that a Register read failed
#define ERR_HAL_REG_WRITE				87	// Indicates that a Register write failed
#define ERR_SVC_ALREADY_PRESENT			88	// Adding a new service failed because the requested service already exists.
#define ERR_INVALID_PM_INTERVAL			89	// Interval value is not a valid value (1-7) or the loss interval != delay interval
#define	ERR_GENERATING_MAID				90	// There was a problem generating the MAID from the MD and MA names
#define ERR_INVALID_SERVICE_ID			91	// The service ID provided did not match the expected format
#define ERR_INVALID_SERVICE_REQEST		92	//
#define ERR_INVALID_CALLBACK			93	// No callback function was registered or the function address is NULL
#define ERR_POLL_FLAG_TIMEOUT			94  // The MR_MAX_ITERS number of allowed iterations occurred before a flag was set/cleared
#define ERR_READING_MAID				95	// This can occur when reading the maid from the LMep (maid) table if there is an invalid length
#define ERR_INVALID_MEPID				96	// The MEP ID provided was invalid or could not be found
#define	ERR_EMPTY_LIST					97	// The results list is empty
#define	ERR_TRANS_ID_NOT_FOUND			98	// The LT Transaction ID was not found
#define	ERR_INVALID_INDEX				99	// The index value provided is invalid
#define	ERR_PURGED_INDEX				100	// The index value has been purged due to limited storage
#endif
