Add ue MAC procedures for PDCCH orders.

master
Fabian Eckermann 3 years ago committed by Andre Puschmann
parent 74a289976a
commit 8bac4eceda

@ -36,6 +36,9 @@ public:
uint32_t pid; uint32_t pid;
uint16_t rnti; uint16_t rnti;
bool is_sps_release; bool is_sps_release;
bool is_pdcch_order;
uint32_t preamble_idx;
uint32_t prach_mask_idx;
uint32_t tti; uint32_t tti;
} mac_grant_dl_t; } mac_grant_dl_t;

@ -249,6 +249,8 @@ bool cc_worker::work_dl_regular()
// If found a dci for this carrier, generate a grant, pass it to MAC and decode the associated PDSCH // If found a dci for this carrier, generate a grant, pass it to MAC and decode the associated PDSCH
if (has_dl_grant) { if (has_dl_grant) {
// PDCCH order has no associated PDSCH to decode
if (not dci_dl.is_pdcch_order) {
// Read last TB from last retx for this pid // Read last TB from last retx for this pid
for (uint32_t i = 0; i < SRSRAN_MAX_CODEWORDS; i++) { for (uint32_t i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
ue_dl_cfg.cfg.pdsch.grant.last_tbs[i] = phy->last_dl_tbs[dci_dl.pid][cc_idx][i]; ue_dl_cfg.cfg.pdsch.grant.last_tbs[i] = phy->last_dl_tbs[dci_dl.pid][cc_idx][i];
@ -266,7 +268,7 @@ bool cc_worker::work_dl_regular()
// Set RNTI // Set RNTI
ue_dl_cfg.cfg.pdsch.rnti = dci_dl.rnti; ue_dl_cfg.cfg.pdsch.rnti = dci_dl.rnti;
}
// Generate MAC grant // Generate MAC grant
mac_interface_phy_lte::mac_grant_dl_t mac_grant = {}; mac_interface_phy_lte::mac_grant_dl_t mac_grant = {};
dl_phy_to_mac_grant(&ue_dl_cfg.cfg.pdsch.grant, &dci_dl, &mac_grant); dl_phy_to_mac_grant(&ue_dl_cfg.cfg.pdsch.grant, &dci_dl, &mac_grant);
@ -357,6 +359,11 @@ void cc_worker::dl_phy_to_mac_grant(srsran_pdsch_grant_t*
mac_grant->pid = dl_dci->pid; mac_grant->pid = dl_dci->pid;
mac_grant->rnti = dl_dci->rnti; mac_grant->rnti = dl_dci->rnti;
mac_grant->tti = CURRENT_TTI; mac_grant->tti = CURRENT_TTI;
mac_grant->is_pdcch_order = dl_dci->is_pdcch_order;
if (dl_dci->is_pdcch_order) {
mac_grant->preamble_idx = dl_dci->preamble_idx;
mac_grant->prach_mask_idx = dl_dci->prach_mask_idx;
}
for (int i = 0; i < SRSRAN_MAX_CODEWORDS; i++) { for (int i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
mac_grant->tb[i].ndi = dl_dci->tb[i].ndi; mac_grant->tb[i].ndi = dl_dci->tb[i].ndi;

@ -362,7 +362,10 @@ void mac::mch_decoded(uint32_t len, bool crc)
void mac::tb_decoded(uint32_t cc_idx, mac_grant_dl_t grant, bool ack[SRSRAN_MAX_CODEWORDS]) void mac::tb_decoded(uint32_t cc_idx, mac_grant_dl_t grant, bool ack[SRSRAN_MAX_CODEWORDS])
{ {
if (SRSRAN_RNTI_ISRAR(grant.rnti)) { if (grant.is_pdcch_order) {
ra_procedure.set_config_ded(grant.preamble_idx, grant.prach_mask_idx);
ra_procedure.start_pdcch_order();
} else if (SRSRAN_RNTI_ISRAR(grant.rnti)) {
if (ack[0]) { if (ack[0]) {
ra_procedure.tb_decoded_ok(cc_idx, grant.tti); ra_procedure.tb_decoded_ok(cc_idx, grant.tti);
} }

@ -150,8 +150,11 @@ void ra_proc::state_pdcch_setup()
ra_tti = info.tti_ra; ra_tti = info.tti_ra;
ra_rnti = 1 + (ra_tti % 10) + (10 * info.f_id); ra_rnti = 1 + (ra_tti % 10) + (10 * info.f_id);
rInfo("seq=%d, ra-rnti=0x%x, ra-tti=%d, f_id=%d", sel_preamble.load(), ra_rnti, info.tti_ra, info.f_id); rInfo("seq=%d, ra-rnti=0x%x, ra-tti=%d, f_id=%d", sel_preamble.load(), ra_rnti, info.tti_ra, info.f_id);
srsran::console( srsran::console("Random Access Transmission%s: seq=%d, tti=%d, ra-rnti=0x%x\n",
"Random Access Transmission: seq=%d, tti=%d, ra-rnti=0x%x\n", sel_preamble.load(), info.tti_ra, ra_rnti); (started_by_pdcch) ? " (PDCCH order)" : "",
sel_preamble.load(),
info.tti_ra,
ra_rnti);
rar_window_st = ra_tti + 3; rar_window_st = ra_tti + 3;
rntis->set_rar_rnti(ra_rnti); rntis->set_rar_rnti(ra_rnti);
state = RESPONSE_RECEPTION; state = RESPONSE_RECEPTION;
@ -516,7 +519,7 @@ void ra_proc::start_pdcch_order()
rInfo("Starting PRACH by PDCCH order"); rInfo("Starting PRACH by PDCCH order");
initialization(); initialization();
} else { } else {
logger.warning("Trying to start PRACH by MAC order in invalid state (%s)", state_str[state]); logger.warning("Trying to start PRACH by PDCCH order in invalid state (%s)", state_str[state]);
} }
} }

Loading…
Cancel
Save