2014-04-17 03:28:21 -07:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* \section COPYRIGHT
|
|
|
|
*
|
|
|
|
* Copyright 2013-2014 The libLTE Developers. See the
|
|
|
|
* COPYRIGHT file at the top-level directory of this distribution.
|
|
|
|
*
|
|
|
|
* \section LICENSE
|
|
|
|
*
|
|
|
|
* This file is part of the libLTE library.
|
|
|
|
*
|
|
|
|
* libLTE is free software: you can redistribute it and/or modify
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* libLTE 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 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/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DCI_
|
|
|
|
#define DCI_
|
|
|
|
|
2014-05-12 10:43:14 -07:00
|
|
|
#include <stdint.h>
|
2014-06-13 04:42:29 -07:00
|
|
|
|
2014-06-17 06:20:00 -07:00
|
|
|
#include "liblte/config.h"
|
2014-06-26 04:13:05 -07:00
|
|
|
#include "liblte/phy/common/phy_common.h"
|
2014-06-17 06:20:00 -07:00
|
|
|
#include "liblte/phy/phch/ra.h"
|
2014-04-17 03:28:21 -07:00
|
|
|
|
|
|
|
typedef _Complex float cf_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DCI message generation according to the formats, as specified in
|
|
|
|
* 36.212 Section 5.3.3.1
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2014-06-17 02:11:41 -07:00
|
|
|
#define DCI_MAX_BITS 57
|
2014-04-17 03:28:21 -07:00
|
|
|
|
|
|
|
typedef enum {
|
2014-06-17 02:11:41 -07:00
|
|
|
Format0, Format1, Format1A, Format1C
|
2014-05-12 10:43:14 -07:00
|
|
|
} 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
|
2014-06-13 04:42:29 -07:00
|
|
|
typedef struct LIBLTE_API {
|
2014-06-17 02:11:41 -07:00
|
|
|
enum {
|
|
|
|
PUSCH_SCHED, PDSCH_SCHED, MCCH_CHANGE, TPC_COMMAND, RA_PROC_PDCCH
|
|
|
|
} type;
|
|
|
|
dci_format_t format;
|
2014-05-12 10:43:14 -07:00
|
|
|
}dci_msg_type_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-05-12 10:43:14 -07:00
|
|
|
typedef enum {
|
2014-06-17 02:11:41 -07:00
|
|
|
DCI_COMMON = 0, DCI_UE = 1
|
2014-05-12 10:43:14 -07:00
|
|
|
} dci_spec_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-06-13 04:42:29 -07:00
|
|
|
typedef struct LIBLTE_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
|
2014-07-05 12:00:32 -07:00
|
|
|
} dci_location_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-06-13 04:42:29 -07:00
|
|
|
typedef struct LIBLTE_API {
|
2014-06-17 02:11:41 -07:00
|
|
|
char data[DCI_MAX_BITS];
|
2014-07-05 12:00:32 -07:00
|
|
|
uint32_t nof_bits;
|
2014-05-12 10:43:14 -07:00
|
|
|
} dci_msg_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-06-29 10:51:25 -07:00
|
|
|
|
2014-06-13 04:42:29 -07:00
|
|
|
LIBLTE_API char* dci_format_string(dci_format_t format);
|
2014-05-12 10:43:14 -07:00
|
|
|
|
2014-07-05 12:00:32 -07:00
|
|
|
LIBLTE_API int dci_location_set(dci_location_t *c,
|
|
|
|
uint32_t L,
|
|
|
|
uint32_t nCCE);
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-07-06 12:08:11 -07:00
|
|
|
LIBLTE_API bool dci_location_isvalid(dci_location_t *c);
|
|
|
|
|
2014-06-29 10:51:25 -07:00
|
|
|
LIBLTE_API int dci_msg_get_type(dci_msg_t *msg,
|
|
|
|
dci_msg_type_t *type,
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t nof_prb,
|
2014-07-05 12:00:32 -07:00
|
|
|
uint16_t msg_rnti,
|
2014-06-29 10:51:25 -07:00
|
|
|
uint16_t crnti);
|
|
|
|
|
|
|
|
LIBLTE_API void dci_msg_type_fprint(FILE *f,
|
|
|
|
dci_msg_type_t type);
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-05-12 10:43:14 -07:00
|
|
|
// For dci_msg_type_t = PUSCH_SCHED
|
2014-06-29 10:51:25 -07:00
|
|
|
LIBLTE_API int dci_msg_pack_pusch(ra_pusch_t *data,
|
|
|
|
dci_msg_t *msg,
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t nof_prb);
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-06-29 10:51:25 -07:00
|
|
|
LIBLTE_API int dci_msg_unpack_pusch(dci_msg_t *msg,
|
|
|
|
ra_pusch_t *data,
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t nof_prb);
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-06-29 10:51:25 -07:00
|
|
|
// For dci_msg_type_t = PDSCH_SCHED
|
|
|
|
LIBLTE_API int dci_msg_pack_pdsch(ra_pdsch_t *data,
|
|
|
|
dci_msg_t *msg,
|
|
|
|
dci_format_t format,
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t nof_prb,
|
2014-06-29 10:51:25 -07:00
|
|
|
bool crc_is_crnti);
|
|
|
|
|
|
|
|
LIBLTE_API int dci_msg_unpack_pdsch(dci_msg_t *msg,
|
|
|
|
ra_pdsch_t *data,
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t nof_prb,
|
2014-06-29 10:51:25 -07:00
|
|
|
bool crc_is_crnti);
|
|
|
|
|
2014-07-01 01:48:51 -07:00
|
|
|
LIBLTE_API uint32_t dci_format_sizeof(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_
|