Commit e8be11da authored by Francesco Mani's avatar Francesco Mani

changes in ta procedure at gnb, to be tested with the phone

parent 4776e13c
...@@ -338,7 +338,6 @@ void nr_schedule_pucch(int Mod_idP, ...@@ -338,7 +338,6 @@ void nr_schedule_pucch(int Mod_idP,
O_ack = curr_pucch->dai_c; O_ack = curr_pucch->dai_c;
O_uci = O_ack + curr_pucch->csi_bits; // for now we are just sending acknacks in pucch O_uci = O_ack + curr_pucch->csi_bits; // for now we are just sending acknacks in pucch
if ((O_uci>0 || SR_flag==1) && (frameP == curr_pucch->frame) && (slotP == curr_pucch->ul_slot)) { if ((O_uci>0 || SR_flag==1) && (frameP == curr_pucch->frame) && (slotP == curr_pucch->ul_slot)) {
UL_tti_req->SFN = curr_pucch->frame; UL_tti_req->SFN = curr_pucch->frame;
UL_tti_req->Slot = curr_pucch->ul_slot; UL_tti_req->Slot = curr_pucch->ul_slot;
UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE; UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE;
...@@ -477,20 +476,15 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -477,20 +476,15 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
else else
UE_list->fiveG_connected[UE_id] = true; UE_list->fiveG_connected[UE_id] = true;
if (get_softmodem_params()->phy_test) { if (UE_list->fiveG_connected[UE_id]) {
// TbD once RACH is available, start ta_timer when UE is connected // TbD once RACH is available, start ta_timer when UE is connected
if (ue_sched_ctl->ta_timer) if (ue_sched_ctl->ta_timer)
ue_sched_ctl->ta_timer--; ue_sched_ctl->ta_timer--;
if (ue_sched_ctl->ta_timer == 0) { if (ue_sched_ctl->ta_timer == 0) {
gNB->ta_command = ue_sched_ctl->ta_update; ue_sched_ctl->ta_apply = true;
/* if time is up, then set the timer to not send it for 5 frames /* if time is up, then set the timer to not send it for 5 frames
// regardless of the TA value */ // regardless of the TA value */
ue_sched_ctl->ta_timer = 100; ue_sched_ctl->ta_timer = 100;
/* reset ta_update */
ue_sched_ctl->ta_update = 31;
/* MAC CE flag indicating TA length */
gNB->ta_len = 2;
} }
} }
...@@ -505,8 +499,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -505,8 +499,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
ue_sched_ctl->current_harq_pid = slot % num_slots_per_tdd; ue_sched_ctl->current_harq_pid = slot % num_slots_per_tdd;
nr_acknack_scheduling(module_idP, UE_id, frame, slot, num_slots_per_tdd,&pucch_sched,&pucch_occ); nr_acknack_scheduling(module_idP, UE_id, frame, slot, num_slots_per_tdd,&pucch_sched,&pucch_occ);
nr_schedule_uss_dlsch_phytest(module_idP, frame, slot, &UE_list->UE_sched_ctrl[UE_id].sched_pucch[pucch_sched][pucch_occ], NULL); nr_schedule_uss_dlsch_phytest(module_idP, frame, slot, &UE_list->UE_sched_ctrl[UE_id].sched_pucch[pucch_sched][pucch_occ], NULL);
// resetting ta flag ue_sched_ctl->ta_apply = false;
gNB->ta_len = 0;
} }
if (UE_list->fiveG_connected[UE_id]) if (UE_list->fiveG_connected[UE_id])
......
...@@ -91,13 +91,13 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, ...@@ -91,13 +91,13 @@ int nr_generate_dlsch_pdu(module_id_t module_idP,
// now TA is always send when ta_timer resets regardless of its value // now TA is always send when ta_timer resets regardless of its value
// this is done to avoid issues with the timeAlignmentTimer which is // this is done to avoid issues with the timeAlignmentTimer which is
// supposed to monitor if the UE received TA or not */ // supposed to monitor if the UE received TA or not */
if (gNB->ta_len) { if (ue_sched_ctl->ta_apply) {
mac_pdu_ptr->R = 0; mac_pdu_ptr->R = 0;
mac_pdu_ptr->LCID = DL_SCH_LCID_TA_COMMAND; mac_pdu_ptr->LCID = DL_SCH_LCID_TA_COMMAND;
//last_size = 1; //last_size = 1;
mac_pdu_ptr++; mac_pdu_ptr++;
// TA MAC CE (1 octet) // TA MAC CE (1 octet)
timing_advance_cmd = gNB->ta_command; timing_advance_cmd = ue_sched_ctl->ta_update;
AssertFatal(timing_advance_cmd < 64, "timing_advance_cmd %d > 63\n", timing_advance_cmd); AssertFatal(timing_advance_cmd < 64, "timing_advance_cmd %d > 63\n", timing_advance_cmd);
((NR_MAC_CE_TA *) ce_ptr)->TA_COMMAND = timing_advance_cmd; //(timing_advance_cmd+31)&0x3f; ((NR_MAC_CE_TA *) ce_ptr)->TA_COMMAND = timing_advance_cmd; //(timing_advance_cmd+31)&0x3f;
......
...@@ -592,7 +592,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, ...@@ -592,7 +592,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
LOG_D(MAC, "In nr_schedule_uss_dlsch_phytest frame %d slot %d\n",frameP,slotP); LOG_D(MAC, "In nr_schedule_uss_dlsch_phytest frame %d slot %d\n",frameP,slotP);
int post_padding = 0, ta_len = 0, header_length_total = 0, sdu_length_total = 0, num_sdus = 0; int post_padding = 0, header_length_total = 0, sdu_length_total = 0, num_sdus = 0;
int lcid, offset, i, header_length_last, TBS_bytes = 0; int lcid, offset, i, header_length_last, TBS_bytes = 0;
int UE_id = 0, CC_id = 0; int UE_id = 0, CC_id = 0;
...@@ -611,12 +611,13 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, ...@@ -611,12 +611,13 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
unsigned char sdu_lcids[NB_RB_MAX] = {0}; unsigned char sdu_lcids[NB_RB_MAX] = {0};
uint16_t sdu_lengths[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0};
uint16_t rnti = UE_list->rnti[UE_id]; uint16_t rnti = UE_list->rnti[UE_id];
NR_UE_sched_ctrl_t *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES]; uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES];
LOG_D(MAC, "Scheduling UE specific search space DCI type 1\n"); LOG_D(MAC, "Scheduling UE specific search space DCI type 1\n");
ta_len = gNB_mac->ta_len; int ta_len = (ue_sched_ctl->ta_apply)?2:0;
TBS_bytes = configure_fapi_dl_pdu(module_idP, TBS_bytes = configure_fapi_dl_pdu(module_idP,
dl_req, dl_req,
......
...@@ -310,6 +310,7 @@ typedef struct { ...@@ -310,6 +310,7 @@ typedef struct {
NR_sched_pusch *sched_pusch; NR_sched_pusch *sched_pusch;
uint16_t ta_timer; uint16_t ta_timer;
int16_t ta_update; int16_t ta_update;
bool ta_apply;
uint8_t tpc0; uint8_t tpc0;
uint8_t tpc1; uint8_t tpc1;
uint16_t ul_rssi; uint16_t ul_rssi;
...@@ -362,10 +363,6 @@ typedef struct gNB_MAC_INST_s { ...@@ -362,10 +363,6 @@ typedef struct gNB_MAC_INST_s {
int pusch_target_snrx10; int pusch_target_snrx10;
/// Pucch target SNR /// Pucch target SNR
int pucch_target_snrx10; int pucch_target_snrx10;
/// TA command
int ta_command;
/// MAC CE flag indicating TA length
int ta_len;
/// Common cell resources /// Common cell resources
NR_COMMON_channels_t common_channels[NFAPI_CC_MAX]; NR_COMMON_channels_t common_channels[NFAPI_CC_MAX];
/// current PDU index (BCH,DLSCH) /// current PDU index (BCH,DLSCH)
......
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