Merge branch 'next' of github.com:softwareradiosystems/srsLTE into next

This commit is contained in:
Pedro Alvarez 2018-12-14 17:16:41 +00:00
commit a5a7eb02d2
16 changed files with 44 additions and 27 deletions

View File

@ -93,10 +93,10 @@ void pdcp::reset()
{
// destroy all bearers
pthread_rwlock_wrlock(&rwlock);
for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); ++it) {
for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); /* post increment in erase */ ) {
it->second->reset();
delete(it->second);
pdcp_array.erase(it);
pdcp_array.erase(it++);
}
pthread_rwlock_unlock(&rwlock);

View File

@ -77,7 +77,7 @@ void parse_args(all_args_t *args, int argc, char* argv[]) {
("enb.tac", bpo::value<string>(&tac)->default_value("0x0"), "Tracking Area Code")
("enb.mcc", bpo::value<string>(&mcc)->default_value("001"), "Mobile Country Code")
("enb.mnc", bpo::value<string>(&mnc)->default_value("01"), "Mobile Network Code")
("enb.mme_addr", bpo::value<string>(&args->enb.s1ap.mme_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connnection")
("enb.mme_addr", bpo::value<string>(&args->enb.s1ap.mme_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connection")
("enb.gtp_bind_addr", bpo::value<string>(&args->enb.s1ap.gtp_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for GTP connection")
("enb.s1c_bind_addr", bpo::value<string>(&args->enb.s1ap.s1c_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for S1AP connection")
("enb.phy_cell_id", bpo::value<uint32_t>(&args->enb.pci)->default_value(0), "Physical Cell Identity (PCI)")

View File

@ -125,7 +125,7 @@ void txrx::run_thread()
srslte_timestamp_copy(&tx_time, &rx_time);
srslte_timestamp_add(&tx_time, 0, HARQ_DELAY_MS*1e-3);
Debug("Settting TTI=%d, tx_mutex=%d, tx_time=%ld:%f to worker %d\n",
Debug("Setting TTI=%d, tx_mutex=%d, tx_time=%ld:%f to worker %d\n",
tti, tx_worker_cnt,
tx_time.full_secs, tx_time.frac_secs,
worker->get_id());

View File

@ -552,7 +552,7 @@ void rrc::parse_ul_dcch(uint16_t rnti, uint32_t lcid, byte_buffer_t *pdu)
if (users.count(rnti)) {
users[rnti].parse_ul_dcch(lcid, pdu);
} else {
rrc_log->error("Processing %s: Unkown rnti=0x%x\n", rb_id_text[lcid], rnti);
rrc_log->error("Processing %s: Unknown rnti=0x%x\n", rb_id_text[lcid], rnti);
}
}
}
@ -576,7 +576,7 @@ void rrc::process_rl_failure(uint16_t rnti)
rrc_log->info("%d Radio-Link failure detected rnti=0x%x\n", n_rfl, rnti);
}
} else {
rrc_log->error("Radio-Link failure detected for uknown rnti=0x%x\n", rnti);
rrc_log->error("Radio-Link failure detected for unknown rnti=0x%x\n", rnti);
}
}

View File

@ -288,7 +288,10 @@ bool s1ap::connect_mme()
s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.s1c_bind_addr.c_str());
return false;
}
bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr));
if (bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr)) != 0) {
s1ap_log->error("Failed to bind on S1-C address %s: %s errno %d\n", args.s1c_bind_addr.c_str(), strerror(errno), errno);
return false;
}
// Connect to the MME address
memset(&mme_addr, 0, sizeof(struct sockaddr_in));
@ -1043,7 +1046,7 @@ std::string s1ap::get_cause(LIBLTE_S1AP_CAUSE_STRUCT *c)
cause += liblte_s1ap_causemisc_text[c->choice.misc.e];
break;
default:
cause += "unkown";
cause += "unknown";
break;
}
return cause;

View File

@ -112,7 +112,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) {
("mme.tac", bpo::value<string>(&tac)->default_value("0x0"), "Tracking Area Code")
("mme.mcc", bpo::value<string>(&mcc)->default_value("001"), "Mobile Country Code")
("mme.mnc", bpo::value<string>(&mnc)->default_value("01"), "Mobile Network Code")
("mme.mme_bind_addr", bpo::value<string>(&mme_bind_addr)->default_value("127.0.0.1"), "IP address of MME for S1 connnection")
("mme.mme_bind_addr", bpo::value<string>(&mme_bind_addr)->default_value("127.0.0.1"), "IP address of MME for S1 connection")
("mme.dns_addr", bpo::value<string>(&dns_addr)->default_value("8.8.8.8"), "IP address of the DNS server for the UEs")
("mme.apn", bpo::value<string>(&mme_apn)->default_value(""), "Set Access Point Name (APN) for data services")
("hss.db_file", bpo::value<string>(&hss_db_file)->default_value("ue_db.csv"), ".csv file that stores UE's keys")

View File

@ -319,7 +319,7 @@ mbms_gw::handle_sgi_md_pdu(srslte::byte_buffer_t *msg)
int n = sendto(m_m1u, msg->msg, msg->N_bytes, 0,
(sockaddr *) &m_m1u_multi_addr, sizeof(struct sockaddr));
if(n<0){
m_mbms_gw_log->console("Error writting to M1-U socket.\n");
m_mbms_gw_log->console("Error writing to M1-U socket.\n");
}
else{
m_mbms_gw_log->debug("Sent %d Bytes\n", msg->N_bytes);

View File

@ -179,7 +179,7 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(nas *nas_ctx, uint16_t e
struct in_addr addr;
addr.s_addr = htonl(sgw_s1u_ip);
m_s1ap_log->info("Sent Intial Context Setup Request. E-RAB id %d \n",erab_ctx_req->e_RAB_ID.E_RAB_ID);
m_s1ap_log->info("Sent Initial Context Setup Request. E-RAB id %d \n",erab_ctx_req->e_RAB_ID.E_RAB_ID);
m_s1ap_log->info("Initial Context -- S1-U TEID 0x%x. IP %s \n", sgw_s1u_teid,inet_ntoa(addr));
m_s1ap_log->console("Initial Context Setup Request -- eNB UE S1AP Id %d, MME UE S1AP Id %d\n",in_ctxt_req->eNB_UE_S1AP_ID.ENB_UE_S1AP_ID, in_ctxt_req->MME_UE_S1AP_ID.MME_UE_S1AP_ID);
m_s1ap_log->console("Initial Context Setup Request -- E-RAB id %d\n",erab_ctx_req->e_RAB_ID.E_RAB_ID);

View File

@ -94,8 +94,8 @@ s1ap_mngmt_proc::handle_s1_setup_request(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRU
//Check matching PLMNs
if(enb_ctx.plmn!=m_s1ap->get_plmn()){
m_s1ap_log->console("Sending S1 Setup Failure - Unkown PLMN\n");
m_s1ap_log->warning("Sending S1 Setup Failure - Unkown PLMN\n");
m_s1ap_log->console("Sending S1 Setup Failure - Unknown PLMN\n");
m_s1ap_log->warning("Sending S1 Setup Failure - Unknown PLMN\n");
pack_s1_setup_failure(LIBLTE_S1AP_CAUSEMISC_UNKNOWN_PLMN,reply_buffer);
}
else{

View File

@ -343,5 +343,4 @@ s1ap_nas_transport::send_downlink_nas_transport(uint32_t enb_ue_s1ap_id, uint32_
return true;
}
} //namespace srsepc

View File

@ -245,10 +245,11 @@ bool demux::process_ce(srslte::sch_subh *subh) {
case srslte::sch_subh::TA_CMD:
phy_h->set_timeadv(subh->get_ta_cmd());
Info("Received TA=%d\n", subh->get_ta_cmd());
// Start or restart timeAlignmentTimer
time_alignment_timer->reset();
time_alignment_timer->run();
// Start or restart timeAlignmentTimer only if running
if (time_alignment_timer->is_running()) {
time_alignment_timer->reset();
time_alignment_timer->run();
}
break;
case srslte::sch_subh::PADDING:
break;

View File

@ -64,6 +64,10 @@ bool mac::init(phy_interface_mac *phy, rlc_interface_mac *rlc, rrc_interface_mac
timer_alignment = timers.get_unique_id();
contention_resolution_timer = timers.get_unique_id();
log_h->debug("Timer Timing Alignment ID 0x%x\n", timer_alignment);
log_h->debug("Timer Contention Resolution ID 0x%x\n",
contention_resolution_timer);
bsr_procedure.init( rlc_h, log_h, &config, &timers);
phr_procedure.init(phy_h, log_h, &config, &timers);
mux_unit.init ( rlc_h, log_h, &bsr_procedure, &phr_procedure);
@ -364,9 +368,14 @@ void mac::setup_timers()
// stop currently running time alignment timer
if (timers.get(timer_alignment)->is_running()) {
timers.get(timer_alignment)->stop();
log_h->debug("Stop running MAC Time Alignment Timer with ID 0x%x\n",
timer_alignment);
}
int value = liblte_rrc_time_alignment_timer_num[config.main.time_alignment_timer];
int value =
liblte_rrc_time_alignment_timer_num[config.main.time_alignment_timer];
log_h->info("Set MAC Time Alignment Timer (0x%x) to: %d value: %d \n",
timer_alignment, config.main.time_alignment_timer, value);
if (value > 0) {
timers.get(timer_alignment)->set(this, value);
}
@ -382,9 +391,11 @@ void mac::timer_expired(uint32_t timer_id)
}
/* Function called on expiry of TimeAlignmentTimer */
void mac::timer_alignment_expire()
{
printf("TimeAlignment timer has expired value=%d ms\n", timers.get(timer_alignment)->get_timeout());
void mac::timer_alignment_expire() {
log_h->console("TimeAlignment timer has expired value=%d ms\n",
timers.get(timer_alignment)->get_timeout());
log_h->warning("TimeAlignment timer has expired value=%d ms\n",
timers.get(timer_alignment)->get_timeout());
rrc_h->release_pucch_srs();
dl_harq.reset();
ul_harq.reset();

View File

@ -308,7 +308,7 @@ bool bsr_proc::need_to_send_bsr_on_ul_grant(uint32_t grant_size, bsr_t *bsr)
generate_bsr(bsr, 0);
bsr_sz = bsr->format==LONG_BSR?3:1;
if (total_data <= (int)grant_size && total_data + 1 + bsr_sz > grant_size) {
Debug("Grant is not enough to accomodate the BSR MAC CE\n");
Debug("Grant is not enough to accommodate the BSR MAC CE\n");
} else {
Debug("BSR: Including Regular BSR: grant_size=%d, total_data=%d, bsr_sz=%d\n",
grant_size, total_data, bsr_sz);

View File

@ -179,8 +179,11 @@ void ra_proc::process_timeadv_cmd(uint32_t ta) {
if (preambleIndex == 0) {
// Preamble not selected by UE MAC
phy_h->set_timeadv_rar(ta);
time_alignment_timer->reset();
time_alignment_timer->run();
// Only if timer is running reset the timer
if (time_alignment_timer->is_running()) {
time_alignment_timer->reset();
time_alignment_timer->run();
}
Debug("Applying RAR TA CMD %d\n", ta);
} else {
// Preamble selected by UE MAC

View File

@ -136,7 +136,7 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
("usim.imei", bpo::value<string>(&args->usim.imei), "USIM IMEI")
("usim.k", bpo::value<string>(&args->usim.k), "USIM K")
("usim.pin", bpo::value<string>(&args->usim.pin), "PIN in case real SIM card is used")
("usim.reader", bpo::value<string>(&args->usim.reader)->default_value(""), "Force specifiy PCSC reader. Default: Try all available readers.")
("usim.reader", bpo::value<string>(&args->usim.reader)->default_value(""), "Force specific PCSC reader. Default: Try all available readers.")
/* Expert section */
("expert.ip_netmask",

View File

@ -1617,7 +1617,7 @@ void phch_recv::intra_measure::write(uint32_t tti, cf_t *data, uint32_t nsamples
}
if (receiving == true) {
if (srslte_ringbuffer_write(&ring_buffer, data, nsamples*sizeof(cf_t)) < (int) (nsamples*sizeof(cf_t))) {
Warning("Error writting to ringbuffer\n");
Warning("Error writing to ringbuffer\n");
receiving = false;
} else {
receive_cnt++;