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_ue_ptrs_ports_t;
typedefstruct
{
uint8_tnum_ptrs_ports;
nfapi_nr_ue_ptrs_ports_t*ptrs_ports_list;
uint8_tptrs_time_density;
uint8_tptrs_freq_density;
uint8_tul_ptrs_power;
}nfapi_nr_ue_pusch_ptrs_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_ue_dfts_ofdm_t;
typedefstruct
{
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
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
uint16_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
@@ -296,7 +296,7 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u
/* 38.321 5.4.2.1 2> if the uplink grant was received on PDCCH for the C-RNTI and the HARQ buffer of the identified process is empty */
if((ulsch->harq_processes[harq_pid]->first_tx==1)&&(rnti_type==_C_RNTI_)){/* no transmission yet on this process so consider its harq buffer as empty */
ulsch->harq_processes[harq_pid]->first_tx=0;
ulsch->harq_processes[harq_pid]->DCINdi=ndi;/* store first value of ndi */
ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator=ndi;/* store first value of ndi */
@@ -306,8 +306,8 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u
}
/* 38.321 5.4.2.1 2> if the received grant was not addressed to a Temporary C-RNTI on PDCCH, and the NDI provided in the associated HARQ */
/* information has been toggled compared to the value in the previous transmission of this TB of this HARQ process */
elseif((ulsch->harq_processes[harq_pid]->DCINdi!=ndi)&&(rnti_type!=_TC_RNTI_)){/* is ndi toogled so this is a new grant ? */
ulsch->harq_processes[harq_pid]->DCINdi=ndi;/* store first value of ndi */
elseif((ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator!=ndi)&&(rnti_type!=_TC_RNTI_)){/* is ndi toogled so this is a new grant ? */
ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator=ndi;/* store first value of ndi */
@@ -424,15 +423,6 @@ int main(int argc, char **argv)
for(i=0;i<TBS/8;i++)
test_input[i]=(unsignedchar)rand();
/////////////////////////[adk] preparing NR_UE_ULSCH_t parameters///////////////////////// A HOT FIX until creating nfapi_nr_ul_config_ulsch_pdu_rel15_t
pusch_pdu->data_scrambling_id=0;//It equals the higher-layer parameter Data-scrambling-Identity if configured and the RNTI equals the C-RNTI, otherwise L2 needs to set it to physical cell id.;
pusch_pdu->nrOfLayers=1;
//DMRS
pusch_pdu->ul_dmrs_symb_pos=1<<2;//for now the gnb assumes dmrs in the first symbol of the scheduled pusch resource
pusch_pdu->dmrs_config_type=0;//dmrs-type 1 (the one with a single DMRS symbol in the beginning)
pusch_pdu->ul_dmrs_scrambling_id=0;//If provided and the PUSCH is not a msg3 PUSCH, otherwise, L2 should set this to physical cell id.
pusch_pdu->scid=0;//DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]. Should match what is sent in DCI 0_1, otherwise set to 0.
//pusch_pdu->num_dmrs_cdm_grps_no_data;
//pusch_pdu->dmrs_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]
pusch_pdu->resource_alloc=1;//type 1
//pusch_pdu->rb_bitmap;// for ressource alloc type 0