mirror of https://github.com/PentHertz/srsLTE.git
some tiny MAC code refactoring and typo fixing
This commit is contained in:
parent
8d284f48bd
commit
265037c202
|
@ -129,9 +129,9 @@ private:
|
|||
mac_interface_phy_lte::mac_phy_cfg_mbsfn_t phy_mbsfn_cfg;
|
||||
|
||||
// RNTI search window scheduling
|
||||
int si_window_length, si_window_start;
|
||||
int ra_window_length, ra_window_start;
|
||||
int p_window_start;
|
||||
int si_window_length = -1, si_window_start = -1;
|
||||
int ra_window_length = -1, ra_window_start = -1;
|
||||
int p_window_start = -1;
|
||||
|
||||
// UE-specific RNTIs
|
||||
ue_rnti_t uernti;
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
void start_mac_order(uint32_t msg_len_bits = 56, bool is_ho = false);
|
||||
void step(uint32_t tti);
|
||||
|
||||
bool update_rar_window(int* rar_window_start, int* rar_window_length);
|
||||
void update_rar_window(int& rar_window_start, int& rar_window_length);
|
||||
bool is_contention_resolution();
|
||||
void harq_retx();
|
||||
void harq_max_retx();
|
||||
|
|
|
@ -233,20 +233,18 @@ void mac::run_tti(const uint32_t tti)
|
|||
}
|
||||
|
||||
ra_procedure.step(tti);
|
||||
ra_window_start = -1;
|
||||
ra_window_length = -1;
|
||||
ra_procedure.update_rar_window(&ra_window_start, &ra_window_length);
|
||||
ra_procedure.update_rar_window(ra_window_start, ra_window_length);
|
||||
}
|
||||
|
||||
void mac::bcch_start_rx(int si_window_start, int si_window_length)
|
||||
void mac::bcch_start_rx(int si_window_start_, int si_window_length_)
|
||||
{
|
||||
if (si_window_length >= 0 && si_window_start >= 0) {
|
||||
dl_harq.at(0)->set_si_window_start(si_window_start);
|
||||
this->si_window_length = si_window_length;
|
||||
this->si_window_start = si_window_start;
|
||||
if (si_window_length_ >= 0 && si_window_start_ >= 0) {
|
||||
dl_harq.at(0)->set_si_window_start(si_window_start_);
|
||||
si_window_length = si_window_length_;
|
||||
si_window_start = si_window_start_;
|
||||
} else {
|
||||
this->si_window_length = 0;
|
||||
this->si_window_start = 0;
|
||||
si_window_length = 0;
|
||||
si_window_start = 0;
|
||||
}
|
||||
Info("SCHED: Searching for DL dci for SI-RNTI window_st=%d, window_len=%d\n", si_window_start, si_window_length);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace srsue {
|
|||
const char* state_str[] = {"RA: INIT: ",
|
||||
"RA: PDCCH: ",
|
||||
"RA: Rx: ",
|
||||
"RA: Backof: ",
|
||||
"RA: Backoff:",
|
||||
"RA: ConRes: ",
|
||||
"RA: WaitComplt: ",
|
||||
"RA: Complt: "};
|
||||
|
@ -493,7 +493,7 @@ void ra_proc::response_error()
|
|||
rDebug("Backoff wait interval %d\n", backoff_interval);
|
||||
state = BACKOFF_WAIT;
|
||||
} else {
|
||||
rDebug("Transmitting inmediatly (%d/%d)\n", preambleTransmissionCounter, rach_cfg.preambleTransMax);
|
||||
rDebug("Transmitting immediately (%d/%d)\n", preambleTransmissionCounter, rach_cfg.preambleTransMax);
|
||||
resource_selection();
|
||||
}
|
||||
}
|
||||
|
@ -609,22 +609,17 @@ void ra_proc::pdcch_to_crnti(bool is_new_uplink_transmission)
|
|||
}
|
||||
}
|
||||
|
||||
bool ra_proc::update_rar_window(int* rar_window_start, int* rar_window_length)
|
||||
void ra_proc::update_rar_window(int& rar_window_start, int& rar_window_length)
|
||||
{
|
||||
if (state == RESPONSE_RECEPTION) {
|
||||
if (rar_window_length) {
|
||||
*rar_window_length = rach_cfg.responseWindowSize;
|
||||
}
|
||||
if (rar_window_start) {
|
||||
*rar_window_start = rar_window_st;
|
||||
}
|
||||
return true;
|
||||
if (state != RESPONSE_RECEPTION) {
|
||||
// reset RAR window params to default values to disable RAR search
|
||||
rar_window_start = -1;
|
||||
rar_window_length = -1;
|
||||
} else {
|
||||
if (rar_window_length) {
|
||||
*rar_window_length = -1;
|
||||
}
|
||||
return false;
|
||||
rar_window_length = rach_cfg.responseWindowSize;
|
||||
rar_window_start = rar_window_st;
|
||||
}
|
||||
rDebug("rar_window_start=%d, rar_window_length=%d\n", rar_window_start, rar_window_length);
|
||||
}
|
||||
|
||||
// Restart timer at each Msg3 HARQ retransmission (5.1.5)
|
||||
|
|
|
@ -642,7 +642,7 @@ proc_outcome_t rrc::connection_request_proc::step()
|
|||
|
||||
// Save dedicatedInfoNAS SDU
|
||||
if (rrc_ptr->dedicated_info_nas.get()) {
|
||||
log_h->warning("Received a new dedicatedInfoNAS SDU but there was one still in queue. Removing it\n");
|
||||
log_h->warning("Received a new dedicatedInfoNAS SDU but there was one still in queue. Removing it.\n");
|
||||
}
|
||||
|
||||
Info("Waiting for RRCConnectionSetup/Reject or expiry\n");
|
||||
|
@ -680,7 +680,8 @@ void rrc::connection_request_proc::then(const srslte::proc_state_t& result)
|
|||
{
|
||||
if (result.is_error()) {
|
||||
log_h->warning("Could not establish connection. Deallocating dedicatedInfoNAS PDU\n");
|
||||
this->dedicated_info_nas.reset();
|
||||
dedicated_info_nas.reset();
|
||||
rrc_ptr->dedicated_info_nas.reset();
|
||||
} else {
|
||||
Info("Finished connection request procedure successfully.\n");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue