changeset 144:a005102f0dd2

l1_sync.c: l1s_dedicated_mode_manager(): logic reconstructed, but the compiler's register allocation is different, resulting in different object code being generated. The logic has been verified by manual comparison.
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 15 May 2016 18:56:25 +0000
parents 136a30c40ba5
children 7fcdd7581123
files chipsetsw/layer1/cfile/l1_sync.c
diffstat 1 files changed, 109 insertions(+), 89 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/cfile/l1_sync.c	Sun May 15 07:31:52 2016 +0000
+++ b/chipsetsw/layer1/cfile/l1_sync.c	Sun May 15 18:56:25 2016 +0000
@@ -166,6 +166,8 @@
 #include "l1_pwmgr.h"
 #endif //NOT SIMULATION
 
+#define	W_A_DSP_PR20037	1	/* FreeCalypso */
+
 #if (GSM_IDLE_RAM != 0)
 #if (OP_L1_STANDALONE == 1)
 #include "csmi_simul.h"
@@ -7176,10 +7178,12 @@
       || (  l1a_l1s_com.dedic_set.SignalCode == MPHC_CHANGE_FREQUENCY)  )
   // A new channel is given in fset...
   {
-    // Reset DTX AMR status
-#if (AMR == 1)
-    l1s.dtx_amr_dl_on=FALSE;
-#endif
+    #if 0	/* FreeCalypso TCS211 reconstruction */
+      // Reset DTX AMR status
+      #if (AMR == 1)
+        l1s.dtx_amr_dl_on=FALSE;
+      #endif
+    #endif
     // When a Dedicated mode request is pending, L1S must be ran every frame
     // to be able to cope with STI.
     l1a_l1s_com.time_to_next_l1s_task = 0;
@@ -7417,14 +7421,14 @@
             // AMR NSYNC bit: set to 0 by load_amr_param, set to 1 if HO from AMR cell to AMR cell, reset by DSP
             if ( (current_channel_mode == TCH_AFS_MODE) || (current_channel_mode == TCH_AHS_MODE) )
             {
-#if (FF_L1_TCH_VOCODER_CONTROL == 1)
+            #if (FF_L1_TCH_VOCODER_CONTROL == 1)
               if(l1a_l1s_com.dedic_set.vocoder_on == TRUE)
               {
                 l1s_dsp_com.dsp_ndb_ptr->a_amr_config[NSYNC_INDEX] |= (1 << NSYNC_SHIFT);
               }
-#else
+            #else
               l1s_dsp_com.dsp_ndb_ptr->a_amr_config[NSYNC_INDEX] |= (1 << NSYNC_SHIFT);
-#endif
+            #endif
             }
           #endif
 
@@ -7600,67 +7604,25 @@
   // All channel must be aborted...
   {
     // Perform the functions below if there is active dedicated set.
-	// This check is to take care of race condition which can happen
-	// if MPHC_STOP_DEDICATED_REQ is receivedm before MPHC_HANDOVER_FAIL_REQ
-	if (l1a_l1s_com.dedic_set.aset!=NULL)
-	{
-
-    // Stop TCH/F and TCH/H (stop Omega) (used in SYNCHRO task).
-    UWORD8 channel_type = l1a_l1s_com.dedic_set.aset->chan1.desc.channel_type;
-    if((channel_type == TCH_F) || (channel_type == TCH_H))
+    // This check is to take care of race condition which can happen
+    // if MPHC_STOP_DEDICATED_REQ is receivedm before MPHC_HANDOVER_FAIL_REQ
+#if 0	/* FreeCalypso TCS211 reconstruction */
+    if (l1a_l1s_com.dedic_set.aset!=NULL)
     {
-      l1a_l1s_com.dedic_set.stop_tch = TRUE;
-
-      /* FreeCalypso change: same situation as earlier in this function */
-    #if 0
-      // If audio enabling was forced by L1S because of a HO failure, do not force it anymore.
-      // Restore it in the state required by the MMI if the feature is compiled.
-      if (l1a_l1s_com.audio_forced_by_l1s == TRUE)
-      {
-      #if (L1_EXTERNAL_AUDIO_VOICE_ONOFF == 1)
-        if (l1a_l1s_com.audio_onoff_task.parameters.onoff_value == FALSE)
+#endif
+
+      // Stop TCH/F and TCH/H (stop Omega) (used in SYNCHRO task).
+      UWORD8 channel_type = l1a_l1s_com.dedic_set.aset->chan1.desc.channel_type;
+      if((channel_type == TCH_F) || (channel_type == TCH_H))
+      {
+        l1a_l1s_com.dedic_set.stop_tch = TRUE;
+
+        /* FreeCalypso change: same situation as earlier in this function */
+      #if 0
+        // If audio enabling was forced by L1S because of a HO failure, do not force it anymore.
+        // Restore it in the state required by the MMI if the feature is compiled.
+        if (l1a_l1s_com.audio_forced_by_l1s == TRUE)
         {
-          l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
-        }
-      #else // L1_EXTERNAL_AUDIO_VOICE_ONOFF
-        l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
-      #endif // L1_EXTERNAL_AUDIO_VOICE_ONOFF
-        l1a_l1s_com.audio_forced_by_l1s = FALSE;
-      }
-    #endif
-
-   #if (AMR == 1)
-      // Reset DTX AMR status
-      l1s.dtx_amr_dl_on=FALSE;
-   #endif
-
-    }
-
-    // Clear ciphering setting in MCU-DSP com.
-    l1ddsp_load_ciph_param(0, &(l1a_l1s_com.dedic_set.aset->ciph_key));
-
-    // Reset the global dedicated enable flag.
-    l1a_l1s_com.l1s_en_task[DEDIC] = TASK_DISABLED;
-    l1a_l1s_com.l1s_en_task[DDL]   = TASK_DISABLED;
-    l1a_l1s_com.l1s_en_task[DUL]   = TASK_DISABLED;
-    l1a_l1s_com.l1s_en_task[ADL]   = TASK_DISABLED;
-    l1a_l1s_com.l1s_en_task[AUL]   = TASK_DISABLED;
-    l1a_l1s_com.l1s_en_task[TCHTH] = TASK_DISABLED;
-    l1a_l1s_com.l1s_en_task[TCHD]  = TASK_DISABLED;
-    l1a_l1s_com.l1s_en_task[TCHTF] = TASK_DISABLED;
-    l1a_l1s_com.l1s_en_task[TCHA]  = TASK_DISABLED;
-
-
-    // Reset active dedicated set.
-    l1a_l1s_com.dedic_set.aset = NULL;
-
-  }
-  else
-  {
-    /* FreeCalypso change: same AUDIO_TASK situation as earlier */
-    #if 0
-      if (l1a_l1s_com.audio_forced_by_l1s == TRUE)
-      {
         #if (L1_EXTERNAL_AUDIO_VOICE_ONOFF == 1)
           if (l1a_l1s_com.audio_onoff_task.parameters.onoff_value == FALSE)
           {
@@ -7669,32 +7631,77 @@
         #else // L1_EXTERNAL_AUDIO_VOICE_ONOFF
           l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
         #endif // L1_EXTERNAL_AUDIO_VOICE_ONOFF
-        l1a_l1s_com.audio_forced_by_l1s = FALSE;
-      }
-    #endif
-    #if (AMR == 1)
-      // Reset DTX AMR status
-      l1s.dtx_amr_dl_on=FALSE;
-    #endif
-  }
-
-  // Clear d_ra_conf => default value
-  l1s_dsp_com.dsp_ndb_ptr->d_ra_conf = 0;
-
-  // Reset input msg.
-  l1a_l1s_com.dedic_set.SignalCode = NULL;
- #if ((REL99 == 1) && (FF_BHO == 1))
-    // this is required in BHO as you need to retain the previous channel info.
-    //This is checked in HO_REQ to L1S.....In normal handover this does not happen
-    if(l1a_l1s_com.dedic_set.handover_type == NORMAL_HANDOVER)
+          l1a_l1s_com.audio_forced_by_l1s = FALSE;
+        }
+      #endif
+
+      #if (AMR == 1)
+        // Reset DTX AMR status
+        l1s.dtx_amr_dl_on=FALSE;
+      #endif
+
+      }
+
+      // Clear d_ra_conf => default value
+      l1s_dsp_com.dsp_ndb_ptr->d_ra_conf = 0;
+
+      // Clear ciphering setting in MCU-DSP com.
+      l1ddsp_load_ciph_param(0, &(l1a_l1s_com.dedic_set.aset->ciph_key));
+
+      // Reset the global dedicated enable flag.
+      l1a_l1s_com.l1s_en_task[DEDIC] = TASK_DISABLED;
+      l1a_l1s_com.l1s_en_task[DDL]   = TASK_DISABLED;
+      l1a_l1s_com.l1s_en_task[DUL]   = TASK_DISABLED;
+      l1a_l1s_com.l1s_en_task[ADL]   = TASK_DISABLED;
+      l1a_l1s_com.l1s_en_task[AUL]   = TASK_DISABLED;
+      l1a_l1s_com.l1s_en_task[TCHTH] = TASK_DISABLED;
+      l1a_l1s_com.l1s_en_task[TCHD]  = TASK_DISABLED;
+      l1a_l1s_com.l1s_en_task[TCHTF] = TASK_DISABLED;
+      l1a_l1s_com.l1s_en_task[TCHA]  = TASK_DISABLED;
+
+#if 0	/* FreeCalypso TCS211 reconstruction */
+    }
+    else
     {
+      /* FreeCalypso change: same AUDIO_TASK situation as earlier */
+      #if 0
+        if (l1a_l1s_com.audio_forced_by_l1s == TRUE)
+        {
+          #if (L1_EXTERNAL_AUDIO_VOICE_ONOFF == 1)
+            if (l1a_l1s_com.audio_onoff_task.parameters.onoff_value == FALSE)
+            {
+              l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
+            }
+          #else // L1_EXTERNAL_AUDIO_VOICE_ONOFF
+            l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
+          #endif // L1_EXTERNAL_AUDIO_VOICE_ONOFF
+          l1a_l1s_com.audio_forced_by_l1s = FALSE;
+        }
+      #endif
+      #if (AMR == 1)
+        // Reset DTX AMR status
+        l1s.dtx_amr_dl_on=FALSE;
+      #endif
+
+      // Clear d_ra_conf => default value
+      l1s_dsp_com.dsp_ndb_ptr->d_ra_conf = 0;
+    }
+#endif	/* FreeCalypso TCS211 reconstruction */
+
+    // Reset input msg.
+    l1a_l1s_com.dedic_set.SignalCode = NULL;
+    #if ((REL99 == 1) && (FF_BHO == 1))
+      // this is required in BHO as you need to retain the previous channel info.
+      //This is checked in HO_REQ to L1S.....In normal handover this does not happen
+      if(l1a_l1s_com.dedic_set.handover_type == NORMAL_HANDOVER)
+      {
+        // Reset active dedicated set.
+        l1a_l1s_com.dedic_set.aset = NULL;
+      }
+    #else
       // Reset active dedicated set.
       l1a_l1s_com.dedic_set.aset = NULL;
-    }
-  #else
-      // Reset active dedicated set.
-      l1a_l1s_com.dedic_set.aset = NULL;
-  #endif
+    #endif
 
     // SYNCHRO task and its associated parameters (tn_difference, dl_tn and
     // dsp_scheduler_mode) are not Enabled/Updated if we are in the specific case:
@@ -7988,6 +7995,19 @@
 	#endif
         }
 
+	/*
+	 * FreeCalypso: the following code has been reconstructed from the
+	 * TCS211 binary object; it appears neither in the LoCosto nor
+	 * in the TSM30 source.
+	 */
+        #if (AEC)
+	  if((l1s.aec.aec_control & 0x0002) || (l1s.aec.aec_control & 0x0004)) {
+	    l1s.aec.aec_control = l1a_l1s_com.aec_task.parameters.aec_control
+				  | 0x0001;
+	    l1s_dsp_com.dsp_ndb_ptr->d_aec_ctrl = l1s.aec.aec_control;
+	  }
+        #endif
+
         // Clear ciphering setting in MCU-DSP com.
         l1ddsp_load_ciph_param(0, &(l1a_l1s_com.dedic_set.aset->ciph_key));