Commit 6a79c29e authored by francescomani's avatar francescomani

trigger RA DL or UL data arrival during RRC_CONNECTED when UL synchronisation...

trigger RA DL or UL data arrival during RRC_CONNECTED when UL synchronisation status is non-synchronised
parent 6ff75c46
...@@ -312,6 +312,7 @@ void free_rach_structures(NR_UE_MAC_INST_t *nr_mac, int bwp_id); ...@@ -312,6 +312,7 @@ void free_rach_structures(NR_UE_MAC_INST_t *nr_mac, int bwp_id);
void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac); void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac);
void nr_Msg1_transmitted(NR_UE_MAC_INST_t *mac); void nr_Msg1_transmitted(NR_UE_MAC_INST_t *mac);
void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac, uint8_t CC_id, frame_t frameP, slot_t slotP, uint8_t gNB_id); void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac, uint8_t CC_id, frame_t frameP, slot_t slotP, uint8_t gNB_id);
void trigger_MAC_UE_RA(NR_UE_MAC_INST_t *mac);
void nr_get_msg3_payload(NR_UE_MAC_INST_t *mac, uint8_t *buf, int TBS_max); void nr_get_msg3_payload(NR_UE_MAC_INST_t *mac, uint8_t *buf, int TBS_max);
void handle_time_alignment_timer_expired(NR_UE_MAC_INST_t *mac); void handle_time_alignment_timer_expired(NR_UE_MAC_INST_t *mac);
int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
......
...@@ -908,23 +908,12 @@ void nr_ra_failed(NR_UE_MAC_INST_t *mac, uint8_t CC_id, NR_PRACH_RESOURCES_t *pr ...@@ -908,23 +908,12 @@ void nr_ra_failed(NR_UE_MAC_INST_t *mac, uint8_t CC_id, NR_PRACH_RESOURCES_t *pr
} }
} }
void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac) void trigger_MAC_UE_RA(NR_UE_MAC_INST_t *mac)
{ {
LOG_W(NR_MAC, "Triggering new RA procedure for UE with RNTI %x\n", mac->crnti); LOG_W(NR_MAC, "Triggering new RA procedure for UE with RNTI %x\n", mac->crnti);
mac->state = UE_SYNC; mac->state = UE_SYNC;
reset_ra(mac, false); reset_ra(mac, false);
mac->ra.msg3_C_RNTI = true; mac->ra.msg3_C_RNTI = true;
// release PUCCH for all Serving Cells;
// release SRS for all Serving Cells;
release_PUCCH_SRS(mac);
// clear any configured downlink assignments and uplink grants;
int scs = mac->current_UL_BWP->scs;
if (mac->dl_config_request)
memset(mac->dl_config_request, 0, sizeof(*mac->dl_config_request));
if (mac->ul_config_request)
clear_ul_config_request(mac, scs);
// clear any PUSCH resources for semi-persistent CSI reporting
// TODO we don't have semi-persistent CSI reporting
} }
void prepare_msg4_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack) void prepare_msg4_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack)
......
...@@ -2823,6 +2823,11 @@ void nr_ue_send_sdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info, in ...@@ -2823,6 +2823,11 @@ void nr_ue_send_sdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info, in
// it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs // it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs
switch (dl_info->rx_ind->rx_indication_body[pdu_id].pdu_type) { switch (dl_info->rx_ind->rx_indication_body[pdu_id].pdu_type) {
case FAPI_NR_RX_PDU_TYPE_DLSCH : case FAPI_NR_RX_PDU_TYPE_DLSCH :
// DL data arrival during RRC_CONNECTED when UL synchronisation status is "non-synchronised"
if (!is_nr_timer_active(mac->time_alignment_timer) && mac->state == UE_CONNECTED) {
trigger_MAC_UE_RA(mac);
break;
}
nr_ue_process_mac_pdu(mac, dl_info, pdu_id); nr_ue_process_mac_pdu(mac, dl_info, pdu_id);
break; break;
case FAPI_NR_RX_PDU_TYPE_RAR : case FAPI_NR_RX_PDU_TYPE_RAR :
......
...@@ -1236,6 +1236,22 @@ static bool check_pucchres_for_pending_SR(NR_PUCCH_Config_t *pucch_Config, int t ...@@ -1236,6 +1236,22 @@ static bool check_pucchres_for_pending_SR(NR_PUCCH_Config_t *pucch_Config, int t
return false; return false;
} }
void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac)
{
trigger_MAC_UE_RA(mac);
// release PUCCH for all Serving Cells;
// release SRS for all Serving Cells;
release_PUCCH_SRS(mac);
// clear any configured downlink assignments and uplink grants;
int scs = mac->current_UL_BWP->scs;
if (mac->dl_config_request)
memset(mac->dl_config_request, 0, sizeof(*mac->dl_config_request));
if (mac->ul_config_request)
clear_ul_config_request(mac, scs);
// clear any PUSCH resources for semi-persistent CSI reporting
// TODO we don't have semi-persistent CSI reporting
}
static void nr_update_sr(NR_UE_MAC_INST_t *mac) static void nr_update_sr(NR_UE_MAC_INST_t *mac)
{ {
NR_UE_SCHEDULING_INFO *sched_info = &mac->scheduling_info; NR_UE_SCHEDULING_INFO *sched_info = &mac->scheduling_info;
...@@ -1424,6 +1440,11 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info) ...@@ -1424,6 +1440,11 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
} else { } else {
if (ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator if (ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator
&& (mac->state == UE_CONNECTED || (ra->ra_state == nrRA_WAIT_RAR && ra->cfra))) { && (mac->state == UE_CONNECTED || (ra->ra_state == nrRA_WAIT_RAR && ra->cfra))) {
if (!is_nr_timer_active(mac->time_alignment_timer) && mac->state == UE_CONNECTED) {
// UL data arrival during RRC_CONNECTED when UL synchronisation status is "non-synchronised"
trigger_MAC_UE_RA(mac);
return;
}
// Getting IP traffic to be transmitted // Getting IP traffic to be transmitted
nr_ue_get_sdu(mac, cc_id, frame_tx, slot_tx, gNB_index, ulsch_input_buffer, TBS_bytes); nr_ue_get_sdu(mac, cc_id, frame_tx, slot_tx, gNB_index, ulsch_input_buffer, TBS_bytes);
ulcfg_pdu->pusch_config_pdu.tx_request_body.fapiTxPdu = ulsch_input_buffer; ulcfg_pdu->pusch_config_pdu.tx_request_body.fapiTxPdu = ulsch_input_buffer;
......
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