enb: add MAC-NR PCAP

* use fixed filename until eNB stack layout is decided
master
Andre Puschmann 3 years ago
parent c03623863b
commit 4076338a1b

@ -30,7 +30,7 @@ uint32_t mac_pcap::open(std::string filename_, uint32_t ue_id_)
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
// set DLT for selected RAT // set UDP DLT
dlt = UDP_DLT; dlt = UDP_DLT;
pcap_file = DLT_PCAP_Open(dlt, filename_.c_str()); pcap_file = DLT_PCAP_Open(dlt, filename_.c_str());
if (pcap_file == nullptr) { if (pcap_file == nullptr) {

@ -166,6 +166,7 @@ int enb_stack_lte::init(const stack_args_t& args_, const rrc_cfg_t& rrc_cfg_)
mac_args.fixed_dl_mcs = 28; mac_args.fixed_dl_mcs = 28;
mac_args.fixed_ul_mcs = 10; mac_args.fixed_ul_mcs = 10;
mac_args.pcap = args.mac_pcap; mac_args.pcap = args.mac_pcap;
mac_args.pcap.filename = "/tmp/enb_mac_nr.pcap";
if (mac_nr.init(mac_args, phy_nr, nullptr, &rlc_nr, &rrc_nr) != SRSRAN_SUCCESS) { if (mac_nr.init(mac_args, phy_nr, nullptr, &rlc_nr, &rrc_nr) != SRSRAN_SUCCESS) {
stack_logger.error("Couldn't initialize MAC-NR"); stack_logger.error("Couldn't initialize MAC-NR");
return SRSRAN_ERROR; return SRSRAN_ERROR;

@ -27,7 +27,8 @@ namespace srsenb {
mac_nr::mac_nr(srsran::task_sched_handle task_sched_) : mac_nr::mac_nr(srsran::task_sched_handle task_sched_) :
logger(srslog::fetch_basic_logger("MAC-NR")), logger(srslog::fetch_basic_logger("MAC-NR")),
task_sched(task_sched_), task_sched(task_sched_),
sched(srsenb::sched_nr_interface::sched_cfg_t{}) sched(srsenb::sched_nr_interface::sched_cfg_t{}),
bcch_bch_payload(srsran::make_byte_buffer())
{ {
stack_task_queue = task_sched.make_task_queue(); stack_task_queue = task_sched.make_task_queue();
} }
@ -61,11 +62,6 @@ int mac_nr::init(const mac_nr_args_t& args_,
detected_rachs.resize(cells_cfg.size()); detected_rachs.resize(cells_cfg.size());
bcch_bch_payload = srsran::make_byte_buffer();
if (bcch_bch_payload == nullptr) {
return SRSRAN_ERROR;
}
logger.info("Started"); logger.info("Started");
started = true; started = true;
@ -203,9 +199,6 @@ uint16_t mac_nr::add_ue(uint32_t enb_cc_idx)
} }
} while (inserted_ue == nullptr); } while (inserted_ue == nullptr);
// Set PCAP if available
// ..
return rnti; return rnti;
} }
@ -283,6 +276,11 @@ int mac_nr::get_dl_sched(const srsran_slot_cfg_t& slot_cfg, dl_sched_t& dl_sched
continue; continue;
} }
ue_db[rnti]->generate_pdu(tb_data, pdsch.sch.grant.tb->tbs / 8); ue_db[rnti]->generate_pdu(tb_data, pdsch.sch.grant.tb->tbs / 8);
if (pcap != nullptr) {
uint32_t pid = 0; // TODO: get PID from PDCCH struct?
pcap->write_dl_crnti_nr(tb_data->msg, tb_data->N_bytes, rnti, pid, slot_cfg.idx);
}
} }
} }
} }

Loading…
Cancel
Save