|
|
@ -26,6 +26,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <srslte/interfaces/sched_interface.h>
|
|
|
|
#include <srslte/interfaces/sched_interface.h>
|
|
|
|
#include <srslte/asn1/liblte_rrc.h>
|
|
|
|
#include <srslte/asn1/liblte_rrc.h>
|
|
|
|
|
|
|
|
#include <upper/rrc.h>
|
|
|
|
#include "srslte/asn1/liblte_mme.h"
|
|
|
|
#include "srslte/asn1/liblte_mme.h"
|
|
|
|
#include "upper/rrc.h"
|
|
|
|
#include "upper/rrc.h"
|
|
|
|
|
|
|
|
|
|
|
@ -62,6 +63,7 @@ void rrc::init(rrc_cfg_t *cfg_,
|
|
|
|
pthread_mutex_init(&user_mutex, NULL);
|
|
|
|
pthread_mutex_init(&user_mutex, NULL);
|
|
|
|
pthread_mutex_init(&paging_mutex, NULL);
|
|
|
|
pthread_mutex_init(&paging_mutex, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
act_monitor.start(RRC_THREAD_PRIO);
|
|
|
|
bzero(&sr_sched, sizeof(sr_sched_t));
|
|
|
|
bzero(&sr_sched, sizeof(sr_sched_t));
|
|
|
|
|
|
|
|
|
|
|
|
start(RRC_THREAD_PRIO);
|
|
|
|
start(RRC_THREAD_PRIO);
|
|
|
@ -71,7 +73,6 @@ rrc::activity_monitor::activity_monitor(rrc* parent_)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
running = true;
|
|
|
|
running = true;
|
|
|
|
parent = parent_;
|
|
|
|
parent = parent_;
|
|
|
|
start(RRC_THREAD_PRIO);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void rrc::activity_monitor::stop()
|
|
|
|
void rrc::activity_monitor::stop()
|
|
|
@ -149,6 +150,7 @@ uint32_t rrc::generate_sibs()
|
|
|
|
srslte_bit_pack_vector(bitbuffer.msg, sib_buffer[i].msg, bitbuffer.N_bits);
|
|
|
|
srslte_bit_pack_vector(bitbuffer.msg, sib_buffer[i].msg, bitbuffer.N_bits);
|
|
|
|
sib_buffer[i].N_bytes = (bitbuffer.N_bits-1)/8+1;
|
|
|
|
sib_buffer[i].N_bytes = (bitbuffer.N_bits-1)/8+1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
free(msg);
|
|
|
|
return nof_messages;
|
|
|
|
return nof_messages;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -604,23 +606,32 @@ void rrc::run_thread()
|
|
|
|
if (p.pdu) {
|
|
|
|
if (p.pdu) {
|
|
|
|
rrc_log->info_hex(p.pdu->msg, p.pdu->N_bytes, "Rx %s PDU", rb_id_text[p.lcid]);
|
|
|
|
rrc_log->info_hex(p.pdu->msg, p.pdu->N_bytes, "Rx %s PDU", rb_id_text[p.lcid]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch(p.lcid)
|
|
|
|
pthread_mutex_lock(&user_mutex);
|
|
|
|
{
|
|
|
|
if (users.count(p.rnti) == 1) {
|
|
|
|
case RB_ID_SRB0:
|
|
|
|
switch(p.lcid)
|
|
|
|
parse_ul_ccch(p.rnti, p.pdu);
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
case RB_ID_SRB0:
|
|
|
|
case RB_ID_SRB1:
|
|
|
|
parse_ul_ccch(p.rnti, p.pdu);
|
|
|
|
case RB_ID_SRB2:
|
|
|
|
break;
|
|
|
|
parse_ul_dcch(p.rnti, p.lcid, p.pdu);
|
|
|
|
case RB_ID_SRB1:
|
|
|
|
break;
|
|
|
|
case RB_ID_SRB2:
|
|
|
|
case LCID_REM_USER:
|
|
|
|
parse_ul_dcch(p.rnti, p.lcid, p.pdu);
|
|
|
|
usleep(10000);
|
|
|
|
break;
|
|
|
|
rem_user(p.rnti);
|
|
|
|
case LCID_REM_USER:
|
|
|
|
break;
|
|
|
|
pthread_mutex_unlock(&user_mutex);
|
|
|
|
default:
|
|
|
|
usleep(10000);
|
|
|
|
rrc_log->error("Rx PDU with invalid bearer id: %s", p.lcid);
|
|
|
|
rem_user(p.rnti);
|
|
|
|
break;
|
|
|
|
pthread_mutex_lock(&user_mutex);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
rrc_log->error("Rx PDU with invalid bearer id: %s", p.lcid);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
printf("Discarting rnti=0x%xn", p.rnti);
|
|
|
|
|
|
|
|
rrc_log->warning("Discarting PDU for removed rnti=0x%x\n", p.rnti);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pthread_mutex_unlock(&user_mutex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void rrc::activity_monitor::run_thread()
|
|
|
|
void rrc::activity_monitor::run_thread()
|
|
|
|