uint8_tframe_duplex_type;//Frame duplex type Value: 0 = FDD 1 = TDD
}nfapi_nr_cell_config_t;
//table 3-23
typedefstruct
{
uint32_tss_pbch_power;//SSB Block Power Value: TBD (-60..50 dBm)
uint8_tbch_payload;//Defines option selected for generation of BCH payload, see Table 3-13 (v0.0.011 Value: 0: MAC generates the full PBCH payload 1: PHY generates the timing PBCH bits 2: PHY generates the full PBCH payload
uint8_tscs_common;//subcarrierSpacing for common, used for initial access and broadcast message. [38.211 sec 4.2] Value:0->3
}nfapi_nr_ssb_config_t;
//table 3-24
/*typedef struct {
uint8_t unused_root_sequences;//Unused root sequence or sequences per FD occasion. Required for noise estimation.
uint8_tnum_root_sequences;//Number of root sequences for a particular FD occasion that are required to generate the necessary number of preambles
uint16_tk1;//Frequency offset (from UL bandwidth part) for each FD. [38.211, sec 6.3.3.2] Value: from 0 to 272
uint8_tprach_zero_corr_conf;//PRACH Zero CorrelationZone Config which is used to dervive 𝑁𝑐𝑠 [38.211, sec 6.3.3.1] Value: from 0 to 15
uint8_tnum_unused_root_sequences;//Number of unused sequences available for noise estimation per FD occasion. At least one unused root sequence is required per FD occasion.
uint8_t*unused_root_sequences_list;//Unused root sequence or sequences per FD occasion. Required for noise estimation.
}nfapi_nr_num_prach_fd_occasions_t;
typedefstruct
{
uint8_tprach_sequence_length;//RACH sequence length. Long or Short sequence length. Only short sequence length is supported for FR2. [38.211, sec 6.3.3.1] Value: 0 = Long sequence 1 = Short sequence
uint8_tprach_sub_c_spacing;//Subcarrier spacing of PRACH. [38.211 sec 4.2] Value:0->4
uint8_trestricted_set_config;//PRACH restricted set config Value: 0: unrestricted 1: restricted set type A 2: restricted set type B
uint8_tnum_prach_fd_occasions;//Number of RACH frequency domain occasions. Corresponds to the parameter 𝑀 in [38.211, sec 6.3.3.2] which equals the higher layer parameter msg1FDM Value: 1,2,4,8
uint32_tssb_mask;//Bitmap for actually transmitted SSB. MSB->LSB of first 32 bit number corresponds to SSB 0 to SSB 31 MSB->LSB of second 32 bit number corresponds to SSB 32 to SSB 63 Value for each bit: 0: not transmitted 1: transmitted
}nfapi_nr_ssb_mask_size_2_t;
typedefstruct
{
uint8_tbeam_id[64];//BeamID for each SSB in SsbMask. For example, if SSB mask bit 26 is set to 1, then BeamId[26] will be used to indicate beam ID of SSB 26. Value: from 0 to 63
}nfapi_nr_ssb_mask_size_64_t;
typedefstruct
{
uint16_tssb_offset_point_a;//Offset of lowest subcarrier of lowest resource block used for SS/PBCH block. Given in PRB [38.211, section 4.4.4.2] Value: 0->2199
uint8_tbeta_pss;//PSS EPRE to SSS EPRE in a SS/PBCH block [38.213, sec 4.1] Values: 0 = 0dB
uint8_tssb_subcarrier_offset;//ssbSubcarrierOffset or 𝑘𝑆𝑆𝐵 (38.211, section 7.4.3.1) Value: 0->31
uint32_tMIB;//MIB payload, where the 24 MSB are used and represent the MIB in [38.331 MIB IE] and represent 0 1 2 3 1 , , , ,..., A− a a a a a [38.212, sec 7.1.1]
uint16_tbeam_idx;//Index of the digital beam weight vector pre-stored at cell configuration. The vector maps this input port to output TXRUs. Value: 0->65535
}nfapi_nr_dig_bf_interface_t;
typedefstruct
{
uint16_tpm_idx;//Index to precoding matrix (PM) pre-stored at cell configuration. Note: If precoding is not used this parameter should be set to 0. Value: 0->65535.
uint16_tnum_prgs;/*Number of PRGs spanning this allocation.
Value : 1->275 */
uint16_tprg_size;/*Size in RBs of a precoding resource block group (PRG) – to which same precoding and digital beamforming gets applied. Value: 1->275 */
//watchout: dig_bf_interfaces here, in table 3-53 it's dig_bf_interface
uint8_tdig_bf_interfaces;//Number of STD ant ports (parallel streams) feeding into the digBF Value: 0->255
uint8_tbeta_pdcch_1_0;/*PDCCH power value used for PDCCH Format 1_0 with CRC scrambled by SI-RNTI, PI-RNTI or RA-RNTI. This is ratio of
SSB/PBCH EPRE to PDCCH and PDCCH DMRS EPRE [TS38.213, sec 4.1] Value :0->17 */
uint8_tpower_control_offset_ss;//PDCCH power value used for all other PDCCH Formats. This is ratio of SSB/PBCH block EPRE to PDCCH and PDCCH DMRS EPRE [TS38.214, sec 4.1] Values: 0: -3dB, 1: 0dB, 2: 3dB, 3: 6dB
uint16_tpayload_size_bits;//The total DCI length (in bits) including padding bits [TS38.212 sec 7.3.1] Range 0-> DCI_PAYLOAD_BTYE_LEN*8
uint8_tpayload[DCI_PAYLOAD_BTYE_LEN];//DCI payload, where the actual size is defined by PayloadSizeBits. The bit order is as following bit0-bit7 are mapped to first byte of MSB - LSB
}nfapi_nr_dl_dci_pdu_t;
//table 3-36
typedefstruct
{
uint16_tbwp_size;//Bandwidth part size [TS38.213 sec12]. Number of contiguous PRBs allocated to the BWP Value: 1->275
uint16_tbwp_start;//bandwidth part start RB index from reference CRB [TS38.213 sec 12] Value: 0->274
uint8_tcyclic_prefix;//Cyclic prefix type [TS38.211 sec 4.2] 0: Normal; 1: Extended
//Coreset [TS38.211 sec 7.3.2.2]
uint8_tstart_symbol_index;//Starting OFDM symbol for the CORESET Value: 0->13
uint8_tduration_symbols;/* Contiguous time duration of the CORESET in number of symbols. Corresponds to L1 parameter 𝑁𝑠𝑦𝑚𝑏 𝐶𝑂𝑅𝐸𝑆𝐸𝑇 [TS38.211 sec 7.3.2.2] Value: 1,2,3*/
uint8_tfreq_domain_resource[6];/* Frequency domain resources. This is a bitmap defining non-overlapping groups of 6 PRBs in ascending order. [TS38.213 10.1]. Also, corresponds to L1 parameter N^{CORESET}_{RB} [TS38.211 sec 7.3.2.2]
uint8_treg_bundle_size;/*The number of REGs in a bundle. Must be 6 for
cceRegMappingType = nonInterleaved. For cceRegMappingType = interleaved, must belong to {2,6} if duration = 1,2 and must belong to {3,6} if
duration = 3. Corresponds to parameter L. [TS38.211 sec 7.3.2.2] Value: 2,3,6 */
uint8_tinterleaver_size;//The interleaver size. For interleaved mapping belongs to {2,3,6} and for non-interleaved mapping is NA. Corresponds to parameter R. [TS38.211 sec 7.3.2.2] Value: 2,3,6
uint8_tcore_set_type;//[TS38.211 sec 7.3.2.2 and sec 7.4.1.3.2] 0: CORESET is configured by the PBCH or SIB1 (subcarrier 0 of CRB0 for DMRS mapping) 1: otherwise (subcarrier 0 of CORESET)
uint16_tshift_index;//[TS38.211 sec 7.3.2.2] Not applicable for non-interleaved mapping. For interleaved mapping and a PDCCH transmitted in a CORESET configured by the PBCH or SIB1 this should be set to phy cell ID. Value: 10 bits Otherwise, for interleaved mapping this is set to 0-> max num of PRBs. Value 0-> 275
uint8_tprecoder_granularity;//Granularity of precoding [TS38.211 sec 7.3.2.2] 0: sameAsRegBundle 1: allContiguousRBs
uint16_tnum_dl_dci;//Number of DCIs in this CORESET. Value: 0->MaxDciPerSlot
nfapi_nr_dl_dci_pdu_t*dl_dci_list;
}nfapi_nr_pdcch_pdu_t;
//for pdsch_pdu:
typedefstruct
{
uint16_ttarget_code_rate;//
uint8_tqam_mod_order;//
uint8_tmcs_index;//
uint8_tmcs_table;//
uint8_trv_index;//
uint32_ttb_size;//
}nfapi_nr_code_word_t;
//table 3-38
typedefstruct
{
uint16_tpdu_bit_map;//Bitmap indicating presence of optional PDUs Bit 0: pdschPtrs - Indicates PTRS included (FR2) Bit 1:cbgRetxCtrl (Present when CBG based retransmit is used) All other bits reserved
uint16_trnti;//The RNTI used for identifying the UE when receiving the PDU Value: 1 -> 65535
uint16_tpdu_index;//
uint16_tbwp_size;//Bandwidth part size [TS38.213 sec12]. Number of contiguous PRBs allocated to the BWP Value: 1->275
uint16_tbwp_start;//bandwidth part start RB index from reference CRB [TS38.213 sec 12] Value: 0->274
uint8_tsubcarrier_spacing;//Value:0->4
uint8_tcyclic_prefix;//0: Normal; 1: Extended
uint8_tnr_of_code_words;//Number of code words for this RNTI (UE) Value: 1 -> 2
nfapi_nr_code_word_t*code_word_list;
uint16_tdata_scrambling_id;//
uint8_tnr_of_layers;//
uint8_ttransmission_scheme;//PDSCH transmission schemes [TS38.214, sec 5.1.1] 0: Up to 8 transmission layers
uint8_tref_point;//Reference point for PDSCH DMRS "k" - used for tone mapping
//DMRS
uint16_tdl_dmrs_symb_pos;//Bitmap occupying the 14 LSBs with: bit 0: first symbol and for each bit 0: no DMRS 1: DMRS
uint8_tdmrs_config_type;//DL DMRS config type[TS38.211, sec 7.4.1.1.2] 0: type 1 1: type 2
uint16_tdl_dmrs_scrambling_id;//DL-DMRS-Scrambling-ID [TS38.211, sec 7.4.1.1.2 ] If provided by the higher-layer and the PDSCH is scheduled by PDCCH with CRC scrambled by CRNTI or CS-RNTI, otherwise, L2 should set this to physical cell id. Value: 0->65535
uint8_tscid;// 0 1
uint8_tnum_dmrs_cdm_grps_no_data;//Number of DM-RS CDM groups without data [TS38.212 sec 7.3.1.2.2] [TS38.214 Table 4.1-1] it determines the ratio of PDSCH EPRE to DM-RS EPRE. Value: 1->3
uint16_tdmrs_ports;//DMRS ports. [TS38.212 7.3.1.2.2] provides description between DCI 1-1 content and DMRS ports. Bitmap occupying the 11 LSBs with: bit 0: antenna port 1000 bit 11: antenna port 1011 and for each bit 0: DMRS port not used 1: DMRS port used
//Pdsch Allocation in frequency domain [TS38.214, sec 5.1.2.2]
uint8_tresource_alloc;//Resource Allocation Type [TS38.214, sec 5.1.2.2] 0: Type 0 1: Type 1
uint8_trb_bit_map[36];//For resource alloc type 0. TS 38.212 V15.0.x, 7.3.1.2.2 bitmap of RBs, 273 rounded up to multiple of 32. This bitmap is in units of VRBs. LSB of byte 0 of the bitmap represents the first RB of the bwp
uint16_trb_start;//For resource allocation type 1. [TS38.214, sec5.1.2.2.2] The starting resource block within the BWP for this PDSCH. Value: 0->274
uint16_trb_size;//For resource allocation type 1. [TS38.214, sec 5.1.2.2.2] The number of resource block within for this PDSCH. Value: 1->275
uint8_tvrb_to_prb_mapping;//VRB-to-PRB-mapping [TS38.211, sec 7.3.1.6] 0: non-interleaved 1: interleaved with RB size 2 2: Interleaved with RB size 4
//Resource Allocation in time domain [TS38.214, sec 5.1.2.1]
uint8_tstart_symbol_index;//Start symbol index of PDSCH mapping from the start of the slot, S. [TS38.214, Table 5.1.2.1-1] Value: 0->13
uint8_tnr_of_symbols;//PDSCH duration in symbols, L [TS38.214, Table 5.1.2.1-1] Value: 1->14
//PTRS TS38.214 sec 5.1.6.3
uint8_tptrs_port_index;//PT-RS antenna ports [TS38.214, sec 5.1.6.3] [TS38.211, table 7.4.1.2.2-1] Bitmap occupying the 6 LSBs with: bit 0: ntenna port 1000 bit 5: antenna port 1005 and for each bit 0: PTRS port not used 1: PTRS port used
uint8_tptrs_time_density;//PT-RS time density [TS38.214, table 5.1.6.3-1] 0: 1 1: 2 2: 4
uint8_tptrs_freq_density;//PT-RS frequency density [TS38.214, table[5.1.6.3-2] 0: 2 1: 4
uint8_tptrs_re_offset;//PT-RS resource element offset [TS38.211, table [7.4.1.2.2-1]
uint8_tn_epre_ratio_of_pdsch_to_ptrs;//PT-RS-to-PDSCH EPRE ratio [TS38.214, table 4.1-2] Value :0->3
uint8_tis_last_cb_present;//Indicates whether last CB is present in the CBG retransmission 0: CBG retransmission does not include last CB 1: CBG retransmission includes last CB If CBG Re-Tx includes last CB, L1 will add the TB CRC to the last CB in the payload before it is read into the LDPC HW unit
uint8_tis_inline_tb_crc;//Indicates whether TB CRC is part of data payload or control message 0: TB CRC is part of data payload 1: TB CRC is part of control message
uint32_tdl_tb_crc;//TB CRC: to be used in the last CB, applicable only if last CB is present
uint8_trow;//Row entry into the CSI Resource location table. [TS38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1] Value: 1-18
uint16_tfreq_domain;//Value: Up to the 12 LSBs, actual size is determined by the Row parameter
uint8_tsymb_l0;//The time domain location l0 and firstOFDMSymbolInTimeDomain Value: 0->13
uint8_tsymb_l1;//
uint8_tcdm_type;
uint8_tfreq_density;//The density field, p and comb offset (for dot5).0: dot5 (even RB), 1: dot5 (odd RB), 2: one, 3: three
uint16_tscramb_id;//ScramblingID of the CSI-RS [TS38.214, sec 5.2.2.3.1] Value: 0->1023
//tx power info
uint8_tpower_control_offset;//Ratio of PDSCH EPRE to NZP CSI-RSEPRE Value :0->23 representing -8 to 15 dB in 1dB steps
uint8_tpower_control_offset_ss;//Ratio of SSB/PBCH block EPRE to NZP CSI-RS EPRES 0: -3dB, 1: 0dB, 2: 3dB, 3: 6dB
}nfapi_nr_csi_rs_pdu_t;
//for ssb_pdu:
typedefstruct
{
uint32_tbch_payload;//BCH payload. The valid bits are indicated in the PARAM/CONFIG TLVs. If PARAM/CONFIG TLVs indicate MAC generates full bchPayload then the payload length is 31 bits with the 8 LSB bits being. Otherwise timing PBCH bits are generated by the PHY. And for bchPayload the 24 LSB are used.
}nfapi_nr_mac_generated_mib_pdu_t;
typedefstruct
{
uint8_tdmrs_type_a_position;//The position of the first DM-RS for downlink and uplink.
uint8_tpdcch_config_sib1;//The parameter PDCCH-ConfigSIB1 that determines a common ControlResourceSet (CORESET) a common search space and necessary PDCCH parameters.
uint8_tcell_barred;//The flag to indicate whether the cell is barred
uint8_tintra_freq_reselection;//The flag to controls cell selection/reselection to intrafrequency cells when the highest ranked cell is barred, or treated as barred by the UE. value 0 1
uint8_tbeta_pss;//PSS EPRE to SSS EPRE in a SS/PBCH block 0 = 0dB 1 = 3dB
uint8_tssb_block_index;//SS/PBCH block index within a SSB burst set. Required for PBCH DMRS scrambling. Value: 0->63 (Lmax)
uint8_tssb_subcarrier_offset;//
uint16_tssb_offset_point_a;//Offset of lowest subcarrier of lowest resource block used for SS/PBCH block. Value: 0->2199
uint8_tbch_payload_flag;//A value indicating how the BCH payload is generated. This should match the PARAM/CONFIG TLVs. Value: 0: MAC generates the full PBCH payload, see Table 3-41, where bchPayload has 31 bits 1: PHY generates the timing PBCH bits, see Table 3-41, where the bchPayload has 24 bits 2: PHY generates the full PBCH payload
uint16_tpdu_size;//Size of the PDU control information (in bytes). This length value includes the 4 bytes required for the PDU type and PDU size parameters. Value 0 -> 65535
uint16_tptrs_port_index;//PT-RS antenna ports [TS38.214, sec6.2.3.1 and 38.212, section 7.3.1.1.2] Bitmap occupying the 12 LSBs with: bit 0: antenna port 0 bit 11: antenna port 11 and for each bit 0: PTRS port not used 1: PTRS port used
uint8_tptrs_dmrs_port;//DMRS port corresponding to PTRS.
uint8_tptrs_re_offset;//PT-RS resource element offset value taken from 0~11
}nfapi_nr_ptrs_ports_t;
typedefstruct
{
uint8_tnum_ptrs_ports;
nfapi_nr_ptrs_ports_t*ptrs_ports_list;
uint8_tptrs_time_density;
uint8_tptrs_freq_density;
uint8_tul_ptrs_power;
}nfapi_nr_pusch_ptrs_t;
//for nfapi_nr_dfts_ofdm_t
typedefstruct
{
uint8_tlow_papr_group_number;//Group number for Low PAPR sequence generation.
uint16_tlow_papr_sequence_number;//[TS38.211, sec 5.2.2] For DFT-S-OFDM.
uint8_tul_ptrs_sample_density;//Number of PTRS groups [But I suppose this sentence is misplaced, so as the next one. --Chenyu]
uint8_tul_ptrs_time_density_transform_precoding;//Number of samples per PTRS group
}nfapi_nr_dfts_ofdm_t;
#define PUSCH_PDU_BITMAP_PUSCH_DATA 0x1
#define PUSCH_PDU_BITMAP_PUSCH_UCI 0x2
#define PUSCH_PDU_BITMAP_PUSCH_PTRS 0x4
#define PUSCH_PDU_BITMAP_DFTS_OFDM 0x8
typedefstruct
{
uint16_tpdu_bit_map;//Bitmap indicating presence of optional PDUs (see above)
uint16_trnti;
uint32_thandle;//An opaque handling returned in the RxData.indication and/or UCI.indication message
//BWP
uint16_tbwp_size;
uint16_tbwp_start;
uint8_tsubcarrier_spacing;
uint8_tcyclic_prefix;
//pusch information always include
uint16_ttarget_code_rate;
uint8_tqam_mod_order;
uint8_tmcs_index;
uint8_tmcs_table;
uint8_ttransform_precoding;
uint16_tdata_scrambling_id;
uint8_tnrOfLayers;
//DMRS
uint8_tul_dmrs_symb_pos;
uint8_tdmrs_config_type;
uint16_tul_dmrs_scrambling_id;
uint8_tscid;//
uint8_tnum_dmrs_cdm_grps_no_data;
uint16_tdmrs_ports;//DMRS ports. [TS38.212 7.3.1.1.2] provides description between DCI 0-1 content and DMRS ports. Bitmap occupying the 11 LSBs with: bit 0: antenna port 1000 bit 11: antenna port 1011 and for each bit 0: DMRS port not used 1: DMRS port used
//Pusch Allocation in frequency domain [TS38.214, sec 6.1.2.2]
uint8_tresource_alloc;
uint8_trb_bitmap[36];//
uint16_trb_start;
uint16_trb_size;
uint8_tvrb_to_prb_mapping;
uint8_tfrequency_hopping;
uint16_ttx_direct_current_location;//The uplink Tx Direct Current location for the carrier. Only values in the value range of this field between 0 and 3299, which indicate the subcarrier index within the carrier corresponding 1o the numerology of the corresponding uplink BWP and value 3300, which indicates "Outside the carrier" and value 3301, which indicates "Undetermined position within the carrier" are used. [TS38.331, UplinkTxDirectCurrentBWP IE]
uint8_tuplink_frequency_shift_7p5khz;
//Resource Allocation in time domain
uint8_tstart_symbol_index;
uint8_tnr_of_symbols;
//Optional Data only included if indicated in pduBitmap
nfapi_nr_pusch_data_tpusch_data;
nfapi_nr_pusch_uci_tpusch_uci;
nfapi_nr_pusch_ptrs_tpusch_ptrs;
nfapi_nr_dfts_ofdm_tdfts_ofdm;
//beamforming
nfapi_nr_ul_beamforming_tbeamforming;
}nfapi_nr_pusch_pdu_t;
//for pucch_pdu:
typedefstruct
{
uint16_trnti;
uint32_thandle;
//BWP
uint16_tbwp_size;
uint16_tbwp_start;
uint8_tsubcarrier_spacing;
uint8_tcyclic_prefix;
uint8_tformat_type;
uint8_tmulti_slot_tx_indicator;
uint8_tpi_2bpsk;
//pucch allocation in freq domain
uint16_tprb_start;
uint16_tprb_size;
//pucch allocation in tome domain
uint8_tstart_symbol_index;
uint8_tnr_of_symbols;
//hopping info
uint8_tfreq_hop_flag;
uint16_tsecond_hop_prb;
uint8_tgroup_hop_flag;
uint8_tsequence_hop_flag;
uint16_thopping_id;
uint16_tinitial_cyclic_shift;
uint16_tdata_scrambling_id;
uint8_ttime_domain_occ_idx;
uint8_tpre_dft_occ_idx;
uint8_tpre_dft_occ_len;
//DMRS
uint8_tadd_dmrs_flag;
uint16_tdmrs_scrambling_id;
uint8_tdmrs_cyclic_shift;
uint8_tsr_flag;
uint8_tbit_len_harq;
uint16_tbit_len_csi_part1;
uint16_tbit_len_csi_part2;
nfapi_nr_ul_beamforming_tbeamforming;
}nfapi_nr_pucch_pdu_t;
//for srs_pdu:
typedefstruct
{
uint16_trnti;//UE RNTI
uint32_thandle;//An opaque handling returned in the SRS.indication
//BWP
uint16_tbwp_size;
uint16_tbwp_start;
uint8_tsubcarrier_spacing;
uint8_tcyclic_prefix;
uint8_tnum_ant_ports;
uint8_tnum_symbols;
uint8_tnum_repetitions;
uint8_ttime_start_position;//Starting position in the time domain l0; Note: the MAC undertakes the translation from startPosition to 𝑙0
uint16_ttiming_advance;//Timing advance 𝑇𝐴 measured for the UE [TS 38.213, Section 4.2] NTA_new = NTA_old + (TA − 31) ⋅ 16 ⋅ 64⁄2μ Value: 0 → 63 0xffff should be set if this field is invalid
uint16_trssi;
//variable ! fixme
uint32_tpdu;//MAC PDU
}nfapi_nr_rx_data_pdu_t;
typedefstruct
{
uint16_tsfn;
uint16_tslot;
uint16_tnumber_of_pdus;
nfapi_nr_rx_data_pdu_t*pdu_list;
}nfapi_nr_rx_data_indication_t;
//3.4.8 crc_indication
//table 3-62
typedefstruct
{
uint32_thandle;
uint16_trnti;
uint8_tharq_id;
uint8_ttb_crc_status;
uint16_tnum_cb;//If CBG is not used this parameter can be set to zero. Otherwise the number of CBs in the TB. Value: 0->65535