comparison chipsetsw/layer1/cfile/l1_sync.c @ 142:60a142a16d6b

l1_sync.c: l1s_meas_manager() fully reconstructed
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 15 May 2016 07:22:04 +0000
parents 99caa1978401
children 136a30c40ba5
comparison
equal deleted inserted replaced
141:99caa1978401 142:60a142a16d6b
228 extern void l1s_audio_manager (void); 228 extern void l1s_audio_manager (void);
229 #endif 229 #endif
230 /*-------------------------------------------------------*/ 230 /*-------------------------------------------------------*/
231 /* Prototypes of external functions used in this file. */ 231 /* Prototypes of external functions used in this file. */
232 /*-------------------------------------------------------*/ 232 /*-------------------------------------------------------*/
233 void l1ddsp_meas_read (UWORD8 nbmeas, UWORD16 *pm); 233 void l1ddsp_meas_read (UWORD8 nbmeas, UWORD8 *pm);
234 234
235 #if L1_GPRS 235 #if L1_GPRS
236 void l1ps_transfer_mode_manager (void); 236 void l1ps_transfer_mode_manager (void);
237 void l1ps_reset_db_mcu_to_dsp (T_DB_MCU_TO_DSP_GPRS *page_ptr); 237 void l1ps_reset_db_mcu_to_dsp (T_DB_MCU_TO_DSP_GPRS *page_ptr);
238 void l1pddsp_meas_ctrl (UWORD8 nbmeas, UWORD8 pm_pos); 238 void l1pddsp_meas_ctrl (UWORD8 nbmeas, UWORD8 pm_pos);
239 void l1pddsp_meas_read (UWORD8 nbmeas, UWORD16 *pm_read); 239 void l1pddsp_meas_read (UWORD8 nbmeas, UWORD8 *pm_read);
240 void l1ps_meas_manager (void); 240 void l1ps_meas_manager (void);
241 void l1ps_transfer_meas_manager (void); 241 void l1ps_transfer_meas_manager (void);
242 void l1ps_macs_rlc_downlink_call (void); 242 void l1ps_macs_rlc_downlink_call (void);
243 #endif 243 #endif
244 244
5233 /* L1C_RXLEV_PERIODIC_DONE is built and sent to L1A. */ 5233 /* L1C_RXLEV_PERIODIC_DONE is built and sent to L1A. */
5234 /* */ 5234 /* */
5235 /*-------------------------------------------------------*/ 5235 /*-------------------------------------------------------*/
5236 void l1s_meas_manager(void) 5236 void l1s_meas_manager(void)
5237 { 5237 {
5238 static static_s_rxlev_cntr = 0; 5238 /* static static_s_rxlev_cntr = 0; */
5239 UWORD32 i; 5239 UWORD32 i;
5240 UWORD8 IL_for_rxlev; 5240 UWORD8 IL_for_rxlev;
5241 UWORD8 adc_active = INACTIVE; 5241 UWORD8 adc_active = INACTIVE;
5242 5242
5243 static xSignalHeaderRec *pch_msg = NULL; 5243 static xSignalHeaderRec *pch_msg = NULL;
5368 // Call Cell Selection measurement management function or Idle PLMN permitted function 5368 // Call Cell Selection measurement management function or Idle PLMN permitted function
5369 // if meas. task still enabled. 5369 // if meas. task still enabled.
5370 if((l1a_l1s_com.l1s_en_meas & FSMS_MEAS) && !(l1a_l1s_com.meas_param & FSMS_MEAS)) 5370 if((l1a_l1s_com.l1s_en_meas & FSMS_MEAS) && !(l1a_l1s_com.meas_param & FSMS_MEAS))
5371 { 5371 {
5372 #if L1_GPRS 5372 #if L1_GPRS
5373 UWORD16 pm_read[NB_MEAS_MAX_GPRS]={0}; //omaps00090550 5373 UWORD8 pm_read[NB_MEAS_MAX_GPRS];
5374 #else 5374 #else
5375 UWORD16 pm_read[NB_MEAS_MAX]; 5375 UWORD8 pm_read[NB_MEAS_MAX];
5376 #endif 5376 #endif
5377 5377
5378 UWORD8 nbmeas, max_nbmeas; 5378 UWORD8 nbmeas, max_nbmeas;
5379 5379
5380 // When FULL LIST measurement task is enabled L1S is executed every frame. 5380 // When FULL LIST measurement task is enabled L1S is executed every frame.
5444 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) 5444 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5)
5445 trace_fct(CST_READ_FULL_LIST_MEAS, (UWORD32)(-1));//OMAPS00090550 5445 trace_fct(CST_READ_FULL_LIST_MEAS, (UWORD32)(-1));//OMAPS00090550
5446 #endif 5446 #endif
5447 5447
5448 l1_check_pm_error(pm_read[i], FULL_LIST_MEAS_ID); 5448 l1_check_pm_error(pm_read[i], FULL_LIST_MEAS_ID);
5449 pm_read[i] = (pm_read[i] >> 5);
5450 5449
5451 #if (TRACE_TYPE==3) 5450 #if (TRACE_TYPE==3)
5452 stats_samples_pm(pm_read[i]); 5451 stats_samples_pm(pm_read[i]);
5453 #endif 5452 #endif
5454 5453
5896 5895
5897 /* pch_msg != NULL added below due to the fast pagin feature + power reduction feature 5896 /* pch_msg != NULL added below due to the fast pagin feature + power reduction feature
5898 * as the measurement can end in potentially 2 TDMA frames itself and an IBA_R message 5897 * as the measurement can end in potentially 2 TDMA frames itself and an IBA_R message
5899 * when comes in certail TDMA frames of paging task, both static ctrl index and static 5898 * when comes in certail TDMA frames of paging task, both static ctrl index and static
5900 * read index will be zero */ 5899 * read index will be zero */
5901 if((static_ctrl_index != 0) || (static_read_index != 0) || (pch_msg != NULL)) 5900 /* FreeCalypso TCS211 reconstruction: above change reverted */
5901 if((static_ctrl_index != 0) || (static_read_index != 0))
5902 { 5902 {
5903 5903
5904 // Paging process has been interrupted by a L3 message 5904 // Paging process has been interrupted by a L3 message
5905 // Deallocate memory for the received message if msg not forwarded to L3. 5905 // Deallocate memory for the received message if msg not forwarded to L3.
5906 // ---------------------------------------------------------------------- 5906 // ----------------------------------------------------------------------
5932 5932
5933 // variables introduced to cope with RACH sent on one frame of the paging block 5933 // variables introduced to cope with RACH sent on one frame of the paging block
5934 static UWORD8 static_nbmeas_to_report = 8; 5934 static UWORD8 static_nbmeas_to_report = 8;
5935 static UWORD8 static_nbmeas_ctrl_d = 0; 5935 static UWORD8 static_nbmeas_ctrl_d = 0;
5936 static UWORD8 static_nbmeas_ctrl_dd = 0; 5936 static UWORD8 static_nbmeas_ctrl_dd = 0;
5937
5938 #if 0 /* FreeCalypso TCS211 reconstruction */
5937 static UWORD8 num_pm[4]={0,0,0,0}; 5939 static UWORD8 num_pm[4]={0,0,0,0};
5938 #if (FF_L1_FAST_DECODING == 1) 5940 #if (FF_L1_FAST_DECODING == 1)
5939 static UWORD8 num_pm_fp[2]={0,0}; 5941 static UWORD8 num_pm_fp[2]={0,0};
5940 #endif 5942 #endif
5941 static UWORD8 num_pm_frames = 0; /* number of frames over which measurement is scheduled */ 5943 static UWORD8 num_pm_frames = 0; /* number of frames over which measurement is scheduled */
5944 #endif
5942 5945
5943 UWORD8 nbmeas_ctrl = 0; 5946 UWORD8 nbmeas_ctrl = 0;
5944 #if (FF_L1_FAST_DECODING == 1) 5947 #if (FF_L1_FAST_DECODING == 1)
5945 BOOL schedule_measures = FALSE; 5948 BOOL schedule_measures = FALSE;
5946 BOOL fast_decoding = l1s_check_fast_decoding_authorized(NP); 5949 BOOL fast_decoding = l1s_check_fast_decoding_authorized(NP);
5966 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) 5969 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5)
5967 trace_fct(CST_READ_I_BA_MEAS, (UWORD32)(-1));//OMAPS00090550 5970 trace_fct(CST_READ_I_BA_MEAS, (UWORD32)(-1));//OMAPS00090550
5968 #endif 5971 #endif
5969 5972
5970 // Read power measurement result from DSP. 5973 // Read power measurement result from DSP.
5971 pm = (l1s_dsp_com.dsp_db_r_ptr->a_pm[i] & 0xffff); 5974 pm = (l1s_dsp_com.dsp_db_r_ptr->a_pm[i] & 0xffff) >> 5;
5972 l1_check_pm_error(pm, I_BA_MEAS_ID); 5975 l1_check_pm_error(pm, I_BA_MEAS_ID);
5973 pm = pm >> 5;
5974 5976
5975 #if (TRACE_TYPE==3) 5977 #if (TRACE_TYPE==3)
5976 stats_samples_pm(pm); 5978 stats_samples_pm(pm);
5977 #endif 5979 #endif
5978 5980
5986 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) 5988 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4)
5987 RTTL1_FILL_MON_MEAS(pm, IL_for_rxlev, I_BA_MEAS_ID, radio_freq_read) 5989 RTTL1_FILL_MON_MEAS(pm, IL_for_rxlev, I_BA_MEAS_ID, radio_freq_read)
5988 #endif 5990 #endif
5989 5991
5990 5992
5991 #if (GSM_IDLE_RAM != 1) 5993 #if 0 /* FreeCalypso TCS211 reconstruction */
5992 5994 //Check if the message is not empty, else allocate memory
5993 //Check if the message is not empty, else allocate memory 5995 if (pch_msg == NULL)
5994 if (pch_msg == NULL)
5995 { 5996 {
5996 pch_msg = os_alloc_sig(sizeof(T_L1C_RXLEV_PERIODIC_DONE)); 5997 pch_msg = os_alloc_sig(sizeof(T_L1C_RXLEV_PERIODIC_DONE));
5997 DEBUGMSG(status,NU_ALLOC_ERR) 5998 DEBUGMSG(status,NU_ALLOC_ERR)
5998 pch_msg->SignalCode = L1C_RXLEV_PERIODIC_DONE; 5999 pch_msg->SignalCode = L1C_RXLEV_PERIODIC_DONE;
5999 } 6000 }
6000 // Fill reporting message. 6001 #endif
6001 6002
6002 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))-> 6003 // Fill reporting message.
6003 A[static_read_index].radio_freq_no = radio_freq_read; 6004 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->
6004 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))-> 6005 A[static_read_index].radio_freq_no = radio_freq_read;
6005 A[static_read_index].rxlev = l1s_encode_rxlev(IL_for_rxlev); 6006 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->
6006 #elif (GSM_IDLE_RAM == 1) // In this case the msg is not allocated yet -> save into internal variable 6007 A[static_read_index].rxlev = l1s_encode_rxlev(IL_for_rxlev);
6007 // Fill reporting message.
6008 l1s.A[static_read_index].radio_freq_no = radio_freq_read;
6009 l1s.A[static_read_index].rxlev = l1s_encode_rxlev(IL_for_rxlev);
6010 #endif
6011 6008
6012 // Increment the number of neighbor meas read. 6009 // Increment the number of neighbor meas read.
6013 static_read_index ++; 6010 static_read_index ++;
6014 6011
6015 // Increment "l1s.next_to_read" field for next measurement... 6012 // Increment "l1s.next_to_read" field for next measurement...
6020 6017
6021 // Serving cell measurements... 6018 // Serving cell measurements...
6022 // Accumulate the new measurement with the partial result. 6019 // Accumulate the new measurement with the partial result.
6023 // Compensate AGC for current measurement value. 6020 // Compensate AGC for current measurement value.
6024 l1a_l1s_com.Scell_info.meas.acc += l1a_l1s_com.Scell_IL_for_rxlev; 6021 l1a_l1s_com.Scell_info.meas.acc += l1a_l1s_com.Scell_IL_for_rxlev;
6025 static_s_rxlev_cntr++; 6022 /* static_s_rxlev_cntr++; */
6026 6023
6027 // ********** 6024 // **********
6028 // Reporting 6025 // Reporting
6029 // ********** 6026 // **********
6030 if (static_read_index==static_nbmeas_to_report) 6027 if (static_read_index==static_nbmeas_to_report)
6062 // ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/4); 6059 // ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/4);
6063 //#else /* #if (FF_L1_FAST_DECODING == 1) */ 6060 //#else /* #if (FF_L1_FAST_DECODING == 1) */
6064 // ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/4); 6061 // ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/4);
6065 //#endif /* #if (FF_L1_FAST_DECODING == 1) #else */ 6062 //#endif /* #if (FF_L1_FAST_DECODING == 1) #else */
6066 6063
6067 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/(static_s_rxlev_cntr)); 6064 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/4);
6068 // Fill "nbr_of_carriers" field, it is 7 when a RACH coincides with paging block, 8 otherwise. 6065 // Fill "nbr_of_carriers" field, it is 7 when a RACH coincides with paging block, 8 otherwise.
6069 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->nbr_of_carriers = static_nbmeas_to_report; 6066 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->nbr_of_carriers = static_nbmeas_to_report;
6070 6067
6071 // Fill BA identifier field. 6068 // Fill BA identifier field.
6072 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->ba_id = l1a_l1s_com.ba_list.ba_id; 6069 ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->ba_id = l1a_l1s_com.ba_list.ba_id;
6088 qual_acc_idle1[1] =0; 6085 qual_acc_idle1[1] =0;
6089 #endif 6086 #endif
6090 6087
6091 // Reset pointer for debugg. 6088 // Reset pointer for debugg.
6092 pch_msg = NULL; 6089 pch_msg = NULL;
6093 static_s_rxlev_cntr = 0; 6090 /* static_s_rxlev_cntr = 0; */
6094 } 6091 }
6095 6092
6096 }// end of READ 6093 }// end of READ
6097 6094
6098 // ********** 6095 // **********
6105 if (pch_msg == NULL) 6102 if (pch_msg == NULL)
6106 { 6103 {
6107 pch_msg = os_alloc_sig(sizeof(T_L1C_RXLEV_PERIODIC_DONE)); 6104 pch_msg = os_alloc_sig(sizeof(T_L1C_RXLEV_PERIODIC_DONE));
6108 DEBUGMSG(status,NU_ALLOC_ERR) 6105 DEBUGMSG(status,NU_ALLOC_ERR)
6109 pch_msg->SignalCode = L1C_RXLEV_PERIODIC_DONE; 6106 pch_msg->SignalCode = L1C_RXLEV_PERIODIC_DONE;
6110 static_s_rxlev_cntr = 0; 6107 /* static_s_rxlev_cntr = 0; */
6111 } 6108 }
6112 #endif 6109 #endif
6113 // Reset accumalator for serving measurements. 6110 // Reset accumalator for serving measurements.
6114 l1a_l1s_com.Scell_info.meas.acc = 0; 6111 l1a_l1s_com.Scell_info.meas.acc = 0;
6115 6112
6118 6115
6119 // Save first BA index to be measured in this new session. 6116 // Save first BA index to be measured in this new session.
6120 l1a_l1s_com.ba_list.first_index = l1a_l1s_com.ba_list.next_to_ctrl; 6117 l1a_l1s_com.ba_list.first_index = l1a_l1s_com.ba_list.next_to_ctrl;
6121 6118
6122 // Reset static variables for control of nbmeas per frame 6119 // Reset static variables for control of nbmeas per frame
6123 static_nbmeas_to_report = calc_num_pm_to_report(); 6120 static_nbmeas_to_report = 8;
6124 static_nbmeas_ctrl_d = 0; 6121 static_nbmeas_ctrl_d = 0;
6125 static_nbmeas_ctrl_dd = 0; 6122 static_nbmeas_ctrl_dd = 0;
6126
6127 switch(static_nbmeas_to_report)
6128 {
6129 case 1: num_pm[0]=1;
6130 num_pm[1]=0;
6131 num_pm[2]=0;
6132 num_pm[3]=0;
6133 num_pm_frames = 1;
6134 break;
6135 case 2: num_pm[0]=1;
6136 num_pm[1]=1;
6137 num_pm[2]=0;
6138 num_pm[3]=0;
6139 num_pm_frames = 2;
6140 break;
6141 case 3: num_pm[0]=1;
6142 num_pm[1]=1;
6143 num_pm[2]=1;
6144 num_pm[3]=0;
6145 num_pm_frames = 3;
6146 break;
6147 case 4: num_pm[0]=1;
6148 num_pm[1]=1;
6149 num_pm[2]=1;
6150 num_pm[3]=1;
6151 num_pm_frames = 4;
6152 break;
6153 case 5: num_pm[0]=2;
6154 num_pm[1]=1;
6155 num_pm[2]=1;
6156 num_pm[3]=1;
6157 num_pm_frames = 4;
6158 break;
6159 case 6: num_pm[0]=2;
6160 num_pm[1]=2;
6161 num_pm[2]=1;
6162 num_pm[3]=1;
6163 num_pm_frames = 4;
6164 break;
6165 case 7: num_pm[0]=2;
6166 num_pm[1]=2;
6167 num_pm[2]=2;
6168 num_pm[3]=1;
6169 num_pm_frames = 4;
6170 break;
6171 }
6172 #if (FF_L1_FAST_DECODING == 1)
6173 switch(static_nbmeas_to_report)
6174 {
6175 case 1: num_pm_fp[0]=1;
6176 num_pm_fp[1]=0;
6177 num_pm_frames = 1;
6178 break;
6179 case 2: num_pm_fp[0]=1;
6180 num_pm_fp[1]=1;
6181 num_pm_frames = 2;
6182 break;
6183 case 3: num_pm_fp[0]=2;
6184 num_pm_fp[1]=1;
6185 num_pm_frames = 2;
6186 break;
6187 case 4: num_pm_fp[0]=3;
6188 num_pm_fp[1]=1;
6189 num_pm_frames = 2;
6190 break;
6191 case 5: num_pm_fp[0]=4;
6192 num_pm_fp[1]=1;
6193 num_pm_frames = 2;
6194 break;
6195 case 6: num_pm_fp[0]=4;
6196 num_pm_fp[1]=2;
6197 num_pm_frames = 2;
6198 break;
6199 case 7: num_pm_fp[0]=4;
6200 num_pm_fp[1]=3;
6201 num_pm_frames = 2;
6202 break;
6203 }
6204 #endif
6205
6206
6207 } 6123 }
6208 6124
6209 // A PCH burst has been controled, we must make the control of 1 or 2 new measurements. 6125 // A PCH burst has been controled, we must make the control of 1 or 2 new measurements.
6210 #if (FF_L1_FAST_DECODING == 1) 6126 if ((static_ctrl_index == (l1a_l1s_com.ba_list.np_ctrl-1)*2) ||
6211 schedule_measures = FALSE; 6127 (static_ctrl_index == (l1a_l1s_com.ba_list.np_ctrl-1)*2 - 1))
6212
6213 if ( (fast_decoding == TRUE)
6214 &&
6215 ( (l1a_l1s_com.ba_list.np_ctrl == 1) ||
6216 (l1a_l1s_com.ba_list.np_ctrl == 2) )
6217 )
6218 {
6219 /* Fast decoding enabled, current NP control on bursts 1 or 2 */
6220 #if (GSM_IDLE_RAM!=1)
6221 if (pch_msg != NULL)
6222 #endif
6223 {
6224
6225 schedule_measures = TRUE;
6226 }
6227 }
6228 else
6229 if ( (fast_decoding == FALSE)
6230 &&
6231 ( (num_pm[l1a_l1s_com.ba_list.np_ctrl-1]!=0) && ((l1a_l1s_com.ba_list.np_ctrl >=1) && (l1a_l1s_com.ba_list.np_ctrl<=4)))
6232 )
6233 {
6234 /* Fast decoding disabled, use legacy condition to schedule up to
6235 2 power measurements */
6236 #if (GSM_IDLE_RAM!=1)
6237 if (pch_msg != NULL)
6238 #endif
6239 {
6240
6241 schedule_measures = TRUE;
6242 }
6243 }
6244
6245 if (schedule_measures == TRUE)
6246 #else /* #if (FF_L1_FAST_DECODING == 1) */
6247 #if (GSM_IDLE_RAM!=1)
6248 if ((num_pm[l1a_l1s_com.ba_list.np_ctrl-1]!=0) && (pch_msg != NULL) && ((l1a_l1s_com.ba_list.np_ctrl >=1) && (l1a_l1s_com.ba_list.np_ctrl<=4)))
6249 #else
6250 if( (num_pm[l1a_l1s_com.ba_list.np_ctrl-1]!=0) && ((l1a_l1s_com.ba_list.np_ctrl >=1) && (l1a_l1s_com.ba_list.np_ctrl<=4)))
6251 #endif
6252 #endif /* #if (FF_L1_FAST_DECODING == 1) #else*/
6253 { 6128 {
6254 UWORD16 radio_freq_ctrl; 6129 UWORD16 radio_freq_ctrl;
6255 UWORD8 ba_index_ctrl; 6130 UWORD8 ba_index_ctrl;
6256 6131
6257 // check whether RACH has been controlled in the same frame 6132 // check whether RACH has been controlled in the same frame
6258 // if YES only one PW measurement will be controlled and the number of meas to report is decremented by 1 6133 // if YES only one PW measurement will be controlled and the number of meas to report is decremented by 1
6259 if (l1s.tpu_win >= (3 * BP_SPLIT + l1_config.params.tx_ra_load_split + l1_config.params.rx_synth_load_split)) 6134 if (l1s.tpu_win >= (3 * BP_SPLIT + l1_config.params.tx_ra_load_split + l1_config.params.rx_synth_load_split))
6260 { 6135 {
6136 static_nbmeas_to_report--;
6261 nbmeas_ctrl = 1; 6137 nbmeas_ctrl = 1;
6262 #if (FF_L1_FAST_DECODING == 1)
6263 if (fast_decoding == TRUE)
6264 {
6265 if(static_nbmeas_to_report > 5)
6266 static_nbmeas_to_report = 5;
6267
6268 if(l1a_l1s_com.ba_list.np_ctrl == 1)
6269 {
6270 update_num_pm_fp_table_for_rach(static_nbmeas_to_report,num_pm_fp);
6271 }
6272 }
6273 else
6274 {
6275
6276 update_num_pm_table_for_rach(static_nbmeas_to_report,num_pm);
6277
6278 }
6279 #else
6280
6281 update_num_pm_table_for_rach(static_nbmeas_to_report,num_pm);
6282
6283 #endif
6284 } 6138 }
6285 else 6139 else
6286 { 6140 {
6287 #if (FF_L1_FAST_DECODING == 1) 6141 nbmeas_ctrl = 2;
6288 if (fast_decoding)
6289 {
6290 nbmeas_ctrl = num_pm_fp[l1a_l1s_com.ba_list.np_ctrl-1];
6291 }
6292 else
6293 {
6294 nbmeas_ctrl = num_pm[l1a_l1s_com.ba_list.np_ctrl-1];
6295 }
6296 #else /* #if (FF_L1_FAST_DECODING == 1) */
6297 nbmeas_ctrl = num_pm[l1a_l1s_com.ba_list.np_ctrl-1];
6298 #endif /* #if (FF_L1_FAST_DECODING == 1) #else */
6299 } /* end else no RACH */ 6142 } /* end else no RACH */
6300 6143
6301 for(i=0; i<nbmeas_ctrl; i++) 6144 for(i=0; i<nbmeas_ctrl; i++)
6302 { 6145 {
6303 UWORD8 lna_off; 6146 UWORD8 lna_off;
6309 ba_index_ctrl = l1a_l1s_com.ba_list.next_to_ctrl; 6152 ba_index_ctrl = l1a_l1s_com.ba_list.next_to_ctrl;
6310 radio_freq_ctrl = l1a_l1s_com.ba_list.A[ba_index_ctrl].radio_freq; 6153 radio_freq_ctrl = l1a_l1s_com.ba_list.A[ba_index_ctrl].radio_freq;
6311 6154
6312 #if (L1_FF_MULTIBAND == 0) 6155 #if (L1_FF_MULTIBAND == 0)
6313 6156
6314 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
6315 // Get AGC according to the last known IL. 6157 // Get AGC according to the last known IL.
6316 agc = Cust_get_agc_from_IL(radio_freq_ctrl, l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level >> 1, PWR_ID); 6158 agc = Cust_get_agc_from_IL(radio_freq_ctrl, l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level >> 1, PWR_ID);
6159 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
6317 6160
6318 // Memorize the IL used for AGC setting. 6161 // Memorize the IL used for AGC setting.
6319 l1a_l1s_com.ba_list.used_il[i] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; 6162 l1a_l1s_com.ba_list.used_il[i] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level;
6320 l1a_l1s_com.ba_list.used_lna[i] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; 6163 l1a_l1s_com.ba_list.used_lna[i] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
6321 6164
6491 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) 6334 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5)
6492 trace_fct(CST_READ_D_BA_MEAS, (UWORD32)(-1));//OMAPS00090550 6335 trace_fct(CST_READ_D_BA_MEAS, (UWORD32)(-1));//OMAPS00090550
6493 #endif 6336 #endif
6494 6337
6495 // Read power measurement result from DSP. 6338 // Read power measurement result from DSP.
6496 pm = (l1s_dsp_com.dsp_db_r_ptr->a_pm[0] & 0xffff); 6339 pm = (l1s_dsp_com.dsp_db_r_ptr->a_pm[0] & 0xffff) >> 5;
6497 l1_check_pm_error(pm, D_BA_MEAS_ID); 6340 l1_check_pm_error(pm, D_BA_MEAS_ID);
6498 pm = pm >> 5;
6499 6341
6500 #if (TRACE_TYPE==3) 6342 #if (TRACE_TYPE==3)
6501 stats_samples_pm(pm); 6343 stats_samples_pm(pm);
6502 #endif 6344 #endif
6503 6345
6546 ba_index_ctrl = l1a_l1s_com.ba_list.next_to_ctrl; 6388 ba_index_ctrl = l1a_l1s_com.ba_list.next_to_ctrl;
6547 radio_freq_ctrl = l1a_l1s_com.ba_list.A[ba_index_ctrl].radio_freq; 6389 radio_freq_ctrl = l1a_l1s_com.ba_list.A[ba_index_ctrl].radio_freq;
6548 6390
6549 #if (L1_FF_MULTIBAND == 0) 6391 #if (L1_FF_MULTIBAND == 0)
6550 6392
6393 agc = Cust_get_agc_from_IL(radio_freq_ctrl, l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level >> 1, PWR_ID);
6551 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; 6394 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
6552 agc = Cust_get_agc_from_IL(radio_freq_ctrl, l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level >> 1, PWR_ID);
6553 6395
6554 6396
6555 // Store IL used for current CTRL in order to be able to build IL from pm 6397 // Store IL used for current CTRL in order to be able to build IL from pm
6556 // in READ phase. 6398 // in READ phase.
6557 l1a_l1s_com.ba_list.used_il[0] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; 6399 l1a_l1s_com.ba_list.used_il[0] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level;
6666 ba_index_ctrl = l1a_l1s_com.ba_list.next_to_ctrl; 6508 ba_index_ctrl = l1a_l1s_com.ba_list.next_to_ctrl;
6667 radio_freq_ctrl = l1a_l1s_com.ba_list.A[ba_index_ctrl].radio_freq; 6509 radio_freq_ctrl = l1a_l1s_com.ba_list.A[ba_index_ctrl].radio_freq;
6668 6510
6669 #if (L1_FF_MULTIBAND == 0) 6511 #if (L1_FF_MULTIBAND == 0)
6670 6512
6513 agc = Cust_get_agc_from_IL(radio_freq_ctrl, l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level >> 1, PWR_ID);
6671 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; 6514 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
6672 agc = Cust_get_agc_from_IL(radio_freq_ctrl, l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level >> 1, PWR_ID);
6673 6515
6674 // Store IL used for current CTRL in order to be able to build IL from pm 6516 // Store IL used for current CTRL in order to be able to build IL from pm
6675 // in READ phase. 6517 // in READ phase.
6676 l1a_l1s_com.ba_list.used_il[0] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; 6518 l1a_l1s_com.ba_list.used_il[0] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level;
6677 l1a_l1s_com.ba_list.used_lna[0] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; 6519 l1a_l1s_com.ba_list.used_lna[0] = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;