//enum for distinguish the different type of ndlsch (may in the future will be not needed)
typedefenum
{
SIB1,
SI_Message,
RAR,
UE_Data
}ndlsch_flag_t;
typedefstruct{
rnti_trnti;
//array containing the pdus of DCI
uint8_t*a[2];
//Array containing encoded DCI data
uint8_t*e[2];
//UE specific parameters
uint16_tnpdcch_NumRepetitions;
uint16_trepetition_number;
//indicate the corresponding subframe within the repetition (set to 0 when a new NPDCCH pdu is received)
uint16_trepetition_idx;
// uint16_t npdcch_Offset_USS;
// uint16_t npdcch_StartSF_USS;
}NB_IoT_eNB_NPDCCH_t;
typedefstruct{
//Number of repetitions (R) for common search space (RAR and PAGING)
uint16_tnumber_repetition_RA;
uint16_tnumber_repetition_PAg;
//index of the current subframe among the repetition (set to 0 when we receive the new NPDCCH)
uint16_trepetition_idx_RA;
uint16_trepetition_idx_Pag;
}NB_IoT_eNB_COMMON_NPDCCH_t;
typedefstruct{
/// Length of DCI in bits
uint8_tdci_length;
/// Aggregation level only 1,2 in NB-IoT
uint8_tL;
/// Position of first CCE of the dci
intfirstCCE;
/// flag to indicate that this is a RA response
boolean_tra_flag;
/// rnti
rnti_trnti;
/// Format
DCI_format_NB_IoT_tformat;
/// DCI pdu
uint8_tdci_pdu[8];
}DCI_ALLOC_NB_IoT_t;
typedefstruct{
//delete the count for the DCI numbers,NUM_DCI_MAX should set to 2
uint32_tnum_npdcch_symbols;
///indicates the starting OFDM symbol in the first slot of a subframe k for the NPDCCH transmission
/// see FAPI/NFAPI specs Table 4-45
uint8_tnpdcch_start_symbol;
uint8_tNum_dci;
DCI_ALLOC_NB_IoT_tdci_alloc[2];
}DCI_PDU_NB_IoT;
typedefstruct{
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
int32_t*txdataF[8];
/// dl channel estimates (estimated from ul channel estimates)
int32_t**calib_dl_ch_estimates;
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_trnti;
/// Active flag for baseband transmitter processing
uint8_tactive;
/// Indicator of TX activation per subframe. Used during PUCCH detection for ACK/NAK.
uint8_tsubframe_tx[10];
/// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK.
uint8_tnCCE[10];
/*in NB-IoT there is only 1 HARQ process for each UE therefore no pid is required*/
/// The only HARQ process for the DLSCH
NB_IoT_DL_eNB_HARQ_t*harq_process;
/// Number of soft channel bits
uint32_tG;
/// Maximum number of HARQ rounds
uint8_tMlimit;
/// Nsoft parameter related to UE Category
uint32_tNsoft;
/// amplitude of PDSCH (compared to RS) in symbols without pilots
int16_tsqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_tsqrt_rho_b;
///NB-IoT
/// may use in the npdsch_procedures
uint16_tscrambling_sequence_intialization;
/// number of cell specific TX antenna ports assumed by the UE
uint8_tnrs_antenna_ports;
//This indicate the current subframe within the subframe interval between the NPDSCH transmission (Nsf*Nrep)
uint16_tsf_index;
///indicates the starting OFDM symbol in the first slot of a subframe k for the NPDSCH transmission
/// see FAPI/NFAPI specs Table 4-47
uint8_tnpdsch_start_symbol;
/*SIB1-NB related parameters*/
///flag for indicate if the current frame is the start of a new SIB1-NB repetition within the SIB1-NB period (0 = FALSE, 1 = TRUE)
uint8_tsib1_rep_start;
///the number of the frame within the 16 continuous frame in which sib1-NB is transmitted (1-8 = 1st, 2nd ecc..) (0 = not foresees a transmission)
uint8_trelative_sib1_frame;
//Flag used to discern among different NDLSCH structures (SIB1,SI,RA,UE-spec)
//(used inside the ndlsch procedure for distinguish the different type of data to manage also in term of repetitions and transmission over more subframes
ndlsch_flag_tndlsch_type;
}NB_IoT_eNB_NDLSCH_t;
typedefstruct{
/// Length of CQI data under RI=1 assumption(bits)
uint8_tOr1;
/// Rank information
uint8_to_RI[2];
/// Format of CQI data
UCI_format_NB_IoT_tuci_format;
/// The value of DAI in DCI format 0
uint8_tV_UL_DAI;
/// Pointer to CQI data
uint8_to[MAX_CQI_BYTES_NB_IoT];
/// CQI CRC status
uint8_tcqi_crc_status;
/// PHICH active flag
uint8_tphich_active;
/// PHICH ACK
uint8_tphich_ACK;
/// Length of rank information (bits)
uint8_tO_RI;
/// First Allocated RB
uint16_tfirst_rb;
/// Current Number of RBs
uint16_tnb_rb;
/// Determined the subcarrier allocation for the NPUSCH.(15, 3.75 KHz)
uint8_tsubcarrier_indication;
/// Determined the number of resource unit for the NPUSCH
uint8_tresource_assignment;
/// Determined the scheduling delay for NPUSCH
uint8_tscheduling_delay;
/// The number of the repetition number for NPUSCH Transport block
uint8_trepetition_number;
/// Determined the repetition number value 0-3
uint8_tdci_subframe_repetitions;
/// Flag indicating that this ULSCH has been allocated by a DCI (otherwise it is a retransmission based on PHICH NAK)
uint8_tdci_alloc;
/// Flag indicating that this ULSCH has been allocated by a RAR (otherwise it is a retransmission based on PHICH NAK or DCI)
uint8_trar_alloc;
/// Status Flag indicating for this ULSCH (idle,active,disabled)
\brief This function performs a subset of the bit-coding functions for LTE as described in 36-212, Release 8.Support is limited to turbo-coded channels (DLSCH/ULSCH). The implemented functions are:
- CRC computation and addition
- Code block segmentation and sub-block CRC addition
- Channel coding (Turbo coding)
- Rate matching (sub-block interleaving, bit collection, selection and transmission
- Code block concatenation
@param eNB Pointer to eNB PHY context
@param input_buffer Pointer to input buffer for sub-frame
@param frame_parms Pointer to frame descriptor structure
@param num_pdcch_symbols Number of PDCCH symbols in this subframe
@param dlsch Pointer to dlsch to be encoded
@param frame Frame number
@param subframe Subframe number
@param rm_stats Time statistics for rate-matching
@param te_stats Time statistics for turbo-encoding
@param i_stats Time statistics for interleaving
@returns status
*/
int32_tdlsch_encoding_NB_IoT(unsignedchar*a,
NB_IoT_eNB_DLSCH_t*dlsch,
uint8_tNsf,// number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsignedintG,// G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)