allowing TA CE commands in Msg4

This commit is contained in:
yagoda 2019-12-20 12:56:17 +00:00 committed by Andre Puschmann
parent bca5d1a95a
commit 2db90c5dd3
2 changed files with 18 additions and 13 deletions

View File

@ -444,16 +444,13 @@ int sched_ue::generate_format1(dl_harq_proc* h,
data->nof_pdu_elems[0]++; data->nof_pdu_elems[0]++;
conres_ce_pending = false; conres_ce_pending = false;
Info("SCHED: Added MAC Contention Resolution CE for rnti=0x%x\n", rnti); Info("SCHED: Added MAC Contention Resolution CE for rnti=0x%x\n", rnti);
} else { }
// Add TA CE while (nof_ta_cmd > 0 && rem_tbs > 2) {
// TODO: Can't put it in Msg4 because current srsUE doesn't read it data->pdu[0][data->nof_pdu_elems[0]].lcid = srslte::sch_subh::TA_CMD;
while (nof_ta_cmd > 0 && rem_tbs > 2) { data->nof_pdu_elems[0]++;
data->pdu[0][data->nof_pdu_elems[0]].lcid = srslte::sch_subh::TA_CMD; Info("SCHED: Added MAC TA CMD CE for rnti=0x%x\n", rnti);
data->nof_pdu_elems[0]++; nof_ta_cmd--;
Info("SCHED: Added MAC TA CMD CE for rnti=0x%x\n", rnti); rem_tbs -= 2;
nof_ta_cmd--;
rem_tbs -= 2;
}
} }
do { do {
@ -805,7 +802,7 @@ uint32_t sched_ue::get_pending_dl_new_data_unlocked()
pending_data += lch[i].buf_retx + lch[i].buf_tx; pending_data += lch[i].buf_retx + lch[i].buf_tx;
} }
} }
if (not is_first_dl_tx() and nof_ta_cmd > 0) { if (nof_ta_cmd > 0) {
pending_data += nof_ta_cmd * 2; pending_data += nof_ta_cmd * 2;
} }
return pending_data; return pending_data;

View File

@ -97,12 +97,20 @@ void demux::push_pdu_temp_crnti(uint8_t* buff, uint32_t nof_bytes)
pending_mac_msg.init_rx(nof_bytes); pending_mac_msg.init_rx(nof_bytes);
pending_mac_msg.parse_packet(buff); pending_mac_msg.parse_packet(buff);
// Look for Contention Resolution UE ID // Look for Contention Resolution UE ID and TA commands
is_uecrid_successful = false; is_uecrid_successful = false;
while (pending_mac_msg.next() && !is_uecrid_successful) { while (pending_mac_msg.next()) {
if (pending_mac_msg.get()->ce_type() == srslte::sch_subh::CON_RES_ID) { if (pending_mac_msg.get()->ce_type() == srslte::sch_subh::CON_RES_ID) {
Debug("Found Contention Resolution ID CE\n"); Debug("Found Contention Resolution ID CE\n");
is_uecrid_successful = mac->contention_resolution_id_rcv(pending_mac_msg.get()->get_con_res_id()); is_uecrid_successful = mac->contention_resolution_id_rcv(pending_mac_msg.get()->get_con_res_id());
} else if (pending_mac_msg.get()->ce_type() == srslte::sch_subh::TA_CMD) {
phy_h->set_timeadv(pending_mac_msg.get()->get_ta_cmd());
Info("Received TA=%d (%d/%d) \n", pending_mac_msg.get()->get_ta_cmd(),
time_alignment_timer->value(), time_alignment_timer->duration());
// Start or restart timeAlignmentTimer only if set
if (time_alignment_timer->is_set()) {
time_alignment_timer->run();
}
} }
} }
pending_mac_msg.reset(); pending_mac_msg.reset();