Commit e0a670e9 authored by wujing's avatar wujing

fix C-Plane NG because of the size of MSG4 and cqi struct

parent 91ffcd1f
......@@ -755,7 +755,19 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
&ind->cqi_indication_body.cqi_raw_pdu_list[i], sizeof(nfapi_cqi_indication_raw_pdu_t));
}
}else{
eNB->UL_INFO.cqi_ind = ind->cqi_indication_body;
nfapi_cqi_indication_t *dest_ind = &eNB->UL_INFO.cqi_ind;
*dest_ind = *ind;
dest_ind->cqi_indication_body.cqi_pdu_list = ind->cqi_indication_body.cqi_pdu_list;
dest_ind->cqi_indication_body.cqi_raw_pdu_list = ind->cqi_indication_body.cqi_raw_pdu_list;
for(int i=0; i<ind->cqi_indication_body.number_of_cqis; i++) {
nfapi_cqi_indication_pdu_t *src_pdu = &ind->cqi_indication_body.cqi_pdu_list[i];
LOG_D(MAC, "SR_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti,
src_pdu->ul_cqi_information.ul_cqi, src_pdu->ul_cqi_information.channel);
memcpy(&dest_ind->cqi_indication_body.cqi_pdu_list[i],
src_pdu, sizeof(nfapi_cqi_indication_pdu_t));
memcpy(&dest_ind->cqi_indication_body.cqi_raw_pdu_list[i],
&ind->cqi_indication_body.cqi_raw_pdu_list[i], sizeof(nfapi_cqi_indication_raw_pdu_t));
}
}
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
return 1;
......
......@@ -5835,7 +5835,7 @@ static uint8_t unpack_ue_release_resp(uint8_t **ppReadPackedMsg, uint8_t *end, v
return 0;
}
else{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "ue_release_response:error_code = %d\n", pNfapiMsg->error_code);
NFAPI_TRACE(NFAPI_TRACE_INFO, "ue_release_response:error_code = %d\n", pNfapiMsg->error_code);
}
return 1;
}
......
......@@ -1658,8 +1658,9 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
void fill_ulsch_cqi_indication (PHY_VARS_eNB *eNB, uint16_t frame, uint8_t subframe, LTE_UL_eNB_HARQ_t *ulsch_harq, uint16_t rnti) {
pthread_mutex_lock (&eNB->UL_INFO_mutex);
nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list[eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis];
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis];
pdu->instance_length = 0;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = rnti;
......@@ -1685,9 +1686,11 @@ void fill_ulsch_cqi_indication (PHY_VARS_eNB *eNB, uint16_t frame, uint8_t subfr
pdu->cqi_indication_rel9.number_of_cc_reported = 1;
pdu->ul_cqi_information.channel = 1; // PUSCH
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
memcpy ((void *) raw_pdu->pdu, ulsch_harq->o, pdu->cqi_indication_rel9.length);
eNB->UL_INFO.cqi_ind.number_of_cqis++;
LOG_D(PHY,"eNB->UL_INFO.cqi_ind.number_of_cqis:%d\n", eNB->UL_INFO.cqi_ind.number_of_cqis);
eNB->UL_INFO.cqi_ind.cqi_indication_body.tl.tag = NFAPI_CQI_INDICATION_BODY_TAG;
eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis++;
LOG_D(PHY,"eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis:%d\n", eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis);
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
......
......@@ -618,8 +618,8 @@ int main(int argc, char **argv) {
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
eNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = eNB->sr_pdu_list;
eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list = eNB->cqi_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
printf("lte_param_init done\n");
// for a call to phy_reset_ue later we need PHY_vars_UE_g allocated and pointing to UE
PHY_vars_UE_g = (PHY_VARS_UE ** *)malloc(sizeof(PHY_VARS_UE **));
......
......@@ -1051,7 +1051,7 @@ generate_Msg4(module_id_t module_idP,
mac->TX_req[CC_idP].sfn_sf =
fill_nfapi_tx_req(&mac->TX_req[CC_idP].tx_request_body,
(frameP * 10) + subframeP,
rrc_sdu_length,
rrc_sdu_length+offset,
mac->pdu_index[CC_idP],
mac->UE_list.
DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]);
......
......@@ -130,14 +130,13 @@ void handle_cqi(UL_IND_t *UL_info) {
int i;
if (NFAPI_MODE==NFAPI_MODE_PNF) {
if (UL_info->cqi_ind.number_of_cqis>0) {
LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis);
nfapi_cqi_indication_t ind;
ind.header.message_id = NFAPI_RX_CQI_INDICATION;
ind.sfn_sf = UL_info->frame<<4 | UL_info->subframe;
ind.cqi_indication_body = UL_info->cqi_ind;
oai_nfapi_cqi_indication(&ind);
UL_info->cqi_ind.number_of_cqis=0;
if (UL_info->cqi_ind.cqi_indication_body.number_of_cqis>0) {
LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.cqi_indication_body.number_of_cqis);
UL_info->cqi_ind.header.message_id = NFAPI_RX_CQI_INDICATION;
UL_info->cqi_ind.sfn_sf = UL_info->frame<<4 | UL_info->subframe;
oai_nfapi_cqi_indication(&UL_info->cqi_ind);
UL_info->cqi_ind.cqi_indication_body.number_of_cqis=0;
}
} else if (NFAPI_MODE == NFAPI_MODE_VNF) {
for(uint8_t j = 0;j < NUM_NFPAI_SUBFRAME;j++){
......@@ -160,17 +159,17 @@ void handle_cqi(UL_IND_t *UL_info) {
}
}
} else {
for (i=0; i<UL_info->cqi_ind.number_of_cqis; i++)
for (i=0;i<UL_info->cqi_ind.cqi_indication_body.number_of_cqis;i++)
cqi_indication(UL_info->module_id,
UL_info->CC_id,
UL_info->frame,
UL_info->subframe,
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
NFAPI_SFNSF2SFN(UL_info->cqi_ind.sfn_sf),
NFAPI_SFNSF2SF(UL_info->cqi_ind.sfn_sf),
UL_info->cqi_ind.cqi_indication_body.cqi_pdu_list[i].rx_ue_information.rnti,
&UL_info->cqi_ind.cqi_indication_body.cqi_pdu_list[i].cqi_indication_rel9,
UL_info->cqi_ind.cqi_indication_body.cqi_raw_pdu_list[i].pdu,
&UL_info->cqi_ind.cqi_indication_body.cqi_pdu_list[i].ul_cqi_information);
UL_info->cqi_ind.number_of_cqis=0;
UL_info->cqi_ind.cqi_indication_body.number_of_cqis=0;
}
}
......@@ -704,8 +703,7 @@ void UL_indication(UL_IND_t *UL_info) {
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
UL_info->frame,UL_info->subframe,
module_id,CC_id,
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis,
UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.cqi_indication_body.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
if(UL_info->frame==1023&&UL_info->subframe==6) { // dl scheduling (0,0)
frame_cnt= (frame_cnt + 1)%7; // to prevent frame_cnt get too big
......
......@@ -71,7 +71,7 @@ typedef struct{
nfapi_sr_indication_t sr_ind;
/// CQI indication list
nfapi_cqi_indication_body_t cqi_ind;
nfapi_cqi_indication_t cqi_ind;
/// RACH indication list
nfapi_rach_indication_t rach_ind;
......
......@@ -236,8 +236,8 @@ void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subfram
// change for mutiple UE's simulation.
//pthread_mutex_lock(&UE_mac_inst[Mod_id].UL_INFO_mutex);
pthread_mutex_lock(&fill_ul_mutex.cqi_mutex);
nfapi_cqi_indication_pdu_t *pdu = &UL_INFO->cqi_ind.cqi_pdu_list[UL_INFO->cqi_ind.number_of_cqis];
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &UL_INFO->cqi_ind.cqi_raw_pdu_list[UL_INFO->cqi_ind.number_of_cqis];
nfapi_cqi_indication_pdu_t *pdu = &UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list[UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis];
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list[UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis];
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = rnti;
......@@ -263,7 +263,7 @@ void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subfram
UL_INFO->cqi_ind.number_of_cqis++;
UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis++;
// change for mutiple UE's simulation.
//pthread_mutex_unlock(&UE_mac_inst[Mod_id].UL_INFO_mutex);
pthread_mutex_unlock(&fill_ul_mutex.cqi_mutex);
......
......@@ -175,14 +175,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs ||
eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs ||
eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles ||
eNB->UL_INFO.cqi_ind.number_of_cqis
eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis
) {
LOG_D(PHY, "UL_info[rx_ind:%05d:%d harqs:%05d:%d crcs:%05d:%d preambles:%05d:%d cqis:%d] RX:%04d%d TX:%04d%d num_pdcch_symbols:%d\n",
NFAPI_SFNSF2DEC(eNB->UL_INFO.rx_ind.sfn_sf), eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus,
NFAPI_SFNSF2DEC(eNB->UL_INFO.harq_ind.sfn_sf), eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs,
NFAPI_SFNSF2DEC(eNB->UL_INFO.crc_ind.sfn_sf), eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs,
NFAPI_SFNSF2DEC(eNB->UL_INFO.rach_ind.sfn_sf), eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles,
eNB->UL_INFO.cqi_ind.number_of_cqis,
eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis,
proc->frame_rx, proc->subframe_rx,
proc->frame_tx, proc->subframe_tx, eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols);
}
......@@ -1270,8 +1270,8 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
eNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = eNB->sr_pdu_list;
eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list = eNB->cqi_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
eNB->prach_energy_counter = 0;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment