changeset 314:e520acd157e2

l1p_ctl.c: l1pctl_dpcma_agc_read() reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 04 Oct 2017 00:49:05 +0000
parents 0388ecc384d6
children 27a933036b4f
files chipsetsw/layer1/p_cfile/l1p_ctl.c
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/p_cfile/l1p_ctl.c	Tue Oct 03 08:11:02 2017 +0000
+++ b/chipsetsw/layer1/p_cfile/l1p_ctl.c	Wed Oct 04 00:49:05 2017 +0000
@@ -1111,7 +1111,8 @@
       // current_IL processing
       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;
 
           if (radio_freq != l1a_l1s_com.Scell_info.radio_freq)
             current_IL += (l1ps.read_param.dl_pwr_ctl.p0 + 10);
@@ -1220,7 +1221,9 @@
                        &(l1a_l1s_com.last_input_level[serving_index].lna_off),
                        l1a_l1s_com.Scell_info.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(l1a_l1s_com.Scell_info.radio_freq);
     }
 
     // transfer_meas updating
@@ -1228,7 +1231,10 @@
 
     // IL = (min IL in FIFO) + P0 + 10 (PR = 5 format 7.1)
     // Input levels are always stored with lna_on
-    input_level = l1a_l1s_com.last_input_level[serving_index].input_level + l1ps.read_param.dl_pwr_ctl.p0 + 10;
+    input_level = l1a_l1s_com.last_input_level[serving_index].input_level
+                  - l1a_l1s_com.last_input_level[serving_index].lna_off *
+                      l1ctl_get_lna_att(l1a_l1s_com.Scell_info.radio_freq)
+                  + l1ps.read_param.dl_pwr_ctl.p0 + 10;
   
     // IL_2_AGC_xx array size 
     if (input_level>INDEX_MAX) input_level = INDEX_MAX;
@@ -1240,7 +1246,9 @@
 
     l1ctl_encode_lna((UWORD8)(new_calibrated_IL>>1), &(l1a_l1s_com.Scell_info.transfer_meas.lna_off), l1ps.read_param.radio_freq_for_lna);
 
-    l1a_l1s_com.Scell_info.transfer_meas.input_level = (UWORD8)input_level;
+    l1a_l1s_com.Scell_info.transfer_meas.input_level = input_level +
+      l1a_l1s_com.Scell_info.transfer_meas.lna_off *
+        l1ctl_get_lna_att(l1ps.read_param.radio_freq_for_lna);
   } // End if "burst = 3"
 
 } // End of "l1pctl_dpcma_agc_read"