fixed bugs in enb

master
Ismael Gomez 7 years ago
parent 79b0ca81d0
commit 283cb115ac

@ -136,9 +136,6 @@ int srslte_sequence_LTE_pr(srslte_sequence_t *q, uint32_t len, uint32_t seed) {
q->c_float[i] = (1-2*q->c[i]);
q->c_short[i] = (int16_t) q->c_float[i];
}
return SRSLTE_SUCCESS;
}

@ -30,6 +30,7 @@
#include <math.h>
#include <string.h>
#include <srslte/phy/common/phy_common.h>
#include <srslte/srslte.h>
#define CURRENT_FFTSIZE srslte_symbol_sz(q->cell.nof_prb)
@ -89,12 +90,12 @@ int srslte_enb_dl_init(srslte_enb_dl_t *q, uint32_t max_prb)
}
for (int i=0;i<SRSLTE_MAX_PORTS;i++) {
q->sf_symbols[i] = srslte_vec_malloc(CURRENT_SFLEN_RE * sizeof(cf_t));
q->sf_symbols[i] = srslte_vec_malloc(SRSLTE_SF_LEN_RE(max_prb, SRSLTE_CP_NORM) * sizeof(cf_t));
if (!q->sf_symbols[i]) {
perror("malloc");
goto clean_exit;
}
q->slot1_symbols[i] = &q->sf_symbols[i][CURRENT_SLOTLEN_RE];
q->slot1_symbols[i] = &q->sf_symbols[i][SRSLTE_SLOT_LEN_RE(max_prb, SRSLTE_CP_NORM)];
}
ret = SRSLTE_SUCCESS;
@ -115,6 +116,7 @@ void srslte_enb_dl_free(srslte_enb_dl_t *q)
if (q) {
srslte_ofdm_tx_free(&q->ifft);
srslte_regs_free(&q->regs);
srslte_pbch_free(&q->pbch);
srslte_pcfich_free(&q->pcfich);
srslte_phich_free(&q->phich);
srslte_pdcch_free(&q->pdcch);
@ -138,18 +140,18 @@ int srslte_enb_dl_set_cell(srslte_enb_dl_t *q, srslte_cell_t cell)
if (q != NULL &&
srslte_cell_isvalid(&cell))
{
q->cfi = 3;
srslte_enb_dl_set_cfi(q, 3);
q->tx_amp = SRSLTE_ENB_RF_AMP;
if (q->cell.id != cell.id || q->cell.nof_prb == 0) {
if (q->cell.nof_prb) {
if (q->cell.nof_prb != 0) {
srslte_regs_free(&q->regs);
}
memcpy(&q->cell, &cell, sizeof(srslte_cell_t));
if (srslte_regs_init(&q->regs, q->cell)) {
fprintf(stderr, "Error initiating REGs\n");
fprintf(stderr, "Error resizing REGs\n");
return SRSLTE_ERROR;
}
}
memcpy(&q->cell, &cell, sizeof(srslte_cell_t));
if (srslte_ofdm_rx_set_prb(&q->ifft, q->cell.cp, q->cell.nof_prb)) {
fprintf(stderr, "Error initiating FFT\n");
return SRSLTE_ERROR;

@ -253,7 +253,6 @@ int srslte_pbch_set_cell(srslte_pbch_t *q, srslte_cell_t cell) {
if (q->cell.id != cell.id || q->cell.nof_prb == 0) {
memcpy(&q->cell, &cell, sizeof(srslte_cell_t));
if (srslte_sequence_pbch(&q->seq, q->cell.cp, q->cell.id)) {
return SRSLTE_ERROR;
}

@ -331,6 +331,9 @@ int srslte_prach_gen_seqs(srslte_prach_t *p)
int srslte_prach_init_cfg(srslte_prach_t *p, srslte_prach_cfg_t *cfg, uint32_t nof_prb)
{
if (srslte_prach_init(p, srslte_symbol_sz(nof_prb))) {
return -1;
}
return srslte_prach_set_cell(p,
srslte_symbol_sz(nof_prb),
cfg->config_idx,

@ -103,8 +103,10 @@ void phch_worker::init(phch_common* phy_, srslte::log *log_h_)
fprintf(stderr, "Error initiating ENB DL\n");
return;
}
srslte_enb_ul_init(&enb_ul, phy->cell.nof_prb);
if (srslte_enb_ul_init(&enb_ul, phy->cell.nof_prb)) {
fprintf(stderr, "Error initiating ENB UL\n");
return;
}
if (srslte_enb_ul_set_cell(&enb_ul,
phy->cell,
NULL,
@ -112,7 +114,7 @@ void phch_worker::init(phch_common* phy_, srslte::log *log_h_)
&phy->hopping_cfg,
&phy->pucch_cfg))
{
fprintf(stderr, "Error initiating ENB DL\n");
fprintf(stderr, "Error initiating ENB UL\n");
return;
}

@ -24,6 +24,7 @@
*
*/
#include "srslte/srslte.h"
#include "phy/prach_worker.h"
namespace srsenb {

Loading…
Cancel
Save