Skip to content

Commit

Permalink
Merge branch 'next' of github.com:softwareradiosystems/srsLTE into next
Browse files Browse the repository at this point in the history
  • Loading branch information
ismagom committed Feb 12, 2018
2 parents ad703d5 + ccfb931 commit 8f9ce13
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/common/logger_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void logger_file::init(std::string file, int max_length_) {
pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&not_empty, NULL);
pthread_cond_init(&not_full, NULL);
max_length = max_length_*1024;
max_length = (int64_t)max_length_*1024;
name_idx = 0;
filename = file;
logfile = fopen(filename.c_str(), "w");
Expand Down
2 changes: 2 additions & 0 deletions lib/src/phy/utils/ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ int srslte_ringbuffer_write(srslte_ringbuffer_t *q, void *p, int nof_bytes)
int w_bytes = nof_bytes;
pthread_mutex_lock(&q->mutex);
if (!q->active) {
pthread_mutex_unlock(&q->mutex);
return 0;
}
if (q->count + w_bytes > q->capacity) {
Expand Down Expand Up @@ -85,6 +86,7 @@ int srslte_ringbuffer_read(srslte_ringbuffer_t *q, void *p, int nof_bytes)
pthread_cond_wait(&q->cvar, &q->mutex);
}
if (!q->active) {
pthread_mutex_unlock(&q->mutex);
return 0;
}
if (nof_bytes + q->rpm > q->capacity) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/upper/rlc_am.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1085,11 +1085,11 @@ void rlc_am::handle_control_pdu(uint8_t *payload, uint32_t nof_bytes)
it = tx_window.find(i);
if (it != tx_window.end()) {
if(update_vt_a) {
tx_window.erase(it);
if(it->second.buf) {
pool->deallocate(it->second.buf);
it->second.buf = 0;
}
tx_window.erase(it);
vt_a = (vt_a + 1)%MOD;
vt_ms = (vt_ms + 1)%MOD;
}
Expand Down
1 change: 1 addition & 0 deletions lib/test/upper/rlc_am_stress_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class mac_reader
rlc2 = rlc2_;
fail_rate = fail_rate_;
run_enable = true;
running = false;
}

void stop()
Expand Down
12 changes: 9 additions & 3 deletions srsue/hdr/upper/rrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,22 @@ class cell_t
return false;
}
cell_t() {
this->has_valid_sib1 = false;
this->has_valid_sib2 = false;
this->has_valid_sib3 = false;
srslte_cell_t tmp = {};
cell_t(tmp, 0, 0);
}
cell_t(srslte_cell_t phy_cell, uint32_t earfcn, float rsrp) {
this->has_valid_sib1 = false;
this->has_valid_sib2 = false;
this->has_valid_sib3 = false;
this->has_valid_sib13 = false;
this->phy_cell = phy_cell;
this->rsrp = rsrp;
this->earfcn = earfcn;
in_sync = false;
bzero(&sib1, sizeof(sib1));
bzero(&sib2, sizeof(sib2));
bzero(&sib3, sizeof(sib3));
bzero(&sib13, sizeof(sib13));
}

uint32_t earfcn;
Expand Down Expand Up @@ -114,6 +119,7 @@ class rrc
{
public:
rrc();
~rrc();

void init(phy_interface_rrc *phy_,
mac_interface_rrc *mac_,
Expand Down
8 changes: 8 additions & 0 deletions srsue/src/upper/rrc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ rrc::rrc()
:state(RRC_STATE_IDLE)
,drb_up(false)
,sysinfo_index(0)
,serving_cell(NULL)
{
n310_cnt = 0;
n311_cnt = 0;
serving_cell = new cell_t();
}

rrc::~rrc()
{
if (serving_cell) {
delete(serving_cell);
}
}

static void liblte_rrc_handler(void *ctx, char *str) {
rrc *r = (rrc *) ctx;
r->liblte_rrc_log(str);
Expand Down

0 comments on commit 8f9ce13

Please sign in to comment.