Transmit Msg3 only if available (2)

master
Ismael Gomez 7 years ago
parent ca4a22aeaf
commit 13a16e200c

@ -68,6 +68,9 @@ public:
void msg3_flush();
bool msg3_is_transmitted();
void msg3_prepare();
bool msg3_is_pending();
void append_crnti_ce_next_tx(uint16_t crnti);
void set_priority(uint32_t lcid, uint32_t priority, int PBR_x_tti, uint32_t BSD);
@ -105,6 +108,7 @@ private:
/* PDU Buffer */
srslte::sch_pdu pdu_msg;
bool msg3_has_been_transmitted;
bool msg3_pending;
};
} // namespace srsue

@ -238,7 +238,7 @@ private:
reset();
// Uplink grant in a RAR and there is a PDU in the Msg3 buffer
if (grant->is_from_rar && !harq_entity->mux_unit->msg3_is_transmitted()) {
if (grant->is_from_rar && harq_entity->mux_unit->msg3_is_pending()) {
Debug("Getting Msg3 buffer payload, grant size=%d bytes\n", grant->n_bytes[0]);
pdu_ptr = harq_entity->mux_unit->msg3_get(payload_buffer, grant->n_bytes[0]);
if (pdu_ptr) {
@ -246,6 +246,7 @@ private:
} else {
Warning("UL RAR grant available but no Msg3 on buffer\n");
}
printf("Transmitted Msg3\n");
// Normal UL grant
} else {

@ -65,6 +65,7 @@ void mux::reset()
for (uint32_t i=0;i<lch.size();i++) {
lch[i].Bj = 0;
}
msg3_pending = false;
pending_crnti_ce = 0;
}
@ -344,6 +345,7 @@ void mux::msg3_flush()
Debug("Msg3 buffer flushed\n");
}
msg3_has_been_transmitted = false;
msg3_pending = false;
bzero(msg3_buff, sizeof(MSG3_BUFF_SZ));
}
@ -352,6 +354,14 @@ bool mux::msg3_is_transmitted()
return msg3_has_been_transmitted;
}
void mux::msg3_prepare() {
msg3_pending = true;
}
bool mux::msg3_is_pending() {
return msg3_pending;
}
/* Returns a pointer to the Msg3 buffer */
uint8_t* mux::msg3_get(uint8_t *payload, uint32_t pdu_sz)
{
@ -363,6 +373,7 @@ uint8_t* mux::msg3_get(uint8_t *payload, uint32_t pdu_sz)
}
memcpy(payload, msg3_buff_start_pdu, sizeof(uint8_t)*pdu_sz);
msg3_has_been_transmitted = true;
msg3_pending = false;
return payload;
} else {
Error("Msg3 size (%d) is longer than internal msg3_buff size=%d, (see mux.h)\n", pdu_sz, MSG3_BUFF_SZ-32);

@ -350,6 +350,7 @@ void ra_proc::tb_decoded_ok() {
state = COMPLETION;
} else {
// Preamble selected by UE MAC
mux_unit->msg3_prepare();
rntis->temp_rnti = rar_pdu_msg.get()->get_temp_crnti();
phy_h->pdcch_dl_search(SRSLTE_RNTI_TEMP, rar_pdu_msg.get()->get_temp_crnti());

Loading…
Cancel
Save