MAC DL HARQ: Fixed NDI not been toggled in a reTX. Not decoding again if ack=true but send ACK anyways

master
ismagom 10 years ago
parent c9b9accda5
commit 25ebb0ac80

@ -87,6 +87,7 @@ private:
srslte::log *log_h; srslte::log *log_h;
srslte_softbuffer_rx_t softbuffer; srslte_softbuffer_rx_t softbuffer;
bool ack;
}; };
dl_harq_process proc[NOF_HARQ_PROC+1]; dl_harq_process proc[NOF_HARQ_PROC+1];

@ -105,12 +105,14 @@ dl_harq_entity::dl_harq_process::dl_harq_process() : cur_grant(0),pending_ack_gr
is_first_tx = true; is_first_tx = true;
is_first_decoded = true; is_first_decoded = true;
is_initiated = false; is_initiated = false;
ack = false;
bzero(&cur_grant, sizeof(srslte::ue::dl_sched_grant)); bzero(&cur_grant, sizeof(srslte::ue::dl_sched_grant));
payload = NULL; payload = NULL;
max_payload_len = 0; max_payload_len = 0;
} }
void dl_harq_entity::dl_harq_process::reset() { void dl_harq_entity::dl_harq_process::reset() {
ack = false;
is_first_tx = true; is_first_tx = true;
is_first_decoded = true; is_first_decoded = true;
bzero(&cur_grant, sizeof(srslte::ue::dl_sched_grant)); bzero(&cur_grant, sizeof(srslte::ue::dl_sched_grant));
@ -128,32 +130,36 @@ void dl_harq_entity::dl_harq_process::send_pending_ack_contention_resolution()
void dl_harq_entity::dl_harq_process::receive_data(uint32_t tti, srslte::ue::dl_buffer *dl_buffer, phy *phy_h) void dl_harq_entity::dl_harq_process::receive_data(uint32_t tti, srslte::ue::dl_buffer *dl_buffer, phy *phy_h)
{ {
bool ack = false;
pending_ul_buffer = NULL; pending_ul_buffer = NULL;
if (payload) { if (payload) {
if (cur_grant.get_tbs() <= max_payload_len) { if (cur_grant.get_tbs() <= max_payload_len) {
if (dl_buffer->decode_data(&cur_grant, &softbuffer, payload)) {
// RX OK // If data has not yet been successfully decoded
if (pid == HARQ_BCCH_PID) { if (ack == false) {
Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (BCCH)\n", cur_grant.get_tbs()/8); // Combine the received data and attempt to decode it
harq_entity->demux_unit->push_pdu_bcch(payload, cur_grant.get_tbs()); if (dl_buffer->decode_data(&cur_grant, &softbuffer, payload)) {
is_first_tx = true; // RX OK
} else { if (pid == HARQ_BCCH_PID) {
if (is_first_decoded) { Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (BCCH)\n", cur_grant.get_tbs()/8);
if (cur_grant.is_temp_rnti()) { harq_entity->demux_unit->push_pdu_bcch(payload, cur_grant.get_tbs());
Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (Temporal C-RNTI)\n", cur_grant.get_tbs()/8); is_first_tx = true;
harq_entity->demux_unit->push_pdu_temp_crnti(payload, cur_grant.get_tbs()); } else {
} else { if (is_first_decoded) {
Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit\n", cur_grant.get_tbs()/8); if (cur_grant.is_temp_rnti()) {
harq_entity->demux_unit->push_pdu(payload, cur_grant.get_tbs()); Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (Temporal C-RNTI)\n", cur_grant.get_tbs()/8);
harq_entity->demux_unit->push_pdu_temp_crnti(payload, cur_grant.get_tbs());
} else {
Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit\n", cur_grant.get_tbs()/8);
harq_entity->demux_unit->push_pdu(payload, cur_grant.get_tbs());
}
} }
} ack = true;
ack = true; }
} } else {
} else { // RX NOK
// RX NOK ack = false;
ack = false; }
} }
if (pid == HARQ_BCCH_PID || harq_entity->timers_db->get(mac::TIME_ALIGNMENT)->is_expired()) { if (pid == HARQ_BCCH_PID || harq_entity->timers_db->get(mac::TIME_ALIGNMENT)->is_expired()) {
// Do not generate ACK // Do not generate ACK
@ -185,7 +191,7 @@ void dl_harq_entity::dl_harq_process::receive_data(uint32_t tti, srslte::ue::dl_
void dl_harq_entity::dl_harq_process::set_harq_info(srslte::ue::dl_sched_grant* new_grant) { void dl_harq_entity::dl_harq_process::set_harq_info(srslte::ue::dl_sched_grant* new_grant) {
bool is_new_transmission = false; bool is_new_transmission = false;
if (new_grant->get_ndi() != cur_grant.get_ndi() || is_first_tx) { if (new_grant->get_ndi() == 1 || is_first_tx || (pid == HARQ_BCCH_PID && new_grant->get_rv() == 0)) {
is_new_transmission = true; is_new_transmission = true;
is_first_decoded = true; is_first_decoded = true;
Debug("Set HARQ Info for new transmission\n"); Debug("Set HARQ Info for new transmission\n");
@ -204,7 +210,8 @@ void dl_harq_entity::dl_harq_process::set_harq_info(srslte::ue::dl_sched_grant*
is_first_tx = false; is_first_tx = false;
} }
if (is_new_transmission || cur_grant.get_tbs() != new_grant->get_tbs()) { if (is_new_transmission) {
ack = false;
srslte_softbuffer_rx_reset(&softbuffer); srslte_softbuffer_rx_reset(&softbuffer);
} }
if (new_grant->get_tbs() <= max_payload_len) { if (new_grant->get_tbs() <= max_payload_len) {

Loading…
Cancel
Save