FreeCalypso > hg > tcs211-l1-reconst
diff 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 |
line wrap: on
line diff
--- a/chipsetsw/layer1/cfile/l1_sync.c Sun May 15 02:21:37 2016 +0000 +++ b/chipsetsw/layer1/cfile/l1_sync.c Sun May 15 07:22:04 2016 +0000 @@ -230,13 +230,13 @@ /*-------------------------------------------------------*/ /* Prototypes of external functions used in this file. */ /*-------------------------------------------------------*/ -void l1ddsp_meas_read (UWORD8 nbmeas, UWORD16 *pm); +void l1ddsp_meas_read (UWORD8 nbmeas, UWORD8 *pm); #if L1_GPRS void l1ps_transfer_mode_manager (void); void l1ps_reset_db_mcu_to_dsp (T_DB_MCU_TO_DSP_GPRS *page_ptr); void l1pddsp_meas_ctrl (UWORD8 nbmeas, UWORD8 pm_pos); - void l1pddsp_meas_read (UWORD8 nbmeas, UWORD16 *pm_read); + void l1pddsp_meas_read (UWORD8 nbmeas, UWORD8 *pm_read); void l1ps_meas_manager (void); void l1ps_transfer_meas_manager (void); void l1ps_macs_rlc_downlink_call (void); @@ -5235,7 +5235,7 @@ /*-------------------------------------------------------*/ void l1s_meas_manager(void) { - static static_s_rxlev_cntr = 0; + /* static static_s_rxlev_cntr = 0; */ UWORD32 i; UWORD8 IL_for_rxlev; UWORD8 adc_active = INACTIVE; @@ -5370,9 +5370,9 @@ if((l1a_l1s_com.l1s_en_meas & FSMS_MEAS) && !(l1a_l1s_com.meas_param & FSMS_MEAS)) { #if L1_GPRS - UWORD16 pm_read[NB_MEAS_MAX_GPRS]={0}; //omaps00090550 + UWORD8 pm_read[NB_MEAS_MAX_GPRS]; #else - UWORD16 pm_read[NB_MEAS_MAX]; + UWORD8 pm_read[NB_MEAS_MAX]; #endif UWORD8 nbmeas, max_nbmeas; @@ -5446,7 +5446,6 @@ #endif l1_check_pm_error(pm_read[i], FULL_LIST_MEAS_ID); - pm_read[i] = (pm_read[i] >> 5); #if (TRACE_TYPE==3) stats_samples_pm(pm_read[i]); @@ -5898,7 +5897,8 @@ * as the measurement can end in potentially 2 TDMA frames itself and an IBA_R message * when comes in certail TDMA frames of paging task, both static ctrl index and static * read index will be zero */ - if((static_ctrl_index != 0) || (static_read_index != 0) || (pch_msg != NULL)) + /* FreeCalypso TCS211 reconstruction: above change reverted */ + if((static_ctrl_index != 0) || (static_read_index != 0)) { // Paging process has been interrupted by a L3 message @@ -5934,11 +5934,14 @@ static UWORD8 static_nbmeas_to_report = 8; static UWORD8 static_nbmeas_ctrl_d = 0; static UWORD8 static_nbmeas_ctrl_dd = 0; + +#if 0 /* FreeCalypso TCS211 reconstruction */ static UWORD8 num_pm[4]={0,0,0,0}; #if (FF_L1_FAST_DECODING == 1) static UWORD8 num_pm_fp[2]={0,0}; #endif static UWORD8 num_pm_frames = 0; /* number of frames over which measurement is scheduled */ +#endif UWORD8 nbmeas_ctrl = 0; #if (FF_L1_FAST_DECODING == 1) @@ -5968,9 +5971,8 @@ #endif // Read power measurement result from DSP. - pm = (l1s_dsp_com.dsp_db_r_ptr->a_pm[i] & 0xffff); + pm = (l1s_dsp_com.dsp_db_r_ptr->a_pm[i] & 0xffff) >> 5; l1_check_pm_error(pm, I_BA_MEAS_ID); - pm = pm >> 5; #if (TRACE_TYPE==3) stats_samples_pm(pm); @@ -5988,26 +5990,21 @@ #endif - #if (GSM_IDLE_RAM != 1) - - //Check if the message is not empty, else allocate memory - if (pch_msg == NULL) +#if 0 /* FreeCalypso TCS211 reconstruction */ + //Check if the message is not empty, else allocate memory + if (pch_msg == NULL) { pch_msg = os_alloc_sig(sizeof(T_L1C_RXLEV_PERIODIC_DONE)); DEBUGMSG(status,NU_ALLOC_ERR) pch_msg->SignalCode = L1C_RXLEV_PERIODIC_DONE; } - // Fill reporting message. - - ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))-> - A[static_read_index].radio_freq_no = radio_freq_read; - ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))-> - A[static_read_index].rxlev = l1s_encode_rxlev(IL_for_rxlev); - #elif (GSM_IDLE_RAM == 1) // In this case the msg is not allocated yet -> save into internal variable - // Fill reporting message. - l1s.A[static_read_index].radio_freq_no = radio_freq_read; - l1s.A[static_read_index].rxlev = l1s_encode_rxlev(IL_for_rxlev); - #endif +#endif + + // Fill reporting message. + ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))-> + A[static_read_index].radio_freq_no = radio_freq_read; + ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))-> + A[static_read_index].rxlev = l1s_encode_rxlev(IL_for_rxlev); // Increment the number of neighbor meas read. static_read_index ++; @@ -6022,7 +6019,7 @@ // Accumulate the new measurement with the partial result. // Compensate AGC for current measurement value. l1a_l1s_com.Scell_info.meas.acc += l1a_l1s_com.Scell_IL_for_rxlev; - static_s_rxlev_cntr++; + /* static_s_rxlev_cntr++; */ // ********** // Reporting @@ -6064,7 +6061,7 @@ // ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/4); //#endif /* #if (FF_L1_FAST_DECODING == 1) #else */ -((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/(static_s_rxlev_cntr)); +((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->s_rxlev = l1s_encode_rxlev(l1a_l1s_com.Scell_info.meas.acc/4); // Fill "nbr_of_carriers" field, it is 7 when a RACH coincides with paging block, 8 otherwise. ((T_L1C_RXLEV_PERIODIC_DONE*)(pch_msg->SigP))->nbr_of_carriers = static_nbmeas_to_report; @@ -6090,7 +6087,7 @@ // Reset pointer for debugg. pch_msg = NULL; - static_s_rxlev_cntr = 0; + /* static_s_rxlev_cntr = 0; */ } }// end of READ @@ -6107,7 +6104,7 @@ pch_msg = os_alloc_sig(sizeof(T_L1C_RXLEV_PERIODIC_DONE)); DEBUGMSG(status,NU_ALLOC_ERR) pch_msg->SignalCode = L1C_RXLEV_PERIODIC_DONE; - static_s_rxlev_cntr = 0; + /* static_s_rxlev_cntr = 0; */ } #endif // Reset accumalator for serving measurements. @@ -6120,136 +6117,14 @@ l1a_l1s_com.ba_list.first_index = l1a_l1s_com.ba_list.next_to_ctrl; // Reset static variables for control of nbmeas per frame - static_nbmeas_to_report = calc_num_pm_to_report(); + static_nbmeas_to_report = 8; static_nbmeas_ctrl_d = 0; static_nbmeas_ctrl_dd = 0; - - switch(static_nbmeas_to_report) - { - case 1: num_pm[0]=1; - num_pm[1]=0; - num_pm[2]=0; - num_pm[3]=0; - num_pm_frames = 1; - break; - case 2: num_pm[0]=1; - num_pm[1]=1; - num_pm[2]=0; - num_pm[3]=0; - num_pm_frames = 2; - break; - case 3: num_pm[0]=1; - num_pm[1]=1; - num_pm[2]=1; - num_pm[3]=0; - num_pm_frames = 3; - break; - case 4: num_pm[0]=1; - num_pm[1]=1; - num_pm[2]=1; - num_pm[3]=1; - num_pm_frames = 4; - break; - case 5: num_pm[0]=2; - num_pm[1]=1; - num_pm[2]=1; - num_pm[3]=1; - num_pm_frames = 4; - break; - case 6: num_pm[0]=2; - num_pm[1]=2; - num_pm[2]=1; - num_pm[3]=1; - num_pm_frames = 4; - break; - case 7: num_pm[0]=2; - num_pm[1]=2; - num_pm[2]=2; - num_pm[3]=1; - num_pm_frames = 4; - break; - } - #if (FF_L1_FAST_DECODING == 1) - switch(static_nbmeas_to_report) - { - case 1: num_pm_fp[0]=1; - num_pm_fp[1]=0; - num_pm_frames = 1; - break; - case 2: num_pm_fp[0]=1; - num_pm_fp[1]=1; - num_pm_frames = 2; - break; - case 3: num_pm_fp[0]=2; - num_pm_fp[1]=1; - num_pm_frames = 2; - break; - case 4: num_pm_fp[0]=3; - num_pm_fp[1]=1; - num_pm_frames = 2; - break; - case 5: num_pm_fp[0]=4; - num_pm_fp[1]=1; - num_pm_frames = 2; - break; - case 6: num_pm_fp[0]=4; - num_pm_fp[1]=2; - num_pm_frames = 2; - break; - case 7: num_pm_fp[0]=4; - num_pm_fp[1]=3; - num_pm_frames = 2; - break; - } - #endif - - } // A PCH burst has been controled, we must make the control of 1 or 2 new measurements. - #if (FF_L1_FAST_DECODING == 1) - schedule_measures = FALSE; - - if ( (fast_decoding == TRUE) - && - ( (l1a_l1s_com.ba_list.np_ctrl == 1) || - (l1a_l1s_com.ba_list.np_ctrl == 2) ) - ) - { - /* Fast decoding enabled, current NP control on bursts 1 or 2 */ - #if (GSM_IDLE_RAM!=1) - if (pch_msg != NULL) - #endif - { - - schedule_measures = TRUE; - } - } - else - if ( (fast_decoding == FALSE) - && - ( (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))) - ) - { - /* Fast decoding disabled, use legacy condition to schedule up to - 2 power measurements */ - #if (GSM_IDLE_RAM!=1) - if (pch_msg != NULL) - #endif - { - - schedule_measures = TRUE; - } - } - - if (schedule_measures == TRUE) -#else /* #if (FF_L1_FAST_DECODING == 1) */ - #if (GSM_IDLE_RAM!=1) - 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))) - #else - 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))) - #endif -#endif /* #if (FF_L1_FAST_DECODING == 1) #else*/ + if ((static_ctrl_index == (l1a_l1s_com.ba_list.np_ctrl-1)*2) || + (static_ctrl_index == (l1a_l1s_com.ba_list.np_ctrl-1)*2 - 1)) { UWORD16 radio_freq_ctrl; UWORD8 ba_index_ctrl; @@ -6258,44 +6133,12 @@ // if YES only one PW measurement will be controlled and the number of meas to report is decremented by 1 if (l1s.tpu_win >= (3 * BP_SPLIT + l1_config.params.tx_ra_load_split + l1_config.params.rx_synth_load_split)) { + static_nbmeas_to_report--; nbmeas_ctrl = 1; - #if (FF_L1_FAST_DECODING == 1) - if (fast_decoding == TRUE) - { - if(static_nbmeas_to_report > 5) - static_nbmeas_to_report = 5; - - if(l1a_l1s_com.ba_list.np_ctrl == 1) - { - update_num_pm_fp_table_for_rach(static_nbmeas_to_report,num_pm_fp); - } - } - else - { - - update_num_pm_table_for_rach(static_nbmeas_to_report,num_pm); - - } - #else - - update_num_pm_table_for_rach(static_nbmeas_to_report,num_pm); - - #endif } else { - #if (FF_L1_FAST_DECODING == 1) - if (fast_decoding) - { - nbmeas_ctrl = num_pm_fp[l1a_l1s_com.ba_list.np_ctrl-1]; - } - else - { - nbmeas_ctrl = num_pm[l1a_l1s_com.ba_list.np_ctrl-1]; - } -#else /* #if (FF_L1_FAST_DECODING == 1) */ - nbmeas_ctrl = num_pm[l1a_l1s_com.ba_list.np_ctrl-1]; -#endif /* #if (FF_L1_FAST_DECODING == 1) #else */ + nbmeas_ctrl = 2; } /* end else no RACH */ for(i=0; i<nbmeas_ctrl; i++) @@ -6311,9 +6154,9 @@ #if (L1_FF_MULTIBAND == 0) - lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; // Get AGC according to the last known IL. 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); + lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; // Memorize the IL used for AGC setting. 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; @@ -6493,9 +6336,8 @@ #endif // Read power measurement result from DSP. - pm = (l1s_dsp_com.dsp_db_r_ptr->a_pm[0] & 0xffff); + pm = (l1s_dsp_com.dsp_db_r_ptr->a_pm[0] & 0xffff) >> 5; l1_check_pm_error(pm, D_BA_MEAS_ID); - pm = pm >> 5; #if (TRACE_TYPE==3) stats_samples_pm(pm); @@ -6548,8 +6390,8 @@ #if (L1_FF_MULTIBAND == 0) + 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); lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; - 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); // Store IL used for current CTRL in order to be able to build IL from pm @@ -6668,8 +6510,8 @@ #if (L1_FF_MULTIBAND == 0) + 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); lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; - 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); // Store IL used for current CTRL in order to be able to build IL from pm // in READ phase.