discard rx PDU if RB is suspended
This commit is contained in:
@@ -1751,6 +1751,17 @@ 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);
|
||||
}
|
||||
|
||||
bool is_lcid_suspended(NR_UE_MAC_INST_t *mac, int lcid)
|
||||
{
|
||||
for (int j = 0; j < mac->lc_ordered_list.count; j++) {
|
||||
nr_lcordered_info_t *lc = mac->lc_ordered_list.array[j];
|
||||
if (lc->lcid == lcid)
|
||||
return lc->rb_suspended;
|
||||
}
|
||||
LOG_E(NR_MAC, "LCID %d not found in the MAC list\n", lcid);
|
||||
return false;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -293,7 +293,7 @@ void configure_csi_resource_mapping(fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_c
|
||||
uint32_t bwp_size,
|
||||
uint32_t bwp_start);
|
||||
|
||||
|
||||
bool is_lcid_suspended(NR_UE_MAC_INST_t *mac, int lcid);
|
||||
void nr_ra_contention_resolution_failed(NR_UE_MAC_INST_t *mac);
|
||||
void nr_ra_succeeded(NR_UE_MAC_INST_t *mac, const uint8_t gNB_index, const frame_t frame, const int slot);
|
||||
void nr_ra_backoff_setting(RA_config_t *ra);
|
||||
|
||||
@@ -3734,7 +3734,7 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
|
||||
|
||||
LOG_D(MAC, "[UE] LCID %d, PDU length %d\n", rx_lcid, pdu_len);
|
||||
bool ret;
|
||||
switch(rx_lcid){
|
||||
switch (rx_lcid) {
|
||||
// MAC CE
|
||||
case DL_SCH_LCID_CCCH:
|
||||
// MSG4 RRC Setup 38.331
|
||||
@@ -3871,6 +3871,11 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
|
||||
case 1 ... 32:
|
||||
if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len))
|
||||
return;
|
||||
// discard the received subPDU if RB is suspended
|
||||
if (is_lcid_suspended(mac, rx_lcid)) {
|
||||
LOG_W(NR_MAC, "Received PDU for a suspended RB, corresponding to LCID %d. Dropping it.\n", rx_lcid);
|
||||
break;
|
||||
}
|
||||
LOG_D(NR_MAC, "%4d.%2d : DLSCH -> LCID %d %d bytes\n", frameP, slot, rx_lcid, mac_len);
|
||||
nr_mac_rlc_data_ind(mac->ue_id, mac->ue_id, false, rx_lcid, (char *)(pduP + mac_subheader_len), mac_len);
|
||||
break;
|
||||
@@ -3878,8 +3883,8 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
|
||||
LOG_W(MAC, "unknown lcid %02x\n", rx_lcid);
|
||||
break;
|
||||
}
|
||||
pduP += ( mac_subheader_len + mac_len );
|
||||
pdu_len -= ( mac_subheader_len + mac_len );
|
||||
pduP += (mac_subheader_len + mac_len);
|
||||
pdu_len -= (mac_subheader_len + mac_len);
|
||||
if (pdu_len < 0)
|
||||
LOG_E(MAC, "[UE %d][%d.%d] nr_ue_process_mac_pdu, residual mac pdu length %d < 0!\n", mac->ue_id, frameP, slot, pdu_len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user