various improvements and fixes
This commit is contained in:
@@ -673,7 +673,7 @@ typedef struct
|
|||||||
} fapi_nr_prach_config_t;
|
} fapi_nr_prach_config_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16_t target_Nid_cell;
|
int16_t target_Nid_cell;
|
||||||
} fapi_nr_synch_request_t;
|
} fapi_nr_synch_request_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -675,9 +675,8 @@ static int lcid_cmp(const void *lc1, const void *lc2, void *mac_inst)
|
|||||||
return (lc_config[id1 - 1]->ul_SpecificParameters->priority - lc_config[id2 - 1]->ul_SpecificParameters->priority);
|
return (lc_config[id1 - 1]->ul_SpecificParameters->priority - lc_config[id2 - 1]->ul_SpecificParameters->priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_release_mac_config_logicalChannelBearer(module_id_t module_id, long channel_identity)
|
void nr_release_mac_config_logicalChannelBearer(NR_UE_MAC_INST_t *mac, long channel_identity)
|
||||||
{
|
{
|
||||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
|
||||||
if (mac->logicalChannelConfig[channel_identity - 1] != NULL) {
|
if (mac->logicalChannelConfig[channel_identity - 1] != NULL) {
|
||||||
ASN_STRUCT_FREE(asn_DEF_NR_LogicalChannelConfig, mac->logicalChannelConfig[channel_identity - 1]);
|
ASN_STRUCT_FREE(asn_DEF_NR_LogicalChannelConfig, mac->logicalChannelConfig[channel_identity - 1]);
|
||||||
mac->logicalChannelConfig[channel_identity - 1] = NULL;
|
mac->logicalChannelConfig[channel_identity - 1] = NULL;
|
||||||
@@ -750,7 +749,7 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
|
|||||||
for (int i = 0; i < rlc_torelease_list->list.count; i++) {
|
for (int i = 0; i < rlc_torelease_list->list.count; i++) {
|
||||||
if (rlc_torelease_list->list.array[i]) {
|
if (rlc_torelease_list->list.array[i]) {
|
||||||
int lc_identity = *rlc_torelease_list->list.array[i];
|
int lc_identity = *rlc_torelease_list->list.array[i];
|
||||||
nr_release_mac_config_logicalChannelBearer(module_id, lc_identity);
|
nr_release_mac_config_logicalChannelBearer(mac, lc_identity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1351,19 +1350,20 @@ static void configure_common_BWP_ul(NR_UE_MAC_INST_t *mac, int bwp_id, NR_BWP_Up
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_rrc_mac_config_req_reset(module_id_t module_id)
|
void nr_rrc_mac_config_req_reset(module_id_t module_id,
|
||||||
|
NR_UE_MAC_reset_cause_t reset_cause)
|
||||||
{
|
{
|
||||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||||
reset_mac_inst(mac);
|
reset_mac_inst(mac);
|
||||||
}
|
|
||||||
|
|
||||||
void nr_rrc_mac_config_req_release(module_id_t module_id)
|
|
||||||
{
|
|
||||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
|
||||||
|
|
||||||
reset_ra(&mac->ra);
|
reset_ra(&mac->ra);
|
||||||
|
|
||||||
release_mac_configuration(mac);
|
release_mac_configuration(mac);
|
||||||
|
|
||||||
|
for (int i = 0; i < NR_MAX_NUM_LCID; i++) {
|
||||||
|
nr_release_mac_config_logicalChannelBearer(mac, i + 1);
|
||||||
|
memset(&mac->lc_ordered_info[i], 0, sizeof(nr_lcordered_info_t));
|
||||||
|
}
|
||||||
|
|
||||||
mac->first_sync_frame = -1;
|
mac->first_sync_frame = -1;
|
||||||
mac->get_sib1 = false;
|
mac->get_sib1 = false;
|
||||||
mac->phy_config_request_sent = false;
|
mac->phy_config_request_sent = false;
|
||||||
@@ -1375,6 +1375,7 @@ void nr_rrc_mac_config_req_release(module_id_t module_id)
|
|||||||
mac->synch_request.CC_id = 0;
|
mac->synch_request.CC_id = 0;
|
||||||
mac->synch_request.synch_req.target_Nid_cell = -1;
|
mac->synch_request.synch_req.target_Nid_cell = -1;
|
||||||
mac->if_module->synch_request(&mac->synch_request);
|
mac->if_module->synch_request(&mac->synch_request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_rrc_mac_config_req_sib1(module_id_t module_id,
|
void nr_rrc_mac_config_req_sib1(module_id_t module_id,
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ typedef enum {
|
|||||||
UE_CONNECTED
|
UE_CONNECTED
|
||||||
} NR_UE_L2_STATE_t;
|
} NR_UE_L2_STATE_t;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
GO_TO_IDLE,
|
||||||
|
RE_ESTABLISHMENT
|
||||||
|
} NR_UE_MAC_reset_cause_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
RA_2STEP = 0,
|
RA_2STEP = 0,
|
||||||
RA_4STEP
|
RA_4STEP
|
||||||
|
|||||||
@@ -170,8 +170,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
|
|||||||
NR_SI_SchedulingInfo_t *si_SchedulingInfo,
|
NR_SI_SchedulingInfo_t *si_SchedulingInfo,
|
||||||
NR_ServingCellConfigCommonSIB_t *scc);
|
NR_ServingCellConfigCommonSIB_t *scc);
|
||||||
|
|
||||||
void nr_rrc_mac_config_req_reset(module_id_t module_id);
|
void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t cause);
|
||||||
void nr_rrc_mac_config_req_release(module_id_t module_id);
|
|
||||||
|
|
||||||
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
|
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
|
||||||
NR_UE_MAC_INST_t * nr_l2_init_ue();
|
NR_UE_MAC_INST_t * nr_l2_init_ue();
|
||||||
|
|||||||
@@ -181,17 +181,21 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac)
|
|||||||
|
|
||||||
void release_mac_configuration(NR_UE_MAC_INST_t *mac)
|
void release_mac_configuration(NR_UE_MAC_INST_t *mac)
|
||||||
{
|
{
|
||||||
if(mac->mib)
|
if(mac->mib) {
|
||||||
ASN_STRUCT_FREE(asn_DEF_NR_MIB, mac->mib);
|
ASN_STRUCT_FREE(asn_DEF_NR_MIB, mac->mib);
|
||||||
|
mac->mib = NULL;
|
||||||
|
}
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
NR_BWP_PDCCH_t *pdcch = &mac->config_BWP_PDCCH[5];
|
NR_BWP_PDCCH_t *pdcch = &mac->config_BWP_PDCCH[5];
|
||||||
release_common_ss_cset(pdcch);
|
release_common_ss_cset(pdcch);
|
||||||
for (int j = 0; j < pdcch->list_Coreset.count; j++)
|
for (int j = 0; j < pdcch->list_Coreset.count; j++)
|
||||||
asn_sequence_del(&pdcch->list_Coreset, j, 1);
|
asn_sequence_del(&pdcch->list_Coreset, j, 1);
|
||||||
for (int j = 0; j < pdcch->list_SS.count; j++)
|
for (int j = 0; j < pdcch->list_SS.count; j++)
|
||||||
asn_sequence_del(&pdcch->list_SS, j, 1);
|
asn_sequence_del(&pdcch->list_SS, j, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(&mac->current_DL_BWP, 0, sizeof(mac->current_DL_BWP));
|
||||||
|
memset(&mac->current_UL_BWP, 0, sizeof(mac->current_UL_BWP));
|
||||||
memset(&mac->ssb_measurements, 0, sizeof(mac->ssb_measurements));
|
memset(&mac->ssb_measurements, 0, sizeof(mac->ssb_measurements));
|
||||||
memset(&mac->csirs_measurements, 0, sizeof(mac->csirs_measurements));
|
memset(&mac->csirs_measurements, 0, sizeof(mac->csirs_measurements));
|
||||||
memset(&mac->ul_time_alignment, 0, sizeof(mac->ul_time_alignment));
|
memset(&mac->ul_time_alignment, 0, sizeof(mac->ul_time_alignment));
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ static void release_rlc_entity_from_lcid(nr_rlc_ue_t *ue, logical_chan_id_t chan
|
|||||||
return;
|
return;
|
||||||
if (rb->type == NR_RLC_SRB) {
|
if (rb->type == NR_RLC_SRB) {
|
||||||
int id = rb->choice.srb_id - 1;
|
int id = rb->choice.srb_id - 1;
|
||||||
AssertFatal(id > 0, "logic bug: impossible to have srb0 here\n");
|
AssertFatal(id >= 0, "logic bug: impossible to have srb0 here\n");
|
||||||
if (ue->srb[id]) {
|
if (ue->srb[id]) {
|
||||||
ue->srb[id]->delete_entity(ue->srb[id]);
|
ue->srb[id]->delete_entity(ue->srb[id]);
|
||||||
ue->srb[id] = NULL;
|
ue->srb[id] = NULL;
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
#include "rrc_defs.h"
|
#include "rrc_defs.h"
|
||||||
#include "rrc_proto.h"
|
#include "rrc_proto.h"
|
||||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||||
#include "COMMON/mac_rrc_primitives.h"
|
|
||||||
|
|
||||||
#include "intertask_interface.h"
|
#include "intertask_interface.h"
|
||||||
|
|
||||||
@@ -1846,8 +1845,7 @@ void nr_rrc_going_to_IDLE(instance_t instance,
|
|||||||
{
|
{
|
||||||
NR_UE_RRC_INST_t *rrc = &NR_UE_rrc_inst[instance];
|
NR_UE_RRC_INST_t *rrc = &NR_UE_rrc_inst[instance];
|
||||||
NR_UE_Timers_Constants_t *tac = &rrc->timers_and_constants;
|
NR_UE_Timers_Constants_t *tac = &rrc->timers_and_constants;
|
||||||
// reset MAC
|
|
||||||
nr_rrc_mac_config_req_reset(instance);
|
|
||||||
// if going to RRC_IDLE was triggered by reception
|
// if going to RRC_IDLE was triggered by reception
|
||||||
// of the RRCRelease message including a waitTime
|
// of the RRCRelease message including a waitTime
|
||||||
NR_RejectWaitTime_t *waitTime = NULL;
|
NR_RejectWaitTime_t *waitTime = NULL;
|
||||||
@@ -1915,11 +1913,30 @@ void nr_rrc_going_to_IDLE(instance_t instance,
|
|||||||
// discard the keys (only kgnb is stored)
|
// discard the keys (only kgnb is stored)
|
||||||
memset(rrc->kgnb, 0, sizeof(rrc->kgnb));
|
memset(rrc->kgnb, 0, sizeof(rrc->kgnb));
|
||||||
|
|
||||||
// TODO release all radio resources, including release of the RLC entity,
|
// release all radio resources, including release of the RLC entity,
|
||||||
// the MAC configuration and the associated PDCP entity
|
// the MAC configuration and the associated PDCP entity
|
||||||
// and SDAP for all established RBs
|
// and SDAP for all established RBs
|
||||||
nr_pdcp_remove_UE(rrc->rnti);
|
for (int j = 0; j < NB_CNX_UE; j++) {
|
||||||
nr_rlc_remove_ue(rrc->rnti);
|
rrcPerNB_t *nb = &rrc->perNB[j];
|
||||||
|
for (int i = 0; i < MAX_DRBS_PER_UE; i++) {
|
||||||
|
if (nb->status_DRBs[i] != RB_NOT_PRESENT) {
|
||||||
|
nb->status_DRBs[i] = RB_NOT_PRESENT;
|
||||||
|
nr_pdcp_release_drb(rrc->rnti, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 1; i < NR_NUM_SRB; i++) {
|
||||||
|
if (nb->Srb[i] != RB_NOT_PRESENT) {
|
||||||
|
nb->Srb[i] = RB_NOT_PRESENT;
|
||||||
|
nr_pdcp_release_srb(rrc->rnti, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < NR_MAX_NUM_LCID; i++) {
|
||||||
|
if (nb->active_RLC_entity[i]) {
|
||||||
|
nb->active_RLC_entity[i] = false;
|
||||||
|
nr_rlc_release_entity(rrc->rnti, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(rrc->meas_config) {
|
if(rrc->meas_config) {
|
||||||
ASN_STRUCT_FREE(asn_DEF_NR_MeasConfig, rrc->meas_config);
|
ASN_STRUCT_FREE(asn_DEF_NR_MeasConfig, rrc->meas_config);
|
||||||
@@ -1987,7 +2004,9 @@ void nr_rrc_going_to_IDLE(instance_t instance,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nr_rrc_mac_config_req_release(instance);
|
// reset MAC
|
||||||
|
NR_UE_MAC_reset_cause_t cause = GO_TO_IDLE;
|
||||||
|
nr_rrc_mac_config_req_reset(instance, cause);
|
||||||
|
|
||||||
// enter RRC_IDLE
|
// enter RRC_IDLE
|
||||||
rrc->nrRrcState = RRC_STATE_IDLE_NR;
|
rrc->nrRrcState = RRC_STATE_IDLE_NR;
|
||||||
|
|||||||
@@ -491,7 +491,7 @@ bool nr_sdap_delete_entity(ue_id_t ue_id, int pdusession_id)
|
|||||||
int upperBound = 0;
|
int upperBound = 0;
|
||||||
|
|
||||||
if (entityPtr == NULL && (pdusession_id) * (pdusession_id - NGAP_MAX_PDU_SESSION) > 0) {
|
if (entityPtr == NULL && (pdusession_id) * (pdusession_id - NGAP_MAX_PDU_SESSION) > 0) {
|
||||||
LOG_W(SDAP, "SDAP entities not established or Invalid range of pdusession_id [0, 256].\n");
|
LOG_E(SDAP, "SDAP entities not established or Invalid range of pdusession_id [0, 256].\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
LOG_D(SDAP, "Deleting SDAP entity for UE %lx and PDU Session id %d\n", ue_id, entityPtr->pdusession_id);
|
LOG_D(SDAP, "Deleting SDAP entity for UE %lx and PDU Session id %d\n", ue_id, entityPtr->pdusession_id);
|
||||||
@@ -516,7 +516,7 @@ bool nr_sdap_delete_entity(ue_id_t ue_id, int pdusession_id)
|
|||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG_W(SDAP, "Entity does not exist or it was not found.\n");
|
LOG_E(SDAP, "Entity does not exist or it was not found.\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user