From 99f2ab4e9baeea3793ff18de415d2ab49865bbc0 Mon Sep 17 00:00:00 2001 From: ismagom Date: Fri, 19 Jun 2015 13:10:37 +0200 Subject: [PATCH] Fixed bug in PUSCH and DRMS using all PRBs. Fixed bug in PDU writing packet not returning true --- srsapps/ue/mac/include/srsapps/ue/mac/mux.h | 2 +- srsapps/ue/mac/src/mux.cc | 2 +- srsapps/ue/mac/src/pdu.cc | 5 ++++- srsapps/ue/phy/src/phy.cc | 1 - srslte/lib/ch_estimation/src/refsignal_ul.c | 2 +- srslte/lib/dft/src/dft_precoding.c | 8 ++++---- srslte/lib/phch/src/pusch.c | 3 +-- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h index 530c77d15..61f858b73 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h @@ -93,7 +93,7 @@ private: qbuff msg3_buff; /* PDU Buffer */ - static const uint32_t PDU_BUFF_SZ = 16*1024; + static const uint32_t PDU_BUFF_SZ = 128*1024; qbuff pdu_buff; sch_pdu pdu_msg; bool msg3_has_been_transmitted; diff --git a/srsapps/ue/mac/src/mux.cc b/srsapps/ue/mac/src/mux.cc index 435166e13..1ccf9b111 100644 --- a/srsapps/ue/mac/src/mux.cc +++ b/srsapps/ue/mac/src/mux.cc @@ -240,7 +240,7 @@ bool mux::assemble_pdu(uint32_t pdu_sz_nbits) { } pkt_num++; // MAC control element for PHR - if (pkt_num == 1) { + if (pkt_num == 2) { if (pdu_msg.new_subh()) { pdu_msg.next(); pdu_msg.get()->set_phd(46); diff --git a/srsapps/ue/mac/src/pdu.cc b/srsapps/ue/mac/src/pdu.cc index 740064c48..e8fd2d97d 100644 --- a/srsapps/ue/mac/src/pdu.cc +++ b/srsapps/ue/mac/src/pdu.cc @@ -169,7 +169,8 @@ bool sch_pdu::write_packet(uint8_t* ptr) } // Set paddint to zeros (if any) bzero(ptr, rem_len*sizeof(uint8_t)*8); - + + return true; } uint32_t sch_pdu::rem_size() { @@ -572,6 +573,8 @@ bool rar_pdu::write_packet(uint8_t* ptr) } // Set paddint to zeros (if any) bzero(ptr, rem_len*sizeof(uint8_t)*8); + + return true; } diff --git a/srsapps/ue/phy/src/phy.cc b/srsapps/ue/phy/src/phy.cc index 9cc9f6b19..fc76e0a47 100644 --- a/srsapps/ue/phy/src/phy.cc +++ b/srsapps/ue/phy/src/phy.cc @@ -547,7 +547,6 @@ void phy::run_rx_tx_state() Info("Restoring AGC. Set TX gain to %.1f dB\n", old_gain); } else if (get_ul_buffer_adv(current_tti)->is_end_of_burst()) { radio_handler->tx_end(); - Info("Sending TX END\n"); } // Receive alligned buffer for the current tti diff --git a/srslte/lib/ch_estimation/src/refsignal_ul.c b/srslte/lib/ch_estimation/src/refsignal_ul.c index 260c24ee3..49f93a834 100644 --- a/srslte/lib/ch_estimation/src/refsignal_ul.c +++ b/srslte/lib/ch_estimation/src/refsignal_ul.c @@ -315,7 +315,7 @@ bool srslte_refsignal_dmrs_pusch_cfg_isvalid(srslte_refsignal_ul_t *q, srslte_re if (cfg->cyclic_shift < SRSLTE_NOF_CSHIFT && cfg->cyclic_shift_for_dmrs < SRSLTE_NOF_CSHIFT && cfg->delta_ss < SRSLTE_NOF_DELTA_SS && - nof_prb < q->cell.nof_prb) { + nof_prb <= q->cell.nof_prb) { return true; } else { return false; diff --git a/srslte/lib/dft/src/dft_precoding.c b/srslte/lib/dft/src/dft_precoding.c index fbab31424..10a9fd7b2 100644 --- a/srslte/lib/dft/src/dft_precoding.c +++ b/srslte/lib/dft/src/dft_precoding.c @@ -48,7 +48,7 @@ int srslte_dft_precoding_init(srslte_dft_precoding_t *q, uint32_t max_prb) if (max_prb <= SRSLTE_MAX_PRB) { ret = SRSLTE_ERROR; - for (uint32_t i=1;idft_plan[i], i*SRSLTE_NRE, SRSLTE_DFT_FORWARD)) { @@ -77,7 +77,7 @@ clean_exit: /* Free DFT plans for transform precoding */ void srslte_dft_precoding_free(srslte_dft_precoding_t *q) { - for (uint32_t i=1;imax_prb;i++) { + for (uint32_t i=1;i<=q->max_prb;i++) { if(srslte_dft_precoding_valid_prb(i)) { DEBUG("Freeing DFT precoding plan for %d PRBs\n", i); srslte_dft_plan_free(&q->dft_plan[i]); @@ -99,7 +99,7 @@ int srslte_dft_precoding(srslte_dft_precoding_t *q, cf_t *input, cf_t *output, uint32_t nof_prb, uint32_t nof_symbols) { - if (!srslte_dft_precoding_valid_prb(nof_prb)) { + if (!srslte_dft_precoding_valid_prb(nof_prb) && nof_prb <= q->max_prb) { fprintf(stderr, "Error invalid number of PRB (%d)\n", nof_prb); return SRSLTE_ERROR; } @@ -114,7 +114,7 @@ int srslte_dft_precoding(srslte_dft_precoding_t *q, cf_t *input, cf_t *output, int srslte_dft_predecoding(srslte_dft_precoding_t *q, cf_t *input, cf_t *output, uint32_t nof_prb, uint32_t nof_symbols) { - if (!srslte_dft_precoding_valid_prb(nof_prb)) { + if (!srslte_dft_precoding_valid_prb(nof_prb) && nof_prb <= q->max_prb) { fprintf(stderr, "Error invalid number of PRB (%d)\n", nof_prb); return SRSLTE_ERROR; } diff --git a/srslte/lib/phch/src/pusch.c b/srslte/lib/phch/src/pusch.c index 8c5a69dd0..1f1aa02a5 100644 --- a/srslte/lib/phch/src/pusch.c +++ b/srslte/lib/phch/src/pusch.c @@ -517,7 +517,7 @@ int srslte_pusch_uci_encode_rnti(srslte_pusch_t *q, srslte_pusch_cfg_t *cfg, srs fprintf(stderr, "Error encoding TB\n"); return SRSLTE_ERROR; } - + if (rnti != q->rnti) { srslte_sequence_t seq; if (srslte_sequence_pusch(&seq, rnti, 2 * cfg->sf_idx, q->cell.id, cfg->nbits.nof_bits)) { @@ -528,7 +528,6 @@ int srslte_pusch_uci_encode_rnti(srslte_pusch_t *q, srslte_pusch_cfg_t *cfg, srs } else { srslte_scrambling_b_offset_pusch(&q->seq[cfg->sf_idx], (uint8_t*) q->q, 0, cfg->nbits.nof_bits); } - srslte_mod_modulate(&q->mod[cfg->grant.mcs.mod], (uint8_t*) q->q, q->d, cfg->nbits.nof_bits); srslte_dft_precoding(&q->dft_precoding, q->d, q->z, cfg->grant.L_prb, cfg->nbits.nof_symb);