Commit 59c5842b authored by Ding Yumei's avatar Ding Yumei Committed by Haruki NAOI

fix mimo c-plane issue

(cherry picked from commit cbf8e4ceb182a23cfd9f1c9b726afa88b94eea33)
parent b1b52ab5
......@@ -43,6 +43,7 @@
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
extern UL_RCC_IND_t UL_RCC_INFO;
extern int oai_exit;
typedef struct {
uint8_t enabled;
......@@ -420,6 +421,8 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id,
first_time = 0;
}
if (oai_exit) return 0;
if (RC.eNB && RC.eNB[0][0]->configured) {
uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf);
uint16_t sf = NFAPI_SFNSF2SF(sfn_sf);
......@@ -440,6 +443,10 @@ 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);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
if (ind->rach_indication_body.number_of_preambles == 0){
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
return 1;
}
int8_t index = -1;
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.rach_ind[i].header.message_id == 0) && (index == -1)){
......@@ -455,8 +462,6 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
if (ind->rach_indication_body.number_of_preambles > 0){
UL_RCC_INFO.rach_ind[index].rach_indication_body.preamble_list = malloc(sizeof(nfapi_preamble_pdu_t)*ind->rach_indication_body.number_of_preambles );
}else{
UL_RCC_INFO.rach_ind[index].header.message_id = 0;
}
for (int i=0; i<ind->rach_indication_body.number_of_preambles; i++) {
......@@ -507,6 +512,10 @@ 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);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
if (ind->harq_indication_body.number_of_harqs == 0){
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
return 1;
}
int8_t index = -1;
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.harq_ind[i].header.message_id == 0) && (index == -1)){
......@@ -522,8 +531,6 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio
if (ind->harq_indication_body.number_of_harqs > 0){
UL_RCC_INFO.harq_ind[index].harq_indication_body.harq_pdu_list = malloc(sizeof(nfapi_harq_indication_pdu_t)*ind->harq_indication_body.number_of_harqs );
}else{
UL_RCC_INFO.harq_ind[index].header.message_id = 0;
}
for (int i=0; i<ind->harq_indication_body.number_of_harqs; i++) {
......@@ -547,6 +554,10 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
if (ind->crc_indication_body.number_of_crcs == 0){
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
return 1;
}
int8_t index = -1;
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.crc_ind[i].header.message_id == 0) && (index == -1)){
......@@ -565,8 +576,6 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
if (ind->crc_indication_body.number_of_crcs > 0){
UL_RCC_INFO.crc_ind[index].crc_indication_body.crc_pdu_list = malloc(sizeof(nfapi_crc_indication_pdu_t)*ind->crc_indication_body.number_of_crcs );
}else{
UL_RCC_INFO.crc_ind[index].header.message_id = 0;
}
for (int i=0; i<ind->crc_indication_body.number_of_crcs; i++) {
memcpy(&UL_RCC_INFO.crc_ind[index].crc_indication_body.crc_pdu_list[i], &ind->crc_indication_body.crc_pdu_list[i], sizeof(ind->crc_indication_body.crc_pdu_list[0]));
......@@ -614,6 +623,10 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
if (ind->rx_indication_body.number_of_pdus == 0){
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
return 1;
}
int8_t index = -1;
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.rx_ind[i].header.message_id == 0) && (index == -1)){
......@@ -632,8 +645,6 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
if (ind->rx_indication_body.number_of_pdus > 0){
UL_RCC_INFO.rx_ind[index].rx_indication_body.rx_pdu_list = malloc(sizeof(nfapi_rx_indication_pdu_t)*ind->rx_indication_body.number_of_pdus );
}else{
UL_RCC_INFO.rx_ind[index].header.message_id = 0;
}
for (int i=0; i<ind->rx_indication_body.number_of_pdus; i++) {
......@@ -707,6 +718,10 @@ 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);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
if (ind->sr_indication_body.number_of_srs == 0){
pthread_mutex_unlock(&eNB->UL_INFO_mutex);;
return 1;
}
int8_t index = -1;
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.sr_ind[i].header.message_id == 0) && (index == -1)){
......@@ -722,8 +737,6 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t
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){
UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list = malloc(sizeof(nfapi_sr_indication_pdu_t)*ind->sr_indication_body.number_of_srs );
}else{
UL_RCC_INFO.sr_ind[index].header.message_id = 0;
}
for (int i=0; i<ind->sr_indication_body.number_of_srs; i++) {
nfapi_sr_indication_pdu_t *dest_pdu = &UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list[i];
......@@ -760,6 +773,10 @@ 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);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
if (ind->cqi_indication_body.number_of_cqis == 0){
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
return 1;
}
int8_t index = -1;
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
if((UL_RCC_INFO.cqi_ind[i].header.message_id == 0) && (index == -1)){
......@@ -775,8 +792,6 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
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_raw_pdu_list = malloc(sizeof(nfapi_cqi_indication_raw_pdu_t)*ind->cqi_indication_body.number_of_cqis );
}else{
UL_RCC_INFO.cqi_ind[index].header.message_id = 0;
}
for (int i=0; i<ind->cqi_indication_body.number_of_cqis; i++) {
......
......@@ -93,6 +93,9 @@ void* nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t* config)
else
{
buffer_p = calloc(1, size);
if(buffer_p != NULL){
memset(buffer_p,0,size);
}
return buffer_p;
}
}
......@@ -1347,7 +1350,8 @@ static uint8_t pack_hi_dci0_dci_rel8_pdu_value(void *tlv, uint8_t **ppWritePacke
push8(dci_pdu_rel8->ul_index, ppWritePackedMsg, end) &&
push8(dci_pdu_rel8->dl_assignment_index, ppWritePackedMsg, end) &&
push32(dci_pdu_rel8->tpc_bitmap, ppWritePackedMsg, end) &&
push16(dci_pdu_rel8->transmission_power, ppWritePackedMsg, end));
push16(dci_pdu_rel8->transmission_power, ppWritePackedMsg, end) &&
push8(dci_pdu_rel8->harq_pid, ppWritePackedMsg, end));
}
static uint8_t pack_hi_dci0_dci_rel10_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
......@@ -4220,7 +4224,8 @@ static uint8_t unpack_hi_dci0_dci_pdu_rel8_value(void *tlv, uint8_t **ppReadPack
pull8(ppReadPackedMsg, &dci_pdu_rel8->ul_index, end) &&
pull8(ppReadPackedMsg, &dci_pdu_rel8->dl_assignment_index, end) &&
pull32(ppReadPackedMsg, &dci_pdu_rel8->tpc_bitmap, end) &&
pull16(ppReadPackedMsg, &dci_pdu_rel8->transmission_power, end));
pull16(ppReadPackedMsg, &dci_pdu_rel8->transmission_power, end) &&
pull8(ppReadPackedMsg, &dci_pdu_rel8->harq_pid, end));
}
static uint8_t unpack_hi_dci0_dci_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
......@@ -5959,7 +5964,7 @@ static uint8_t unpack_timing_info(uint8_t **ppReadPackedMsg, uint8_t *end, void
#ifdef PHY_RM
static uint8_t unpack_phy_rm_start_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{
uint8_t proceed = 1;
//uint8_t proceed = 1;
nfapi_phy_rm_start_request_t *pNfapiMsg = (nfapi_phy_rm_start_request_t*)msg;
if(pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) == 0)
{
......
......@@ -240,7 +240,7 @@ void vnf_p7_rx_reassembly_queue_remove_msg(vnf_p7_t* vnf_p7, vnf_p7_rx_reassembl
{
previous->next = iterator->next;
}
#ifndef PHY_RM
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting reassembly message\n");
// delete the message
uint16_t i;
......@@ -250,7 +250,7 @@ void vnf_p7_rx_reassembly_queue_remove_msg(vnf_p7_t* vnf_p7, vnf_p7_rx_reassembl
vnf_p7_free(vnf_p7, iterator->segments[i].buffer);
}
vnf_p7_free(vnf_p7, iterator);
#endif
break;
}
......@@ -291,9 +291,9 @@ void vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7_t* vnf_p7, vnf_p7_rx_reas
NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting stale reassembly message (%u %u %d)\n", iterator->rx_hr_time, rx_hr_time, delta);
vnf_p7_rx_message_t* to_delete = iterator;
//vnf_p7_rx_message_t* to_delete = iterator;
iterator = iterator->next;
#ifndef PHY_RM
// delete the message
uint16_t i;
for(i = 0; i < 128; ++i)
......@@ -302,7 +302,7 @@ void vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7_t* vnf_p7, vnf_p7_rx_reas
vnf_p7_free(vnf_p7, to_delete->segments[i].buffer);
}
vnf_p7_free(vnf_p7, to_delete);
#endif
}
else
{
......
......@@ -390,7 +390,7 @@ config_sib2(int Mod_idP,
cfg->pusch_config.hopping_offset.value = radioResourceConfigCommonP->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
cfg->pusch_config.hopping_offset.tl.tag = NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG;
cfg->num_tlv++;
cfg->pucch_config.delta_pucch_shift.value = radioResourceConfigCommonP->pucch_ConfigCommon.deltaPUCCH_Shift;
cfg->pucch_config.delta_pucch_shift.value = radioResourceConfigCommonP->pucch_ConfigCommon.deltaPUCCH_Shift + 1;
cfg->pucch_config.delta_pucch_shift.tl.tag = NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG;
cfg->num_tlv++;
cfg->pucch_config.n_cqi_rb.value = radioResourceConfigCommonP->pucch_ConfigCommon.nRB_CQI;
......
......@@ -1105,13 +1105,16 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
first_rb = 6;
break;
case 25:
first_rb = 11;
//first_rb = 11;
first_rb = 21;
break;
case 50:
first_rb = 23;
//first_rb = 23;
first_rb = 46;
break;
case 100:
first_rb = 48;
//first_rb = 48;
first_rb = 96;
break;
}
......@@ -1123,24 +1126,34 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
// Get MCS for length of SI, 3 PRBs
if (bcch_sdu_length <= 7) {
mcs = 0;
bcch_sdu_length = 7;
} else if (bcch_sdu_length <= 11) {
mcs = 1;
bcch_sdu_length = 11;
} else if (bcch_sdu_length <= 18) {
mcs = 2;
bcch_sdu_length = 18;
} else if (bcch_sdu_length <= 22) {
mcs = 3;
bcch_sdu_length = 22;
} else if (bcch_sdu_length <= 26) {
mcs = 4;
bcch_sdu_length = 26;
} else if (bcch_sdu_length <= 28) {
mcs = 5;
bcch_sdu_length = 28;
} else if (bcch_sdu_length <= 32) {
mcs = 6;
bcch_sdu_length = 32;
} else if (bcch_sdu_length <= 41) {
mcs = 7;
bcch_sdu_length = 41;
} else if (bcch_sdu_length <= 49) {
mcs = 8;
bcch_sdu_length = 49;
} else if (bcch_sdu_length <= 59) {
mcs = 9;
bcch_sdu_length = 59;
}
else AssertFatal(1==0,"Cannot Assign mcs for bcch_sdu_length %d (max mcs 9)\n",bcch_sdu_length);
......
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