summaryrefslogtreecommitdiff
path: root/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c
blob: 349a3be575a4a6c2568e8235ae5ee3121a483129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\

File: oct6100_chip_stats.c

    Copyright (c) 2001-2011 Octasic Inc.
    
Description: 

	This file contains functions used to retreive the OCT6100 chip stats.

This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API  is 
free software; you can redistribute it and/or modify it under the terms of 
the GNU General Public License as published by the Free Software Foundation; 
either version 2 of the License, or (at your option) any later version.

The OCT6100 GPL API 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 General Public License 
along with the OCT6100 GPL API; if not, write to the Free Software 
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

$Octasic_Release: OCT612xAPI-01.04.05 $

$Octasic_Revision: 101 $

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


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


#include "octdef.h"

#include "oct6100api/oct6100_defines.h"
#include "oct6100api/oct6100_errors.h"
#include "oct6100api/oct6100_apiud.h"

#include "apilib/octapi_llman.h"

#include "oct6100api/oct6100_tlv_inst.h"
#include "oct6100api/oct6100_chip_open_inst.h"
#include "oct6100api/oct6100_chip_stats_inst.h"
#include "oct6100api/oct6100_interrupts_inst.h"
#include "oct6100api/oct6100_remote_debug_inst.h"
#include "oct6100api/oct6100_debug_inst.h"
#include "oct6100api/oct6100_api_inst.h"

#include "oct6100api/oct6100_interrupts_pub.h"
#include "oct6100api/oct6100_chip_open_pub.h"
#include "oct6100api/oct6100_channel_pub.h"
#include "oct6100api/oct6100_chip_stats_pub.h"

#include "oct6100_chip_open_priv.h"
#include "oct6100_chip_stats_priv.h"
#include "oct6100_miscellaneous_priv.h"
#include "oct6100_chip_stats_priv.h"

/****************************  PUBLIC FUNCTIONS  *****************************/


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

Function:		Oct6100ChipGetStats

Description:    Retreives the chip statistics and configuration.

-------------------------------------------------------------------------------
|	Argument		|	Description
-------------------------------------------------------------------------------
f_pApiInstance		Pointer to API instance. This memory is used to keep the
					present state of the chip and all its resources.

f_pChipStats		Pointer to a tOCT6100_CHIP_STATS structure.

\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
UINT32 Oct6100ChipGetStatsDef(
				tPOCT6100_CHIP_STATS				f_pChipStats )
{

	f_pChipStats->fResetChipStats				= FALSE;

	f_pChipStats->ulNumberChannels				= cOCT6100_INVALID_STAT;
	f_pChipStats->ulNumberTsiCncts				= cOCT6100_INVALID_STAT;
	f_pChipStats->ulNumberConfBridges			= cOCT6100_INVALID_STAT;
	f_pChipStats->ulNumberPlayoutBuffers		= cOCT6100_INVALID_STAT;
	f_pChipStats->ulPlayoutFreeMemSize			= cOCT6100_INVALID_STAT;

	f_pChipStats->ulNumberPhasingTssts			= cOCT6100_INVALID_STAT;
	f_pChipStats->ulNumberAdpcmChannels			= cOCT6100_INVALID_STAT;

	f_pChipStats->ulH100OutOfSynchCount			= cOCT6100_INVALID_STAT;
	f_pChipStats->ulH100ClockABadCount			= cOCT6100_INVALID_STAT;
	f_pChipStats->ulH100FrameABadCount			= cOCT6100_INVALID_STAT;
	f_pChipStats->ulH100ClockBBadCount			= cOCT6100_INVALID_STAT;
	f_pChipStats->ulInternalReadTimeoutCount	= cOCT6100_INVALID_STAT;
	f_pChipStats->ulSdramRefreshTooLateCount	= cOCT6100_INVALID_STAT;
	f_pChipStats->ulPllJitterErrorCount			= cOCT6100_INVALID_STAT;

	f_pChipStats->ulOverflowToneEventsCount		= cOCT6100_INVALID_STAT;
	f_pChipStats->ulSoftOverflowToneEventsCount	= cOCT6100_INVALID_STAT;
	f_pChipStats->ulSoftOverflowBufferPlayoutEventsCount	= cOCT6100_INVALID_STAT;
	




	
	return cOCT6100_ERR_OK;
}


UINT32 Oct6100ChipGetStats(
				tPOCT6100_INSTANCE_API			f_pApiInstance,
				tPOCT6100_CHIP_STATS			f_pChipStats )
{
	tOCT6100_SEIZE_SERIALIZE_OBJECT		SeizeSerObj;
	tOCT6100_RELEASE_SERIALIZE_OBJECT	ReleaseSerObj;
	UINT32								ulSerRes = cOCT6100_ERR_OK;
	UINT32								ulFncRes = cOCT6100_ERR_OK;

	/* Set the process context of the serialize structure. */
	SeizeSerObj.pProcessContext = f_pApiInstance->pProcessContext;
	ReleaseSerObj.pProcessContext = f_pApiInstance->pProcessContext;

	/* Seize all list semaphores needed by this function. */
	SeizeSerObj.ulSerialObjHndl = f_pApiInstance->ulApiSerObj;
	SeizeSerObj.ulTryTimeMs = cOCT6100_WAIT_INFINITELY;
	ulSerRes = Oct6100UserSeizeSerializeObject( &SeizeSerObj );
	if ( ulSerRes == cOCT6100_ERR_OK )
	{
		/* Call the serialized function. */
		ulFncRes = Oct6100ChipGetStatsSer( f_pApiInstance, f_pChipStats );
	}
	else
	{
		return ulSerRes;
	}

	/* Release the seized semaphores. */
	ReleaseSerObj.ulSerialObjHndl = f_pApiInstance->ulApiSerObj;
	ulSerRes = Oct6100UserReleaseSerializeObject( &ReleaseSerObj );

	/* If an error occured then return the error code. */
	if ( ulSerRes != cOCT6100_ERR_OK )
		return ulSerRes;
	if ( ulFncRes != cOCT6100_ERR_OK )
		return ulFncRes;

	return cOCT6100_ERR_OK;
}


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

Function:		Oct6100ChipGetImageInfo

Description:    Retrieves the chip image information indicating the supported 
				features and tones.

-------------------------------------------------------------------------------
|	Argument		|	Description
-------------------------------------------------------------------------------
f_pApiInstance		Pointer to API instance. This memory is used to keep the
					present state of the chip and all its resources.

f_pChipImageInfo	Pointer to a tPOCT6100_CHIP_IMAGE_INFO structure.

\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
UINT32 Oct6100ChipGetImageInfoDef(
				tPOCT6100_CHIP_IMAGE_INFO				f_pChipImageInfo )
{
	UINT32	i;

	Oct6100UserMemSet( f_pChipImageInfo->szVersionNumber, 0x0, cOCT6100_VERSION_NUMBER_MAX_SIZE );

	f_pChipImageInfo->fBufferPlayout				= FALSE;
	f_pChipImageInfo->fAdaptiveNoiseReduction		= FALSE;
	f_pChipImageInfo->fSoutNoiseBleaching			= FALSE;
	f_pChipImageInfo->fConferencingNoiseReduction	= FALSE;
	f_pChipImageInfo->fAutoLevelControl				= FALSE;
	f_pChipImageInfo->fHighLevelCompensation		= FALSE;
	f_pChipImageInfo->fSilenceSuppression			= FALSE;
	
	f_pChipImageInfo->fAdpcm				= FALSE;
	f_pChipImageInfo->fConferencing			= FALSE;
	f_pChipImageInfo->fDominantSpeaker		= FALSE;
	f_pChipImageInfo->ulMaxChannels			= cOCT6100_INVALID_VALUE;
	f_pChipImageInfo->ulNumTonesAvailable	= cOCT6100_INVALID_VALUE;
	f_pChipImageInfo->ulToneProfileNumber	= cOCT6100_INVALID_VALUE;
	f_pChipImageInfo->ulMaxTailDisplacement = cOCT6100_INVALID_VALUE;
	f_pChipImageInfo->ulBuildId				= cOCT6100_INVALID_VALUE;
	f_pChipImageInfo->ulMaxTailLength		= cOCT6100_INVALID_VALUE;
	f_pChipImageInfo->ulDebugEventSize		= cOCT6100_INVALID_VALUE;
	f_pChipImageInfo->ulMaxPlayoutEvents	= cOCT6100_INVALID_VALUE;
	f_pChipImageInfo->ulImageType			= cOCT6100_INVALID_VALUE;

	f_pChipImageInfo->fAcousticEcho					= FALSE;
	f_pChipImageInfo->fAecTailLength				= FALSE;
	f_pChipImageInfo->fToneRemoval					= FALSE;

	f_pChipImageInfo->fDefaultErl					= FALSE;
	f_pChipImageInfo->fNonLinearityBehaviorA		= FALSE;
	f_pChipImageInfo->fNonLinearityBehaviorB		= FALSE;
	f_pChipImageInfo->fPerChannelTailDisplacement	= FALSE;
	f_pChipImageInfo->fPerChannelTailLength			= FALSE;
	f_pChipImageInfo->fListenerEnhancement			= FALSE;
	f_pChipImageInfo->fRoutNoiseReduction			= FALSE;
	f_pChipImageInfo->fRoutNoiseReductionLevel		= FALSE;
	f_pChipImageInfo->fAnrSnrEnhancement			= FALSE;
	f_pChipImageInfo->fAnrVoiceNoiseSegregation		= FALSE;
	f_pChipImageInfo->fToneDisablerVqeActivationDelay = FALSE;
	f_pChipImageInfo->fMusicProtection				= FALSE;
	f_pChipImageInfo->fDoubleTalkBehavior			= FALSE;
	f_pChipImageInfo->fIdleCodeDetection			= TRUE;
	f_pChipImageInfo->fSinLevel						= TRUE;



	f_pChipImageInfo->fPerChannelPlayoutControl = FALSE;

	for ( i = 0; i < cOCT6100_MAX_TONE_EVENT; i++ )
	{
		Oct6100UserMemSet( f_pChipImageInfo->aToneInfo[ i ].aszToneName, 0x00, cOCT6100_TLV_MAX_TONE_NAME_SIZE );
		f_pChipImageInfo->aToneInfo[ i ].ulDetectionPort = cOCT6100_INVALID_PORT;
		f_pChipImageInfo->aToneInfo[ i ].ulToneID = cOCT6100_INVALID_VALUE;
	}

	return cOCT6100_ERR_OK;
}


UINT32 Oct6100ChipGetImageInfo(
				tPOCT6100_INSTANCE_API			f_pApiInstance,
				tPOCT6100_CHIP_IMAGE_INFO		f_pChipImageInfo )
{
	tPOCT6100_API_IMAGE_INFO	pImageInfo;
	UINT32	i;

	/* Get local pointer(s). */
	pImageInfo = &f_pApiInstance->pSharedInfo->ImageInfo;

	Oct6100UserMemCopy( f_pChipImageInfo->szVersionNumber, pImageInfo->szVersionNumber, cOCT6100_VERSION_NUMBER_MAX_SIZE );

	/* Copy the customer info. */
	f_pChipImageInfo->ulBuildId = pImageInfo->ulBuildId;

	/* Copy the features list. */
	f_pChipImageInfo->fBufferPlayout				= pImageInfo->fBufferPlayout;
	f_pChipImageInfo->fAdaptiveNoiseReduction		= pImageInfo->fAdaptiveNoiseReduction;
	f_pChipImageInfo->fSoutNoiseBleaching			= pImageInfo->fSoutNoiseBleaching;
	f_pChipImageInfo->fSilenceSuppression			= pImageInfo->fSilenceSuppression;

	f_pChipImageInfo->fAdpcm						= pImageInfo->fAdpcm;
	f_pChipImageInfo->fConferencing					= pImageInfo->fConferencing;
	f_pChipImageInfo->fDominantSpeaker				= pImageInfo->fDominantSpeakerEnabled;
	f_pChipImageInfo->fConferencingNoiseReduction	= pImageInfo->fConferencingNoiseReduction;
	f_pChipImageInfo->fAcousticEcho					= pImageInfo->fAcousticEcho;
	f_pChipImageInfo->fAecTailLength				= pImageInfo->fAecTailLength;
	f_pChipImageInfo->fDefaultErl					= pImageInfo->fDefaultErl;
	f_pChipImageInfo->fToneRemoval					= pImageInfo->fToneRemoval;

	f_pChipImageInfo->fNonLinearityBehaviorA		= pImageInfo->fNonLinearityBehaviorA;
	f_pChipImageInfo->fNonLinearityBehaviorB		= pImageInfo->fNonLinearityBehaviorB;
	f_pChipImageInfo->fPerChannelTailDisplacement	= pImageInfo->fPerChannelTailDisplacement;
	f_pChipImageInfo->fListenerEnhancement			= pImageInfo->fListenerEnhancement;
	f_pChipImageInfo->fRoutNoiseReduction			= pImageInfo->fRoutNoiseReduction;
	f_pChipImageInfo->fRoutNoiseReductionLevel		= pImageInfo->fRoutNoiseReductionLevel;
	f_pChipImageInfo->fAnrSnrEnhancement			= pImageInfo->fAnrSnrEnhancement;
	f_pChipImageInfo->fAnrVoiceNoiseSegregation		= pImageInfo->fAnrVoiceNoiseSegregation;
	f_pChipImageInfo->fMusicProtection				= pImageInfo->fMusicProtection;
	f_pChipImageInfo->fIdleCodeDetection			= pImageInfo->fIdleCodeDetection;
	f_pChipImageInfo->fSinLevel						= pImageInfo->fSinLevel;
	f_pChipImageInfo->fDoubleTalkBehavior			= pImageInfo->fDoubleTalkBehavior;
	f_pChipImageInfo->fHighLevelCompensation		= pImageInfo->fRinHighLevelCompensation;

	if ( ( pImageInfo->fRinAutoLevelControl == TRUE ) && ( pImageInfo->fSoutAutoLevelControl == TRUE ) )
		f_pChipImageInfo->fAutoLevelControl = TRUE;
	else
		f_pChipImageInfo->fAutoLevelControl = FALSE;
	
	f_pChipImageInfo->ulMaxChannels					= pImageInfo->usMaxNumberOfChannels;
	f_pChipImageInfo->ulNumTonesAvailable			= pImageInfo->byNumToneDetectors;
	f_pChipImageInfo->ulToneProfileNumber			= pImageInfo->ulToneProfileNumber;
	f_pChipImageInfo->ulMaxTailDisplacement			= pImageInfo->usMaxTailDisplacement;
	f_pChipImageInfo->ulMaxTailLength				= pImageInfo->usMaxTailLength;
	f_pChipImageInfo->fPerChannelTailLength			= pImageInfo->fPerChannelTailLength;
	f_pChipImageInfo->ulDebugEventSize				= f_pApiInstance->pSharedInfo->DebugInfo.ulDebugEventSize;
	f_pChipImageInfo->fToneDisablerVqeActivationDelay = pImageInfo->fToneDisablerVqeActivationDelay;
	f_pChipImageInfo->ulMaxPlayoutEvents			= pImageInfo->byMaxNumberPlayoutEvents - 1; /* 127 or 31 */
	f_pChipImageInfo->ulImageType					= pImageInfo->byImageType;



	f_pChipImageInfo->fPerChannelPlayoutControl = pImageInfo->fPerChannelPlayoutControl;

	for ( i = 0; i < cOCT6100_MAX_TONE_EVENT; i++ )
	{
		Oct6100UserMemCopy( f_pChipImageInfo->aToneInfo[ i ].aszToneName, pImageInfo->aToneInfo[ i ].aszToneName, cOCT6100_TLV_MAX_TONE_NAME_SIZE );
		f_pChipImageInfo->aToneInfo[ i ].ulDetectionPort = pImageInfo->aToneInfo[ i ].ulDetectionPort;
		f_pChipImageInfo->aToneInfo[ i ].ulToneID = pImageInfo->aToneInfo[ i ].ulToneID;
	}
	
	return cOCT6100_ERR_OK;
}


/****************************  PRIVATE FUNCTIONS  ****************************/

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

Function:		Oct6100ApiChipStatsSwInit

Description:    Initializes portions of API instance associated to chip stats.

-------------------------------------------------------------------------------
|	Argument		|	Description
-------------------------------------------------------------------------------
f_pApiInstance		Pointer to API instance. This memory is used to keep
					the present state of the chip and all its resources.

\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
UINT32 Oct6100ApiChipStatsSwInit(
				IN OUT	tPOCT6100_INSTANCE_API			f_pApiInstance )
{
	tPOCT6100_SHARED_INFO	pSharedInfo;

	/* Get local pointer to shared portion of API instance. */
	pSharedInfo = f_pApiInstance->pSharedInfo;

	/* Initialize chip stats. */
	pSharedInfo->ErrorStats.fFatalChipError = FALSE;

	pSharedInfo->ErrorStats.ulH100ClkABadCnt = 0;
	pSharedInfo->ErrorStats.ulH100ClkBBadCnt = 0;
	pSharedInfo->ErrorStats.ulH100FrameABadCnt = 0;
	pSharedInfo->ErrorStats.ulH100OutOfSyncCnt = 0;

	pSharedInfo->ErrorStats.ulInternalReadTimeoutCnt = 0;
	pSharedInfo->ErrorStats.ulSdramRefreshTooLateCnt = 0;
	pSharedInfo->ErrorStats.ulPllJitterErrorCnt	= 0;
	pSharedInfo->ErrorStats.ulOverflowToneEventsCnt = 0;


	
	pSharedInfo->ErrorStats.ulToneDetectorErrorCnt = 0;

	/* Init the chip stats. */
	pSharedInfo->ChipStats.usNumberChannels = 0;
	pSharedInfo->ChipStats.usNumberBiDirChannels = 0;
	pSharedInfo->ChipStats.usNumberTsiCncts = 0;
	pSharedInfo->ChipStats.usNumberConfBridges = 0;
	pSharedInfo->ChipStats.usNumberPlayoutBuffers = 0;
	pSharedInfo->ChipStats.usNumberActiveBufPlayoutPorts = 0;
	pSharedInfo->ChipStats.ulPlayoutMemUsed = 0;
	pSharedInfo->ChipStats.usNumEcChanUsingMixer = 0;

	pSharedInfo->ChipStats.usNumberPhasingTssts = 0;
	pSharedInfo->ChipStats.usNumberAdpcmChans	= 0;





	return cOCT6100_ERR_OK;
}


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

Function:		Oct6100ChipGetStatsSer

Description:    Serialized function retreiving the chip statistics.

-------------------------------------------------------------------------------
|	Argument		|	Description
-------------------------------------------------------------------------------
f_pApiInstance		Pointer to API instance. This memory is used to keep the
					present state of the chip and all its resources.

f_pChipStats		Pointer to master mode configuration structure.

\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
UINT32 Oct6100ChipGetStatsSer(
				IN OUT	tPOCT6100_INSTANCE_API			f_pApiInstance,
				OUT		tPOCT6100_CHIP_STATS			f_pChipStats )
{
	tPOCT6100_SHARED_INFO	pSharedInfo;

	/* Get local pointer(s). */
	pSharedInfo = f_pApiInstance->pSharedInfo;

	f_pChipStats->ulNumberChannels = pSharedInfo->ChipStats.usNumberChannels;
	f_pChipStats->ulNumberTsiCncts = pSharedInfo->ChipStats.usNumberTsiCncts;
	f_pChipStats->ulNumberConfBridges = pSharedInfo->ChipStats.usNumberConfBridges;
	f_pChipStats->ulNumberPlayoutBuffers = pSharedInfo->ChipStats.usNumberPlayoutBuffers;
	f_pChipStats->ulPlayoutFreeMemSize = ( f_pApiInstance->pSharedInfo->MiscVars.ulTotalMemSize - ( f_pApiInstance->pSharedInfo->MemoryMap.ulFreeMemBaseAddress - cOCT6100_EXTERNAL_MEM_BASE_ADDRESS ) ) - ( pSharedInfo->ChipStats.ulPlayoutMemUsed );

	f_pChipStats->ulNumberPhasingTssts	= pSharedInfo->ChipStats.usNumberPhasingTssts;
	f_pChipStats->ulNumberAdpcmChannels	= pSharedInfo->ChipStats.usNumberAdpcmChans;

	/* Check the input parameters. */
	if ( f_pChipStats->fResetChipStats != TRUE && 
		 f_pChipStats->fResetChipStats != FALSE )
		return cOCT6100_ERR_CHIP_STATS_RESET;
	
	if ( f_pChipStats->fResetChipStats == TRUE )
	{
		pSharedInfo->ErrorStats.ulH100OutOfSyncCnt = 0;
		pSharedInfo->ErrorStats.ulH100ClkABadCnt = 0;
		pSharedInfo->ErrorStats.ulH100FrameABadCnt = 0;
		pSharedInfo->ErrorStats.ulH100ClkBBadCnt = 0;

		pSharedInfo->ErrorStats.ulInternalReadTimeoutCnt = 0;
		pSharedInfo->ErrorStats.ulPllJitterErrorCnt = 0;
		pSharedInfo->ErrorStats.ulSdramRefreshTooLateCnt = 0;

		pSharedInfo->ErrorStats.ulOverflowToneEventsCnt = 0;	
		pSharedInfo->SoftBufs.ulToneEventBufferOverflowCnt = 0;
		pSharedInfo->SoftBufs.ulBufPlayoutEventBufferOverflowCnt = 0;




	}

	f_pChipStats->ulH100OutOfSynchCount = pSharedInfo->ErrorStats.ulH100OutOfSyncCnt;
	f_pChipStats->ulH100ClockABadCount = pSharedInfo->ErrorStats.ulH100ClkABadCnt;
	f_pChipStats->ulH100FrameABadCount = pSharedInfo->ErrorStats.ulH100FrameABadCnt;
	f_pChipStats->ulH100ClockBBadCount = pSharedInfo->ErrorStats.ulH100ClkBBadCnt;

	f_pChipStats->ulInternalReadTimeoutCount	= pSharedInfo->ErrorStats.ulInternalReadTimeoutCnt;
	f_pChipStats->ulPllJitterErrorCount			= pSharedInfo->ErrorStats.ulPllJitterErrorCnt;
	f_pChipStats->ulSdramRefreshTooLateCount	= pSharedInfo->ErrorStats.ulSdramRefreshTooLateCnt;
	




	f_pChipStats->ulOverflowToneEventsCount = pSharedInfo->ErrorStats.ulOverflowToneEventsCnt;
	f_pChipStats->ulSoftOverflowToneEventsCount = pSharedInfo->SoftBufs.ulToneEventBufferOverflowCnt;
	f_pChipStats->ulSoftOverflowBufferPlayoutEventsCount = pSharedInfo->SoftBufs.ulBufPlayoutEventBufferOverflowCnt;



	return cOCT6100_ERR_OK;
}