add option to suspend/resume RBs at MAC upon signaling from RRC

This commit is contained in:
francescomani
2025-06-16 16:36:19 +02:00
parent f2e06a8b12
commit 3331a43b95
7 changed files with 48 additions and 3 deletions
+1
View File
@@ -88,6 +88,7 @@ MESSAGE_DEF(NRRRC_FRAME_PROCESS, MESSAGE_PRIORITY_MED, NRRrcFramePr
// UE: RRC -> MAC messages
MESSAGE_DEF(NR_MAC_RRC_CONFIG_RESET, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_reset_t, nr_mac_rrc_config_reset)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_CG, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_cg_t, nr_mac_rrc_config_cg)
MESSAGE_DEF(NR_MAC_RRC_RESUME_RB, MESSAGE_PRIORITY_MED, nr_mac_rrc_resume_rb_t, nr_mac_rrc_resume_rb)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_MIB, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_mib_t, nr_mac_rrc_config_mib)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_SIB1, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_sib1_t, nr_mac_rrc_config_sib1)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_OTHER_SIB, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_other_sib_t, nr_mac_rrc_config_other_sib)
+6
View File
@@ -107,6 +107,7 @@
#define NAS_PDU_SESSION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_pdu_session_req
#define NR_MAC_RRC_CONFIG_RESET(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_reset
#define NR_MAC_RRC_CONFIG_CG(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_cg
#define NR_MAC_RRC_RESUME_RB(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_resume_rb
#define NR_MAC_RRC_CONFIG_MIB(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_mib
#define NR_MAC_RRC_CONFIG_SIB1(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_sib1
#define NR_MAC_RRC_CONFIG_OTHER_SIB(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_other_sib
@@ -470,6 +471,11 @@ typedef struct {
int ue_id;
} RlcMaxRtxIndication;
typedef struct {
bool is_srb;
int rb_id;
} nr_mac_rrc_resume_rb_t;
typedef struct {
NR_ReestablishmentCause_t cause;
} nr_mac_rrc_config_reset_t;
+20
View File
@@ -826,6 +826,7 @@ static void nr_configure_lc_config(NR_UE_MAC_INST_t *mac,
{
NR_LC_SCHEDULING_INFO *lc_sched_info = get_scheduling_info_from_lcid(mac, lc_info->lcid);
lc_info->rb = rb;
lc_info->rb_suspended = false;
if (rb.type == NR_LCID_SRB && !mac_lc_config->ul_SpecificParameters) {
// release configuration and reset to default
set_default_logicalchannelconfig(lc_info, rb.choice.srb_id);
@@ -1729,6 +1730,13 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t
nr_ue_mac_default_configs(mac);
nr_ue_reset_sync_state(mac);
release_mac_configuration(mac, cause);
// suspend all RBs except SRB0
for (int j = 0; j < mac->lc_ordered_list.count; j++) {
nr_lcordered_info_t *lc = mac->lc_ordered_list.array[j];
if (lc->rb.type == NR_LCID_SRB && lc->rb.choice.srb_id == 0)
continue;
lc->rb_suspended = true;
}
// apply the timeAlignmentTimerCommon included in SIB1
configure_timeAlignmentTimer(&mac->time_alignment_timer, mac->timeAlignmentTimerCommon, mac->current_UL_BWP->scs);
// new sync with old cell ID (re-establishment on the same cell)
@@ -1743,6 +1751,18 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t
AssertFatal(!ret, "mutex failed %d\n", ret);
}
void nr_rrc_mac_resume_rb(module_id_t module_id, bool is_srb, int rb_id)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
for (int j = 0; j < mac->lc_ordered_list.count; j++) {
nr_lcordered_info_t *lc = mac->lc_ordered_list.array[j];
if (is_srb && lc->rb.type == NR_LCID_SRB && lc->rb.choice.srb_id == rb_id)
lc->rb_suspended = false;
if (!is_srb && lc->rb.type == NR_LCID_DRB && lc->rb.choice.drb_id == rb_id)
lc->rb_suspended = false;
}
}
static void configure_si_schedulingInfo(NR_UE_MAC_INST_t *mac,
NR_SI_SchedulingInfo_t *si_SchedulingInfo,
NR_SI_SchedulingInfo_v1700_t *si_SchedulingInfo_v1700)
+1
View File
@@ -451,6 +451,7 @@ typedef struct nr_lcordered_info_s {
bool sr_DelayTimerApplied;
bool lc_SRMask;
nr_lcid_rb_t rb;
bool rb_suspended;
} nr_lcordered_info_t;
typedef struct {
+1 -1
View File
@@ -93,7 +93,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *si
struct position; /* forward declaration */
void nr_rrc_mac_config_other_sib(module_id_t module_id, NR_SIB19_r17_t *sib19_r17, bool can_start_ra);
void nr_rrc_mac_resume_rb(module_id_t module_id, bool is_srb, int rb_id);
void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t cause);
/**\brief initialization NR UE MAC instance(s)*/
+3
View File
@@ -146,6 +146,9 @@ void process_msg_rcc_to_mac(MessageDef *msg)
bool can_start_ra = NR_MAC_RRC_CONFIG_OTHER_SIB(msg).can_start_ra;
nr_rrc_mac_config_other_sib(ue_id, NR_MAC_RRC_CONFIG_OTHER_SIB(msg).sib19, can_start_ra);
} break;
case NR_MAC_RRC_RESUME_RB:
nr_rrc_mac_resume_rb(ue_id, NR_MAC_RRC_RESUME_RB(msg).is_srb, NR_MAC_RRC_RESUME_RB(msg).rb_id);
break;
default:
LOG_E(NR_MAC, "Unexpected msg from RRC: %d\n", ITTI_MSG_ID(msg));
}
+16 -2
View File
@@ -894,6 +894,10 @@ static void nr_rrc_handle_msg3_indication(NR_UE_RRC_INST_t *rrc, rnti_t rnti)
nr_rlc_reconfigure_entity(rrc->ue_id, lc_id, NULL);
// resume SRB1
rrc->Srb[srb_id] = RB_ESTABLISHED;
MessageDef *msg = itti_alloc_new_message(TASK_RRC_NRUE, 0, NR_MAC_RRC_RESUME_RB);
NR_MAC_RRC_RESUME_RB(msg).is_srb = true;
NR_MAC_RRC_RESUME_RB(msg).rb_id = 1;
itti_send_msg_to_task(TASK_MAC_UE, rrc->ue_id, msg);
break;
case DURING_HANDOVER:
AssertFatal(1==0, "ra_trigger not implemented yet!\n");
@@ -1868,11 +1872,21 @@ static int nr_rrc_ue_decode_dcch(NR_UE_RRC_INST_t *rrc,
if (rrc->reconfig_after_reestab) {
// if this is the first RRCReconfiguration message after successful completion of the RRC re-establishment procedure
// resume SRB2 and DRBs that are suspended
if (rrc->Srb[2] == RB_SUSPENDED)
if (rrc->Srb[2] == RB_SUSPENDED) {
rrc->Srb[2] = RB_ESTABLISHED;
MessageDef *msg = itti_alloc_new_message(TASK_RRC_NRUE, 0, NR_MAC_RRC_RESUME_RB);
NR_MAC_RRC_RESUME_RB(msg).is_srb = true;
NR_MAC_RRC_RESUME_RB(msg).rb_id = 2;
itti_send_msg_to_task(TASK_MAC_UE, rrc->ue_id, msg);
}
for (int i = 1; i <= MAX_DRBS_PER_UE; i++) {
if (get_DRB_status(rrc, i) == RB_SUSPENDED)
if (get_DRB_status(rrc, i) == RB_SUSPENDED) {
set_DRB_status(rrc, i, RB_ESTABLISHED);
MessageDef *msg = itti_alloc_new_message(TASK_RRC_NRUE, 0, NR_MAC_RRC_RESUME_RB);
NR_MAC_RRC_RESUME_RB(msg).is_srb = false;
NR_MAC_RRC_RESUME_RB(msg).rb_id = i;
itti_send_msg_to_task(TASK_MAC_UE, rrc->ue_id, msg);
}
}
rrc->reconfig_after_reestab = false;
}