fixing sheduling issues and merge errors

master
yagoda 7 years ago
commit d0cb214725

@ -209,11 +209,20 @@ private:
class sch_subh : public subh<sch_subh> class sch_subh : public subh<sch_subh>
{ {
public: public:
sch_subh(subh_type type_ = SCH_SUBH_TYPE) {
lcid = 0;
sch_subh(subh_type type_ = SCH_SUBH_TYPE):type(type_){} nof_bytes = 0;
payload = NULL;
nof_mch_sched_ce = 0;
cur_mch_sched_ce = 0;
F_bit = false;
type = type_;
nof_mch_sched_ce = 0;
cur_mch_sched_ce = 0;
parent = NULL;
bzero(&w_payload_ce, sizeof(w_payload_ce));
}
virtual ~sch_subh(){} virtual ~sch_subh(){}
@ -247,12 +256,9 @@ public:
uint32_t size_plus_header(); uint32_t size_plus_header();
void set_payload_size(uint32_t size); void set_payload_size(uint32_t size);
bool read_subheader(uint8_t** ptr); bool read_subheader(uint8_t** ptr);
void read_payload(uint8_t **ptr); void read_payload(uint8_t **ptr);
uint32_t get_sdu_lcid(); uint32_t get_sdu_lcid();
uint32_t get_payload_size(); uint32_t get_payload_size();
uint32_t get_header_size(bool is_last); uint32_t get_header_size(bool is_last);
@ -267,12 +273,9 @@ public:
bool get_next_mch_sched_info(uint8_t *lcid, uint16_t *mtch_stop); bool get_next_mch_sched_info(uint8_t *lcid, uint16_t *mtch_stop);
// Writing functions // Writing functions
void write_subheader(uint8_t** ptr, bool is_last); void write_subheader(uint8_t** ptr, bool is_last);
void write_payload(uint8_t **ptr); void write_payload(uint8_t **ptr);
int set_sdu(uint32_t lcid, uint32_t nof_bytes, uint8_t *payload); int set_sdu(uint32_t lcid, uint32_t nof_bytes, uint8_t *payload);
int set_sdu(uint32_t lcid, uint32_t requested_bytes, read_pdu_interface *sdu_itf); int set_sdu(uint32_t lcid, uint32_t requested_bytes, read_pdu_interface *sdu_itf);
bool set_c_rnti(uint16_t crnti); bool set_c_rnti(uint16_t crnti);
@ -301,9 +304,6 @@ static const int MAX_CE_PAYLOAD_LEN = 8;
bool F_bit; bool F_bit;
subh_type type; subh_type type;
private: private:
uint32_t sizeof_ce(uint32_t lcid, bool is_ul); uint32_t sizeof_ce(uint32_t lcid, bool is_ul);
static uint8_t buff_size_table(uint32_t buffer_size); static uint8_t buff_size_table(uint32_t buffer_size);
@ -314,7 +314,6 @@ private:
class sch_pdu : public pdu<sch_subh> class sch_pdu : public pdu<sch_subh>
{ {
public: public:
sch_pdu(uint32_t max_subh): pdu(max_subh) {} sch_pdu(uint32_t max_subh): pdu(max_subh) {}
void parse_packet(uint8_t *ptr); void parse_packet(uint8_t *ptr);
@ -336,6 +335,13 @@ public:
class rar_subh : public subh<rar_subh> class rar_subh : public subh<rar_subh>
{ {
public: public:
rar_subh() {
bzero(&grant, sizeof(grant));
ta = 0;
temp_rnti = 0;
preamble = 0;
parent = NULL;
}
static const uint32_t RAR_GRANT_LEN = 20; static const uint32_t RAR_GRANT_LEN = 20;
@ -386,22 +392,16 @@ private:
class mch_subh : public sch_subh class mch_subh : public sch_subh
{ {
public: public:
mch_subh():sch_subh(MCH_SUBH_TYPE){} mch_subh():sch_subh(MCH_SUBH_TYPE){}
// Size of MAC CEs
// // Size of MAC CEs
const static int MAC_CE_CONTRES_LEN = 6; const static int MAC_CE_CONTRES_LEN = 6;
}; };
class mch_pdu : public sch_pdu class mch_pdu : public sch_pdu
{ {
public: public:
mch_pdu(uint32_t max_subh) : sch_pdu(max_subh) {} mch_pdu(uint32_t max_subh) : sch_pdu(max_subh) {}
private: private:

@ -615,7 +615,7 @@ int sch_subh::set_sdu(uint32_t lcid_, uint32_t requested_bytes, read_pdu_interfa
// Save final number of written bytes // Save final number of written bytes
nof_bytes = sdu_sz; nof_bytes = sdu_sz;
if(nof_bytes > requested_bytes) { if(nof_bytes > (int32_t)requested_bytes) {
return -1; return -1;
} }
} }

@ -271,8 +271,7 @@ static float estimate_noise_pilots(srslte_chest_dl_t *q, uint32_t port_id, srslt
float sum_power = 0.0f; float sum_power = 0.0f;
uint32_t count = 0; uint32_t count = 0;
uint32_t npilots = (ch_mode == SRSLTE_SF_MBSFN)?SRSLTE_REFSIGNAL_NUM_SF_MBSFN(q->cell.nof_prb, port_id):SRSLTE_REFSIGNAL_NUM_SF(q->cell.nof_prb, port_id); uint32_t npilots = (ch_mode == SRSLTE_SF_MBSFN)?SRSLTE_REFSIGNAL_NUM_SF_MBSFN(q->cell.nof_prb, port_id):SRSLTE_REFSIGNAL_NUM_SF(q->cell.nof_prb, port_id);
uint32_t nsymbols = uint32_t nsymbols = (ch_mode == SRSLTE_SF_MBSFN) ? srslte_refsignal_mbsfn_nof_symbols() : srslte_refsignal_cs_nof_symbols(port_id);
(ch_mode == SRSLTE_SF_MBSFN) ? srslte_refsignal_mbsfn_nof_symbols() : srslte_refsignal_cs_nof_symbols(port_id);
uint32_t nref = npilots / nsymbols; uint32_t nref = npilots / nsymbols;
uint32_t fidx = (ch_mode == SRSLTE_SF_MBSFN)?srslte_refsignal_mbsfn_fidx(1):srslte_refsignal_cs_fidx(q->cell, 0, port_id, 0); uint32_t fidx = (ch_mode == SRSLTE_SF_MBSFN)?srslte_refsignal_mbsfn_fidx(1):srslte_refsignal_cs_fidx(q->cell, 0, port_id, 0);
@ -502,7 +501,6 @@ uint32_t srslte_chest_dl_interleave_pilots(srslte_chest_dl_t *q, cf_t *input, cf
uint32_t nref = (ch_mode == SRSLTE_SF_MBSFN)?6*q->cell.nof_prb:2*q->cell.nof_prb; uint32_t nref = (ch_mode == SRSLTE_SF_MBSFN)?6*q->cell.nof_prb:2*q->cell.nof_prb;
uint32_t fidx = (ch_mode == SRSLTE_SF_MBSFN)?srslte_refsignal_mbsfn_fidx(1):srslte_refsignal_cs_fidx(q->cell, 0, port_id, 0); uint32_t fidx = (ch_mode == SRSLTE_SF_MBSFN)?srslte_refsignal_mbsfn_fidx(1):srslte_refsignal_cs_fidx(q->cell, 0, port_id, 0);
if (fidx < 3) { if (fidx < 3) {
srslte_vec_interleave(input, &input[nref], tmp, nref); srslte_vec_interleave(input, &input[nref], tmp, nref);
for (int l = 2; l < nsymbols - 1; l += 2) { for (int l = 2; l < nsymbols - 1; l += 2) {
@ -524,7 +522,6 @@ uint32_t srslte_chest_dl_interleave_pilots(srslte_chest_dl_t *q, cf_t *input, cf
static void average_pilots(srslte_chest_dl_t *q, cf_t *input, cf_t *output, uint32_t port_id, srslte_sf_t ch_mode) { static void average_pilots(srslte_chest_dl_t *q, cf_t *input, cf_t *output, uint32_t port_id, srslte_sf_t ch_mode) {
uint32_t nsymbols = (ch_mode == SRSLTE_SF_MBSFN)?srslte_refsignal_mbsfn_nof_symbols(port_id):srslte_refsignal_cs_nof_symbols(port_id); uint32_t nsymbols = (ch_mode == SRSLTE_SF_MBSFN)?srslte_refsignal_mbsfn_nof_symbols(port_id):srslte_refsignal_cs_nof_symbols(port_id);
uint32_t nref = (ch_mode == SRSLTE_SF_MBSFN)?6*q->cell.nof_prb:2*q->cell.nof_prb; uint32_t nref = (ch_mode == SRSLTE_SF_MBSFN)?6*q->cell.nof_prb:2*q->cell.nof_prb;
uint32_t fidx = (ch_mode == SRSLTE_SF_MBSFN)?srslte_refsignal_mbsfn_fidx(1):srslte_refsignal_cs_fidx(q->cell, 0, port_id, 0);
// Average in the time domain if enabled // Average in the time domain if enabled
if (q->average_subframe) { if (q->average_subframe) {

@ -651,7 +651,6 @@ int mac::get_mch_sched(bool is_mcch, dl_sched_t *dl_sched_res)
dl_sched_res->sched_grants[0].data[0] = ue_db[SRSLTE_MRNTI]->generate_mch_pdu(mch, mch.num_mtch_sched + 1, mcs.tbs/8); dl_sched_res->sched_grants[0].data[0] = ue_db[SRSLTE_MRNTI]->generate_mch_pdu(mch, mch.num_mtch_sched + 1, mcs.tbs/8);
} else { } else {
uint32_t current_lcid = 1; uint32_t current_lcid = 1;
uint32_t mtch_index = 0; uint32_t mtch_index = 0;
uint32_t mtch_stop = mch.mtch_sched[mch.num_mtch_sched -1].stop; uint32_t mtch_stop = mch.mtch_sched[mch.num_mtch_sched -1].stop;

@ -200,7 +200,7 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe
// Save contention resolution if lcid == 0 // Save contention resolution if lcid == 0
if (mac_msg_ul.get()->get_sdu_lcid() == 0 && route_pdu) { if (mac_msg_ul.get()->get_sdu_lcid() == 0 && route_pdu) {
int nbytes = srslte::sch_subh::MAC_CE_CONTRES_LEN; int nbytes = srslte::sch_subh::MAC_CE_CONTRES_LEN;
if (mac_msg_ul.get()->get_payload_size() >= nbytes) { if (mac_msg_ul.get()->get_payload_size() >= (uint32_t)nbytes) {
uint8_t *ue_cri_ptr = (uint8_t *) &conres_id; uint8_t *ue_cri_ptr = (uint8_t *) &conres_id;
uint8_t *pkt_ptr = mac_msg_ul.get()->get_sdu_ptr(); // Warning here: we want to include the uint8_t *pkt_ptr = mac_msg_ul.get()->get_sdu_ptr(); // Warning here: we want to include the
for (int i = 0; i < nbytes; i++) { for (int i = 0; i < nbytes; i++) {

@ -215,8 +215,9 @@ void demux::process_mch_pdu(srslte::mch_pdu *mch_msg){
} }
if(mch_msg->get()->is_sdu()) { if(mch_msg->get()->is_sdu()) {
uint32_t lcid = mch_msg->get()->get_sdu_lcid(); uint32_t lcid = mch_msg->get()->get_sdu_lcid();
if(lcid < 0 || lcid >= SRSLTE_N_MCH_LCIDS) {
printf("Radio bearer id must be in [0:%d] - %d\n", SRSLTE_N_MCH_LCIDS, lcid); if(lcid >= SRSLTE_N_MCH_LCIDS) {
Error("Radio bearer id must be in [0:%d] - %d\n", SRSLTE_N_MCH_LCIDS, lcid);
return; return;
} }
Debug("Wrote MCH LCID=%d to RLC\n", lcid); Debug("Wrote MCH LCID=%d to RLC\n", lcid);
@ -229,7 +230,7 @@ void demux::process_mch_pdu(srslte::mch_pdu *mch_msg){
void demux::mch_start_rx(uint32_t lcid) void demux::mch_start_rx(uint32_t lcid)
{ {
if(lcid>=0 && lcid<32) { if(lcid < 32) {
Info("MCH Channel Setup: LCID=%d\n", lcid); Info("MCH Channel Setup: LCID=%d\n", lcid);
mch_lcids[lcid] = 1; mch_lcids[lcid] = 1;
} else { } else {

Loading…
Cancel
Save