code review comments
This commit is contained in:
@@ -377,9 +377,7 @@ ue_send_sdu(module_id_t module_idP,
|
||||
unsigned char rx_lcids[NB_RB_MAX];
|
||||
unsigned short rx_lengths[NB_RB_MAX];
|
||||
unsigned char *tx_sdu;
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].rx_dlsch_sdu);
|
||||
#endif
|
||||
start_UE_TIMING(UE_mac_inst[module_idP].rx_dlsch_sdu);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN);
|
||||
//LOG_D(MAC,"sdu: %x.%x.%x\n",sdu[0],sdu[1],sdu[2]);
|
||||
@@ -563,16 +561,12 @@ ue_send_sdu(module_id_t module_idP,
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].rx_dlsch_sdu);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].rx_dlsch_sdu);
|
||||
}
|
||||
|
||||
void ue_decode_si_mbms(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_index, void *pdu, uint16_t len) {
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].rx_si);
|
||||
#endif
|
||||
start_UE_TIMING(UE_mac_inst[module_idP].rx_si);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_IN);
|
||||
LOG_D(MAC, "[UE %d] Frame %d Sending SI MBMS to RRC (LCID Id %d,len %d)\n",
|
||||
@@ -583,9 +577,7 @@ void ue_decode_si_mbms(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].rx_si);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].rx_si);
|
||||
|
||||
trace_pdu(DIRECTION_UPLINK,
|
||||
(uint8_t *) pdu,
|
||||
@@ -603,9 +595,7 @@ void ue_decode_si_mbms(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
void
|
||||
ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_index, void *pdu, uint16_t len) {
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].rx_si);
|
||||
#endif
|
||||
start_UE_TIMING(UE_mac_inst[module_idP].rx_si);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_IN);
|
||||
LOG_D(MAC, "[UE %d] Frame %d Sending SI to RRC (LCID Id %d,len %d)\n",
|
||||
@@ -616,9 +606,7 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].rx_si);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].rx_si);
|
||||
trace_pdu(DIRECTION_UPLINK,
|
||||
(uint8_t *) pdu,
|
||||
len,
|
||||
@@ -632,9 +620,7 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
void
|
||||
ue_decode_p(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_index, void *pdu, uint16_t len) {
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].rx_p);
|
||||
#endif
|
||||
start_UE_TIMING(UE_mac_inst[module_idP].rx_p);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_IN);
|
||||
LOG_D(MAC,
|
||||
@@ -646,9 +632,7 @@ ue_decode_p(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].rx_p);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].rx_p);
|
||||
trace_pdu(DIRECTION_UPLINK,
|
||||
(uint8_t *) pdu,
|
||||
len,
|
||||
@@ -719,9 +703,7 @@ ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
unsigned char num_sdu, i, j, *payload_ptr;
|
||||
unsigned char rx_lcids[NB_RB_MAX];
|
||||
unsigned short rx_lengths[NB_RB_MAX];
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].rx_mch_sdu);
|
||||
#endif
|
||||
start_UE_TIMING(UE_mac_inst[module_idP].rx_mch_sdu);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_MCH_SDU, VCD_FUNCTION_IN);
|
||||
LOG_D(MAC,
|
||||
@@ -814,9 +796,7 @@ ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_MCH_SDU, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].rx_mch_sdu);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].rx_mch_sdu);
|
||||
}
|
||||
|
||||
void ue_send_sl_sdu(module_id_t module_idP,
|
||||
@@ -1493,10 +1473,7 @@ int ue_query_mch(module_id_t module_idP, uint8_t CC_id, uint32_t frameP, uint32_
|
||||
int mcch_flag = 0, mtch_flag = 0, msi_flag = 0;
|
||||
long mch_scheduling_period = -1;
|
||||
uint8_t mch_lcid = 0;
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].ue_query_mch);
|
||||
#endif
|
||||
|
||||
start_UE_TIMING(UE_mac_inst[module_idP].ue_query_mch);
|
||||
if (UE_mac_inst[module_idP].pmch_Config[0]) {
|
||||
mch_scheduling_period = 8 << UE_mac_inst[module_idP].pmch_Config[0]->mch_SchedulingPeriod_r9;
|
||||
}
|
||||
@@ -1996,9 +1973,7 @@ int ue_query_mch(module_id_t module_idP, uint8_t CC_id, uint32_t frameP, uint32_
|
||||
}
|
||||
} // end of for
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].ue_query_mch);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].ue_query_mch);
|
||||
|
||||
if ((mcch_flag == 1)) { // || (msi_flag==1))
|
||||
*mcch_active = 1;
|
||||
@@ -2349,9 +2324,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
module_idP, frameP, subframe, buflen);
|
||||
AssertFatal(CC_id == 0,
|
||||
"Transmission on secondary CCs is not supported yet\n");
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu);
|
||||
#endif
|
||||
start_UE_TIMING(UE_mac_inst[module_idP].tx_ulsch_sdu);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_IN);
|
||||
bsr_header_len = 0;
|
||||
@@ -2893,9 +2866,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].tx_ulsch_sdu);
|
||||
trace_pdu(DIRECTION_UPLINK, ulsch_buffer, buflen, module_idP, WS_C_RNTI,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
UE_mac_inst[module_idP].txFrame,
|
||||
@@ -2933,9 +2904,7 @@ ue_scheduler(const module_id_t module_idP,
|
||||
protocol_ctxt_t ctxt;
|
||||
MessageDef *msg_p;
|
||||
int result;
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].ue_scheduler);
|
||||
#endif
|
||||
start_UE_TIMING(UE_mac_inst[module_idP].ue_scheduler);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_IN);
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_NO,
|
||||
@@ -3001,9 +2970,7 @@ ue_scheduler(const module_id_t module_idP,
|
||||
LOG_E(MAC, "RRCConnectionSetup failed, returning to IDLE state\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].ue_scheduler);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].ue_scheduler);
|
||||
return (CONNECTION_LOST);
|
||||
break;
|
||||
|
||||
@@ -3011,9 +2978,7 @@ ue_scheduler(const module_id_t module_idP,
|
||||
LOG_E(MAC, "RRC Loss of synch, returning PHY_RESYNCH\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].ue_scheduler);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].ue_scheduler);
|
||||
return (PHY_RESYNCH);
|
||||
|
||||
case RRC_Handover_failed:
|
||||
@@ -3030,9 +2995,7 @@ ue_scheduler(const module_id_t module_idP,
|
||||
"RRC handover, Instruct PHY to start the contention-free PRACH and synchronization\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].ue_scheduler);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].ue_scheduler);
|
||||
return (PHY_HO_PRACH);
|
||||
|
||||
default:
|
||||
@@ -3052,11 +3015,9 @@ ue_scheduler(const module_id_t module_idP,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER,
|
||||
VCD_FUNCTION_OUT);
|
||||
stop_meas(&UE_mac_inst[module_idP].ue_scheduler);
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].ue_scheduler);
|
||||
AssertFatal(1 == 0, "");
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].ue_scheduler);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].ue_scheduler);
|
||||
//return(RRC_OK);
|
||||
}
|
||||
|
||||
@@ -3175,9 +3136,7 @@ ue_scheduler(const module_id_t module_idP,
|
||||
LOG_T(MAC, "[UE %d] Release all SRs \n", module_idP);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].ue_scheduler);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].ue_scheduler);
|
||||
return (CONNECTION_OK);
|
||||
}
|
||||
|
||||
@@ -3233,9 +3192,7 @@ ue_scheduler(const module_id_t module_idP,
|
||||
//If the UE has UL resources allocated for new transmission for this TTI here:
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].ue_scheduler);
|
||||
#endif
|
||||
stop_UE_TIMING(UE_mac_inst[module_idP].ue_scheduler);
|
||||
return (CONNECTION_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -971,7 +971,7 @@ void release_UE_in_freeList(module_id_t mod_id) {
|
||||
|
||||
for(int ue_num = 0; ue_num < sizeofArray(eNB_MAC->UE_free_ctrl) ; ue_num++) {
|
||||
rnti_t rnti = eNB_MAC->UE_free_ctrl[ue_num].rnti;
|
||||
if (!rnti)
|
||||
if (rnti == 0)
|
||||
continue;
|
||||
protocol_ctxt_t ctxt;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, rnti, 0, 0, mod_id);
|
||||
@@ -1006,15 +1006,14 @@ void release_UE_in_freeList(module_id_t mod_id) {
|
||||
int pdu_number = ul_req_tmp->number_of_pdus;
|
||||
|
||||
for (int pdu_index = pdu_number - 1; pdu_index >= 0; pdu_index--) {
|
||||
if ((ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)
|
||||
|| (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)
|
||||
|| (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti)
|
||||
|| (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti)
|
||||
|| (ul_req_tmp->ul_config_pdu_list[pdu_index].srs_pdu.srs_pdu_rel8.rnti == rnti)) {
|
||||
nfapi_ul_config_request_pdu_t *pdu = ul_req_tmp->ul_config_pdu_list + pdu_index;
|
||||
if (pdu->ulsch_pdu.ulsch_pdu_rel8.rnti == rnti || pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti || pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti
|
||||
|| pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti || pdu->srs_pdu.srs_pdu_rel8.rnti == rnti) {
|
||||
LOG_I(RRC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number);
|
||||
|
||||
// Very inefficient memory management, but simple
|
||||
if (pdu_index < pdu_number - 1) {
|
||||
memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index + 1], (pdu_number - 1 - pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
|
||||
memcpy(pdu, pdu + 1, (pdu_number - 1 - pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
|
||||
}
|
||||
|
||||
ul_req_tmp->number_of_pdus--;
|
||||
@@ -1879,46 +1878,6 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
|
||||
// delete UE data of prior RNTI. UE use current RNTI.
|
||||
// protocol_ctxt_t ctxt_prior = *ctxt_pP;
|
||||
// ctxt_prior.rnti = reestablish_rnti;
|
||||
//
|
||||
// LTE_eNB_ULSCH_t *ulsch = NULL;
|
||||
// nfapi_ul_config_request_body_t *ul_req_tmp = NULL;
|
||||
// PHY_VARS_eNB *eNB_PHY = NULL;
|
||||
// eNB_MAC_INST *eNB_MAC = RC.mac[ctxt_prior.module_id];
|
||||
// for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
// eNB_PHY = RC.eNB[ctxt_prior.module_id][CC_id];
|
||||
// for (int i=0; i<MAX_MOBILES_PER_ENB; i++) {
|
||||
// ulsch = eNB_PHY->ulsch[i];
|
||||
// if((ulsch != NULL) && (ulsch->rnti == ctxt_prior.rnti)){
|
||||
// void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch);
|
||||
// LOG_I(RRC, "clean_eNb_ulsch UE %x \n", ctxt_prior.rnti);
|
||||
// clean_eNb_ulsch(ulsch);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for(int j = 0; j < 10; j++){
|
||||
// ul_req_tmp = &eNB_MAC->UL_req_tmp[CC_id][j].ul_config_request_body;
|
||||
// if(ul_req_tmp){
|
||||
// int pdu_number = ul_req_tmp->number_of_pdus;
|
||||
// for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--){
|
||||
// if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == ctxt_prior.rnti){
|
||||
// LOG_I(RRC, "remove UE %x from ul_config_pdu_list %d/%d\n", ctxt_prior.rnti, pdu_index, pdu_number);
|
||||
// if(pdu_index < pdu_number -1){
|
||||
// memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
|
||||
// }
|
||||
// ul_req_tmp->number_of_pdus--;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// rrc_mac_remove_ue(ctxt_prior.module_id, ctxt_prior.rnti);
|
||||
// rrc_rlc_remove_ue(&ctxt_prior);
|
||||
// pdcp_remove_UE(&ctxt_prior);
|
||||
// add UE info to freeList for RU_thread to remove the UE instead of remove it here
|
||||
LOG_I(RRC, "[RRCConnectionReestablishment]put UE %x into freeList\n", reestablish_rnti);
|
||||
put_UE_in_freelist(ctxt_pP->module_id, reestablish_rnti, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user