changeset 311:5f8ab159aa76

l1p_ctl.c: l1pctl_pagc_read() reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 03 Oct 2017 06:30:41 +0000
parents cd2507a8ec57
children 701fb3242432
files chipsetsw/layer1/p_cfile/l1p_ctl.c
diffstat 1 files changed, 24 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/p_cfile/l1p_ctl.c	Mon Oct 02 20:17:05 2017 +0000
+++ b/chipsetsw/layer1/p_cfile/l1p_ctl.c	Tue Oct 03 06:30:41 2017 +0000
@@ -272,7 +272,9 @@
   UWORD16  lna_value;
   WORD16   used_agc, current_IL, new_calibrated_IL, current_calibrated_IL;
   WORD32   serving_index;
+#if (RF_FAM == 61)
   UWORD16  arfcn;
+#endif
   UWORD8   lna_off;
   UWORD16  dco_algo_ctl_pw_temp = 0;
   UWORD8   if_ctl = 0;
@@ -298,6 +300,7 @@
   // LNA attenuation
   lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq);
 
+#if (RF_FAM == 61)
   // DRP correction 
 #if (L1_FF_MULTIBAND == 0)  
   arfcn = Convert_l1_radio_freq(radio_freq);
@@ -305,7 +308,6 @@
   arfcn=radio_freq;
 #endif 
 
-#if(RF_FAM == 61)
    #if (CODE_VERSION != SIMULATION)
 
     cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw_temp, &if_ctl, (UWORD8) L1_IL_VALID , 
@@ -327,7 +329,7 @@
 
   if (0==pm)  // Check and filter illegal pm value by using last valid IL
   {
-    current_IL = l1a_l1s_com.last_input_level[serving_index].input_level;
+    current_IL = l1a_l1s_com.last_input_level[serving_index].input_level - lna_value;
   }
   else 
   { 
@@ -366,7 +368,9 @@
                     &(l1a_l1s_com.last_input_level[serving_index].lna_off),
                     radio_freq );
 
-  l1a_l1s_com.last_input_level[serving_index].input_level =  new_IL;
+  l1a_l1s_com.last_input_level[serving_index].input_level = new_IL +
+    l1a_l1s_com.last_input_level[serving_index].lna_off * l1ctl_get_lna_att(radio_freq);
+
   return((UWORD8)current_calibrated_IL);
 } // End of "l1pctl_pagc_read"
 
@@ -620,7 +624,9 @@
   UWORD16      radio_freq, lna_value;
   WORD16       used_agc;
   WORD32       serving_index;
+#if (RF_FAM == 61)
   UWORD16      arfcn;
+#endif
   UWORD8       lna_off;
   UWORD16 dco_algo_ctl_pw_temp = 0;
   UWORD8 if_ctl = 0;
@@ -688,8 +694,9 @@
           current_IL = l1a_l1s_com.Scell_info.transfer_meas.input_level;
       }
       else
+      {
 
-	  {
+#if (RF_FAM == 61)
         // DRP correction 
 #if (L1_FF_MULTIBAND == 0)  
   arfcn = Convert_l1_radio_freq(radio_freq);
@@ -697,7 +704,6 @@
   arfcn=radio_freq;
 #endif 
 
-#if(RF_FAM == 61)
    #if (CODE_VERSION != SIMULATION)
 
     cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw_temp, &if_ctl, (UWORD8) L1_IL_VALID , 
@@ -716,7 +722,7 @@
 #endif
 
         current_IL = -(pm - (used_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq));
-	  }
+      }
 
       // Calibrated IL processing
       current_calibrated_IL = current_IL - delta1_freq - delta2_freq;
@@ -1000,7 +1006,9 @@
   UWORD16      radio_freq, lna_value;
   WORD16       used_agc;
   WORD32       serving_index;
+#if (RF_FAM == 61)
   UWORD16      arfcn;
+#endif
   UWORD8       lna_off;
   UWORD16 dco_algo_ctl_pw_temp = 0;
   UWORD8 if_ctl = 0;
@@ -1046,6 +1054,7 @@
   // IL processing for each received burst
   // **************************************
 
+#if (RF_FAM == 61)
   // DRP correction
 #if (L1_FF_MULTIBAND == 0)  
   arfcn = Convert_l1_radio_freq(radio_freq);
@@ -1053,7 +1062,6 @@
   arfcn=radio_freq;
 #endif 
 
-#if(RF_FAM == 61)
    #if (CODE_VERSION != SIMULATION)
    
     cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw_temp, &if_ctl, (UWORD8) L1_IL_VALID , 
@@ -1316,7 +1324,9 @@
   UWORD16      radio_freq, lna_value;
   WORD16       used_agc;
   WORD32       serving_index;
+#if (RF_FAM == 61)
   UWORD16      arfcn;
+#endif
   UWORD8       lna_off;
   UWORD16 dco_algo_ctl_pw_temp = 0;
   UWORD8 if_ctl = 0;
@@ -1383,7 +1393,9 @@
             current_IL += (l1ps.last_PR_good);
       }
       else
-	  {
+      {
+
+#if (RF_FAM == 61)
 	    // DRP correction
 #if (L1_FF_MULTIBAND == 0)  
   arfcn = Convert_l1_radio_freq(radio_freq);
@@ -1391,7 +1403,6 @@
   arfcn=radio_freq;
 #endif 
 
-#if(RF_FAM == 61)
    #if (CODE_VERSION != SIMULATION)
 
 
@@ -1413,7 +1424,7 @@
 #endif
 
         current_IL = -(pm - ( used_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq));
-	  }
+      }
 
       // Calibrated IL processing
       current_calibrated_IL = current_IL - delta1_freq - delta2_freq;
@@ -1578,7 +1589,9 @@
   UWORD16      lna_value;
   WORD16       used_agc, current_IL, current_calibrated_IL, new_calibrated_IL;
   WORD32       index;
+#if (RF_FAM == 61)
   UWORD16      arfcn;
+#endif
   UWORD16 dco_algo_ctl_pw_temp = 0;
   UWORD8 if_ctl = 0;
 #if (RF_FAM == 61) && (CODE_VERSION != SIMULATION)
@@ -1605,6 +1618,7 @@
   used_agc = (Cust_get_agc_from_IL(radio_freq, last_known_il >> 1, PWR_ID)) << 1;
 
 
+#if (RF_FAM == 61)
   // DRP correction
 #if (L1_FF_MULTIBAND == 0)  
   arfcn = Convert_l1_radio_freq(radio_freq);
@@ -1612,7 +1626,6 @@
   arfcn=radio_freq;
 #endif 
 
-#if(RF_FAM == 61)
    #if (CODE_VERSION != SIMULATION)