/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\

File: OCTVC1_GSM_EVT.h
Copyright (c) 2014 Octasic Inc. All rights reserved.

Description: Contains the event definition of the GSM API.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Octasic_Release: OCTSDR-2G-01.08.05-B29-ALPHA (2014/08/14)

$Octasic_Revision: $

\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

#ifndef __OCTVC1_GSM_EVT_H__
#define __OCTVC1_GSM_EVT_H__


/*****************************  INCLUDE FILES  *******************************/

#include "octvc1_gsm_api.h"

/************************  COMMON DEFINITIONS  *******************************/

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM : 	Process utilization type.
-------------------------------------------------------------------------------------*/
#define tOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM						tOCT_UINT32

#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_INVALID					0		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_WCDMA_SCHEDULER			1		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_L1C_APAPTATION_LAYER		2		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_ULIM_RACH				3		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_ULIM_MASTER				4		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_ULIM_RFI					5		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_ULIM_SLAVE				6		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_ULOM_MASTER				7		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_ULOM_SLAVE				8		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_DLIM_MASTER				9		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_DLIM_SLAVE				10		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_DLOM_MASTER				11		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_DLOM_SLAVE				12		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_DLIM_RFI					13		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_ETH						14		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_HSDLOM					15		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_HSDLIM					16		
#define cOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM_CTRL						17		

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_CHECKPOINT_TYPE_ENUM :
-------------------------------------------------------------------------------------*/
#define tOCTVC1_GSM_CHECKPOINT_TYPE_ENUM					tOCT_UINT32

#define cOCTVC1_GSM_CHECKPOINT_TYPE_ENUM_START				0		
#define cOCTVC1_GSM_CHECKPOINT_TYPE_ENUM_END				1		

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_CHECKPOINT_STATE_ENUM :
-------------------------------------------------------------------------------------*/
#define tOCTVC1_GSM_CHECKPOINT_STATE_ENUM					tOCT_UINT32

#define cOCTVC1_GSM_CHECKPOINT_STATE_ENUM_OK				0		
#define cOCTVC1_GSM_CHECKPOINT_STATE_ENUM_PROCESSING_ERROR	1		

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_SEVERITY_ENUM :
-------------------------------------------------------------------------------------*/
#define tOCTVC1_GSM_MSG_SEVERITY_ENUM						tOCT_UINT32

#define cOCTVC1_GSM_MSG_SEVERITY_ENUM_INFO					10		
#define cOCTVC1_GSM_MSG_SEVERITY_ENUM_WARNING				20		
#define cOCTVC1_GSM_MSG_SEVERITY_ENUM_ERROR					30		
#define cOCTVC1_GSM_MSG_SEVERITY_ENUM_FATAL					40		

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_TRACING_TYPE_ENUM :
-------------------------------------------------------------------------------------*/
#define tOCTVC1_GSM_TRACING_TYPE_ENUM						tOCT_UINT32

#define cOCTVC1_GSM_TRACING_TYPE_ENUM_DLOM_REQUEST			((tOCT_UINT32)(0x51|cOCTVC1_GSM_REQUEST_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_DLOM_RESPONSE			((tOCT_UINT32)(0x52|cOCTVC1_GSM_RESPONSE_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_DLIM_REQUEST			((tOCT_UINT32)(0x53|cOCTVC1_GSM_REQUEST_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_DLIM_RESPONSE			((tOCT_UINT32)(0x54|cOCTVC1_GSM_RESPONSE_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_ULOM_REQUEST			((tOCT_UINT32)(0x55|cOCTVC1_GSM_REQUEST_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_ULOM_RESPONSE			((tOCT_UINT32)(0x56|cOCTVC1_GSM_RESPONSE_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_ULIM_REQUEST			((tOCT_UINT32)(0x57|cOCTVC1_GSM_REQUEST_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_ULIM_RESPONSE			((tOCT_UINT32)(0x58|cOCTVC1_GSM_RESPONSE_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_ULIM_RACH_REQUEST		((tOCT_UINT32)(0x59|cOCTVC1_GSM_REQUEST_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_ULIM_RACHM_RESPONSE	((tOCT_UINT32)(0x5A|cOCTVC1_GSM_RESPONSE_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_ULIM_RACHP_RESPONSE	((tOCT_UINT32)(0x5B|cOCTVC1_GSM_RESPONSE_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_SCHEDPARAMS			0x5C	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_HSDLOM_REQUEST		((tOCT_UINT32)(0x5D|cOCTVC1_GSM_REQUEST_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_HSDLOM_RESPONSE		((tOCT_UINT32)(0x5E|cOCTVC1_GSM_RESPONSE_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_HSDLIM_REQUEST		((tOCT_UINT32)(0x5F|cOCTVC1_GSM_REQUEST_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_HSDLIM_RESPONSE		((tOCT_UINT32)(0x60|cOCTVC1_GSM_RESPONSE_INDICATION_FLAG) )	
#define cOCTVC1_GSM_TRACING_TYPE_ENUM_NOTDEFINED			0x7F	

/*****************************  NOTIFICATIONS  **********************************/
/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_TIME_INDICATION_EVT

 Members:
	Header
	byu2Pad_u6TRXId
	byu5Pad_u3TN
	usFrameNumberMSW
	usFrameNumberLSW
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCT_UINT8				byu2Pad_u6TRXId;
	tOCT_UINT8				byu5Pad_u3TN;
	tOCT_UINT16				usFrameNumberMSW;
	tOCT_UINT16				usFrameNumberLSW;

} tOCTVC1_GSM_MSG_MODULE_TIME_INDICATION_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_DATA_INDICATION_EVT

 Members:
	Header
	byu2Pad_u6TRXId
	byu5SAPI_u3Dir
	bySubchannelNum
	byu5Pad_u3TN
	usFrameNumberMSW
	usFrameNumberLSW
	tMeasurementInfo
	usDataFrameLength
	ausDataFrameContents
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCT_UINT8						byu2Pad_u6TRXId;
	tOCT_UINT8						byu5SAPI_u3Dir;
	tOCT_UINT8						bySubchannelNum;
	tOCT_UINT8						byu5Pad_u3TN;
	tOCT_UINT16						usFrameNumberMSW;
	tOCT_UINT16						usFrameNumberLSW;
	tOCTVC1_GSM_tMEASUREMENT_INFO	tMeasurementInfo;
	tOCT_UINT16						usDataFrameLength;
	tOCT_UINT16						ausDataFrameContents[cOCTVC1_GSM_cSDR_DATA_IND_MAX_DATA_SIZE_WORDS];

} tOCTVC1_GSM_MSG_MODULE_DATA_INDICATION_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_TRX_RADIO_READY_EVT

 Members:
	Header
	byu2Pad_u6TRXId
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCT_UINT8				byu2Pad_u6TRXId;

} tOCTVC1_GSM_MSG_MODULE_TRX_RADIO_READY_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_READY_TO_SEND_INDICATION_EVT

 Members:
	Header
	byu2Pad_u6TRXId
	byu3TN_u5SAPI
	bySubchannelNum
	byPad
	usFrameNumberMSW
	usFrameNumberLSW
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCT_UINT8				byu2Pad_u6TRXId;
	tOCT_UINT8				byu3TN_u5SAPI;
	tOCT_UINT8				bySubchannelNum;
	tOCT_UINT8				byPad;
	tOCT_UINT16				usFrameNumberMSW;
	tOCT_UINT16				usFrameNumberLSW;

} tOCTVC1_GSM_MSG_MODULE_READY_TO_SEND_INDICATION_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_RACH_INDICATION_EVT

 Members:
	Header
	byu2Pad_u6TRXId
	byuu3TN_u5SAPI
	bySubchannelNum
	byBurstType
	usFrameNumberMSW
	usFrameNumberLSW
	tMeasurementInfo
	usMessageLength
		Range:		[0..cOCTVC1_GSM_cSDR_RACH_IND_MAX_MESSAGE_LENGTH_WORDS]
	ausMessageContents
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCT_UINT8						byu2Pad_u6TRXId;
	tOCT_UINT8						byuu3TN_u5SAPI;
	tOCT_UINT8						bySubchannelNum;
	tOCT_UINT8						byBurstType;
	tOCT_UINT16						usFrameNumberMSW;
	tOCT_UINT16						usFrameNumberLSW;
	tOCTVC1_GSM_tMEASUREMENT_INFO	tMeasurementInfo;
	tOCT_UINT16						usMessageLength;
	tOCT_UINT16						ausMessageContents[cOCTVC1_GSM_cSDR_RACH_IND_MAX_MESSAGE_LENGTH_WORDS];

} tOCTVC1_GSM_MSG_MODULE_RACH_INDICATION_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_ERROR_EVT

 Members:
	Header
	hProcessUnit
 		Handle of the object that is sending the event.
	ulErrorCode
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCTVC1_HANDLE			hProcessUnit;
	tOCTVC1_GSM_ERR_ENUM	ulErrorCode;

} tOCTVC1_GSM_MSG_MODULE_ERROR_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_MESSAGE_EVT

 Members:
	Header
	hProcessUnit
 		Handle of the object that is sending the event.
	ulMessageCode
	ulSeverityLevel
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCTVC1_HANDLE					hProcessUnit;
	tOCTVC1_GSM_2G_MSG_ENUM			ulMessageCode;
	tOCTVC1_GSM_MSG_SEVERITY_ENUM	ulSeverityLevel;

} tOCTVC1_GSM_MSG_MODULE_MESSAGE_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_CHECKPOINT_EVT

 Members:
	Header
 		OCTVC1 Event Header.
	hProcessUnit
 		Handle of the object that is sending the event.
	ulCoreId
 		The logical core Id, on which the data processing occurs.
	ulFrameIndex
 		Frame index being processed.
	ulSlotIndex
 		Slot index being processed.
	ulCheckPointType
 		Type of checkpoint .
	ulProcessUnitType
 		Type of data or codec processed.
	ulState
 		The status of the actual processing
	aulReserved
 		Reserved for future used.
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hProcessUnit;
	tOCT_UINT32							ulCoreId;
	tOCT_UINT32							ulFrameIndex;
	tOCT_UINT32							ulSlotIndex;
	tOCTVC1_GSM_CHECKPOINT_TYPE_ENUM	ulCheckPointType;
	tOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM	ulProcessUnitType;
	tOCTVC1_GSM_CHECKPOINT_STATE_ENUM	ulState;
	tOCT_UINT32							aulReserved[cOCTVC1_GSM_NB_RESERVED];

} tOCTVC1_GSM_MSG_MODULE_CHECKPOINT_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_MODULE_TRACING_EVT

 Members:
	Header
 		OCTVC1 Event Header.
	hProcessUnit
 		Handle of the object that is sending the event.
	ulCoreId
 		The logical core Id, on which the data processing occurs.
	ulTraceType
 		The type of tracing.
	ulLastTracePacket
 		cOCT_FALSE Indicates that more trace packet are to come.
 		cOCT_TRUE Indicates that the tracing is completed.
	ulTraceIndex
 		This is the tracing packet idx. This is used when tracing are sent into muliple
 		packets .
	ulPayloadSizeBytes
 		The number of valid data that can be found in abyUnparsedPayload.
	abyUnparsedPayload
 		Ctx structure
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCTVC1_HANDLE					hProcessUnit;
	tOCT_UINT32						ulCoreId;
	tOCTVC1_GSM_TRACING_TYPE_ENUM	ulTraceType;
	tOCT_BOOL32						ulLastTracePacket;
	tOCT_UINT32						ulTraceIndex;
	tOCT_UINT32						ulPayloadSizeBytes;
	tOCT_UINT8						abyUnparsedPayload[cOCTVC1_GSM_TRACING_BUFFER_SIZE];

} tOCTVC1_GSM_MSG_MODULE_TRACING_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_PROCESS_UNIT_ERROR_EVT

 Members:
	Header
	hProcessUnit
 		Handle of the object that is sending the event.
	ulErrorCode
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCTVC1_HANDLE			hProcessUnit;
	tOCTVC1_GSM_ERR_ENUM	ulErrorCode;

} tOCTVC1_GSM_MSG_PROCESS_UNIT_ERROR_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_PROCESS_UNIT_MESSAGE_EVT

 Members:
	Header
	hProcessUnit
 		Handle of the object that is sending the event.
	ulMessageCode
	ulSeverityLevel
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCTVC1_HANDLE					hProcessUnit;
	tOCTVC1_GSM_2G_MSG_ENUM			ulMessageCode;
	tOCTVC1_GSM_MSG_SEVERITY_ENUM	ulSeverityLevel;

} tOCTVC1_GSM_MSG_PROCESS_UNIT_MESSAGE_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_PROCESS_UNIT_CHECKPOINT_EVT

 Members:
	Header
 		OCTVC1 Event Header.
	hProcessUnit
 		Handle of the object that is sending the event.
	ulCoreId
 		The logical core Id, on which the data processing occurs.
	ulFrameIndex
 		Frame index being processed.
	ulSlotIndex
 		Slot index being processed.
	ulCheckPointType
 		Type of checkpoint .
	ulProcessUnitType
 		Type of data or codec processed.
	ulState
 		The status of the actual processing
	aulReserved
 		Reserved for future used.
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hProcessUnit;
	tOCT_UINT32							ulCoreId;
	tOCT_UINT32							ulFrameIndex;
	tOCT_UINT32							ulSlotIndex;
	tOCTVC1_GSM_CHECKPOINT_TYPE_ENUM	ulCheckPointType;
	tOCTVC1_GSM_PROCESS_UNIT_TYPE_ENUM	ulProcessUnitType;
	tOCTVC1_GSM_CHECKPOINT_STATE_ENUM	ulState;
	tOCT_UINT32							aulReserved[cOCTVC1_GSM_NB_RESERVED];

} tOCTVC1_GSM_MSG_PROCESS_UNIT_CHECKPOINT_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_PROCESS_UNIT_TRACING_EVT

 Members:
	Header
 		OCTVC1 Event Header.
	hProcessUnit
 		Handle of the object that is sending the event.
	ulCoreId
 		The logical core Id, on which the data processing occurs.
	ulTraceType
 		The type of tracing.
	ulPayloadSizeBytes
 		The number of valid data that can be found in abyUnparsedPayload.
	abyUnparsedPayload
 		Ctx structure
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCTVC1_HANDLE					hProcessUnit;
	tOCT_UINT32						ulCoreId;
	tOCTVC1_GSM_TRACING_TYPE_ENUM	ulTraceType;
	tOCT_UINT32						ulPayloadSizeBytes;
	tOCT_UINT8						abyUnparsedPayload[cOCTVC1_GSM_TRACING_BUFFER_SIZE];

} tOCTVC1_GSM_MSG_PROCESS_UNIT_TRACING_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_GSM_MSG_TEST_ETSI_TEST_REPORT_EVT

 Members:
	Header
	usTodo
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCT_UINT16				usTodo;

} tOCTVC1_GSM_MSG_TEST_ETSI_TEST_REPORT_EVT;


#endif /* __OCTVC1_GSM_EVT_H__ */

