Commit 59413c18 authored by francescomani's avatar francescomani

implementation of scheduling of msg3 retransmission at gnb

parent efc696cc
...@@ -607,6 +607,7 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp, ...@@ -607,6 +607,7 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp,
uint8_t tpc, uint8_t tpc,
int n_ubwp, int n_ubwp,
int bwp_id) { int bwp_id) {
const int bw = NRRIV2BW(ubwp ? const int bw = NRRIV2BW(ubwp ?
ubwp->bwp_Common->genericParameters.locationAndBandwidth : ubwp->bwp_Common->genericParameters.locationAndBandwidth :
scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
......
...@@ -523,7 +523,6 @@ void handle_nr_ul_harq(module_id_t mod_id, ...@@ -523,7 +523,6 @@ void handle_nr_ul_harq(module_id_t mod_id,
} }
NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info; NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
int8_t harq_pid = sched_ctrl->feedback_ul_harq.head; int8_t harq_pid = sched_ctrl->feedback_ul_harq.head;
while (crc_pdu->harq_id != harq_pid || harq_pid < 0) { while (crc_pdu->harq_id != harq_pid || harq_pid < 0) {
LOG_W(NR_MAC, LOG_W(NR_MAC,
...@@ -586,6 +585,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -586,6 +585,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const uint16_t timing_advance, const uint16_t timing_advance,
const uint8_t ul_cqi, const uint8_t ul_cqi,
const uint16_t rssi){ const uint16_t rssi){
gNB_MAC_INST *gNB_mac = RC.nrmac[gnb_mod_idP]; gNB_MAC_INST *gNB_mac = RC.nrmac[gnb_mod_idP];
NR_UE_info_t *UE_info = &gNB_mac->UE_info; NR_UE_info_t *UE_info = &gNB_mac->UE_info;
...@@ -784,9 +784,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -784,9 +784,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if (ra->state != WAIT_Msg3) if (ra->state != WAIT_Msg3)
continue; continue;
LOG_W(NR_MAC, "Random Access %i failed at state %i (state is not WAIT_Msg3)\n", i, ra->state); if( (frameP!=ra->Msg3_frame) || (slotP!=ra->Msg3_slot))
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); continue;
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
LOG_W(NR_MAC, "Random Access %i failed at state %i (CRC did not pass)\n", i, ra->state);
ra->state = Msg3_retransmission;
} }
} }
} }
......
...@@ -124,6 +124,8 @@ void nr_get_Msg3alloc(module_id_t module_id, ...@@ -124,6 +124,8 @@ void nr_get_Msg3alloc(module_id_t module_id,
NR_RA_t *ra, NR_RA_t *ra,
int16_t *tdd_beam_association); int16_t *tdd_beam_association);
void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, NR_RA_t *ra);
/* \brief Function in gNB to fill RAR pdu when requested by PHY. /* \brief Function in gNB to fill RAR pdu when requested by PHY.
@param ra Instance of RA resources of gNB @param ra Instance of RA resources of gNB
@param dlsch_buffer Pointer to RAR input buffer @param dlsch_buffer Pointer to RAR input buffer
...@@ -134,6 +136,14 @@ void nr_fill_rar(uint8_t Mod_idP, ...@@ -134,6 +136,14 @@ void nr_fill_rar(uint8_t Mod_idP,
uint8_t * dlsch_buffer, uint8_t * dlsch_buffer,
nfapi_nr_pusch_pdu_t *pusch_pdu); nfapi_nr_pusch_pdu_t *pusch_pdu);
void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
NR_ServingCellConfigCommon_t *scc,
int startSymbolAndLength,
rnti_t rnti, int scs,
int bwp_size, int bwp_start,
int mappingtype, int fh,
int msg3_first_rb, int msg3_nb_rb);
void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP); void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP);
......
...@@ -93,8 +93,9 @@ typedef enum { ...@@ -93,8 +93,9 @@ typedef enum {
RA_IDLE = 0, RA_IDLE = 0,
Msg2 = 1, Msg2 = 1,
WAIT_Msg3 = 2, WAIT_Msg3 = 2,
Msg4 = 3, Msg3_retransmission = 3,
WAIT_Msg4_ACK = 4 Msg4 = 4,
WAIT_Msg4_ACK = 5
} RA_gNB_state_t; } RA_gNB_state_t;
typedef struct NR_preamble_ue { typedef struct NR_preamble_ue {
......
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