fix uninitialised variables in enb during startup

master
Andre Puschmann 6 years ago
parent 94481c1963
commit 4204321fde

@ -63,6 +63,7 @@ class mac
{ {
public: public:
mac(); mac();
~mac();
bool init(mac_args_t *args, srslte_cell_t *cell, phy_interface_mac *phy, rlc_interface_mac *rlc, rrc_interface_mac *rrc, srslte::log *log_h); bool init(mac_args_t *args, srslte_cell_t *cell, phy_interface_mac *phy, rlc_interface_mac *rlc, rrc_interface_mac *rrc, srslte::log *log_h);
void stop(); void stop();

@ -74,8 +74,6 @@ typedef struct {
class phch_common class phch_common
{ {
public: public:
phch_common(uint32_t nof_workers); phch_common(uint32_t nof_workers);
~phch_common(); ~phch_common();

@ -63,6 +63,13 @@ mac::mac() : timers_db(128), timers_thread(&timers_db), tti(0), last_rnti(0),
bzero(&bcch_softbuffer_tx, sizeof(bcch_softbuffer_tx)); bzero(&bcch_softbuffer_tx, sizeof(bcch_softbuffer_tx));
bzero(&pcch_softbuffer_tx, sizeof(pcch_softbuffer_tx)); bzero(&pcch_softbuffer_tx, sizeof(pcch_softbuffer_tx));
bzero(&rar_softbuffer_tx, sizeof(rar_softbuffer_tx)); bzero(&rar_softbuffer_tx, sizeof(rar_softbuffer_tx));
pthread_rwlock_init(&rwlock, NULL);
}
mac::~mac()
{
pthread_rwlock_unlock(&rwlock);
pthread_rwlock_destroy(&rwlock);
} }
bool mac::init(mac_args_t *args_, srslte_cell_t *cell_, phy_interface_mac *phy, rlc_interface_mac *rlc, rrc_interface_mac *rrc, srslte::log *log_h_) bool mac::init(mac_args_t *args_, srslte_cell_t *cell_, phy_interface_mac *phy, rlc_interface_mac *rlc, rrc_interface_mac *rrc, srslte::log *log_h_)
@ -97,8 +104,6 @@ bool mac::init(mac_args_t *args_, srslte_cell_t *cell_, phy_interface_mac *phy,
reset(); reset();
pthread_rwlock_init(&rwlock, NULL);
started = true; started = true;
} }
@ -120,9 +125,6 @@ void mac::stop()
started = false; started = false;
timers_thread.stop(); timers_thread.stop();
pdu_process_thread.stop(); pdu_process_thread.stop();
pthread_rwlock_unlock(&rwlock);
pthread_rwlock_destroy(&rwlock);
} }
// Implement Section 5.9 // Implement Section 5.9
@ -137,7 +139,6 @@ void mac::reset()
/* Setup scheduler */ /* Setup scheduler */
scheduler.reset(); scheduler.reset();
} }
void mac::start_pcap(srslte::mac_pcap* pcap_) void mac::start_pcap(srslte::mac_pcap* pcap_)

@ -61,10 +61,11 @@ sched::sched() : bc_aggr_level(0), rar_aggr_level(0), avail_rbg(0), P(0), start_
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
bzero(rar_locations[i], sizeof(sched_ue::sched_dci_cce_t) * 10); bzero(rar_locations[i], sizeof(sched_ue::sched_dci_cce_t) * 10);
} }
reset();
pthread_rwlock_init(&rwlock, NULL); pthread_rwlock_init(&rwlock, NULL);
pthread_mutex_init(&sched_mutex, NULL); pthread_mutex_init(&sched_mutex, NULL);
reset();
} }
sched::~sched() sched::~sched()

@ -42,16 +42,21 @@ using namespace asn1::rrc;
namespace srsenb { namespace srsenb {
phch_common::phch_common(uint32_t max_workers) : tx_sem(max_workers) phch_common::phch_common(uint32_t max_workers_) :
tx_sem(max_workers_),
sib13_configured(false),
mcch_configured(false),
radio(NULL),
mac(NULL),
is_first_tx(false),
is_first_of_burst(false),
pdsch_p_b(0),
max_workers(max_workers_),
nof_workers(0),
params()
{ {
this->nof_workers = nof_workers;
params.max_prach_offset_us = 20; params.max_prach_offset_us = 20;
radio = NULL;
mac = NULL;
is_first_tx = false;
is_first_of_burst = false;
pdsch_p_b = 0;
this->max_workers = max_workers;
bzero(&pusch_cfg, sizeof(pusch_cfg)); bzero(&pusch_cfg, sizeof(pusch_cfg));
bzero(&hopping_cfg, sizeof(hopping_cfg)); bzero(&hopping_cfg, sizeof(hopping_cfg));
bzero(&pucch_cfg, sizeof(pucch_cfg)); bzero(&pucch_cfg, sizeof(pucch_cfg));
@ -68,9 +73,9 @@ phch_common::~phch_common() {
} }
} }
void phch_common::set_nof_workers(uint32_t nof_workers) void phch_common::set_nof_workers(uint32_t nof_workers_)
{ {
this->nof_workers = nof_workers; nof_workers = nof_workers_;
} }
void phch_common::reset() { void phch_common::reset() {

@ -78,7 +78,7 @@ void txrx::run_thread()
{ {
phch_worker *worker = NULL; phch_worker *worker = NULL;
cf_t *buffer[SRSLTE_MAX_PORTS] = {NULL}; cf_t *buffer[SRSLTE_MAX_PORTS] = {NULL};
srslte_timestamp_t rx_time, tx_time; srslte_timestamp_t rx_time = {}, tx_time = {};
uint32_t sf_len = SRSLTE_SF_LEN_PRB(worker_com->cell.nof_prb); uint32_t sf_len = SRSLTE_SF_LEN_PRB(worker_com->cell.nof_prb);
float samp_rate = srslte_sampling_freq_hz(worker_com->cell.nof_prb); float samp_rate = srslte_sampling_freq_hz(worker_com->cell.nof_prb);

Loading…
Cancel
Save