mirror of https://github.com/PentHertz/srsLTE.git
considering PUCCH2 in PUSCH scheduler
This commit is contained in:
parent
955170bd52
commit
0ca8c8aac6
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <boost/concept_check.hpp>
|
#include <boost/concept_check.hpp>
|
||||||
|
#include <srslte/interfaces/sched_interface.h>
|
||||||
|
|
||||||
#include "srslte/srslte.h"
|
#include "srslte/srslte.h"
|
||||||
#include "srslte/common/pdu.h"
|
#include "srslte/common/pdu.h"
|
||||||
|
@ -171,9 +172,8 @@ void sched_ue::ul_buffer_state(uint8_t lc_id, uint32_t bsr, bool set_value)
|
||||||
} else {
|
} else {
|
||||||
lch[lc_id].bsr += bsr;
|
lch[lc_id].bsr += bsr;
|
||||||
}
|
}
|
||||||
Debug("SCHED: UL lcid=%d buffer_state=%d\n", lc_id, bsr);
|
|
||||||
}
|
}
|
||||||
Info("SCHED: bsr=%d, lcid=%d, bsr={%d,%d,%d,%d}\n", bsr, lc_id,
|
Debug("SCHED: bsr=%d, lcid=%d, bsr={%d,%d,%d,%d}\n", bsr, lc_id,
|
||||||
lch[0].bsr, lch[1].bsr, lch[2].bsr, lch[3].bsr);
|
lch[0].bsr, lch[1].bsr, lch[2].bsr, lch[3].bsr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ bool sched_ue::get_pucch_sched(uint32_t current_tti, uint32_t prb_idx[2], uint32
|
||||||
|
|
||||||
// First check if it has pending ACKs
|
// First check if it has pending ACKs
|
||||||
for (int i=0;i<SCHED_MAX_HARQ_PROC;i++) {
|
for (int i=0;i<SCHED_MAX_HARQ_PROC;i++) {
|
||||||
if (((dl_harq[i].get_tti()+8)%10240) == current_tti) {
|
if (((dl_harq[i].get_tti()+4)%10240) == current_tti) {
|
||||||
uint32_t n_pucch = srslte_pucch_get_npucch(dl_harq[i].get_n_cce(), SRSLTE_PUCCH_FORMAT_1A, has_sr, &pucch_sched);
|
uint32_t n_pucch = srslte_pucch_get_npucch(dl_harq[i].get_n_cce(), SRSLTE_PUCCH_FORMAT_1A, has_sr, &pucch_sched);
|
||||||
if (prb_idx) {
|
if (prb_idx) {
|
||||||
for (int i=0;i<2;i++) {
|
for (int i=0;i<2;i++) {
|
||||||
|
@ -255,7 +255,8 @@ bool sched_ue::get_pucch_sched(uint32_t current_tti, uint32_t prb_idx[2], uint32
|
||||||
if (L) {
|
if (L) {
|
||||||
*L = 1;
|
*L = 1;
|
||||||
}
|
}
|
||||||
Debug("SCHED: Reserved Format1A PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d\n", rnti, prb_idx[0], prb_idx[1], n_pucch);
|
Info("SCHED: Reserved Format1A PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d, n_cce=%d, has_sr=%d\n",
|
||||||
|
rnti, prb_idx[0], prb_idx[1], n_pucch, dl_harq[i].get_n_cce(), has_sr);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,9 +270,24 @@ bool sched_ue::get_pucch_sched(uint32_t current_tti, uint32_t prb_idx[2], uint32
|
||||||
if (L) {
|
if (L) {
|
||||||
*L = 1;
|
*L = 1;
|
||||||
}
|
}
|
||||||
Debug("SCHED: Reserved Format1 PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d\n", rnti, prb_idx[0], prb_idx[1], cfg.sr_N_pucch);
|
Info("SCHED: Reserved Format1 PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d\n", rnti, prb_idx[0], prb_idx[1], cfg.sr_N_pucch);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
// Finally check Format2 (periodic CQI)
|
||||||
|
if (cfg.cqi_enabled && srslte_cqi_send(cfg.cqi_idx, current_tti)) {
|
||||||
|
if (prb_idx) {
|
||||||
|
for (int i=0;i<2;i++) {
|
||||||
|
prb_idx[i] = srslte_pucch_n_prb(&cfg.pucch_cfg, SRSLTE_PUCCH_FORMAT_2, cfg.cqi_pucch, cell.nof_prb, cell.cp, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(L) {
|
||||||
|
*L = 2;
|
||||||
|
}
|
||||||
|
Info("SCHED: Reserved Format2 PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d, pmi_idx=%d\n",
|
||||||
|
rnti, prb_idx[0], prb_idx[1], cfg.cqi_pucch, cfg.cqi_idx);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +319,7 @@ void sched_ue::ul_recv_len(uint32_t lcid, uint32_t len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Info("SCHED: recv_len=%d, lcid=%d, bsr={%d,%d,%d,%d}\n", len, lcid,
|
Debug("SCHED: recv_len=%d, lcid=%d, bsr={%d,%d,%d,%d}\n", len, lcid,
|
||||||
lch[0].bsr, lch[1].bsr, lch[2].bsr, lch[3].bsr);
|
lch[0].bsr, lch[1].bsr, lch[2].bsr, lch[3].bsr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,7 +579,7 @@ uint32_t sched_ue::get_pending_ul_new_data(uint32_t tti)
|
||||||
pending_data = 0;
|
pending_data = 0;
|
||||||
}
|
}
|
||||||
if (pending_data) {
|
if (pending_data) {
|
||||||
Info("SCHED: pending_data=%d, pending_ul_data=%d, bsr={%d,%d,%d,%d}\n", pending_data,pending_ul_data,
|
Debug("SCHED: pending_data=%d, pending_ul_data=%d, bsr={%d,%d,%d,%d}\n", pending_data,pending_ul_data,
|
||||||
lch[0].bsr, lch[1].bsr, lch[2].bsr, lch[3].bsr);
|
lch[0].bsr, lch[1].bsr, lch[2].bsr, lch[3].bsr);
|
||||||
}
|
}
|
||||||
return pending_data;
|
return pending_data;
|
||||||
|
|
|
@ -226,7 +226,7 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, uint32_t tstamp)
|
||||||
if (!bsr_received && lcid_most_data > 2) {
|
if (!bsr_received && lcid_most_data > 2) {
|
||||||
// Add BSR to the LCID for which most data was received
|
// Add BSR to the LCID for which most data was received
|
||||||
sched->ul_bsr(rnti, lcid_most_data, 256, false); // false adds BSR instead of setting
|
sched->ul_bsr(rnti, lcid_most_data, 256, false); // false adds BSR instead of setting
|
||||||
Info("BSR not received. Giving extra grant\n");
|
Debug("BSR not received. Giving extra grant\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug("MAC PDU processed\n");
|
Debug("MAC PDU processed\n");
|
||||||
|
@ -282,9 +282,9 @@ bool ue::process_ce(srslte::sch_subh *subh) {
|
||||||
for (uint32_t i=0;i<lc_groups[idx].size();i++) {
|
for (uint32_t i=0;i<lc_groups[idx].size();i++) {
|
||||||
// Indicate BSR to scheduler
|
// Indicate BSR to scheduler
|
||||||
sched->ul_bsr(rnti, lc_groups[idx][i], buff_size[idx]);
|
sched->ul_bsr(rnti, lc_groups[idx][i], buff_size[idx]);
|
||||||
Info("CE: Received %s BSR rnti=0x%x, lcg=%d, lcid=%d, value=%d\n",
|
|
||||||
subh->ce_type()==srslte::sch_subh::SHORT_BSR?"Short":"Trunc", rnti, idx, lc_groups[idx][i], buff_size[idx]);
|
|
||||||
}
|
}
|
||||||
|
Info("CE: Received %s BSR rnti=0x%x, lcg=%d, value=%d\n",
|
||||||
|
subh->ce_type()==srslte::sch_subh::SHORT_BSR?"Short":"Trunc", rnti, idx, buff_size[idx]);
|
||||||
is_bsr = true;
|
is_bsr = true;
|
||||||
break;
|
break;
|
||||||
case srslte::sch_subh::LONG_BSR:
|
case srslte::sch_subh::LONG_BSR:
|
||||||
|
|
Loading…
Reference in New Issue