1
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
5
Copyright (c) 2001-2007 Octasic Inc.
9
This file contains the functions used to manage the allocation of mixer
12
This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is
13
free software; you can redistribute it and/or modify it under the terms of
14
the GNU General Public License as published by the Free Software Foundation;
15
either version 2 of the License, or (at your option) any later version.
17
The OCT6100 GPL API is distributed in the hope that it will be useful, but
18
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22
You should have received a copy of the GNU General Public License
23
along with the OCT6100 GPL API; if not, write to the Free Software
24
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26
$Octasic_Release: OCT612xAPI-01.00-PR49 $
28
$Octasic_Revision: 42 $
30
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
33
/***************************** INCLUDE FILES *******************************/
37
#include "oct6100api/oct6100_defines.h"
38
#include "oct6100api/oct6100_errors.h"
40
#include "apilib/octapi_llman.h"
42
#include "oct6100api/oct6100_apiud.h"
43
#include "oct6100api/oct6100_tlv_inst.h"
44
#include "oct6100api/oct6100_chip_open_inst.h"
45
#include "oct6100api/oct6100_chip_stats_inst.h"
46
#include "oct6100api/oct6100_interrupts_inst.h"
47
#include "oct6100api/oct6100_remote_debug_inst.h"
48
#include "oct6100api/oct6100_debug_inst.h"
49
#include "oct6100api/oct6100_api_inst.h"
50
#include "oct6100api/oct6100_channel_inst.h"
51
#include "oct6100api/oct6100_mixer_inst.h"
53
#include "oct6100api/oct6100_interrupts_pub.h"
54
#include "oct6100api/oct6100_chip_open_pub.h"
55
#include "oct6100api/oct6100_channel_pub.h"
56
#include "oct6100api/oct6100_mixer_pub.h"
58
#include "oct6100_chip_open_priv.h"
59
#include "oct6100_miscellaneous_priv.h"
60
#include "oct6100_channel_priv.h"
61
#include "oct6100_mixer_priv.h"
63
/**************************** PUBLIC FUNCTIONS ****************************/
66
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
68
Function: Oct6100MixerCopyEventCreate
70
Description: This function creates a mixer copy event used to copy
71
information from one channel port to another channel port.
73
-------------------------------------------------------------------------------
74
| Argument | Description
75
-------------------------------------------------------------------------------
76
f_pApiInstance Pointer to API instance. This memory is used to keep the
77
present state of the chip and all its resources.
79
f_pCopyEventCreate Pointer to a mixer copy event structure.
81
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
82
#if !SKIP_Oct6100MixerCopyEventCreateDef
83
UINT32 Oct6100MixerCopyEventCreateDef(
84
tPOCT6100_COPY_EVENT_CREATE f_pCopyEventCreate )
86
f_pCopyEventCreate->pulCopyEventHndl = NULL;
88
f_pCopyEventCreate->ulSourceChanHndl = cOCT6100_INVALID_HANDLE;
89
f_pCopyEventCreate->ulSourcePort = cOCT6100_INVALID_PORT;
91
f_pCopyEventCreate->ulDestinationChanHndl = cOCT6100_INVALID_HANDLE;
92
f_pCopyEventCreate->ulDestinationPort = cOCT6100_INVALID_PORT;
94
return cOCT6100_ERR_OK;
99
#if !SKIP_Oct6100MixerCopyEventCreate
100
UINT32 Oct6100MixerCopyEventCreate(
101
tPOCT6100_INSTANCE_API f_pApiInstance,
102
tPOCT6100_COPY_EVENT_CREATE f_pCopyEventCreate )
104
tOCT6100_SEIZE_SERIALIZE_OBJECT SeizeSerObj;
105
tOCT6100_RELEASE_SERIALIZE_OBJECT ReleaseSerObj;
106
UINT32 ulSerRes = cOCT6100_ERR_OK;
107
UINT32 ulFncRes = cOCT6100_ERR_OK;
109
/* Set the process context of the serialize structure. */
110
SeizeSerObj.pProcessContext = f_pApiInstance->pProcessContext;
111
ReleaseSerObj.pProcessContext = f_pApiInstance->pProcessContext;
113
/* Seize all list semaphores needed by this function. */
114
SeizeSerObj.ulSerialObjHndl = f_pApiInstance->ulApiSerObj;
115
SeizeSerObj.ulTryTimeMs = cOCT6100_WAIT_INFINITELY;
116
ulSerRes = Oct6100UserSeizeSerializeObject( &SeizeSerObj );
117
if ( ulSerRes == cOCT6100_ERR_OK )
119
/* Call the serialized function. */
120
ulFncRes = Oct6100MixerCopyEventCreateSer( f_pApiInstance, f_pCopyEventCreate );
127
/* Release the seized semaphores. */
128
ReleaseSerObj.ulSerialObjHndl = f_pApiInstance->ulApiSerObj;
129
ulSerRes = Oct6100UserReleaseSerializeObject( &ReleaseSerObj );
131
/* If an error occured then return the error code. */
132
if ( ulSerRes != cOCT6100_ERR_OK )
134
if ( ulFncRes != cOCT6100_ERR_OK )
137
return cOCT6100_ERR_OK;
142
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
144
Function: Oct6100MixerCopyEventDestroy
146
Description: This function destroys a mixer copy event used to copy
147
information from one channel port to another.
149
-------------------------------------------------------------------------------
150
| Argument | Description
151
-------------------------------------------------------------------------------
152
f_pApiInstance Pointer to API instance. This memory is used to keep the
153
present state of the chip and all its resources.
155
f_pCopyEventDestroy Pointer to a destroy copy event structure.
157
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
158
#if !SKIP_Oct6100MixerCopyEventDestroyDef
159
UINT32 Oct6100MixerCopyEventDestroyDef(
160
tPOCT6100_COPY_EVENT_DESTROY f_pCopyEventDestroy )
162
f_pCopyEventDestroy->ulCopyEventHndl = cOCT6100_INVALID_HANDLE;
164
return cOCT6100_ERR_OK;
169
#if !SKIP_Oct6100MixerCopyEventDestroy
170
UINT32 Oct6100MixerCopyEventDestroy(
171
tPOCT6100_INSTANCE_API f_pApiInstance,
172
tPOCT6100_COPY_EVENT_DESTROY f_pCopyEventDestroy )
174
tOCT6100_SEIZE_SERIALIZE_OBJECT SeizeSerObj;
175
tOCT6100_RELEASE_SERIALIZE_OBJECT ReleaseSerObj;
176
UINT32 ulSerRes = cOCT6100_ERR_OK;
177
UINT32 ulFncRes = cOCT6100_ERR_OK;
179
/* Set the process context of the serialize structure. */
180
SeizeSerObj.pProcessContext = f_pApiInstance->pProcessContext;
181
ReleaseSerObj.pProcessContext = f_pApiInstance->pProcessContext;
183
/* Seize all list semaphores needed by this function. */
184
SeizeSerObj.ulSerialObjHndl = f_pApiInstance->ulApiSerObj;
185
SeizeSerObj.ulTryTimeMs = cOCT6100_WAIT_INFINITELY;
186
ulSerRes = Oct6100UserSeizeSerializeObject( &SeizeSerObj );
187
if ( ulSerRes == cOCT6100_ERR_OK )
189
/* Call the serialized function. */
190
ulFncRes = Oct6100MixerCopyEventDestroySer( f_pApiInstance, f_pCopyEventDestroy );
197
/* Release the seized semaphores. */
198
ReleaseSerObj.ulSerialObjHndl = f_pApiInstance->ulApiSerObj;
199
ulSerRes = Oct6100UserReleaseSerializeObject( &ReleaseSerObj );
201
/* If an error occured then return the error code. */
202
if ( ulSerRes != cOCT6100_ERR_OK )
204
if ( ulFncRes != cOCT6100_ERR_OK )
207
return cOCT6100_ERR_OK;
212
/**************************** PRIVATE FUNCTIONS ****************************/
215
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
217
Function: Oct6100ApiGetMixerSwSizes
219
Description: Gets the sizes of all portions of the API instance pertinent
220
to the management of mixer events.
222
-------------------------------------------------------------------------------
223
| Argument | Description
224
-------------------------------------------------------------------------------
226
f_pOpenChip User chip configuration.
227
f_pInstSizes Pointer to struct containing instance sizes.
229
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
230
#if !SKIP_Oct6100ApiGetMixerSwSizes
231
UINT32 Oct6100ApiGetMixerSwSizes(
232
IN tPOCT6100_CHIP_OPEN f_pOpenChip,
233
OUT tPOCT6100_API_INSTANCE_SIZES f_pInstSizes )
238
/* Calculate the API memory required for the resource entry lists. */
239
f_pInstSizes->ulMixerEventList = cOCT6100_MAX_MIXER_EVENTS * sizeof( tOCT6100_API_MIXER_EVENT );
241
/* Calculate memory needed for mixers entry allocation. */
242
ulResult = OctapiLlmAllocGetSize( cOCT6100_MAX_MIXER_EVENTS, &f_pInstSizes->ulMixerEventAlloc );
243
if ( ulResult != cOCT6100_ERR_OK )
244
return cOCT6100_ERR_FATAL_1D;
246
mOCT6100_ROUND_MEMORY_SIZE( f_pInstSizes->ulMixerEventList, ulTempVar )
247
mOCT6100_ROUND_MEMORY_SIZE( f_pInstSizes->ulMixerEventAlloc, ulTempVar )
250
f_pInstSizes->ulCopyEventList = cOCT6100_MAX_MIXER_EVENTS * sizeof( tOCT6100_API_COPY_EVENT );
252
ulResult = OctapiLlmAllocGetSize( cOCT6100_MAX_MIXER_EVENTS, &f_pInstSizes->ulCopyEventAlloc );
253
if ( ulResult != cOCT6100_ERR_OK )
254
return cOCT6100_ERR_FATAL_1D;
256
mOCT6100_ROUND_MEMORY_SIZE( f_pInstSizes->ulCopyEventList, ulTempVar )
257
mOCT6100_ROUND_MEMORY_SIZE( f_pInstSizes->ulCopyEventAlloc, ulTempVar )
260
return cOCT6100_ERR_OK;
265
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
267
Function: Oct6100ApiMixerSwInit
269
Description: Initializes all elements of the instance structure associated
272
-------------------------------------------------------------------------------
273
| Argument | Description
274
-------------------------------------------------------------------------------
275
f_pApiInstance Pointer to API instance. This mixer is used to keep
276
the present state of the chip and all its resources.
278
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
279
#if !SKIP_Oct6100ApiMixerSwInit
280
UINT32 Oct6100ApiMixerSwInit(
281
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance )
283
tPOCT6100_SHARED_INFO pSharedInfo;
284
tPOCT6100_API_MIXER_EVENT pMixerEventList;
285
PVOID pMixerEventAlloc;
286
PVOID pCopyEventAlloc;
290
/* Get local pointer(s). */
291
pSharedInfo = f_pApiInstance->pSharedInfo;
293
/*===================================================================*/
294
/* Initialize the mixer event list. */
295
mOCT6100_GET_MIXER_EVENT_LIST_PNT( pSharedInfo, pMixerEventList );
297
/* Initialize the mixer event allocation software to "all free". */
298
Oct6100UserMemSet( pMixerEventList, 0x00, cOCT6100_MAX_MIXER_EVENTS * sizeof( tOCT6100_API_MIXER_EVENT ));
300
mOCT6100_GET_MIXER_EVENT_ALLOC_PNT( pSharedInfo, pMixerEventAlloc )
302
ulResult = OctapiLlmAllocInit( &pMixerEventAlloc, cOCT6100_MAX_MIXER_EVENTS );
303
if ( ulResult != cOCT6100_ERR_OK )
304
return cOCT6100_ERR_FATAL_1F;
306
/* Now reserve the first entry as the first node. */
307
ulResult = OctapiLlmAllocAlloc( pMixerEventAlloc, &ulTempVar );
308
if ( ulResult != cOCT6100_ERR_OK )
310
return cOCT6100_ERR_FATAL_20;
313
/* Check that we obtain the first event. */
314
if ( ulTempVar != 0 )
315
return cOCT6100_ERR_FATAL_21;
317
/* Now reserve the tail entry. */
318
ulResult = OctapiLlmAllocAlloc( pMixerEventAlloc, &ulTempVar );
319
if ( ulResult != cOCT6100_ERR_OK )
321
return cOCT6100_ERR_FATAL_AA;
323
/* Check that we obtain the first event. */
324
if ( ulTempVar != 1 )
325
return cOCT6100_ERR_FATAL_AB;
327
/* Program the head node. */
328
pMixerEventList[ cOCT6100_MIXER_HEAD_NODE ].fReserved = TRUE;
329
pMixerEventList[ cOCT6100_MIXER_HEAD_NODE ].usNextEventPtr = cOCT6100_MIXER_TAIL_NODE;
330
pMixerEventList[ cOCT6100_MIXER_HEAD_NODE ].usEventType = cOCT6100_MIXER_CONTROL_MEM_NO_OP;
332
/* Program the tail node. */
333
pMixerEventList[ cOCT6100_MIXER_TAIL_NODE ].fReserved = TRUE;
334
pMixerEventList[ cOCT6100_MIXER_TAIL_NODE ].usNextEventPtr = cOCT6100_INVALID_INDEX;
335
pMixerEventList[ cOCT6100_MIXER_TAIL_NODE ].usEventType = cOCT6100_MIXER_CONTROL_MEM_NO_OP;
337
/* Now reserve the entry used for channel recording if the feature is enabled. */
338
if ( pSharedInfo->ChipConfig.fEnableChannelRecording == TRUE )
342
/* Reserve an entry to copy the desire SOUT signal to the SIN signal of the recording channel. */
343
ulResult = OctapiLlmAllocAlloc( pMixerEventAlloc, &ulAllocIndex );
344
if ( ulResult != cOCT6100_ERR_OK )
346
return cOCT6100_ERR_FATAL_90;
349
pSharedInfo->MixerInfo.usRecordCopyEventIndex = (UINT16)( ulAllocIndex & 0xFFFF );
351
/* Reserve an entry to copy the saved SIN signal of the debugged channel into it's original location. */
352
ulResult = OctapiLlmAllocAlloc( pMixerEventAlloc, &ulAllocIndex );
353
if ( ulResult != cOCT6100_ERR_OK )
355
return cOCT6100_ERR_FATAL_90;
358
pSharedInfo->MixerInfo.usRecordSinEventIndex = (UINT16)( ulAllocIndex & 0xFFFF );
360
/* Configure the SIN event. */
361
pMixerEventList[ pSharedInfo->MixerInfo.usRecordSinEventIndex ].fReserved = TRUE;
362
pMixerEventList[ pSharedInfo->MixerInfo.usRecordSinEventIndex ].usNextEventPtr = cOCT6100_MIXER_TAIL_NODE;
363
pMixerEventList[ pSharedInfo->MixerInfo.usRecordSinEventIndex ].usEventType = cOCT6100_MIXER_CONTROL_MEM_NO_OP;
365
/* Configure the SOUT copy event. */
366
pMixerEventList[ pSharedInfo->MixerInfo.usRecordCopyEventIndex ].fReserved = TRUE;
367
pMixerEventList[ pSharedInfo->MixerInfo.usRecordCopyEventIndex ].usNextEventPtr = pSharedInfo->MixerInfo.usRecordSinEventIndex;
368
pMixerEventList[ pSharedInfo->MixerInfo.usRecordCopyEventIndex ].usEventType = cOCT6100_MIXER_CONTROL_MEM_NO_OP;
370
/* Program the head node. */
371
pMixerEventList[ cOCT6100_MIXER_HEAD_NODE ].usNextEventPtr = pSharedInfo->MixerInfo.usRecordCopyEventIndex;
374
/* Initialize the copy event list. */
375
mOCT6100_GET_COPY_EVENT_ALLOC_PNT( pSharedInfo, pCopyEventAlloc )
377
ulResult = OctapiLlmAllocInit( &pCopyEventAlloc, cOCT6100_MAX_MIXER_EVENTS );
378
if ( ulResult != cOCT6100_ERR_OK )
379
return cOCT6100_ERR_FATAL_B4;
381
return cOCT6100_ERR_OK;
386
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
388
Function: Oct6100ApiMixerEventAdd
390
Description: This function adds a mixer event event to the list of events
391
based on the event type passed to the function.
393
-------------------------------------------------------------------------------
394
| Argument | Description
395
-------------------------------------------------------------------------------
396
f_pApiInstance Pointer to API instance. This memory is used to keep
397
the present state of the chip and all its resources.
398
f_usEventIndex Index of the event within the API's mixer event list.
399
f_usEventType Type of mixer event.
400
f_usDestinationChanIndex Index of the destination channel within the API's
403
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
404
#if !SKIP_Oct6100ApiMixerEventAdd
405
UINT32 Oct6100ApiMixerEventAdd(
406
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
407
IN UINT16 f_usEventIndex,
408
IN UINT16 f_usEventType,
409
IN UINT16 f_usDestinationChanIndex )
411
tPOCT6100_SHARED_INFO pSharedInfo;
412
tPOCT6100_API_MIXER_EVENT pCurrentEventEntry;
413
tPOCT6100_API_MIXER_EVENT pTempEventEntry;
414
tPOCT6100_API_CHANNEL pDestinationEntry;
415
tOCT6100_WRITE_PARAMS WriteParams;
417
UINT16 usTempEventIndex;
419
/* Obtain local pointer to shared portion of instance. */
420
pSharedInfo = f_pApiInstance->pSharedInfo;
422
WriteParams.pProcessContext = f_pApiInstance->pProcessContext;
424
WriteParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId;
426
/* Get a pointer to the event entry. */
427
mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pCurrentEventEntry, f_usEventIndex );
429
/* Get a pointer to the destination channel entry. */
430
mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pDestinationEntry, f_usDestinationChanIndex );
432
/* Now proceed according to the event type. */
433
switch ( f_usEventType )
435
case cOCT6100_EVENT_TYPE_SOUT_COPY:
437
/* Now insert the Sin copy event */
438
if ( pSharedInfo->MixerInfo.usFirstSoutCopyEventPtr == cOCT6100_INVALID_INDEX )
440
/* The only node in the list before the point where the node needs to */
441
/* be inserted is the head node. */
442
usTempEventIndex = cOCT6100_MIXER_HEAD_NODE;
444
/* This node will be the first one in the Sout copy section. */
445
pSharedInfo->MixerInfo.usFirstSoutCopyEventPtr = f_usEventIndex;
446
pSharedInfo->MixerInfo.usLastSoutCopyEventPtr = f_usEventIndex;
448
else /* pSharedInfo->MixerInfo.usFirstSoutCopyEventPtr != cOCT6100_INVALID_INDEX */
450
usTempEventIndex = pSharedInfo->MixerInfo.usLastSoutCopyEventPtr;
451
pSharedInfo->MixerInfo.usLastSoutCopyEventPtr = f_usEventIndex;
456
case cOCT6100_EVENT_TYPE_SIN_COPY:
458
/* Now insert the Sin copy event. */
459
if ( pSharedInfo->MixerInfo.usFirstSinCopyEventPtr == cOCT6100_INVALID_INDEX )
461
/* This is the first Sin copy event. We must find the event that comes before */
462
/* the event we want to add. First let's check for a bridge event. */
463
if ( pSharedInfo->MixerInfo.usLastBridgeEventPtr == cOCT6100_INVALID_INDEX )
465
/* No event in the bridge section, now let's check in the Sout copy section. */
466
if ( pSharedInfo->MixerInfo.usLastSoutCopyEventPtr == cOCT6100_INVALID_INDEX )
468
/* The only node in the list then is the head node. */
469
usTempEventIndex = cOCT6100_MIXER_HEAD_NODE;
473
usTempEventIndex = pSharedInfo->MixerInfo.usLastSoutCopyEventPtr;
478
usTempEventIndex = pSharedInfo->MixerInfo.usLastBridgeEventPtr;
481
/* This node will be the first one in the Sin copy section. */
482
pSharedInfo->MixerInfo.usFirstSinCopyEventPtr = f_usEventIndex;
483
pSharedInfo->MixerInfo.usLastSinCopyEventPtr = f_usEventIndex;
485
else /* pSharedInfo->MixerInfo.usFirstSinCopyEventPtr != cOCT6100_INVALID_INDEX */
487
usTempEventIndex = pSharedInfo->MixerInfo.usLastSinCopyEventPtr;
488
pSharedInfo->MixerInfo.usLastSinCopyEventPtr = f_usEventIndex;
494
return cOCT6100_ERR_FATAL_AF;
498
mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pTempEventEntry, usTempEventIndex );
500
/*=======================================================================*/
501
/* Program the Copy event. */
503
/* Set the Copy event first. */
504
pCurrentEventEntry->usEventType = cOCT6100_MIXER_CONTROL_MEM_COPY;
505
pCurrentEventEntry->usNextEventPtr = pTempEventEntry->usNextEventPtr;
507
WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( f_usEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE );
508
WriteParams.ulWriteAddress += 4;
509
WriteParams.usWriteData = pCurrentEventEntry->usNextEventPtr;
511
mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult );
512
if ( ulResult != cOCT6100_ERR_OK )
515
/*=======================================================================*/
517
/*=======================================================================*/
518
/* Modify the previous node. */
520
/* Set the last Sub-store entry. */
521
pTempEventEntry->usNextEventPtr = f_usEventIndex;
523
WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( usTempEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE );
524
WriteParams.ulWriteAddress += 4;
525
WriteParams.usWriteData = f_usEventIndex;
527
mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult );
528
if ( ulResult != cOCT6100_ERR_OK )
531
/*=======================================================================*/
533
/* Save the destination channel index, needed when removing the event from the mixer. */
534
pCurrentEventEntry->usDestinationChanIndex = f_usDestinationChanIndex;
536
/* Mark the entry as reserved. */
537
pCurrentEventEntry->fReserved = TRUE;
539
/* Increment the event count on that particular destination channel */
540
pDestinationEntry->usMixerEventCnt++;
542
return cOCT6100_ERR_OK;
547
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
549
Function: Oct6100ApiMixerEventRemove
551
Description: This function removes a mixer event event from the list of events based
552
on the event type passed to the function.
554
-------------------------------------------------------------------------------
555
| Argument | Description
556
-------------------------------------------------------------------------------
557
f_pApiInstance Pointer to API instance. This memory is used to keep the
558
present state of the chip and all its resources.
560
f_usEventIndex Index of event within the API's mixer event list.
561
f_usEventType Type of mixer event.
563
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
564
#if !SKIP_Oct6100ApiMixerEventRemove
565
UINT32 Oct6100ApiMixerEventRemove(
566
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
567
IN UINT16 f_usEventIndex,
568
IN UINT16 f_usEventType )
570
tPOCT6100_SHARED_INFO pSharedInfo;
571
tPOCT6100_API_MIXER_EVENT pCurrentEventEntry;
572
tPOCT6100_API_MIXER_EVENT pTempEventEntry;
573
tPOCT6100_API_CHANNEL pDestinationEntry;
574
tOCT6100_WRITE_BURST_PARAMS BurstWriteParams;
575
tOCT6100_WRITE_PARAMS WriteParams;
576
BOOL fFirstSinCopyEvent = FALSE;
578
UINT16 usTempEventIndex;
579
UINT32 ulLoopCount = 0;
580
UINT16 ausWriteData[ 4 ] = { 0 };
582
/* Obtain local pointer to shared portion of instance. */
583
pSharedInfo = f_pApiInstance->pSharedInfo;
585
WriteParams.pProcessContext = f_pApiInstance->pProcessContext;
587
WriteParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId;
589
BurstWriteParams.pProcessContext = f_pApiInstance->pProcessContext;
591
BurstWriteParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId;
592
BurstWriteParams.pusWriteData = ausWriteData;
593
BurstWriteParams.ulWriteLength = 4;
595
/* Get a pointer to the event entry. */
596
mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pCurrentEventEntry, f_usEventIndex );
598
/* Get the pointer to the channel entry. */
599
mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pDestinationEntry, pCurrentEventEntry->usDestinationChanIndex );
601
/* Now proceed according to the event type. */
602
switch ( f_usEventType )
604
case cOCT6100_EVENT_TYPE_SOUT_COPY:
606
if ( f_usEventIndex == pSharedInfo->MixerInfo.usFirstSoutCopyEventPtr )
608
usTempEventIndex = cOCT6100_MIXER_HEAD_NODE;
612
/* Now insert the Sin copy event. */
613
usTempEventIndex = pSharedInfo->MixerInfo.usFirstSoutCopyEventPtr;
616
/* Find the copy entry before the entry to remove. */
617
mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pTempEventEntry, usTempEventIndex );
619
while( pTempEventEntry->usNextEventPtr != f_usEventIndex )
621
usTempEventIndex = pTempEventEntry->usNextEventPtr;
623
mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pTempEventEntry, usTempEventIndex );
626
if ( ulLoopCount == cOCT6100_MAX_LOOP )
627
return cOCT6100_ERR_FATAL_B2;
630
/*=======================================================================*/
631
/* Update the global mixer pointers. */
632
if ( f_usEventIndex == pSharedInfo->MixerInfo.usFirstSoutCopyEventPtr )
634
if ( f_usEventIndex == pSharedInfo->MixerInfo.usLastSoutCopyEventPtr )
636
/* This event was the only of the list.*/
637
pSharedInfo->MixerInfo.usFirstSoutCopyEventPtr = cOCT6100_INVALID_INDEX;
638
pSharedInfo->MixerInfo.usLastSoutCopyEventPtr = cOCT6100_INVALID_INDEX;
642
pSharedInfo->MixerInfo.usFirstSoutCopyEventPtr = pCurrentEventEntry->usNextEventPtr;
645
else if ( f_usEventIndex == pSharedInfo->MixerInfo.usLastSoutCopyEventPtr )
647
pSharedInfo->MixerInfo.usLastSoutCopyEventPtr = usTempEventIndex;
649
/*=======================================================================*/
654
case cOCT6100_EVENT_TYPE_SIN_COPY:
656
if ( f_usEventIndex == pSharedInfo->MixerInfo.usFirstSinCopyEventPtr )
658
fFirstSinCopyEvent = TRUE;
660
if ( pSharedInfo->MixerInfo.usLastBridgeEventPtr != cOCT6100_INVALID_INDEX )
662
usTempEventIndex = pSharedInfo->MixerInfo.usLastBridgeEventPtr;
664
else if ( pSharedInfo->MixerInfo.usLastSoutCopyEventPtr != cOCT6100_INVALID_INDEX )
666
usTempEventIndex = pSharedInfo->MixerInfo.usLastSoutCopyEventPtr;
670
usTempEventIndex = cOCT6100_MIXER_HEAD_NODE;
675
/* Now insert the Sin copy event. */
676
usTempEventIndex = pSharedInfo->MixerInfo.usFirstSinCopyEventPtr;
679
/* Find the copy entry before the entry to remove. */
680
mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pTempEventEntry, usTempEventIndex );
682
/* If we are not the first event of the Sin copy list. */
683
if ( fFirstSinCopyEvent == FALSE )
685
while( pTempEventEntry->usNextEventPtr != f_usEventIndex )
687
usTempEventIndex = pTempEventEntry->usNextEventPtr;
688
mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pTempEventEntry, usTempEventIndex );
691
if ( ulLoopCount == cOCT6100_MAX_LOOP )
692
return cOCT6100_ERR_FATAL_B1;
696
/*=======================================================================*/
697
/* Update the global mixer pointers. */
698
if ( f_usEventIndex == pSharedInfo->MixerInfo.usFirstSinCopyEventPtr )
700
if ( f_usEventIndex == pSharedInfo->MixerInfo.usLastSinCopyEventPtr )
702
/* This event was the only of the list. */
703
pSharedInfo->MixerInfo.usFirstSinCopyEventPtr = cOCT6100_INVALID_INDEX;
704
pSharedInfo->MixerInfo.usLastSinCopyEventPtr = cOCT6100_INVALID_INDEX;
708
pSharedInfo->MixerInfo.usFirstSinCopyEventPtr = pCurrentEventEntry->usNextEventPtr;
711
else if ( f_usEventIndex == pSharedInfo->MixerInfo.usLastSinCopyEventPtr )
713
pSharedInfo->MixerInfo.usLastSinCopyEventPtr = usTempEventIndex;
715
/*=======================================================================*/
720
return cOCT6100_ERR_FATAL_B0;
724
/*=======================================================================*/
725
/* Modify the previous event. */
727
pTempEventEntry->usNextEventPtr = pCurrentEventEntry->usNextEventPtr;
729
WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( usTempEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE );
730
WriteParams.ulWriteAddress += 4;
731
WriteParams.usWriteData = pTempEventEntry->usNextEventPtr;
733
mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult );
734
if ( ulResult != cOCT6100_ERR_OK )
737
/*=======================================================================*/
740
/*=======================================================================*/
741
/* Clear the current event. */
743
BurstWriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( f_usEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE );
745
mOCT6100_DRIVER_WRITE_BURST_API( BurstWriteParams, ulResult );
746
if ( ulResult != cOCT6100_ERR_OK )
749
/*=======================================================================*/
752
/*=======================================================================*/
753
/* Decrement the mixer event count active on that channel. */
754
pDestinationEntry->usMixerEventCnt--;
756
/*=======================================================================*/
759
/*=======================================================================*/
761
/* This index of this channel is not valid anymore! */
762
pCurrentEventEntry->usDestinationChanIndex = cOCT6100_INVALID_INDEX;
764
/* Mark this entry as free. */
765
pCurrentEventEntry->fReserved = FALSE;
767
return cOCT6100_ERR_OK;
772
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
774
Function: Oct6100MixerCopyEventCreateSer
776
-------------------------------------------------------------------------------
777
| Argument | Description
778
-------------------------------------------------------------------------------
779
f_pApiInstance Pointer to API instance. This memory is used to keep the
780
present state of the chip and all its resources.
782
f_pCopyEventCreate Pointer to a create copy event structure.
784
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
785
#if !SKIP_Oct6100MixerCopyEventCreateSer
786
UINT32 Oct6100MixerCopyEventCreateSer(
787
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
788
IN OUT tPOCT6100_COPY_EVENT_CREATE f_pCopyEventCreate )
790
UINT16 usCopyEventIndex = 0;
791
UINT16 usMixerEventIndex = 0;
792
UINT16 usSourceChanIndex;
793
UINT16 usDestinationChanIndex;
796
/* Check the user's configuration of the copy event for errors. */
797
ulResult = Oct6100ApiCheckCopyEventCreateParams( f_pApiInstance,
800
&usDestinationChanIndex );
801
if ( ulResult != cOCT6100_ERR_OK )
804
/* Reserve all resources needed by the copy event. */
805
ulResult = Oct6100ApiReserveCopyEventCreateResources( f_pApiInstance,
807
&usMixerEventIndex );
808
if ( ulResult != cOCT6100_ERR_OK )
811
/* Write all necessary structures to activate the echo cancellation channel. */
812
ulResult = Oct6100ApiWriteCopyEventCreateStructs( f_pApiInstance,
816
usDestinationChanIndex );
817
if ( ulResult != cOCT6100_ERR_OK )
820
/* Update the new echo cancellation channels's entry in the ECHO channel list. */
821
ulResult = Oct6100ApiUpdateCopyEventCreateEntry( f_pApiInstance,
826
usDestinationChanIndex );
827
if ( ulResult != cOCT6100_ERR_OK )
830
return cOCT6100_ERR_OK;
835
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
837
Function: Oct6100ApiCheckCopyEventCreateParams
839
Description: Checks the user's parameter passed to the create
842
-------------------------------------------------------------------------------
843
| Argument | Description
844
-------------------------------------------------------------------------------
845
f_pApiInstance Pointer to API instance. This memory is used to keep the
846
present state of the chip and all its resources.
848
f_pCopyEventCreate Pointer to a create copy event structure.
849
f_pusSourceChanIndex Pointer to the index of the input channel.
850
f_pusDestinationChanIndex Pointer to the index of the output channel.
852
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
853
#if !SKIP_Oct6100ApiCheckCopyEventCreateParams
854
UINT32 Oct6100ApiCheckCopyEventCreateParams(
855
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
856
IN OUT tPOCT6100_COPY_EVENT_CREATE f_pCopyEventCreate,
857
OUT PUINT16 f_pusSourceChanIndex,
858
OUT PUINT16 f_pusDestinationChanIndex )
860
tPOCT6100_SHARED_INFO pSharedInfo;
861
tPOCT6100_API_CHANNEL pSourceEntry;
862
tPOCT6100_API_CHANNEL pDestinationEntry;
863
UINT32 ulEntryOpenCnt;
865
/* Obtain shared resources pointer. */
866
pSharedInfo = f_pApiInstance->pSharedInfo;
868
if ( f_pCopyEventCreate->pulCopyEventHndl == NULL )
869
return cOCT6100_ERR_MIXER_COPY_EVENT_HANDLE;
871
if ( f_pCopyEventCreate->ulSourceChanHndl == cOCT6100_INVALID_HANDLE )
872
return cOCT6100_ERR_MIXER_SOURCE_CHAN_HANDLE;
873
if ( f_pCopyEventCreate->ulDestinationChanHndl == cOCT6100_INVALID_HANDLE )
874
return cOCT6100_ERR_MIXER_DESTINATION_CHAN_HANDLE;
876
if ( f_pCopyEventCreate->ulSourcePort != cOCT6100_CHANNEL_PORT_RIN &&
877
f_pCopyEventCreate->ulSourcePort != cOCT6100_CHANNEL_PORT_SIN )
878
return cOCT6100_ERR_MIXER_SOURCE_PORT;
880
if ( f_pCopyEventCreate->ulDestinationPort != cOCT6100_CHANNEL_PORT_RIN &&
881
f_pCopyEventCreate->ulDestinationPort != cOCT6100_CHANNEL_PORT_SIN )
882
return cOCT6100_ERR_MIXER_DESTINATION_PORT;
884
/*=======================================================================*/
885
/* Verify the first channel handle. */
887
if ( (f_pCopyEventCreate->ulSourceChanHndl & cOCT6100_HNDL_TAG_MASK) != cOCT6100_HNDL_TAG_CHANNEL )
888
return cOCT6100_ERR_MIXER_SOURCE_CHAN_HANDLE;
890
*f_pusSourceChanIndex = (UINT16)( f_pCopyEventCreate->ulSourceChanHndl & cOCT6100_HNDL_INDEX_MASK );
891
if ( *f_pusSourceChanIndex >= pSharedInfo->ChipConfig.usMaxChannels )
892
return cOCT6100_ERR_MIXER_SOURCE_CHAN_HANDLE;
894
/* Get a pointer to the channel's list entry. */
895
mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pSourceEntry, *f_pusSourceChanIndex )
897
/* Extract the entry open count from the provided handle. */
898
ulEntryOpenCnt = ( f_pCopyEventCreate->ulSourceChanHndl >> cOCT6100_ENTRY_OPEN_CNT_SHIFT) & cOCT6100_ENTRY_OPEN_CNT_MASK;
900
/* Check for errors. */
901
if ( pSourceEntry->fReserved != TRUE )
902
return cOCT6100_ERR_CHANNEL_NOT_OPEN;
903
if ( ulEntryOpenCnt != pSourceEntry->byEntryOpenCnt )
904
return cOCT6100_ERR_MIXER_SOURCE_CHAN_HANDLE;
905
if ( pSourceEntry->CodecConfig.byDecoderPort == f_pCopyEventCreate->ulSourcePort )
906
return cOCT6100_ERR_MIXER_SOURCE_ADPCM_RESOURCES_ACTIVATED;
908
/*=======================================================================*/
910
/*=======================================================================*/
911
/* Verify the second channel handle. */
913
if ( (f_pCopyEventCreate->ulDestinationChanHndl & cOCT6100_HNDL_TAG_MASK) != cOCT6100_HNDL_TAG_CHANNEL )
914
return cOCT6100_ERR_MIXER_DESTINATION_CHAN_HANDLE;
916
*f_pusDestinationChanIndex = (UINT16)( f_pCopyEventCreate->ulDestinationChanHndl & cOCT6100_HNDL_INDEX_MASK );
917
if ( *f_pusDestinationChanIndex >= pSharedInfo->ChipConfig.usMaxChannels )
918
return cOCT6100_ERR_MIXER_DESTINATION_CHAN_HANDLE;
920
/* Get a pointer to the channel's list entry. */
921
mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pDestinationEntry, *f_pusDestinationChanIndex )
923
/* Extract the entry open count from the provided handle. */
924
ulEntryOpenCnt = ( f_pCopyEventCreate->ulDestinationChanHndl >> cOCT6100_ENTRY_OPEN_CNT_SHIFT) & cOCT6100_ENTRY_OPEN_CNT_MASK;
926
/* Check for errors. */
927
if ( pDestinationEntry->fReserved != TRUE )
928
return cOCT6100_ERR_CHANNEL_NOT_OPEN;
929
if ( ulEntryOpenCnt != pDestinationEntry->byEntryOpenCnt )
930
return cOCT6100_ERR_MIXER_DESTINATION_CHAN_HANDLE;
931
if ( pDestinationEntry->CodecConfig.byDecoderPort == f_pCopyEventCreate->ulDestinationPort )
932
return cOCT6100_ERR_MIXER_DEST_ADPCM_RESOURCES_ACTIVATED;
934
/*=======================================================================*/
936
return cOCT6100_ERR_OK;
941
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
943
Function: Oct6100ApiReserveCopyEventCreateResources
945
-------------------------------------------------------------------------------
946
| Argument | Description
947
-------------------------------------------------------------------------------
948
f_pApiInstance Pointer to API instance. This memory is used to keep the
949
present state of the chip and all its resources.
951
f_pusCopyEntryIndex Pointer to the index of the copy entry within the API's list.
952
f_pusCopyEventIndex Pointer to the index of the mixer copy event.
954
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
955
#if !SKIP_Oct6100ApiReserveCopyEventCreateResources
956
UINT32 Oct6100ApiReserveCopyEventCreateResources(
957
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
958
OUT PUINT16 f_pusCopyEntryIndex,
959
IN OUT PUINT16 f_pusCopyEventIndex )
961
tPOCT6100_SHARED_INFO pSharedInfo;
962
UINT32 ulResult = cOCT6100_ERR_OK;
965
/* Obtain local pointer to shared portion of instance. */
966
pSharedInfo = f_pApiInstance->pSharedInfo;
968
/*===============================================================================*/
969
/* Verify and reserve the resources that might already be allocated. */
971
ulResult = Oct6100ApiReserveCopyEventEntry( f_pApiInstance,
972
f_pusCopyEntryIndex );
973
if ( ulResult == cOCT6100_ERR_OK )
975
/* Reserve the source copy event for the first channel. */
976
ulResult = Oct6100ApiReserveMixerEventEntry( f_pApiInstance,
977
f_pusCopyEventIndex );
978
if ( ulResult != cOCT6100_ERR_OK )
980
/* Reserve the Sin copy event for the first channel. */
981
ulTempVar = Oct6100ApiReleaseCopyEventEntry ( f_pApiInstance,
982
*f_pusCopyEntryIndex );
983
if ( ulTempVar != cOCT6100_ERR_OK )
988
return cOCT6100_ERR_OK;
993
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
995
Function: Oct6100ApiWriteCopyEventCreateStructs
997
Description: Performs all the required structure writes to configure the
1000
-------------------------------------------------------------------------------
1001
| Argument | Description
1002
-------------------------------------------------------------------------------
1003
f_pApiInstance Pointer to API instance. This memory is used to keep the
1004
present state of the chip and all its resources.
1006
f_pCopyEventCreate Pointer to a create copy event structure.
1007
f_usMixerEventIndex Index of the copy event within the mixer memory.
1008
f_usSourceChanIndex Index of the source channel within the API's channel list.
1009
f_usDestinationChanIndex Index of the destination channel within the API's channel list.
1011
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1012
#if !SKIP_Oct6100ApiWriteCopyEventCreateStructs
1013
UINT32 Oct6100ApiWriteCopyEventCreateStructs(
1014
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1015
IN OUT tPOCT6100_COPY_EVENT_CREATE f_pCopyEventCreate,
1016
IN UINT16 f_usMixerEventIndex,
1017
IN UINT16 f_usSourceChanIndex,
1018
IN UINT16 f_usDestinationChanIndex )
1020
tPOCT6100_SHARED_INFO pSharedInfo;
1021
tPOCT6100_API_CHANNEL pSourceEntry;
1022
tPOCT6100_API_CHANNEL pDestinationEntry;
1023
tOCT6100_WRITE_PARAMS WriteParams;
1026
/* Obtain local pointer to shared portion of instance. */
1027
pSharedInfo = f_pApiInstance->pSharedInfo;
1029
WriteParams.pProcessContext = f_pApiInstance->pProcessContext;
1031
WriteParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId;
1033
/*==============================================================================*/
1034
/* Get a pointer to the two channel entry. */
1036
mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pSourceEntry, f_usSourceChanIndex );
1037
mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pDestinationEntry, f_usDestinationChanIndex );
1039
/*==============================================================================*/
1040
/* Configure the TSST control memory and add the Sin copy event if necessary. */
1042
WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( f_usMixerEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE );
1044
WriteParams.usWriteData = cOCT6100_MIXER_CONTROL_MEM_COPY;
1046
if ( f_pCopyEventCreate->ulSourcePort == cOCT6100_CHANNEL_PORT_RIN )
1048
WriteParams.usWriteData |= pSourceEntry->usRinRoutTsiMemIndex;
1049
WriteParams.usWriteData |= pSourceEntry->TdmConfig.byRinPcmLaw << cOCT6100_MIXER_CONTROL_MEM_LAW_OFFSET;
1051
else /* f_pCopyEventCreate->ulSourcePort == cOCT6100_CHANNEL_PORT_SIN */
1053
if ( pSourceEntry->usExtraSinTsiMemIndex != cOCT6100_INVALID_INDEX )
1055
WriteParams.usWriteData |= pSourceEntry->usExtraSinTsiMemIndex;
1059
WriteParams.usWriteData |= pSourceEntry->usSinSoutTsiMemIndex;
1062
WriteParams.usWriteData |= pSourceEntry->TdmConfig.bySinPcmLaw << cOCT6100_MIXER_CONTROL_MEM_LAW_OFFSET;
1065
mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult );
1066
if ( ulResult != cOCT6100_ERR_OK )
1069
WriteParams.ulWriteAddress += 2;
1071
if ( f_pCopyEventCreate->ulDestinationPort == cOCT6100_CHANNEL_PORT_RIN )
1073
WriteParams.usWriteData = (UINT16)( pDestinationEntry->usRinRoutTsiMemIndex );
1075
else /* f_pCopyEventCreate->ulDestinationPort == cOCT6100_CHANNEL_PORT_SIN */
1077
WriteParams.usWriteData = (UINT16)( pDestinationEntry->usSinSoutTsiMemIndex );
1080
mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult );
1081
if ( ulResult != cOCT6100_ERR_OK )
1084
/*=======================================================================*/
1086
/* Now insert the event into the event list. */
1087
ulResult = Oct6100ApiMixerEventAdd( f_pApiInstance,
1088
f_usMixerEventIndex,
1089
cOCT6100_EVENT_TYPE_SIN_COPY,
1090
f_usDestinationChanIndex );
1091
if ( ulResult != cOCT6100_ERR_OK )
1094
/* Increment the copy event count on this channel. */
1095
pDestinationEntry->usCopyEventCnt++;
1097
/*==============================================================================*/
1099
return cOCT6100_ERR_OK;
1104
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1106
Function: Oct6100ApiUpdateCopyEventCreateEntry
1108
-------------------------------------------------------------------------------
1109
| Argument | Description
1110
-------------------------------------------------------------------------------
1111
f_pApiInstance Pointer to API instance. This memory is used to keep
1112
the present state of the chip and all its resources.
1113
f_pCopyEventCreate Pointer to a create copy event structure.
1114
f_usCopyEventIndex Index of the copy event within the API's event list.
1115
f_usMixerEventIndex Index of the copy event within the mixer memory.
1116
f_usSourceChanIndex Index of the source channel within the API's channel list.
1117
f_usDestinationChanIndex Index of the destination channel within the API's channel list.
1119
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1120
#if !SKIP_Oct6100ApiUpdateCopyEventCreateEntry
1121
UINT32 Oct6100ApiUpdateCopyEventCreateEntry(
1122
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1123
IN OUT tPOCT6100_COPY_EVENT_CREATE f_pCopyEventCreate,
1124
IN UINT16 f_usCopyEventIndex,
1125
IN UINT16 f_usMixerEventIndex,
1126
IN UINT16 f_usSourceChanIndex,
1127
IN UINT16 f_usDestinationChanIndex )
1129
tPOCT6100_SHARED_INFO pSharedInfo;
1130
tPOCT6100_API_COPY_EVENT pCopyEventEntry;
1132
/* Obtain local pointer to shared portion of instance. */
1133
pSharedInfo = f_pApiInstance->pSharedInfo;
1135
/* Obtain a pointer to the new buffer's list entry. */
1136
mOCT6100_GET_COPY_EVENT_ENTRY_PNT( pSharedInfo, pCopyEventEntry, f_usCopyEventIndex );
1138
/*=======================================================================*/
1139
/* Copy the channel's configuration and allocated resources. */
1141
/* Save the channel info in the copy event. */
1142
pCopyEventEntry->usSourceChanIndex = f_usSourceChanIndex;
1143
pCopyEventEntry->bySourcePort = (UINT8)( f_pCopyEventCreate->ulSourcePort & 0xFF );
1145
pCopyEventEntry->usDestinationChanIndex = f_usDestinationChanIndex;
1146
pCopyEventEntry->byDestinationPort = (UINT8)( f_pCopyEventCreate->ulDestinationPort & 0xFF );
1148
pCopyEventEntry->usMixerEventIndex = f_usMixerEventIndex;
1150
/*=======================================================================*/
1152
/* Form handle returned to user. */
1153
*f_pCopyEventCreate->pulCopyEventHndl = cOCT6100_HNDL_TAG_COPY_EVENT | (pCopyEventEntry->byEntryOpenCnt << cOCT6100_ENTRY_OPEN_CNT_SHIFT) | f_usCopyEventIndex;
1155
/* Finally, mark the event as used. */
1156
pCopyEventEntry->fReserved = TRUE;
1158
return cOCT6100_ERR_OK;
1163
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1165
Function: Oct6100MixerCopyEventDestroySer
1167
-------------------------------------------------------------------------------
1168
| Argument | Description
1169
-------------------------------------------------------------------------------
1170
f_pApiInstance Pointer to API instance. This memory is used to keep the
1171
present state of the chip and all its resources.
1173
f_pCopyEventDestroy Pointer to a destroy copy event structure.
1175
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1176
#if !SKIP_Oct6100MixerCopyEventDestroySer
1177
UINT32 Oct6100MixerCopyEventDestroySer(
1178
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1179
IN tPOCT6100_COPY_EVENT_DESTROY f_pCopyEventDestroy )
1181
UINT16 usCopyEventIndex;
1182
UINT16 usMixerEventIndex;
1185
/* Verify that all the parameters given match the state of the API. */
1186
ulResult = Oct6100ApiAssertCopyEventDestroyParams( f_pApiInstance,
1187
f_pCopyEventDestroy,
1189
&usMixerEventIndex );
1190
if ( ulResult != cOCT6100_ERR_OK )
1193
/* Release all resources associated to the echo cancellation channel. */
1194
ulResult = Oct6100ApiInvalidateCopyEventStructs( f_pApiInstance,
1196
usMixerEventIndex );
1197
if ( ulResult != cOCT6100_ERR_OK )
1200
/* Release all resources associated to the echo cancellation channel. */
1201
ulResult = Oct6100ApiReleaseCopyEventResources( f_pApiInstance,
1203
usMixerEventIndex );
1204
if ( ulResult != cOCT6100_ERR_OK )
1207
/* Invalidate the handle. */
1208
f_pCopyEventDestroy->ulCopyEventHndl = cOCT6100_INVALID_HANDLE;
1210
return cOCT6100_ERR_OK;
1215
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1217
Function: Oct6100ApiAssertCopyEventDestroyParams
1221
-------------------------------------------------------------------------------
1222
| Argument | Description
1223
-------------------------------------------------------------------------------
1224
f_pApiInstance Pointer to API instance. This memory is used to keep the
1225
present state of the chip and all its resources.
1227
f_pCopyEventDestroy Pointer to a destroy copy event structure.
1228
f_pusCopyEventIndex Pointer to the index of the copy event in the API.
1229
f_pusMixerEventIndex Pointer to the index of the copy event in the mixer memory.
1231
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1232
#if !SKIP_Oct6100ApiAssertCopyEventDestroyParams
1233
UINT32 Oct6100ApiAssertCopyEventDestroyParams(
1234
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1235
IN tPOCT6100_COPY_EVENT_DESTROY f_pCopyEventDestroy,
1236
IN OUT PUINT16 f_pusCopyEventIndex,
1237
IN OUT PUINT16 f_pusMixerEventIndex )
1239
tPOCT6100_SHARED_INFO pSharedInfo;
1240
tPOCT6100_API_COPY_EVENT pCopyEventEntry;
1241
UINT32 ulEntryOpenCnt;
1243
/* Get local pointer(s). */
1244
pSharedInfo = f_pApiInstance->pSharedInfo;
1246
/* Check the provided handle. */
1247
if ( (f_pCopyEventDestroy->ulCopyEventHndl & cOCT6100_HNDL_TAG_MASK) != cOCT6100_HNDL_TAG_COPY_EVENT )
1248
return cOCT6100_ERR_MIXER_COPY_EVENT_HANDLE;
1250
*f_pusCopyEventIndex = (UINT16)( f_pCopyEventDestroy->ulCopyEventHndl & cOCT6100_HNDL_INDEX_MASK );
1251
if ( *f_pusCopyEventIndex >= cOCT6100_MAX_MIXER_EVENTS )
1252
return cOCT6100_ERR_MIXER_COPY_EVENT_HANDLE;
1254
/*=======================================================================*/
1256
mOCT6100_GET_COPY_EVENT_ENTRY_PNT( pSharedInfo, pCopyEventEntry, *f_pusCopyEventIndex )
1258
/* Extract the entry open count from the provided handle. */
1259
ulEntryOpenCnt = ( f_pCopyEventDestroy->ulCopyEventHndl >> cOCT6100_ENTRY_OPEN_CNT_SHIFT) & cOCT6100_ENTRY_OPEN_CNT_MASK;
1261
/* Check for errors. */
1262
if ( pCopyEventEntry->fReserved != TRUE )
1263
return cOCT6100_ERR_MIXER_EVENT_NOT_OPEN;
1264
if ( ulEntryOpenCnt != pCopyEventEntry->byEntryOpenCnt )
1265
return cOCT6100_ERR_MIXER_COPY_EVENT_HANDLE;
1267
/*=======================================================================*/
1269
/* Return the index of the associated event. */
1270
*f_pusMixerEventIndex = pCopyEventEntry->usMixerEventIndex;
1272
return cOCT6100_ERR_OK;
1277
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1279
Function: Oct6100ApiInvalidateCopyEventStructs
1281
Description: Destroy the link between the two channels.
1283
-------------------------------------------------------------------------------
1284
| Argument | Description
1285
-------------------------------------------------------------------------------
1286
f_pApiInstance Pointer to API instance. This memory is used to keep the
1287
present state of the chip and all its resources.
1289
f_usCopyEventIndex Index of the copy event in the API.
1290
f_usMixerEventIndex Index of the copy event in the mixer memory.
1292
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1293
#if !SKIP_Oct6100ApiInvalidateCopyEventStructs
1294
UINT32 Oct6100ApiInvalidateCopyEventStructs(
1295
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1296
IN UINT16 f_usCopyEventIndex,
1297
IN UINT16 f_usMixerEventIndex )
1299
tPOCT6100_SHARED_INFO pSharedInfo;
1300
tOCT6100_WRITE_PARAMS WriteParams;
1303
/* Obtain local pointer to shared portion of instance. */
1304
pSharedInfo = f_pApiInstance->pSharedInfo;
1306
WriteParams.pProcessContext = f_pApiInstance->pProcessContext;
1308
WriteParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId;
1310
/*=======================================================================*/
1311
/* Clear the Copy event. */
1312
WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( f_usMixerEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE );
1313
WriteParams.usWriteData = cOCT6100_MIXER_CONTROL_MEM_NO_OP;
1315
mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult );
1316
if ( ulResult != cOCT6100_ERR_OK )
1319
/*=======================================================================*/
1321
/* Remove the event from the list. */
1322
ulResult = Oct6100ApiMixerEventRemove( f_pApiInstance,
1323
f_usMixerEventIndex,
1324
cOCT6100_EVENT_TYPE_SIN_COPY );
1325
if ( ulResult != cOCT6100_ERR_OK )
1328
return cOCT6100_ERR_OK;
1333
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1335
Function: Oct6100ApiReleaseCopyEventResources
1337
-------------------------------------------------------------------------------
1338
| Argument | Description
1339
-------------------------------------------------------------------------------
1340
f_pApiInstance Pointer to API instance. This memory is used to keep the
1341
present state of the chip and all its resources.
1343
f_usCopyEventIndex Index of the copy event in the API.
1344
f_usMixerEventIndex Index of the copy event in the mixer memory.
1346
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1347
#if !SKIP_Oct6100ApiReleaseCopyEventResources
1348
UINT32 Oct6100ApiReleaseCopyEventResources(
1349
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1350
IN UINT16 f_usCopyEventIndex,
1351
IN UINT16 f_usMixerEventIndex )
1353
tPOCT6100_SHARED_INFO pSharedInfo;
1354
tPOCT6100_API_CHANNEL pDestinationEntry;
1355
tPOCT6100_API_COPY_EVENT pCopyEventEntry;
1356
tPOCT6100_API_MIXER_EVENT pTempEventEntry;
1359
/* Obtain local pointer to shared portion of instance. */
1360
pSharedInfo = f_pApiInstance->pSharedInfo;
1362
mOCT6100_GET_COPY_EVENT_ENTRY_PNT( pSharedInfo, pCopyEventEntry, f_usCopyEventIndex );
1364
ulResult = Oct6100ApiReleaseCopyEventEntry( f_pApiInstance, f_usCopyEventIndex );
1365
if ( ulResult != cOCT6100_ERR_OK )
1366
return cOCT6100_ERR_FATAL_AC;
1368
/* Relese the SIN copy event. */
1369
ulResult = Oct6100ApiReleaseMixerEventEntry( f_pApiInstance, f_usMixerEventIndex );
1370
if ( ulResult != cOCT6100_ERR_OK )
1371
return cOCT6100_ERR_FATAL_B3;
1373
mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pTempEventEntry, f_usMixerEventIndex );
1375
/* Invalidate the entry. */
1376
pTempEventEntry->fReserved = FALSE;
1377
pTempEventEntry->usEventType = cOCT6100_INVALID_INDEX;
1378
pTempEventEntry->usNextEventPtr = cOCT6100_INVALID_INDEX;
1380
mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pDestinationEntry, pCopyEventEntry->usDestinationChanIndex );
1382
/* Decrement the copy event count on this channel. */
1383
pDestinationEntry->usCopyEventCnt--;
1385
/*=======================================================================*/
1387
/* Mark the event entry as unused. */
1388
pCopyEventEntry->fReserved = FALSE;
1389
pCopyEventEntry->byEntryOpenCnt++;
1391
/*=======================================================================*/
1393
return cOCT6100_ERR_OK;
1398
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1400
Function: Oct6100ApiReserveMixerEventEntry
1402
Description: Reserves a free entry in the mixer event list.
1404
-------------------------------------------------------------------------------
1405
| Argument | Description
1406
-------------------------------------------------------------------------------
1407
f_pApiInstance Pointer to API instance. This memory is used to keep the
1408
present state of the chip and all its resources.
1410
f_pusEventIndex List entry reserved.
1412
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1413
#if !SKIP_Oct6100ApiReserveMixerEventEntry
1414
UINT32 Oct6100ApiReserveMixerEventEntry(
1415
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1416
OUT PUINT16 f_pusEventIndex )
1418
PVOID pMixerEventAlloc;
1420
UINT32 ulEventIndex;
1422
mOCT6100_GET_MIXER_EVENT_ALLOC_PNT( f_pApiInstance->pSharedInfo, pMixerEventAlloc )
1424
ulResult = OctapiLlmAllocAlloc( pMixerEventAlloc, &ulEventIndex );
1425
if ( ulResult != cOCT6100_ERR_OK )
1427
if ( ulResult == OCTAPI_LLM_NO_STRUCTURES_LEFT )
1428
return cOCT6100_ERR_MIXER_ALL_MIXER_EVENT_ENTRY_OPENED;
1430
return cOCT6100_ERR_FATAL_2B;
1433
*f_pusEventIndex = (UINT16)( ulEventIndex & 0xFFFF );
1435
return cOCT6100_ERR_OK;
1440
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1442
Function: Oct6100ApiReleaseMixerEventEntry
1444
Description: Release an entry from the mixer event list.
1446
-------------------------------------------------------------------------------
1447
| Argument | Description
1448
-------------------------------------------------------------------------------
1449
f_pApiInstance Pointer to API instance. This memory is used to keep the
1450
present state of the chip and all its resources.
1452
f_usEventIndex List entry reserved.
1454
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1455
#if !SKIP_Oct6100ApiReleaseMixerEventEntry
1456
UINT32 Oct6100ApiReleaseMixerEventEntry(
1457
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1458
IN UINT16 f_usEventIndex )
1460
PVOID pMixerEventAlloc;
1463
mOCT6100_GET_MIXER_EVENT_ALLOC_PNT( f_pApiInstance->pSharedInfo, pMixerEventAlloc )
1465
ulResult = OctapiLlmAllocDealloc( pMixerEventAlloc, f_usEventIndex );
1466
if ( ulResult != cOCT6100_ERR_OK )
1467
return cOCT6100_ERR_FATAL_2C;
1469
return cOCT6100_ERR_OK;
1474
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1476
Function: Oct6100ApiGetFreeMixerEventCnt
1478
Description: Retrieve the number of events left in the list.
1480
-------------------------------------------------------------------------------
1481
| Argument | Description
1482
-------------------------------------------------------------------------------
1483
f_pApiInstance Pointer to API instance. This memory is used to keep the
1484
present state of the chip and all its resources.
1486
f_pulFreeEventCnt How many events left.
1488
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1489
#if !SKIP_Oct6100ApiGetFreeMixerEventCnt
1490
UINT32 Oct6100ApiGetFreeMixerEventCnt(
1491
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1492
OUT PUINT32 f_pulFreeEventCnt )
1494
PVOID pMixerEventAlloc;
1496
UINT32 ulAllocatedEvents;
1497
UINT32 ulAvailableEvents;
1499
mOCT6100_GET_MIXER_EVENT_ALLOC_PNT( f_pApiInstance->pSharedInfo, pMixerEventAlloc )
1501
ulResult = OctapiLlmAllocInfo( pMixerEventAlloc, &ulAllocatedEvents, &ulAvailableEvents );
1502
if ( ulResult != cOCT6100_ERR_OK )
1503
return cOCT6100_ERR_FATAL_E8;
1505
/* Return number of free events. */
1506
*f_pulFreeEventCnt = ulAvailableEvents;
1508
return cOCT6100_ERR_OK;
1513
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1515
Function: Oct6100ApiReserveCopyEventEntry
1517
Description: Reserves a free entry in the copy event list.
1519
-------------------------------------------------------------------------------
1520
| Argument | Description
1521
-------------------------------------------------------------------------------
1522
f_pApiInstance Pointer to API instance. This memory is used to keep the
1523
present state of the chip and all its resources.
1525
f_pusEventIndex List entry reserved.
1527
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1528
#if !SKIP_Oct6100ApiReserveCopyEventEntry
1529
UINT32 Oct6100ApiReserveCopyEventEntry(
1530
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1531
OUT PUINT16 f_pusEventIndex )
1533
PVOID pCopyEventAlloc;
1535
UINT32 ulEventIndex;
1537
mOCT6100_GET_COPY_EVENT_ALLOC_PNT( f_pApiInstance->pSharedInfo, pCopyEventAlloc )
1539
ulResult = OctapiLlmAllocAlloc( pCopyEventAlloc, &ulEventIndex );
1540
if ( ulResult != cOCT6100_ERR_OK )
1542
if ( ulResult == OCTAPI_LLM_NO_STRUCTURES_LEFT )
1543
return cOCT6100_ERR_MIXER_ALL_COPY_EVENT_ENTRY_OPENED;
1545
return cOCT6100_ERR_FATAL_AD;
1548
*f_pusEventIndex = (UINT16)( ulEventIndex & 0xFFFF );
1550
return cOCT6100_ERR_OK;
1555
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
1557
Function: Oct6100ApiReleaseCopyEventEntry
1559
Description: Release an entry from the copy event list.
1561
-------------------------------------------------------------------------------
1562
| Argument | Description
1563
-------------------------------------------------------------------------------
1564
f_pApiInstance Pointer to API instance. This memory is used to keep the
1565
present state of the chip and all its resources.
1567
f_usEventIndex List entry reserved.
1569
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
1570
#if !SKIP_Oct6100ApiReleaseCopyEventEntry
1571
UINT32 Oct6100ApiReleaseCopyEventEntry(
1572
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
1573
IN UINT16 f_usEventIndex )
1575
PVOID pCopyEventAlloc;
1578
mOCT6100_GET_COPY_EVENT_ALLOC_PNT( f_pApiInstance->pSharedInfo, pCopyEventAlloc )
1580
ulResult = OctapiLlmAllocDealloc( pCopyEventAlloc, f_usEventIndex );
1581
if ( ulResult != cOCT6100_ERR_OK )
1582
return cOCT6100_ERR_FATAL_AE;
1584
return cOCT6100_ERR_OK;