From ac89cd86e5cd7d7eb95c832abefe5e6299fd0061 Mon Sep 17 00:00:00 2001 From: Octasic Inc Date: Fri, 28 Sep 2007 13:40:54 +0200 Subject: importing OCT612x-01.00-PR49 --- .../oct6100api/oct6100_api/oct6100_interrupts.c | 48 ++++++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c') diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c index 6503402..60d7616 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c @@ -23,9 +23,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: 78 $ +$Octasic_Revision: 81 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -1797,15 +1797,18 @@ UINT32 Oct6100ApiCheckProcessorState( tPOCT6100_SHARED_INFO pSharedInfo; tOCT6100_READ_PARAMS ReadParams; tOCT6100_READ_BURST_PARAMS ReadBurstParams; + UINT32 ulNlpTimestamp; UINT32 ulAfTimestamp; UINT32 ulTimestampDiff; UINT32 ulResult; UINT32 i; - + UINT16 usReadData; UINT16 ausReadData[ 2 ]; + + UINT32 aulWaitTime[ 2 ]; /* Get local pointer(s). */ pSharedInfo = f_pApiInstance->pSharedInfo; @@ -1913,7 +1916,7 @@ UINT32 Oct6100ApiCheckProcessorState( /*-----------------------------------------------------------------------*/ /* Check the validity of the timestamp. */ - + if ( ulAfTimestamp > ulNlpTimestamp ) { /* The NLP timestamp wrapped. */ @@ -1930,6 +1933,43 @@ UINT32 Oct6100ApiCheckProcessorState( pSharedInfo->ErrorStats.fFatalChipError = TRUE; } + /*Check if AF and NLP are both stuck*/ + if ( f_pIntFlags->fErrorH100ClkA == FALSE && + f_pIntFlags->fErrorH100ClkB == FALSE && + f_pIntFlags->fErrorH100FrameA == FALSE && + f_pIntFlags->fErrorH100OutOfSync == FALSE ) + + { + if ( ulAfTimestamp == 0 && ulNlpTimestamp == 0 ) + { + /*Give some time to the counters*/ + aulWaitTime[ 0 ] = 250; + aulWaitTime[ 1 ] = 0; + ulResult = Oct6100ApiWaitForTime( f_pApiInstance, aulWaitTime ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + + /*Let's read again the AF timestamp to be sure. Maybe they were at 0 at the same time*/ + ReadBurstParams.ulReadAddress = 0x082E0008; + ReadBurstParams.ulReadLength = 2; + + mOCT6100_DRIVER_READ_BURST_API( ReadBurstParams, ulResult ) + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + + ulAfTimestamp = (ausReadData[ 0 ] << 16) | ausReadData[ 1 ]; + + if ( ulAfTimestamp == 0 ) + { + /*TDM Clocks are ok but NLP and AF timestamps are both at 0*/ + f_pIntFlags->ulFatalGeneralFlags |= cOCT6100_FATAL_GENERAL_ERROR_TYPE_9; + f_pIntFlags->fFatalGeneral = TRUE; + pSharedInfo->ErrorStats.fFatalChipError = TRUE; + } + } + + } + /*-----------------------------------------------------------------------*/ return cOCT6100_ERR_OK; -- cgit v1.2.3