Merge remote-tracking branch 'origin/develop' into NR_2port_CSIRS
This commit is contained in:
@@ -33,7 +33,7 @@ MESSAGE_DEF(X2AP_SETUP_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgT
|
||||
/* eNB application layer -> X2AP messages */
|
||||
MESSAGE_DEF(X2AP_REGISTER_ENB_REQ , MESSAGE_PRIORITY_MED, x2ap_register_enb_req_t , x2ap_register_enb_req)
|
||||
MESSAGE_DEF(X2AP_SUBFRAME_PROCESS , MESSAGE_PRIORITY_MED, x2ap_subframe_process_t , x2ap_subframe_process)
|
||||
|
||||
MESSAGE_DEF(X2AP_RESET_REQ , MESSAGE_PRIORITY_MED, x2ap_reset_req_t , x2ap_reset_req)
|
||||
/* X2AP -> eNB application layer messages */
|
||||
MESSAGE_DEF(X2AP_REGISTER_ENB_CNF , MESSAGE_PRIORITY_MED, x2ap_register_enb_cnf_t , x2ap_register_enb_cnf)
|
||||
MESSAGE_DEF(X2AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, x2ap_deregistered_enb_ind_t , x2ap_deregistered_enb_ind)
|
||||
|
||||
@@ -38,6 +38,8 @@ typedef enum {
|
||||
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req
|
||||
#define X2AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_req
|
||||
#define X2AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_resp
|
||||
#define X2AP_RESET_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_reset_req
|
||||
#define X2AP_RESET_RESP(mSGpTR) (mSGpTR)->ittiMsg.x2ap_reset_resp
|
||||
#define X2AP_HANDOVER_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
|
||||
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
|
||||
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
|
||||
@@ -68,6 +70,14 @@ typedef struct x2ap_setup_resp_s {
|
||||
int num_cc;
|
||||
} x2ap_setup_resp_t;
|
||||
|
||||
typedef struct x2ap_reset_req_s {
|
||||
uint32_t cause;
|
||||
} x2ap_reset_req_t;
|
||||
|
||||
typedef struct x2ap_reset_resp_s {
|
||||
int dummy;
|
||||
} x2ap_reset_resp_t;
|
||||
|
||||
/* X2AP UE CONTEXT RELEASE */
|
||||
typedef struct x2ap_ue_context_release_s {
|
||||
/* used for X2AP->RRC in source and RRC->X2AP in target */
|
||||
|
||||
@@ -660,6 +660,8 @@ int nr_rrc_mac_config_req_ue(
|
||||
if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) num_slots_ul++;
|
||||
LOG_I(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul);
|
||||
mac->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t));
|
||||
for (int i=0; i<num_slots_ul; i++)
|
||||
pthread_mutex_init(&(mac->ul_config_request[i].mutex_ul_config), NULL);
|
||||
// Setup the SSB to Rach Occasions mapping according to the config
|
||||
build_ssb_to_ro_map(mac);//->scc, mac->phy_config.config_req.cell_config.frame_duplex_type);
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp.h"
|
||||
#include <pthread.h>
|
||||
|
||||
static NR_UE_MAC_INST_t *nr_ue_mac_inst;
|
||||
|
||||
@@ -74,6 +75,8 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
|
||||
num_slots_ul++;
|
||||
LOG_D(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul);
|
||||
nr_ue_mac_inst->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t));
|
||||
for (int i=0; i<num_slots_ul; i++)
|
||||
pthread_mutex_init(&(nr_ue_mac_inst->ul_config_request[i].mutex_ul_config), NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -668,15 +668,15 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
LOG_W(MAC, "In %s: ul_config request is NULL. Probably due to unexpected UL DCI in frame.slot %d.%d. Ignoring DCI!\n", __FUNCTION__, frame, slot);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
AssertFatal(ul_config->number_pdus<FAPI_NR_UL_CONFIG_LIST_NUM, "ul_config->number_pdus %d out of bounds\n",ul_config->number_pdus);
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu;
|
||||
|
||||
fill_ul_config(ul_config, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH);
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
|
||||
// Config PUSCH PDU
|
||||
ret = nr_config_pusch_pdu(mac, pusch_config_pdu, dci, NULL, rnti, &dci_format);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -729,13 +729,15 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
return -1;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
AssertFatal(ul_config->number_pdus<FAPI_NR_UL_CONFIG_LIST_NUM, "ul_config->number_pdus %d out of bounds\n",ul_config->number_pdus);
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu;
|
||||
|
||||
fill_ul_config(ul_config, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH);
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
|
||||
// Config PUSCH PDU
|
||||
ret = nr_config_pusch_pdu(mac, pusch_config_pdu, dci, NULL, rnti, &dci_format);
|
||||
|
||||
} else AssertFatal(1==0,"Cannot schedule PUSCH\n");
|
||||
break;
|
||||
}
|
||||
@@ -3944,13 +3946,15 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
|
||||
rnti = ra->t_crnti;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
AssertFatal(ul_config->number_pdus<FAPI_NR_UL_CONFIG_LIST_NUM, "ul_config->number_pdus %d out of bounds\n",ul_config->number_pdus);
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu;
|
||||
|
||||
fill_ul_config(ul_config, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH);
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
|
||||
// Config Msg3 PDU
|
||||
nr_config_pusch_pdu(mac, pusch_config_pdu, NULL, &rar_grant, rnti, NULL);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/* exe */
|
||||
#include <common/utils/nr/nr_common.h>
|
||||
@@ -59,7 +60,6 @@ static prach_association_pattern_t prach_assoc_pattern;
|
||||
static ssb_list_info_t ssb_list;
|
||||
|
||||
void fill_ul_config(fapi_nr_ul_config_request_t *ul_config, frame_t frame_tx, int slot_tx, uint8_t pdu_type){
|
||||
|
||||
ul_config->ul_config_list[ul_config->number_pdus].pdu_type = pdu_type;
|
||||
ul_config->slot = slot_tx;
|
||||
ul_config->sfn = frame_tx;
|
||||
@@ -945,77 +945,88 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
|
||||
// Schedule ULSCH only if the current frame and slot match those in ul_config_req
|
||||
// AND if a UL grant (UL DCI or Msg3) has been received (as indicated by num_pdus)
|
||||
if (ul_config && (ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && ul_config->number_pdus > 0){
|
||||
if (ul_config){
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
if ((ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && ul_config->number_pdus > 0){
|
||||
|
||||
LOG_D(NR_MAC, "In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus, ul_config->sfn, ul_config->slot);
|
||||
LOG_D(NR_MAC, "In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus, ul_config->sfn, ul_config->slot);
|
||||
|
||||
uint8_t ulsch_input_buffer[MAX_ULSCH_PAYLOAD_BYTES];
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
fapi_nr_tx_request_t tx_req;
|
||||
uint8_t ulsch_input_buffer_array[NFAPI_MAX_NUM_UL_PDU][MAX_ULSCH_PAYLOAD_BYTES];
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
fapi_nr_tx_request_t tx_req;
|
||||
tx_req.slot = slot_tx;
|
||||
tx_req.sfn = frame_tx;
|
||||
tx_req.number_of_pdus = 0;
|
||||
|
||||
for (int j = 0; j < ul_config->number_pdus; j++) {
|
||||
for (int j = 0; j < ul_config->number_pdus; j++) {
|
||||
uint8_t *ulsch_input_buffer = &(ulsch_input_buffer_array[tx_req.number_of_pdus][MAX_ULSCH_PAYLOAD_BYTES]);
|
||||
|
||||
fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = &ul_config->ul_config_list[j];
|
||||
fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = &ul_config->ul_config_list[j];
|
||||
|
||||
if (ulcfg_pdu->pdu_type == FAPI_NR_UL_CONFIG_TYPE_PUSCH) {
|
||||
if (ulcfg_pdu->pdu_type == FAPI_NR_UL_CONFIG_TYPE_PUSCH) {
|
||||
int mac_pdu_exist = 0;
|
||||
uint16_t TBS_bytes = ulcfg_pdu->pusch_config_pdu.pusch_data.tb_size;
|
||||
LOG_D(NR_MAC,"harq_id %d, NDI %d NDI_DCI %d, TBS_bytes %d (ra_state %d)\n",
|
||||
ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id,
|
||||
mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id],
|
||||
ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator,
|
||||
TBS_bytes,ra->ra_state);
|
||||
if (ra->ra_state == WAIT_RAR && !ra->cfra){
|
||||
memcpy(ulsch_input_buffer, mac->ulsch_pdu.payload, TBS_bytes);
|
||||
LOG_D(NR_MAC,"[RAPROC] Msg3 to be transmitted:\n");
|
||||
for (int k = 0; k < TBS_bytes; k++) {
|
||||
LOG_D(NR_MAC,"(%i): 0x%x\n",k,mac->ulsch_pdu.payload[k]);
|
||||
}
|
||||
LOG_D(NR_MAC,"Flipping NDI for harq_id %d (Msg3)\n",ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator);
|
||||
mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator;
|
||||
mac->first_ul_tx[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = 0;
|
||||
mac_pdu_exist = 1;
|
||||
} else {
|
||||
|
||||
uint16_t TBS_bytes = ulcfg_pdu->pusch_config_pdu.pusch_data.tb_size;
|
||||
LOG_D(NR_MAC,"harq_id %d, NDI %d NDI_DCI %d, TBS_bytes %d (ra_state %d)\n",
|
||||
ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id,
|
||||
mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id],
|
||||
ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator,
|
||||
TBS_bytes,ra->ra_state);
|
||||
if (ra->ra_state == WAIT_RAR && !ra->cfra){
|
||||
memcpy(ulsch_input_buffer, mac->ulsch_pdu.payload, TBS_bytes);
|
||||
LOG_D(NR_MAC,"[RAPROC] Msg3 to be transmitted:\n");
|
||||
for (int k = 0; k < TBS_bytes; k++) {
|
||||
LOG_D(NR_MAC,"(%i): 0x%x\n",k,mac->ulsch_pdu.payload[k]);
|
||||
}
|
||||
LOG_D(NR_MAC,"Flipping NDI for harq_id %d (Msg3)\n",ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator);
|
||||
mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator;
|
||||
mac->first_ul_tx[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = 0;
|
||||
} else {
|
||||
if ((mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] != ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator ||
|
||||
mac->first_ul_tx[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id]==1) &&
|
||||
((get_softmodem_params()->phy_test == 1) ||
|
||||
(ra->ra_state == RA_SUCCEEDED) ||
|
||||
(ra->ra_state == WAIT_RAR && ra->cfra))){
|
||||
|
||||
if ((mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] != ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator ||
|
||||
mac->first_ul_tx[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id]==1) &&
|
||||
((get_softmodem_params()->phy_test == 1) ||
|
||||
(ra->ra_state == RA_SUCCEEDED) ||
|
||||
(ra->ra_state == WAIT_RAR && ra->cfra))){
|
||||
// Getting IP traffic to be transmitted
|
||||
nr_ue_get_sdu(mod_id, cc_id,frame_tx, slot_tx, gNB_index, ulsch_input_buffer, TBS_bytes);
|
||||
mac_pdu_exist = 1;
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC,"Flipping NDI for harq_id %d\n",ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator);
|
||||
mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator;
|
||||
mac->first_ul_tx[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = 0;
|
||||
|
||||
// Getting IP traffic to be transmitted
|
||||
nr_ue_get_sdu(mod_id, cc_id,frame_tx, slot_tx, gNB_index, ulsch_input_buffer, TBS_bytes);
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC,"Flipping NDI for harq_id %d\n",ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator);
|
||||
mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator;
|
||||
mac->first_ul_tx[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = 0;
|
||||
|
||||
}
|
||||
|
||||
// Config UL TX PDU
|
||||
tx_req.slot = slot_tx;
|
||||
tx_req.sfn = frame_tx;
|
||||
tx_req.number_of_pdus++;
|
||||
tx_req.tx_request_body[0].pdu_length = TBS_bytes;
|
||||
tx_req.tx_request_body[0].pdu_index = j;
|
||||
tx_req.tx_request_body[0].pdu = ulsch_input_buffer;
|
||||
|
||||
if (ra->ra_state == WAIT_CONTENTION_RESOLUTION && !ra->cfra){
|
||||
LOG_I(NR_MAC,"[RAPROC] RA-Msg3 retransmitted\n");
|
||||
// 38.321 restart the ra-ContentionResolutionTimer at each HARQ retransmission in the first symbol after the end of the Msg3 transmission
|
||||
nr_Msg3_transmitted(ul_info->module_id, ul_info->cc_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->gNB_index);
|
||||
}
|
||||
if (ra->ra_state == WAIT_RAR && !ra->cfra){
|
||||
LOG_I(NR_MAC,"[RAPROC] RA-Msg3 transmitted\n");
|
||||
nr_Msg3_transmitted(ul_info->module_id, ul_info->cc_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->gNB_index);
|
||||
// Config UL TX PDU
|
||||
if (mac_pdu_exist) {
|
||||
tx_req.tx_request_body[tx_req.number_of_pdus].pdu_length = TBS_bytes;
|
||||
tx_req.tx_request_body[tx_req.number_of_pdus].pdu_index = j;
|
||||
tx_req.tx_request_body[tx_req.number_of_pdus].pdu = ulsch_input_buffer;
|
||||
tx_req.number_of_pdus++;
|
||||
}
|
||||
if (ra->ra_state == WAIT_CONTENTION_RESOLUTION && !ra->cfra){
|
||||
LOG_I(NR_MAC,"[RAPROC][%d.%d] RA-Msg3 retransmitted\n", frame_tx, slot_tx);
|
||||
// 38.321 restart the ra-ContentionResolutionTimer at each HARQ retransmission in the first symbol after the end of the Msg3 transmission
|
||||
nr_Msg3_transmitted(ul_info->module_id, ul_info->cc_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->gNB_index);
|
||||
}
|
||||
if (ra->ra_state == WAIT_RAR && !ra->cfra){
|
||||
LOG_I(NR_MAC,"[RAPROC][%d.%d] RA-Msg3 transmitted\n", frame_tx, slot_tx);
|
||||
nr_Msg3_transmitted(ul_info->module_id, ul_info->cc_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->gNB_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config); // avoid double lock
|
||||
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, mod_id, cc_id, rx_frame, rx_slot, ul_info->thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, mod_id, cc_id, rx_frame, rx_slot, ul_info->thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
}
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2095,7 +2106,8 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
|
||||
}
|
||||
|
||||
// CSI
|
||||
if (mac->ra.ra_state == RA_SUCCEEDED)
|
||||
if (mac->ra.ra_state == RA_SUCCEEDED ||
|
||||
get_softmodem_params()->phy_test == 1)
|
||||
O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch);
|
||||
|
||||
// ACKNACK
|
||||
@@ -2144,7 +2156,13 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
|
||||
pucch->resource_set_id = find_pucch_resource_set(mac, N_UCI);
|
||||
select_pucch_resource(mac, pucch);
|
||||
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP);
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
AssertFatal(ul_config->number_pdus<FAPI_NR_UL_CONFIG_LIST_NUM, "ul_config->number_pdus %d out of bounds\n",ul_config->number_pdus);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pucch_config_pdu;
|
||||
|
||||
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PUCCH);
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
|
||||
nr_ue_configure_pucch(mac,
|
||||
slotP,
|
||||
rnti,
|
||||
@@ -2152,7 +2170,6 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
|
||||
pucch_pdu,
|
||||
O_SR, O_ACK, O_CSI);
|
||||
LOG_D(NR_MAC,"Configuring pucch, is_common = %d\n",pucch->is_common);
|
||||
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PUCCH);
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
@@ -2213,13 +2230,16 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
|
||||
format0 = format & 0xff; // single PRACH format
|
||||
format1 = (format >> 8) & 0xff; // dual PRACH format
|
||||
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
AssertFatal(ul_config->number_pdus<FAPI_NR_UL_CONFIG_LIST_NUM, "ul_config->number_pdus %d out of bounds\n",ul_config->number_pdus);
|
||||
prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
|
||||
memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu));
|
||||
|
||||
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PRACH);
|
||||
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
LOG_D(PHY, "In %s: (%p) %d UL PDUs:\n", __FUNCTION__, ul_config, ul_config->number_pdus);
|
||||
|
||||
memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu));
|
||||
|
||||
ncs = get_NCS(rach_ConfigGeneric->zeroCorrelationZoneConfig, format0, setup->restrictedSetConfig);
|
||||
|
||||
prach_config_pdu->phys_cell_id = mac->physCellId;
|
||||
@@ -2295,6 +2315,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
|
||||
AssertFatal(1 == 0, "Invalid PRACH format");
|
||||
}
|
||||
} // if format1
|
||||
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
@@ -2723,7 +2744,11 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
|
||||
|
||||
if (sdu_length > 0) {
|
||||
|
||||
LOG_D(NR_MAC, "In %s: Generating UL MAC sub-PDU for SDU %d, length %d bytes, RB with LCID 0x%02x (buflen (TBS) %d bytes)\n", __FUNCTION__,
|
||||
LOG_D(NR_MAC, "In %s: [UE %d] [%d.%d] UL-DXCH -> ULSCH, Generating UL MAC sub-PDU for SDU %d, length %d bytes, RB with LCID 0x%02x (buflen (TBS) %d bytes)\n",
|
||||
__FUNCTION__,
|
||||
module_idP,
|
||||
frameP,
|
||||
subframe,
|
||||
num_sdus + 1,
|
||||
sdu_length,
|
||||
lcid,
|
||||
|
||||
@@ -347,7 +347,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
if ((slot == 0) && (frame & 127) == 0) {
|
||||
stats_output[0]='\0';
|
||||
dump_mac_stats(RC.nrmac[module_idP],stats_output,16384);
|
||||
dump_mac_stats(RC.nrmac[module_idP],stats_output,16384,true);
|
||||
LOG_I(NR_MAC,"Frame.Slot %d.%d\n%s\n",frame,slot,stats_output);
|
||||
}
|
||||
|
||||
|
||||
@@ -1456,7 +1456,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
int n_rb=0;
|
||||
for (int i=0;i<6;i++)
|
||||
for (int j=0;j<8;j++) {
|
||||
n_rb+=((coreset->frequencyDomainResources.buf[i]>>j)&1);
|
||||
n_rb+=((coreset->frequencyDomainResources.buf[i]>>j)&1);
|
||||
}
|
||||
n_rb*=6;
|
||||
const uint16_t N_cce = n_rb * coreset->duration / NR_NB_REG_PER_CCE;
|
||||
@@ -1752,7 +1752,8 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram
|
||||
const int current_harq_pid = ra->harq_pid;
|
||||
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
|
||||
NR_UE_harq_t *harq = &UE_info->UE_sched_ctrl[UE_id].harq_processes[current_harq_pid];
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_UE_harq_t *harq = &sched_ctrl->harq_processes[current_harq_pid];
|
||||
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
|
||||
LOG_D(NR_MAC, "ue %d, rnti %d, harq is waiting %d, round %d, frame %d %d, harq id %d\n", UE_id, ra->rnti, harq->is_waiting, harq->round, frame, slot, current_harq_pid);
|
||||
@@ -1764,6 +1765,8 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram
|
||||
nr_clear_ra_proc(module_id, CC_id, frame, ra);
|
||||
UE_info->active[UE_id] = true;
|
||||
UE_info->Msg4_ACKed[UE_id] = true;
|
||||
if(sched_ctrl->retrans_dl_harq.head>=0)
|
||||
remove_nr_list(&sched_ctrl->retrans_dl_harq, current_harq_pid);
|
||||
}
|
||||
else {
|
||||
LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti);
|
||||
|
||||
@@ -420,9 +420,9 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t
|
||||
return old_mcs; // no update
|
||||
|
||||
// last update is longer than x frames ago
|
||||
const int dtx = stats->dlsch_rounds[0] - bler_stats->dlsch_rounds[0];
|
||||
const int dretx = stats->dlsch_rounds[1] - bler_stats->dlsch_rounds[1];
|
||||
const int dretx2 = stats->dlsch_rounds[2] - bler_stats->dlsch_rounds[2];
|
||||
const int dtx = (int)(stats->dlsch_rounds[0] - bler_stats->dlsch_rounds[0]);
|
||||
const int dretx = (int)(stats->dlsch_rounds[1] - bler_stats->dlsch_rounds[1]);
|
||||
const int dretx2 = (int)(stats->dlsch_rounds[2] - bler_stats->dlsch_rounds[2]);
|
||||
const float bler_window = dtx > 0 ? (float) dretx / dtx : bler_stats->bler;
|
||||
const float rd2_bler_wnd = dtx > 0 ? (float) dretx2 / dtx : bler_stats->rd2_bler;
|
||||
bler_stats->bler = BLER_FILTER * bler_stats->bler + (1 - BLER_FILTER) * bler_window;
|
||||
|
||||
@@ -801,7 +801,7 @@ static void handle_dl_harq(module_id_t mod_id,
|
||||
harq->ndi ^= 1;
|
||||
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
stats->dlsch_errors++;
|
||||
LOG_D(NR_MAC, "retransmission error for UE %d (total %d)\n", UE_id, stats->dlsch_errors);
|
||||
LOG_D(NR_MAC, "retransmission error for UE %d (total %"PRIu64")\n", UE_id, stats->dlsch_errors);
|
||||
} else {
|
||||
add_tail_nr_list(&UE_info->UE_sched_ctrl[UE_id].retrans_dl_harq, harq_pid);
|
||||
harq->round++;
|
||||
@@ -921,7 +921,6 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
|
||||
uint8_t diff_rsrp_idx = 0;
|
||||
uint8_t i, j;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
|
||||
if (n_dl_bwp < 4)
|
||||
pdsch_bwp_id = bwp_id;
|
||||
@@ -945,11 +944,8 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
|
||||
|
||||
//if strongest measured RSRP is configured
|
||||
strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP);
|
||||
// including ssb rsrp in mac stats
|
||||
stats->cumul_rsrp += strongest_ssb_rsrp;
|
||||
stats->num_rsrp_meas++;
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
|
||||
LOG_D(MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
|
||||
LOG_D(NR_MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
|
||||
|
||||
//if current ssb rsrp is greater than better rsrp
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) {
|
||||
@@ -1087,12 +1083,12 @@ uint8_t pickandreverse_bits(uint8_t *payload, uint16_t bitlen, uint8_t start_bit
|
||||
|
||||
|
||||
void evaluate_rsrp_report(NR_UE_info_t *UE_info,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
int UE_id,
|
||||
uint8_t csi_report_id,
|
||||
uint8_t *payload,
|
||||
int *cumul_bits,
|
||||
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type){
|
||||
NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
int UE_id,
|
||||
uint8_t csi_report_id,
|
||||
uint8_t *payload,
|
||||
int *cumul_bits,
|
||||
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type){
|
||||
|
||||
nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id];
|
||||
uint8_t cri_ssbri_bitlen = csi_report->CSI_report_bitlen.cri_ssbri_bitlen;
|
||||
@@ -1121,15 +1117,18 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
|
||||
for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) {
|
||||
curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits);
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type)
|
||||
sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) {
|
||||
sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
|
||||
*(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
else
|
||||
sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
|
||||
LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
|
||||
}
|
||||
else {
|
||||
sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
|
||||
*(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
|
||||
LOG_D(MAC,"CSI-RS Resource Indicator = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
|
||||
}
|
||||
*cumul_bits += cri_ssbri_bitlen;
|
||||
LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]);
|
||||
|
||||
}
|
||||
|
||||
curr_payload = pickandreverse_bits(payload, 7, *cumul_bits);
|
||||
@@ -1142,6 +1141,11 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
|
||||
*cumul_bits += 4;
|
||||
}
|
||||
csi_report->nb_of_csi_ssb_report++;
|
||||
int strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP);
|
||||
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
// including ssb rsrp in mac stats
|
||||
stats->cumul_rsrp += strongest_ssb_rsrp;
|
||||
stats->num_rsrp_meas++;
|
||||
LOG_D(MAC,"rsrp_id = %d rsrp = %d\n",
|
||||
sched_ctrl->CSI_report.ssb_cri_report.RSRP,
|
||||
get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP));
|
||||
@@ -1489,7 +1493,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
||||
}
|
||||
if ((uci_234->pduBitmap >> 2) & 0x01) {
|
||||
//API to parse the csi report and store it into sched_ctrl
|
||||
extract_pucch_csi_report (csi_MeasConfig, uci_234, frame, slot, UE_id, mod_id);
|
||||
extract_pucch_csi_report(csi_MeasConfig, uci_234, frame, slot, UE_id, mod_id);
|
||||
//TCI handling function
|
||||
tci_handling(mod_id, UE_id,frame, slot);
|
||||
}
|
||||
@@ -1667,7 +1671,7 @@ int nr_acknack_scheduling(int mod_id,
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
}
|
||||
if (ind_found==-1) {
|
||||
LOG_W(NR_MAC,
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d could not find pdsch_to_harq_feedback for UE %d: earliest "
|
||||
"ack slot %d\n",
|
||||
frame,
|
||||
|
||||
@@ -451,5 +451,5 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
|
||||
void nr_sr_reporting(int Mod_idP, frame_t frameP, sub_frame_t slotP);
|
||||
|
||||
void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen);
|
||||
void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rsrp);
|
||||
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
|
||||
|
||||
@@ -57,7 +57,7 @@ void *nrmac_stats_thread(void *arg) {
|
||||
AssertFatal(fd!=NULL,"Cannot open nrMAC_stats.log, error %s\n",strerror(errno));
|
||||
|
||||
while (oai_exit == 0) {
|
||||
dump_mac_stats(gNB,output,MACSTATSSTRLEN);
|
||||
dump_mac_stats(gNB,output,MACSTATSSTRLEN,false);
|
||||
fprintf(fd,"%s\n",output);
|
||||
fflush(fd);
|
||||
usleep(200000);
|
||||
@@ -71,7 +71,7 @@ void clear_mac_stats(gNB_MAC_INST *gNB) {
|
||||
memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t));
|
||||
}
|
||||
|
||||
void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen)
|
||||
void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rsrp)
|
||||
{
|
||||
NR_UE_info_t *UE_info = &gNB->UE_info;
|
||||
int num = 1;
|
||||
@@ -94,36 +94,37 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen)
|
||||
avg_rsrp,
|
||||
stats->num_rsrp_meas);
|
||||
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d, BLER %.5f MCS %d\n",
|
||||
UE_id,
|
||||
stats->dlsch_rounds[0], stats->dlsch_rounds[1],
|
||||
stats->dlsch_rounds[2], stats->dlsch_rounds[3],
|
||||
stats->dlsch_errors,
|
||||
stats->pucch0_DTX,
|
||||
sched_ctrl->dl_bler_stats.bler,
|
||||
sched_ctrl->dl_bler_stats.mcs);
|
||||
|
||||
stats->num_rsrp_meas = 0;
|
||||
stats->cumul_rsrp = 0 ;
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes);
|
||||
stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n",
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64", dlsch_errors %"PRIu64", pucch0_DTX %d, BLER %.5f MCS %d\n",
|
||||
UE_id,
|
||||
stats->dlsch_rounds[0], stats->dlsch_rounds[1],
|
||||
stats->dlsch_rounds[2], stats->dlsch_rounds[3],
|
||||
stats->dlsch_errors,
|
||||
stats->pucch0_DTX,
|
||||
sched_ctrl->dl_bler_stats.bler,
|
||||
sched_ctrl->dl_bler_stats.mcs);
|
||||
if (reset_rsrp) {
|
||||
stats->num_rsrp_meas = 0;
|
||||
stats->cumul_rsrp = 0;
|
||||
}
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %"PRIu64"\n", UE_id, stats->dlsch_total_bytes);
|
||||
stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64", ulsch_DTX %d, ulsch_errors %"PRIu64"\n",
|
||||
UE_id,
|
||||
stats->ulsch_rounds[0], stats->ulsch_rounds[1],
|
||||
stats->ulsch_rounds[2], stats->ulsch_rounds[3],
|
||||
stats->ulsch_DTX,
|
||||
stats->ulsch_errors);
|
||||
stroff+=sprintf(output+stroff,
|
||||
"UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n",
|
||||
"UE %d: ulsch_total_bytes_scheduled %"PRIu64", ulsch_total_bytes_received %"PRIu64"\n",
|
||||
UE_id,
|
||||
stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx);
|
||||
for (int lc_id = 0; lc_id < 63; lc_id++) {
|
||||
if (stats->lc_bytes_tx[lc_id] > 0) {
|
||||
stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]);
|
||||
LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]);
|
||||
stroff+=sprintf(output+stroff, "UE %d: LCID %d: %"PRIu64" bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]);
|
||||
LOG_D(NR_MAC, "UE %d: LCID %d: %"PRIu64" bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]);
|
||||
}
|
||||
if (stats->lc_bytes_rx[lc_id] > 0) {
|
||||
stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]);
|
||||
LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]);
|
||||
stroff+=sprintf(output+stroff, "UE %d: LCID %d: %"PRIu64" bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]);
|
||||
LOG_D(NR_MAC, "UE %d: LCID %d: %"PRIu64" bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ typedef struct NR_DL_bler_stats {
|
||||
float bler;
|
||||
float rd2_bler;
|
||||
uint8_t mcs;
|
||||
int dlsch_rounds[8];
|
||||
uint64_t dlsch_rounds[8];
|
||||
} NR_DL_bler_stats_t;
|
||||
|
||||
//
|
||||
@@ -618,19 +618,19 @@ typedef struct {
|
||||
} NRUEcontext_t;
|
||||
|
||||
typedef struct {
|
||||
int lc_bytes_tx[64];
|
||||
int lc_bytes_rx[64];
|
||||
int dlsch_rounds[8];
|
||||
int dlsch_errors;
|
||||
int dlsch_total_bytes;
|
||||
uint64_t lc_bytes_tx[64];
|
||||
uint64_t lc_bytes_rx[64];
|
||||
uint64_t dlsch_rounds[8];
|
||||
uint64_t dlsch_errors;
|
||||
uint64_t dlsch_total_bytes;
|
||||
int dlsch_current_bytes;
|
||||
int ulsch_rounds[8];
|
||||
int ulsch_errors;
|
||||
int ulsch_DTX;
|
||||
int ulsch_total_bytes_scheduled;
|
||||
int ulsch_total_bytes_rx;
|
||||
uint64_t ulsch_rounds[8];
|
||||
uint64_t ulsch_errors;
|
||||
uint32_t ulsch_DTX;
|
||||
uint64_t ulsch_total_bytes_scheduled;
|
||||
uint64_t ulsch_total_bytes_rx;
|
||||
int ulsch_current_bytes;
|
||||
int pucch0_DTX;
|
||||
uint32_t pucch0_DTX;
|
||||
int cumul_rsrp;
|
||||
uint8_t num_rsrp_meas;
|
||||
} NR_mac_stats_t;
|
||||
|
||||
@@ -3293,6 +3293,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.measTimingConfig_r15.periodicityAndOffset_r15.present = LTE_MTC_SSB_NR_r15__periodicityAndOffset_r15_PR_sf20_r15;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.measTimingConfig_r15.periodicityAndOffset_r15.choice.sf20_r15 = 0;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.measTimingConfig_r15.ssb_Duration_r15 = LTE_MTC_SSB_NR_r15__ssb_Duration_r15_sf4;
|
||||
|
||||
if (rrc_inst->nr_scg_ssb_freq > 2016666) //FR2
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.subcarrierSpacingSSB_r15 = LTE_RS_ConfigSSB_NR_r15__subcarrierSpacingSSB_r15_kHz120;
|
||||
else
|
||||
|
||||
@@ -72,6 +72,8 @@
|
||||
#include "NR_RRCReestablishmentRequest.h"
|
||||
#include "NR_UE-CapabilityRequestFilterNR.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
#if defined(NR_Rel16)
|
||||
#include "NR_SCS-SpecificCarrier.h"
|
||||
#include "NR_TDD-UL-DL-ConfigCommon.h"
|
||||
@@ -989,7 +991,7 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
rrc_gNB_carrier_data_t *carrier) {
|
||||
|
||||
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
SpCellConfig->servCellIndex = NULL;
|
||||
SpCellConfig->reconfigurationWithSync = NULL;
|
||||
SpCellConfig->rlmInSyncOutOfSyncThreshold = NULL;
|
||||
@@ -1018,7 +1020,9 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
// one symbol (13)
|
||||
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
|
||||
pucchres0->pucch_ResourceId=0;
|
||||
pucchres0->startingPRB=0;
|
||||
//pucchres0->startingPRB=0;
|
||||
pucchres0->startingPRB=(8+rnti) % curr_bwp;
|
||||
LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp);
|
||||
pucchres0->intraSlotFrequencyHopping=NULL;
|
||||
pucchres0->secondHopPRB=NULL;
|
||||
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
|
||||
@@ -1170,9 +1174,9 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30,
|
||||
"SCS != 30kHz\n");
|
||||
AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity==NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5,
|
||||
"TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
|
||||
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8 + 10*((rnti>>1)&3) + (rnti&1);
|
||||
"TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
|
||||
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8;
|
||||
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
|
||||
*schedulingRequestResourceConfig->resource = 0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
|
||||
|
||||
@@ -57,6 +57,17 @@ int x2ap_eNB_handle_x2_setup_response (instance_t instance,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
static
|
||||
int x2ap_eNB_handle_x2_reset_request (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
static
|
||||
int x2ap_eNB_handle_x2_reset_response (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
static
|
||||
int x2ap_eNB_handle_x2_setup_failure (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
@@ -166,7 +177,7 @@ x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
|
||||
{ 0, 0, 0 }, /* snStatusTransfer */
|
||||
{ x2ap_eNB_handle_ue_context_release, 0, 0 }, /* uEContextRelease */
|
||||
{ x2ap_eNB_handle_x2_setup_request, x2ap_eNB_handle_x2_setup_response, x2ap_eNB_handle_x2_setup_failure }, /* x2Setup */
|
||||
{ 0, 0, 0 }, /* reset */
|
||||
{ x2ap_eNB_handle_x2_reset_request, x2ap_eNB_handle_x2_reset_response, 0 }, /* reset */
|
||||
{ 0, 0, 0 }, /* eNBConfigurationUpdate */
|
||||
{ 0, 0, 0 }, /* resourceStatusReportingInitiation */
|
||||
{ 0, 0, 0 }, /* resourceStatusReporting */
|
||||
@@ -501,6 +512,163 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance,
|
||||
return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data);
|
||||
}
|
||||
|
||||
const char *X2AP_cause_str1[4]={"radioNetwork","transport","protocol","misc"};
|
||||
const char *X2AP_case_str_radio[50]={" X2AP_CauseRadioNetwork_handover_desirable_for_radio_reasons",
|
||||
"X2AP_CauseRadioNetwork_time_critical_handover",
|
||||
"X2AP_CauseRadioNetwork_resource_optimisation_handover",
|
||||
"X2AP_CauseRadioNetwork_reduce_load_in_serving_cell",
|
||||
"X2AP_CauseRadioNetwork_partial_handover",
|
||||
"X2AP_CauseRadioNetwork_unknown_new_eNB_UE_X2AP_ID",
|
||||
"X2AP_CauseRadioNetwork_unknown_old_eNB_UE_X2AP_ID",
|
||||
"X2AP_CauseRadioNetwork_unknown_pair_of_UE_X2AP_ID",
|
||||
"X2AP_CauseRadioNetwork_ho_target_not_allowed",
|
||||
"X2AP_CauseRadioNetwork_tx2relocoverall_expiry",
|
||||
"X2AP_CauseRadioNetwork_trelocprep_expiry",
|
||||
"X2AP_CauseRadioNetwork_cell_not_available",
|
||||
"X2AP_CauseRadioNetwork_no_radio_resources_available_in_target_cell",
|
||||
"X2AP_CauseRadioNetwork_invalid_MME_GroupID",
|
||||
"X2AP_CauseRadioNetwork_unknown_MME_Code",
|
||||
"X2AP_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported",
|
||||
"X2AP_CauseRadioNetwork_reportCharacteristicsEmpty",
|
||||
"X2AP_CauseRadioNetwork_noReportPeriodicity",
|
||||
"X2AP_CauseRadioNetwork_existingMeasurementID",
|
||||
"X2AP_CauseRadioNetwork_unknown_eNB_Measurement_ID",
|
||||
"X2AP_CauseRadioNetwork_measurement_temporarily_not_available",
|
||||
"X2AP_CauseRadioNetwork_unspecified",
|
||||
"X2AP_CauseRadioNetwork_load_balancing",
|
||||
"X2AP_CauseRadioNetwork_handover_optimisation",
|
||||
"X2AP_CauseRadioNetwork_value_out_of_allowed_range",
|
||||
"X2AP_CauseRadioNetwork_multiple_E_RAB_ID_instances",
|
||||
"X2AP_CauseRadioNetwork_switch_off_ongoing",
|
||||
"X2AP_CauseRadioNetwork_not_supported_QCI_value",
|
||||
"X2AP_CauseRadioNetwork_measurement_not_supported_for_the_object",
|
||||
"X2AP_CauseRadioNetwork_tDCoverall_expiry",
|
||||
"X2AP_CauseRadioNetwork_tDCprep_expiry",
|
||||
"X2AP_CauseRadioNetwork_action_desirable_for_radio_reasons",
|
||||
"X2AP_CauseRadioNetwork_reduce_load",
|
||||
"X2AP_CauseRadioNetwork_resource_optimisation",
|
||||
"X2AP_CauseRadioNetwork_time_critical_action",
|
||||
"X2AP_CauseRadioNetwork_target_not_allowed",
|
||||
"X2AP_CauseRadioNetwork_no_radio_resources_available",
|
||||
"X2AP_CauseRadioNetwork_invalid_QoS_combination",
|
||||
"X2AP_CauseRadioNetwork_encryption_algorithms_not_supported",
|
||||
"X2AP_CauseRadioNetwork_procedure_cancelled",
|
||||
"X2AP_CauseRadioNetwork_rRM_purpose",
|
||||
"X2AP_CauseRadioNetwork_improve_user_bit_rate",
|
||||
"X2AP_CauseRadioNetwork_user_inactivity",
|
||||
"X2AP_CauseRadioNetwork_radio_connection_with_UE_lost",
|
||||
"X2AP_CauseRadioNetwork_bearer_option_not_supported",
|
||||
"X2AP_CauseRadioNetwork_mCG_Mobility",
|
||||
"X2AP_CauseRadioNetwork_sCG_Mobility",
|
||||
"X2AP_CauseRadioNetwork_count_reaches_max_value",
|
||||
"X2AP_CauseRadioNetwork_unknown_old_en_gNB_UE_X2AP_ID",
|
||||
"X2AP_CauseRadioNetwork_pDCP_Overload"};
|
||||
|
||||
const char *X2AP_cause_str_radio[2]={"X2AP_CauseTransport_transport_resource_unavailable",
|
||||
"X2AP_CauseTransport_unspecified"};
|
||||
const char *X2AP_cause_str_protocol[7]={" X2AP_CauseProtocol_transfer_syntax_error",
|
||||
"X2AP_CauseProtocol_abstract_syntax_error_reject",
|
||||
"X2AP_CauseProtocol_abstract_syntax_error_ignore_and_notify",
|
||||
"X2AP_CauseProtocol_message_not_compatible_with_receiver_state",
|
||||
"X2AP_CauseProtocol_semantic_error",
|
||||
"X2AP_CauseProtocol_unspecified",
|
||||
"X2AP_CauseProtocol_abstract_syntax_error_falsely_constructed_message"};
|
||||
const char *X2AP_cause_str_misc[5]={"X2AP_CauseMisc_control_processing_overload",
|
||||
"X2AP_CauseMisc_hardware_failure",
|
||||
"X2AP_CauseMisc_om_intervention",
|
||||
"X2AP_CauseMisc_not_enough_user_plane_processing_resources",
|
||||
"X2AP_CauseMisc_unspecified"};
|
||||
|
||||
|
||||
int
|
||||
x2ap_eNB_handle_x2_reset_response(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
x2ap_eNB_handle_x2_reset_request(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
X2AP_ResetRequest_t *ResetRequest;
|
||||
X2AP_ResetRequest_IEs_t *ie;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
MessageDef *msg;
|
||||
uint32_t eNB_id = 0;
|
||||
|
||||
DevAssert (pdu != NULL);
|
||||
ResetRequest = &pdu->choice.initiatingMessage.value.choice.ResetRequest;
|
||||
|
||||
X2AP_DEBUG("Received a new X2 reset request\n");
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_ResetRequest_IEs_t, ie, ResetRequest,
|
||||
X2AP_ProtocolIE_ID_id_Cause, true);
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
} else {
|
||||
AssertFatal(ie->value.present <= X2AP_Cause_PR_misc && ie->value.present > 0,"Cause value %d, is impossible\n",ie->value.present);
|
||||
LOG_I(X2AP,"Received X2AP Reset Request with Cause Type %s\n",X2AP_cause_str1[ie->value.present-1]);
|
||||
}
|
||||
|
||||
X2AP_DEBUG("Adding eNB to the list of associated eNBs\n");
|
||||
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_id_in_list (eNB_id)) == NULL) {
|
||||
/*
|
||||
* eNB has not been found in list of associated eNB,
|
||||
* * * * Add it to the tail of list and initialize data
|
||||
*/
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_assoc_id_in_list (assoc_id)) == NULL) {
|
||||
/*
|
||||
* ??
|
||||
*/
|
||||
return -1;
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
x2ap_eNB_data->eNB_id = eNB_id;
|
||||
}
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
/*
|
||||
* eNB has been found in list, consider the x2 setup request as a reset connection,
|
||||
* * * * reseting any previous UE state if sctp association is != than the previous one
|
||||
*/
|
||||
if (x2ap_eNB_data->assoc_id != assoc_id) {
|
||||
/*
|
||||
* ??: Send an overload cause...
|
||||
*/
|
||||
X2AP_ERROR("Reset Request: eNB id %d is already associated to an active sctp association" "Previous known: %d, new one: %d\n", eNB_id, x2ap_eNB_data->assoc_id, assoc_id);
|
||||
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* TODO: call the reset procedure
|
||||
*/
|
||||
}
|
||||
|
||||
msg = itti_alloc_new_message(TASK_X2AP, 0, X2AP_RESET_REQ);
|
||||
|
||||
X2AP_RESET_REQ(msg).cause = ie->value.present;
|
||||
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
|
||||
|
||||
return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data);
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
int x2ap_eNB_handle_x2_setup_response(instance_t instance,
|
||||
|
||||
Reference in New Issue
Block a user