parameterize TTI offset between UL grant and UL tx and UL tx and HARQ rx

This commit is contained in:
Andre Puschmann 2017-06-26 10:08:55 +02:00
parent 20a004a768
commit c247f1103d
3 changed files with 9 additions and 5 deletions

View File

@ -300,6 +300,7 @@ public:
uint32_t rv;
uint16_t rnti;
uint32_t current_tx_nb;
int32_t tti_offset; // relative offset between grant and UL tx/HARQ rx
srslte_softbuffer_tx_t *softbuffer;
srslte_phy_grant_t phy_grant;
uint8_t *payload_ptr;

View File

@ -128,13 +128,13 @@ public:
void new_grant_ul_ack(Tgrant grant, bool ack, Taction *action)
{
set_ack(grant.tti, ack);
set_ack(grant.tti, ack, action);
new_grant_ul(grant, action);
}
void harq_recv(uint32_t tti, bool ack, Taction *action)
{
set_ack(tti, ack);
set_ack(tti, ack, action);
run_tti(tti, NULL, action);
}
@ -385,13 +385,13 @@ private:
// Called with UL grant
void run_tti(uint32_t tti, Tgrant *grant, Taction* action)
{
uint32_t tti_tx = (tti+4)%10240;
uint32_t tti_tx = (tti+action->tti_offset)%10240;
proc[pidof(tti_tx)].run_tti(tti_tx, grant, action);
}
void set_ack(uint32_t tti, bool ack)
void set_ack(uint32_t tti, bool ack, Taction *action)
{
int tti_harq = (int) tti - 4;
int tti_harq = (int) tti - action->tti_offset;
if (tti_harq < 0) {
tti_harq += 10240;
}

View File

@ -240,6 +240,9 @@ void phch_worker::work_imp()
set_uci_periodic_cqi();
}
/* TTI offset for UL is always 4 for LTE */
ul_action.tti_offset = 4;
/* Send UL grant or HARQ information (from PHICH) to MAC */
if (ul_grant_available && ul_ack_available) {
phy->mac->new_grant_ul_ack(ul_mac_grant, ul_ack, &ul_action);