From 97546c36fdd39f75b229dfe85db89ac70eeb6bab Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Tue, 2 Oct 2007 19:07:04 +0000 Subject: merge up to PR49 git-svn-id: http://svn.asterisk.org/svn/octasic_api/oct612x/trunk@33 537310ab-6354-42db-a3cc-247b777f7be6 --- .../oct6100api/oct6100_api/oct6100_debug.c | 43 ++++++++++++++-------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c') diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c index ac25f81..1f4de01 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c @@ -22,9 +22,9 @@ 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.00-PR48 $ +$Octasic_Release: OCT612xAPI-01.00-PR49 $ -$Octasic_Revision: 64 $ +$Octasic_Revision: 65 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -257,7 +257,7 @@ UINT32 Oct6100DebugSelectChannelSer( mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pTempChanEntry, pSharedInfo->DebugInfo.usCurrentDebugChanIndex ) /* Release the extra TSI memory entry and reprogram the TSST control memory if required. */ - if ( pTempChanEntry->usExtraSinTsiDependencyCnt == 1 ) + if ( pTempChanEntry->usExtraSinTsiDependencyCnt >= 1 ) { /*=======================================================================*/ /* Clear memcpy operations. */ @@ -280,23 +280,30 @@ UINT32 Oct6100DebugSelectChannelSer( /*=======================================================================*/ - ulResult = Oct6100ApiReleaseTsiMemEntry( f_pApiInstance, pTempChanEntry->usExtraSinTsiMemIndex ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; - - if ( pTempChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX ) + /* If we are the last dependency using the extra Sin TSI, release it */ + if ( pTempChanEntry->usExtraSinTsiDependencyCnt == 1 ) { - ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance, - pTempChanEntry->usSinTsstIndex, - pTempChanEntry->usSinSoutTsiMemIndex, - pTempChanEntry->TdmConfig.bySinPcmLaw ); - } + ulResult = Oct6100ApiReleaseTsiMemEntry( f_pApiInstance, pTempChanEntry->usExtraSinTsiMemIndex ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; + /* Do not forget to reprogram the TSST control memory. */ + if ( pTempChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX ) + { + ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance, + pTempChanEntry->usSinTsstIndex, + pTempChanEntry->usSinSoutTsiMemIndex, + pTempChanEntry->TdmConfig.bySinPcmLaw ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } + pTempChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX; + + /* XXX: What about the silence TSI usSinSilenceEventIndex ?? */ + } pTempChanEntry->usExtraSinTsiDependencyCnt--; - pTempChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX; + } } @@ -337,12 +344,14 @@ UINT32 Oct6100DebugSelectChannelSer( /* Check if the API needs to reserve an extra TSI memory to load the SIN signal. */ if ( pSharedInfo->ChipConfig.fEnableChannelRecording == TRUE ) { + /* Reserve the extra Sin TSI memory if it was not already reserved. */ if ( pChanEntry->usExtraSinTsiMemIndex == cOCT6100_INVALID_INDEX ) { ulResult = Oct6100ApiReserveTsiMemEntry( f_pApiInstance, &pChanEntry->usExtraSinTsiMemIndex ); if ( ulResult != cOCT6100_ERR_OK ) return ulResult; + /* Reprogram the TSST control memory accordingly. */ if ( pChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX ) { ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance, @@ -352,6 +361,8 @@ UINT32 Oct6100DebugSelectChannelSer( if ( ulResult != cOCT6100_ERR_OK ) return ulResult; } + + /* XXX: What about the silence TSI usSinSilenceEventIndex ?? */ } -- cgit v1.2.3