Commit 4e1f08fd authored by Andrew Burger's avatar Andrew Burger

Debugging after msg4 Problem

parent 8c75f74c
...@@ -440,17 +440,17 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio ...@@ -440,17 +440,17 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
printf("[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles); printf("[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){ if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1; int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){ // for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.rach_ind[i].header.message_id == 0) && (index == -1)){ // if((UL_RCC_INFO.rach_ind[i].header.message_id == 0) && (index == -1)){
index = i; // index = i;
break; // break;
} // }
} // }
if(index == -1){ // if(index == -1){
LOG_E(MAC,"phy_rach_indication : num of rach reach max \n"); // LOG_E(MAC,"phy_rach_indication : num of rach reach max \n");
return 0; // return 0;
} // }
UL_RCC_INFO.rach_ind[index] = *ind; UL_RCC_INFO.rach_ind[index] = *ind;
if (ind->rach_indication_body.number_of_preambles > 0) if (ind->rach_indication_body.number_of_preambles > 0)
...@@ -504,17 +504,17 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio ...@@ -504,17 +504,17 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->harq_indication_body.number_of_harqs); LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->harq_indication_body.number_of_harqs);
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){ if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1; int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){ // for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.harq_ind[i].header.message_id == 0) && (index == -1)){ // if((UL_RCC_INFO.harq_ind[i].header.message_id == 0) && (index == -1)){
index = i; // index = i;
break; // break;
} // }
} // }
if(index == -1){ // if(index == -1){
LOG_E(MAC,"phy_harq_indication : num of harq reach max \n"); // LOG_E(MAC,"phy_harq_indication : num of harq reach max \n");
return 0; // return 0;
} // }
UL_RCC_INFO.harq_ind[index] = *ind; UL_RCC_INFO.harq_ind[index] = *ind;
if (ind->harq_indication_body.number_of_harqs > 0) if (ind->harq_indication_body.number_of_harqs > 0)
...@@ -540,20 +540,20 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_ ...@@ -540,20 +540,20 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){ if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1; int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){ // for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.crc_ind[i].header.message_id == 0) && (index == -1)){ // if((UL_RCC_INFO.crc_ind[i].header.message_id == 0) && (index == -1)){
index = i; // index = i;
} // }
if(UL_RCC_INFO.rx_ind[i].sfn_sf == ind->sfn_sf){ // if(UL_RCC_INFO.rx_ind[i].sfn_sf == ind->sfn_sf){
index = i; // index = i;
break; // break;
} // }
} // }
if(index == -1){ // if(index == -1){
LOG_E(MAC,"phy_crc_indication : num of crc reach max \n"); // LOG_E(MAC,"phy_crc_indication : num of crc reach max \n");
return 0; // return 0;
} // }
UL_RCC_INFO.crc_ind[index] = *ind; UL_RCC_INFO.crc_ind[index] = *ind;
if (ind->crc_indication_body.number_of_crcs > 0) if (ind->crc_indication_body.number_of_crcs > 0)
...@@ -605,20 +605,20 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t ...@@ -605,20 +605,20 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){ if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1; int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){ // for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.rx_ind[i].header.message_id == 0) && (index == -1)){ // if((UL_RCC_INFO.rx_ind[i].header.message_id == 0) && (index == -1)){
index = i; // index = i;
} // }
if(UL_RCC_INFO.crc_ind[i].sfn_sf == ind->sfn_sf){ // if(UL_RCC_INFO.crc_ind[i].sfn_sf == ind->sfn_sf){
index = i; // index = i;
break; // break;
} // }
} // }
if(index == -1){ // if(index == -1){
LOG_E(MAC,"phy_rx_indication : num of rx reach max \n"); // LOG_E(MAC,"phy_rx_indication : num of rx reach max \n");
return 0; // return 0;
} // }
UL_RCC_INFO.rx_ind[index] = *ind; UL_RCC_INFO.rx_ind[index] = *ind;
if (ind->rx_indication_body.number_of_pdus > 0) if (ind->rx_indication_body.number_of_pdus > 0)
...@@ -691,17 +691,17 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t ...@@ -691,17 +691,17 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t
LOG_D(MAC, "%s() NFAPI SFN/SF:%d srs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->sr_indication_body.number_of_srs); LOG_D(MAC, "%s() NFAPI SFN/SF:%d srs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->sr_indication_body.number_of_srs);
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){ if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1; int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){ // for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.sr_ind[i].header.message_id == 0) && (index == -1)){ // if((UL_RCC_INFO.sr_ind[i].header.message_id == 0) && (index == -1)){
index = i; // index = i;
break; // break;
} // }
} // }
if(index == -1){ // if(index == -1){
LOG_E(MAC,"phy_sr_indication : num of sr reach max \n"); // LOG_E(MAC,"phy_sr_indication : num of sr reach max \n");
return 0; // return 0;
} // }
UL_RCC_INFO.sr_ind[index] = *ind; UL_RCC_INFO.sr_ind[index] = *ind;
LOG_D(MAC,"%s() UL_INFO[%d].sr_ind.sr_indication_body.number_of_srs:%d\n", __FUNCTION__, index, eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs); LOG_D(MAC,"%s() UL_INFO[%d].sr_ind.sr_indication_body.number_of_srs:%d\n", __FUNCTION__, index, eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs);
if (ind->sr_indication_body.number_of_srs > 0) if (ind->sr_indication_body.number_of_srs > 0)
...@@ -742,17 +742,17 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_ ...@@ -742,17 +742,17 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_cqis:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis); LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_cqis:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis);
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){ if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1; int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){ // for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.cqi_ind[i].header.message_id == 0) && (index == -1)){ // if((UL_RCC_INFO.cqi_ind[i].header.message_id == 0) && (index == -1)){
index = i; // index = i;
break; // break;
} // }
} // }
if(index == -1){ // if(index == -1){
LOG_E(MAC,"phy_cqi_indication : num of cqi reach max \n"); // LOG_E(MAC,"phy_cqi_indication : num of cqi reach max \n");
return 0; // return 0;
} // }
UL_RCC_INFO.cqi_ind[index] = *ind; UL_RCC_INFO.cqi_ind[index] = *ind;
if (ind->cqi_indication_body.number_of_cqis > 0){ if (ind->cqi_indication_body.number_of_cqis > 0){
UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_pdu_list = malloc(sizeof(nfapi_cqi_indication_pdu_t)*ind->cqi_indication_body.number_of_cqis ); UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_pdu_list = malloc(sizeof(nfapi_cqi_indication_pdu_t)*ind->cqi_indication_body.number_of_cqis );
......
...@@ -22,27 +22,32 @@ extern UL_RCC_IND_t UL_RCC_INFO; ...@@ -22,27 +22,32 @@ extern UL_RCC_IND_t UL_RCC_INFO;
uint16_t frame_cnt=0; uint16_t frame_cnt=0;
void handle_rach(UL_IND_t *UL_info) { void handle_rach(UL_IND_t *UL_info) {
int i; int i;
int j = UL_info->subframe;
if(NFAPI_MODE == NFAPI_MODE_VNF) {
for(uint8_t j = 0; j < NUM_NFPAI_SUBFRAME; j++) { if (NFAPI_MODE == NFAPI_MODE_VNF)
if (UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles>0) { {
AssertFatal(UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n"); LOG_I(MAC, "handle_rach j: %d UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles: %d\n",
LOG_D(MAC,"UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->subframe, NFAPI_SFNSF2DEC(UL_RCC_INFO.rach_ind[j].sfn_sf)); j, UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles);
initiate_ra_proc(UL_info->module_id, if (UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles > 0)
UL_info->CC_id, {
NFAPI_SFNSF2SFN(UL_RCC_INFO.rach_ind[j].sfn_sf), LOG_E(MAC, "UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:Frame: %d Subframe: %d\n",
NFAPI_SFNSF2SF(UL_RCC_INFO.rach_ind[j].sfn_sf), UL_info->frame, UL_info->subframe, NFAPI_SFNSF2SFN(UL_RCC_INFO.rach_ind[j].sfn_sf), NFAPI_SFNSF2SF(UL_RCC_INFO.rach_ind[j].sfn_sf));
UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.preamble, AssertFatal(UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles == 1, "More than 1 preamble not supported\n"); // dump frame/sf and all things in UL_RCC_INFO
UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.timing_advance, initiate_ra_proc(UL_info->module_id,
UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.rnti, UL_info->CC_id,
0 NFAPI_SFNSF2SFN(UL_RCC_INFO.rach_ind[j].sfn_sf),
); NFAPI_SFNSF2SF(UL_RCC_INFO.rach_ind[j].sfn_sf),
free(UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list); UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.preamble,
UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles = 0; UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
UL_RCC_INFO.rach_ind[j].header.message_id = 0; UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.rnti,
} 0);
free(UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list);
UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles = 0;
UL_RCC_INFO.rach_ind[j].header.message_id = 0;
} }
} else { }
else
{
if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) { if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n"); AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
UL_info->rach_ind.rach_indication_body.number_of_preambles=0; UL_info->rach_ind.rach_indication_body.number_of_preambles=0;
...@@ -695,7 +700,7 @@ void UL_indication(UL_IND_t *UL_info, L1_rxtx_proc_t *proc) { ...@@ -695,7 +700,7 @@ void UL_indication(UL_IND_t *UL_info, L1_rxtx_proc_t *proc) {
Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id]; Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id];
IF_Module_t *ifi = if_inst[module_id]; IF_Module_t *ifi = if_inst[module_id];
eNB_MAC_INST *mac = RC.mac[module_id]; eNB_MAC_INST *mac = RC.mac[module_id];
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", LOG_E(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, UL_info->frame,UL_info->subframe,
module_id,CC_id, 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->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,
...@@ -787,7 +792,7 @@ IF_Module_t *IF_Module_init(int Mod_id) { ...@@ -787,7 +792,7 @@ IF_Module_t *IF_Module_init(int Mod_id) {
AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0, AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0,
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id); "allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
} }
memset(&UL_RCC_INFO, 0, sizeof(UL_RCC_INFO));
return if_inst[Mod_id]; return if_inst[Mod_id];
} }
......
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