adding mbsfn conditional to gtpu to create mch thread only if mbsfn is enabled

master
yagoda 7 years ago
parent 16b2172e36
commit cca8362a69

@ -71,7 +71,7 @@ class gtpu
{
public:
bool init(std::string gtp_bind_addr_, std::string mme_addr_, pdcp_interface_gtpu *pdcp_, srslte::log *gtpu_log_);
bool init(std::string gtp_bind_addr_, std::string mme_addr_, pdcp_interface_gtpu *pdcp_, srslte::log *gtpu_log_, bool enable_mbsfn = false);
void stop();
// gtpu_interface_rrc
@ -90,9 +90,9 @@ private:
bool running;
bool run_enable;
bool mch_running;
bool mch_running;
bool mch_run_enable;
bool _enable_mbsfn;
std::string gtp_bind_addr;
std::string mme_addr;
srsenb::pdcp_interface_gtpu *pdcp;

@ -219,7 +219,7 @@ bool enb::init(all_args_t *args_)
pdcp.init(&rlc, &rrc, &gtpu, &pdcp_log);
rrc.init(&rrc_cfg, &phy, &mac, &rlc, &pdcp, &s1ap, &gtpu, &rrc_log);
s1ap.init(args->enb.s1ap, &rrc, &s1ap_log);
gtpu.init(args->enb.s1ap.gtp_bind_addr, args->enb.s1ap.mme_addr, &pdcp, &gtpu_log);
gtpu.init(args->enb.s1ap.gtp_bind_addr, args->enb.s1ap.mme_addr, &pdcp, &gtpu_log, args->expert.enable_mbsfn);
started = true;
return true;

@ -34,7 +34,7 @@ using namespace srslte;
namespace srsenb {
bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, srsenb::pdcp_interface_gtpu* pdcp_, srslte::log* gtpu_log_)
bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, srsenb::pdcp_interface_gtpu* pdcp_, srslte::log* gtpu_log_, bool enable_mbsfn)
{
pdcp = pdcp_;
gtpu_log = gtpu_log_;
@ -95,11 +95,13 @@ bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, srsenb::pdcp_
//Setup M1-u
init_m1u(gtpu_log_);
mch_lcid_counter = 1;
_enable_mbsfn = enable_mbsfn;
// Setup a thread to receive packets from the src socket
start(THREAD_PRIO);
pthread_create(&mch_thread ,NULL ,mch_thread_routine , this);
if(_enable_mbsfn){
mch_lcid_counter = 1;
pthread_create(&mch_thread ,NULL ,mch_thread_routine , this);
}
return true;
}
@ -224,8 +226,9 @@ void gtpu::stop()
}
}
wait_thread_finish();
pthread_join(mch_thread, NULL);
if(_enable_mbsfn) {
pthread_join(mch_thread, NULL);
}
}
if (snk_fd) {

Loading…
Cancel
Save