2019-04-26 12:27:38 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2013-2019 Software Radio Systems Limited
|
2016-05-06 02:03:42 -07:00
|
|
|
*
|
2019-04-26 12:27:38 -07:00
|
|
|
* This file is part of srsLTE.
|
2016-05-06 02:03:42 -07:00
|
|
|
*
|
|
|
|
* srsLTE is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* srsLTE is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* A copy of the GNU Affero General Public License can be found in
|
|
|
|
* the LICENSE file in the top-level directory of this distribution
|
|
|
|
* and at http://www.gnu.org/licenses/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* File: enb_dl.h
|
|
|
|
*
|
|
|
|
* Description: ENB downlink object.
|
|
|
|
*
|
|
|
|
* This module is a frontend to all the downlink data and control
|
|
|
|
* channel processing modules for the ENB transmitter side.
|
|
|
|
*
|
|
|
|
* Reference:
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSLTE_ENB_DL_H
|
|
|
|
#define SRSLTE_ENB_DL_H
|
2016-05-06 02:03:42 -07:00
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
#include "srslte/phy/ch_estimation/refsignal_dl.h"
|
2017-05-18 00:48:24 -07:00
|
|
|
#include "srslte/phy/common/phy_common.h"
|
|
|
|
#include "srslte/phy/dft/ofdm.h"
|
|
|
|
#include "srslte/phy/phch/dci.h"
|
|
|
|
#include "srslte/phy/phch/pbch.h"
|
|
|
|
#include "srslte/phy/phch/pcfich.h"
|
|
|
|
#include "srslte/phy/phch/pdcch.h"
|
|
|
|
#include "srslte/phy/phch/pdsch.h"
|
|
|
|
#include "srslte/phy/phch/pdsch_cfg.h"
|
|
|
|
#include "srslte/phy/phch/phich.h"
|
2019-04-23 01:53:11 -07:00
|
|
|
#include "srslte/phy/phch/pmch.h"
|
2017-05-18 00:48:24 -07:00
|
|
|
#include "srslte/phy/phch/ra.h"
|
|
|
|
#include "srslte/phy/phch/regs.h"
|
2019-04-23 01:53:11 -07:00
|
|
|
#include "srslte/phy/sync/pss.h"
|
|
|
|
#include "srslte/phy/sync/sss.h"
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2017-05-18 00:48:24 -07:00
|
|
|
#include "srslte/phy/enb/enb_ul.h"
|
2019-04-23 01:53:11 -07:00
|
|
|
#include "srslte/phy/ue/ue_dl.h"
|
2016-06-28 09:28:57 -07:00
|
|
|
|
2017-05-18 00:48:24 -07:00
|
|
|
#include "srslte/phy/utils/vector.h"
|
|
|
|
#include "srslte/phy/utils/debug.h"
|
2016-05-06 02:03:42 -07:00
|
|
|
|
|
|
|
#include "srslte/config.h"
|
|
|
|
|
|
|
|
typedef struct SRSLTE_API {
|
|
|
|
srslte_cell_t cell;
|
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
srslte_dl_sf_cfg_t dl_sf;
|
|
|
|
|
|
|
|
cf_t* sf_symbols[SRSLTE_MAX_PORTS];
|
|
|
|
|
2017-10-20 07:09:27 -07:00
|
|
|
srslte_ofdm_t ifft[SRSLTE_MAX_PORTS];
|
2019-04-23 01:53:11 -07:00
|
|
|
srslte_ofdm_t ifft_mbsfn;
|
|
|
|
|
2016-05-06 02:03:42 -07:00
|
|
|
srslte_pbch_t pbch;
|
|
|
|
srslte_pcfich_t pcfich;
|
|
|
|
srslte_regs_t regs;
|
|
|
|
srslte_pdcch_t pdcch;
|
|
|
|
srslte_pdsch_t pdsch;
|
2018-05-15 07:13:03 -07:00
|
|
|
srslte_pmch_t pmch;
|
2016-05-06 02:03:42 -07:00
|
|
|
srslte_phich_t phich;
|
|
|
|
|
2017-09-21 03:48:09 -07:00
|
|
|
srslte_refsignal_t csr_signal;
|
2018-05-15 07:13:03 -07:00
|
|
|
srslte_refsignal_t mbsfnr_signal;
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
cf_t pss_signal[SRSLTE_PSS_LEN];
|
|
|
|
float sss_signal0[SRSLTE_SSS_LEN];
|
|
|
|
float sss_signal5[SRSLTE_SSS_LEN];
|
|
|
|
|
|
|
|
} srslte_enb_dl_t;
|
2016-05-31 06:56:32 -07:00
|
|
|
|
|
|
|
typedef struct {
|
2016-06-28 09:28:57 -07:00
|
|
|
uint8_t ack;
|
2016-11-20 08:36:21 -08:00
|
|
|
uint32_t n_prb_lowest;
|
2019-04-23 01:53:11 -07:00
|
|
|
uint32_t n_dmrs;
|
|
|
|
} srslte_enb_dl_phich_t;
|
2016-05-06 02:03:42 -07:00
|
|
|
|
|
|
|
/* This function shall be called just after the initial synchronization */
|
2017-10-20 07:09:27 -07:00
|
|
|
SRSLTE_API int srslte_enb_dl_init(srslte_enb_dl_t *q,
|
|
|
|
cf_t *out_buffer[SRSLTE_MAX_PORTS],
|
2017-09-01 04:29:11 -07:00
|
|
|
uint32_t max_prb);
|
2016-05-06 02:03:42 -07:00
|
|
|
|
|
|
|
SRSLTE_API void srslte_enb_dl_free(srslte_enb_dl_t *q);
|
|
|
|
|
2017-09-01 04:29:11 -07:00
|
|
|
SRSLTE_API int srslte_enb_dl_set_cell(srslte_enb_dl_t *q,
|
|
|
|
srslte_cell_t cell);
|
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API int srslte_enb_dl_add_rnti(srslte_enb_dl_t* q, uint16_t rnti);
|
2016-06-28 09:28:57 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API void srslte_enb_dl_rem_rnti(srslte_enb_dl_t* q, uint16_t rnti);
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API void srslte_enb_dl_put_base(srslte_enb_dl_t* q, srslte_dl_sf_cfg_t* dl_sf);
|
2018-05-15 07:13:03 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API void srslte_enb_dl_put_phich(srslte_enb_dl_t* q, srslte_phich_grant_t* grant, bool ack);
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API int srslte_enb_dl_put_pdcch_dl(srslte_enb_dl_t* q, srslte_dci_cfg_t* dci_cfg, srslte_dci_dl_t* dci_dl);
|
2018-05-15 07:13:03 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API int srslte_enb_dl_put_pdcch_ul(srslte_enb_dl_t* q, srslte_dci_cfg_t* dci_cfg, srslte_dci_ul_t* dci_ul);
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API int
|
|
|
|
srslte_enb_dl_put_pdsch(srslte_enb_dl_t* q, srslte_pdsch_cfg_t* pdsch, uint8_t* data[SRSLTE_MAX_CODEWORDS]);
|
2016-05-07 05:02:06 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API int srslte_enb_dl_put_pmch(srslte_enb_dl_t* q, srslte_pmch_cfg_t* pmch_cfg, uint8_t* data);
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API void srslte_enb_dl_gen_signal(srslte_enb_dl_t* q);
|
2018-05-15 07:13:03 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API bool srslte_enb_dl_gen_cqi_periodic(
|
|
|
|
srslte_cell_t* cell, srslte_dl_cfg_t* dl_cfg, uint32_t tti, uint32_t ri, srslte_cqi_cfg_t* cqi_cfg);
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API bool
|
|
|
|
srslte_enb_dl_gen_cqi_aperiodic(srslte_cell_t* cell, srslte_dl_cfg_t* dl_cfg, uint32_t ri, srslte_cqi_cfg_t* cqi_cfg);
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
SRSLTE_API void srslte_enb_dl_save_signal(srslte_enb_dl_t* q);
|
2016-05-06 02:03:42 -07:00
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#endif // SRSLTE_ENB_DL_H
|