2014-04-17 03:28:21 -07:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* \section COPYRIGHT
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* Copyright 2013-2014 The srsLTE Developers. See the
|
2014-04-17 03:28:21 -07:00
|
|
|
* COPYRIGHT file at the top-level directory of this distribution.
|
|
|
|
*
|
|
|
|
* \section LICENSE
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* This file is part of the srsLTE library.
|
2014-04-17 03:28:21 -07:00
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* srsLTE is free software: you can redistribute it and/or modify
|
2014-04-17 03:28:21 -07:00
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* srsLTE is distributed in the hope that it will be useful,
|
2014-04-17 03:28:21 -07:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* A copy of the GNU Lesser 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/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-04-03 05:49:12 -07:00
|
|
|
/******************************************************************************
|
|
|
|
* File: dci.h
|
|
|
|
*
|
|
|
|
* Description: Downlink control information (DCI)
|
|
|
|
*
|
|
|
|
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.3.3
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2014-04-17 03:28:21 -07:00
|
|
|
#ifndef DCI_
|
|
|
|
#define DCI_
|
|
|
|
|
2014-05-12 10:43:14 -07:00
|
|
|
#include <stdint.h>
|
2014-06-13 04:42:29 -07:00
|
|
|
|
2015-03-18 05:16:28 -07:00
|
|
|
#include "srslte/config.h"
|
2015-03-18 05:31:13 -07:00
|
|
|
#include "srslte/common/phy_common.h"
|
|
|
|
#include "srslte/phch/ra.h"
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-06-17 02:11:41 -07:00
|
|
|
#define DCI_MAX_BITS 57
|
2014-04-17 03:28:21 -07:00
|
|
|
|
|
|
|
typedef enum {
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_DCI_FORMAT0,
|
|
|
|
SRSLTE_DCI_FORMAT1,
|
|
|
|
SRSLTE_DCI_FORMAT1A,
|
|
|
|
SRSLTE_DCI_FORMAT1C,
|
|
|
|
SRSLTE_DCI_FORMAT_ERROR
|
|
|
|
} srslte_dci_format_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-05-12 10:43:14 -07:00
|
|
|
// Each type is for a different interface to packing/unpacking functions
|
2015-03-18 05:31:13 -07:00
|
|
|
typedef struct SRSLTE_API {
|
2014-06-17 02:11:41 -07:00
|
|
|
enum {
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_DCI_MSG_TYPE_PUSCH_SCHED,
|
|
|
|
SRSLTE_DCI_MSG_TYPE_PDSCH_SCHED,
|
|
|
|
SRSLTE_DCI_MSG_TYPE_MCCH_CHANGE,
|
|
|
|
SRSLTE_DCI_MSG_TYPE_TPC_COMMAND,
|
|
|
|
SRSLTE_DCI_MSG_TYPE_RA_PROC_PDCCH
|
2014-06-17 02:11:41 -07:00
|
|
|
} type;
|
2015-03-18 11:14:24 -07:00
|
|
|
srslte_dci_format_t format;
|
|
|
|
}srslte_dci_msg_type_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-05-12 10:43:14 -07:00
|
|
|
typedef enum {
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_DCI_SPEC_COMMON_ = 0,
|
|
|
|
SRSLTE_DCI_SPEC_UE = 1
|
2014-05-12 10:43:14 -07:00
|
|
|
} dci_spec_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
typedef struct SRSLTE_API {
|
2014-07-05 12:00:32 -07:00
|
|
|
uint32_t L; // Aggregation level
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t ncce; // Position of first CCE of the dci
|
2015-03-18 11:14:24 -07:00
|
|
|
} srslte_dci_location_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
typedef struct SRSLTE_API {
|
2014-10-17 11:44:01 -07:00
|
|
|
uint8_t data[DCI_MAX_BITS];
|
2014-07-05 12:00:32 -07:00
|
|
|
uint32_t nof_bits;
|
2015-03-18 11:14:24 -07:00
|
|
|
} srslte_dci_msg_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-07-10 05:43:18 -07:00
|
|
|
/* Converts a received PDSCH DL scheduling DCI message
|
|
|
|
* to ra structures ready to be passed to the harq setup function
|
|
|
|
*/
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_API int srslte_dci_msg_to_ra_dl(srslte_dci_msg_t *msg,
|
|
|
|
uint16_t msg_rnti,
|
|
|
|
srslte_cell_t cell,
|
|
|
|
uint32_t cfi,
|
|
|
|
srslte_ra_pdsch_t *ra_dl);
|
|
|
|
|
|
|
|
SRSLTE_API int srslte_dci_msg_to_ra_ul(srslte_dci_msg_t *msg,
|
|
|
|
uint32_t nof_prb,
|
|
|
|
uint32_t n_rb_ho,
|
|
|
|
srslte_ra_pusch_t *ra_ul);
|
|
|
|
|
|
|
|
SRSLTE_API int srslte_dci_rar_to_ra_ul(uint32_t rba,
|
|
|
|
uint32_t trunc_mcs,
|
|
|
|
bool hopping_flag,
|
|
|
|
uint32_t nof_prb,
|
|
|
|
srslte_ra_pusch_t *ra);
|
|
|
|
|
|
|
|
SRSLTE_API srslte_dci_format_t srslte_dci_format_from_string(char *str);
|
|
|
|
|
|
|
|
SRSLTE_API char* srslte_dci_format_string(srslte_dci_format_t format);
|
|
|
|
|
|
|
|
SRSLTE_API int srslte_dci_location_set(srslte_dci_location_t *c,
|
|
|
|
uint32_t L,
|
|
|
|
uint32_t nCCE);
|
|
|
|
|
|
|
|
SRSLTE_API bool srslte_dci_location_isvalid(srslte_dci_location_t *c);
|
|
|
|
|
|
|
|
SRSLTE_API int srslte_dci_msg_get_type(srslte_dci_msg_t *msg,
|
|
|
|
srslte_dci_msg_type_t *type,
|
|
|
|
uint32_t nof_prb,
|
|
|
|
uint16_t msg_rnti);
|
|
|
|
|
|
|
|
SRSLTE_API void srslte_dci_msg_type_fprint(FILE *f,
|
|
|
|
srslte_dci_msg_type_t type);
|
|
|
|
|
|
|
|
// For srslte_dci_msg_type_t = SRSLTE_DCI_MSG_TYPE_PUSCH_SCHED
|
|
|
|
SRSLTE_API int srslte_dci_msg_pack_pusch(srslte_ra_pusch_t *data,
|
|
|
|
srslte_dci_msg_t *msg,
|
|
|
|
uint32_t nof_prb);
|
|
|
|
|
|
|
|
SRSLTE_API int srslte_dci_msg_unpack_pusch(srslte_dci_msg_t *msg,
|
|
|
|
srslte_ra_pusch_t *data,
|
|
|
|
uint32_t nof_prb);
|
|
|
|
|
|
|
|
// For srslte_dci_msg_type_t = SRSLTE_DCI_MSG_TYPE_PDSCH_SCHED
|
|
|
|
SRSLTE_API int srslte_dci_msg_pack_pdsch(srslte_ra_pdsch_t *data,
|
|
|
|
srslte_dci_msg_t *msg,
|
|
|
|
srslte_dci_format_t format,
|
|
|
|
uint32_t nof_prb,
|
2015-04-08 08:22:09 -07:00
|
|
|
bool crc_is_crnti);
|
2015-03-18 11:14:24 -07:00
|
|
|
|
|
|
|
SRSLTE_API int srslte_dci_msg_unpack_pdsch(srslte_dci_msg_t *msg,
|
|
|
|
srslte_ra_pdsch_t *data,
|
|
|
|
uint32_t nof_prb,
|
2015-04-08 08:22:09 -07:00
|
|
|
bool crc_is_crnti);
|
2015-03-18 11:14:24 -07:00
|
|
|
|
|
|
|
SRSLTE_API uint32_t srslte_dci_format_sizeof(srslte_dci_format_t format,
|
|
|
|
uint32_t nof_prb);
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-06-13 04:42:29 -07:00
|
|
|
#endif // DCI_
|