Merge remote-tracking branch 'origin/develop-SA-CBRA' into integration_2020_wk15
Conflicts: openair1/PHY/TOOLS/nr_phy_scope.c targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
This commit is contained in:
@@ -124,7 +124,37 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon));
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero = CALLOC(1,sizeof(long));
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero = CALLOC(1,sizeof(long));
|
||||
// scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = CALLOC(1,sizeof(struct NR_ControlResourceSet));
|
||||
|
||||
NR_ControlResourceSet_t *coreset0 = CALLOC(1,sizeof(struct NR_ControlResourceSet));
|
||||
coreset0->controlResourceSetId = 0;
|
||||
// frequencyDomainResources '11111111 00000000 00000000 00000000 00000000 00000'B,
|
||||
if(coreset0->frequencyDomainResources.buf == NULL) coreset0->frequencyDomainResources.buf = calloc(1,6);
|
||||
coreset0->frequencyDomainResources.buf[0] = 0xff;
|
||||
coreset0->frequencyDomainResources.buf[1] = 0;
|
||||
coreset0->frequencyDomainResources.buf[2] = 0;
|
||||
coreset0->frequencyDomainResources.buf[3] = 0;
|
||||
coreset0->frequencyDomainResources.buf[4] = 0;
|
||||
coreset0->frequencyDomainResources.buf[5] = 0;
|
||||
coreset0->frequencyDomainResources.size = 6;
|
||||
coreset0->frequencyDomainResources.bits_unused = 3;
|
||||
coreset0->duration = 1;
|
||||
coreset0->cce_REG_MappingType.present=NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved;
|
||||
coreset0->cce_REG_MappingType.choice.interleaved=calloc(1,sizeof(*coreset0->cce_REG_MappingType.choice.interleaved));
|
||||
coreset0->cce_REG_MappingType.choice.interleaved->reg_BundleSize = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6;
|
||||
coreset0->cce_REG_MappingType.choice.interleaved->interleaverSize = NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n2;
|
||||
coreset0->cce_REG_MappingType.choice.interleaved->shiftIndex = scc->physCellId;
|
||||
coreset0->precoderGranularity = NR_ControlResourceSet__precoderGranularity_sameAsREG_bundle;
|
||||
if(coreset0->tci_StatesPDCCH_ToAddList == NULL) coreset0->tci_StatesPDCCH_ToAddList = calloc(1,sizeof(*coreset0->tci_StatesPDCCH_ToAddList));
|
||||
NR_TCI_StateId_t *tci[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
tci[i]=calloc(1,sizeof(*tci[i]));
|
||||
*tci[i] = i;
|
||||
ASN_SEQUENCE_ADD(&coreset0->tci_StatesPDCCH_ToAddList->list,tci[i]);
|
||||
}
|
||||
coreset0->tci_StatesPDCCH_ToReleaseList = NULL;
|
||||
coreset0->tci_PresentInDCI = NULL;
|
||||
coreset0->pdcch_DMRS_ScramblingID = NULL;
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = coreset0;
|
||||
|
||||
// scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList));
|
||||
// scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
|
||||
@@ -335,12 +335,12 @@ typedef struct {
|
||||
#define DL_SCH_LCID_CON_RES_ID 0x3E
|
||||
#define DL_SCH_LCID_PADDING 0x3F
|
||||
|
||||
#define UL_SCH_LCID_CCCH 0x00
|
||||
#define UL_SCH_LCID_CCCH1 0x00
|
||||
#define UL_SCH_LCID_SRB1 0x01
|
||||
#define UL_SCH_LCID_SRB2 0x02
|
||||
#define UL_SCH_LCID_SRB3 0x03
|
||||
#define UL_SCH_LCID_DTCH 0x04
|
||||
#define UL_SCH_LCID_CCCH_MSG3 0x21
|
||||
#define UL_SCH_LCID_CCCH 0x34
|
||||
#define UL_SCH_LCID_RECOMMENDED_BITRATE_QUERY 0x35
|
||||
#define UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT 0x36
|
||||
#define UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION 0x37
|
||||
|
||||
@@ -125,6 +125,152 @@ const float table_38213_13_12_c3[16] = { 1, 0.5f, 1, 0.5f, 1, 0.5f, 0.5f, 0.5f
|
||||
|
||||
const int32_t table_38213_10_1_1_c2[5] = { 0, 0, 4, 2, 1 };
|
||||
|
||||
// for PDSCH from TS 38.214 subclause 5.1.2.1.1
|
||||
const uint8_t table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[16][3]={
|
||||
{0,2,12}, // row index 1
|
||||
{0,2,10}, // row index 2
|
||||
{0,2,9}, // row index 3
|
||||
{0,2,7}, // row index 4
|
||||
{0,2,5}, // row index 5
|
||||
{0,9,4}, // row index 6
|
||||
{0,4,4}, // row index 7
|
||||
{0,5,7}, // row index 8
|
||||
{0,5,2}, // row index 9
|
||||
{0,9,2}, // row index 10
|
||||
{0,12,2}, // row index 11
|
||||
{0,1,13}, // row index 12
|
||||
{0,1,6}, // row index 13
|
||||
{0,2,4}, // row index 14
|
||||
{0,4,7}, // row index 15
|
||||
{0,8,4} // row index 16
|
||||
};
|
||||
const uint8_t table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[16][3]={
|
||||
{0,3,11}, // row index 1
|
||||
{0,3,9}, // row index 2
|
||||
{0,3,8}, // row index 3
|
||||
{0,3,6}, // row index 4
|
||||
{0,3,4}, // row index 5
|
||||
{0,10,4}, // row index 6
|
||||
{0,6,4}, // row index 7
|
||||
{0,5,7}, // row index 8
|
||||
{0,5,2}, // row index 9
|
||||
{0,9,2}, // row index 10
|
||||
{0,12,2}, // row index 11
|
||||
{0,1,13}, // row index 12
|
||||
{0,1,6}, // row index 13
|
||||
{0,2,4}, // row index 14
|
||||
{0,4,7}, // row index 15
|
||||
{0,8,4} // row index 16
|
||||
};
|
||||
const uint8_t table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[16][3]={
|
||||
{0,2,6}, // row index 1
|
||||
{0,2,10}, // row index 2
|
||||
{0,2,9}, // row index 3
|
||||
{0,2,7}, // row index 4
|
||||
{0,2,5}, // row index 5
|
||||
{0,6,4}, // row index 6
|
||||
{0,4,4}, // row index 7
|
||||
{0,5,6}, // row index 8
|
||||
{0,5,2}, // row index 9
|
||||
{0,9,2}, // row index 10
|
||||
{0,10,2}, // row index 11
|
||||
{0,1,11}, // row index 12
|
||||
{0,1,6}, // row index 13
|
||||
{0,2,4}, // row index 14
|
||||
{0,4,6}, // row index 15
|
||||
{0,8,4} // row index 16
|
||||
};
|
||||
const uint8_t table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[16][3]={
|
||||
{0,3,5}, // row index 1
|
||||
{0,3,9}, // row index 2
|
||||
{0,3,8}, // row index 3
|
||||
{0,3,6}, // row index 4
|
||||
{0,3,4}, // row index 5
|
||||
{0,8,2}, // row index 6
|
||||
{0,6,4}, // row index 7
|
||||
{0,5,6}, // row index 8
|
||||
{0,5,2}, // row index 9
|
||||
{0,9,2}, // row index 10
|
||||
{0,10,2}, // row index 11
|
||||
{0,1,11}, // row index 12
|
||||
{0,1,6}, // row index 13
|
||||
{0,2,4}, // row index 14
|
||||
{0,4,6}, // row index 15
|
||||
{0,8,4} // row index 16
|
||||
};
|
||||
const uint8_t table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[16][3]={
|
||||
{0,2,2}, // row index 1
|
||||
{0,4,2}, // row index 2
|
||||
{0,6,2}, // row index 3
|
||||
{0,8,2}, // row index 4
|
||||
{0,10,2}, // row index 5
|
||||
{1,2,2}, // row index 6
|
||||
{1,4,2}, // row index 7
|
||||
{0,2,4}, // row index 8
|
||||
{0,4,4}, // row index 9
|
||||
{0,6,4}, // row index 10
|
||||
{0,8,4}, // row index 11
|
||||
{0,10,4}, // row index 12
|
||||
{0,2,7}, // row index 13
|
||||
{0,2,12}, // row index 14
|
||||
{1,2,4}, // row index 15
|
||||
{0,0,0} // row index 16
|
||||
};
|
||||
const uint8_t table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[16][3]={
|
||||
{0,2,2}, // row index 1
|
||||
{0,4,2}, // row index 2
|
||||
{0,6,2}, // row index 3
|
||||
{0,8,2}, // row index 4
|
||||
{0,10,2}, // row index 5
|
||||
{1,2,2}, // row index 6
|
||||
{1,4,2}, // row index 7
|
||||
{0,2,4}, // row index 8
|
||||
{0,4,4}, // row index 9
|
||||
{0,6,4}, // row index 10
|
||||
{0,8,4}, // row index 11
|
||||
{0,10,4}, // row index 12
|
||||
{0,2,7}, // row index 13
|
||||
{0,3,11}, // row index 14
|
||||
{1,2,4}, // row index 15
|
||||
{0,0,0} // row index 16
|
||||
};
|
||||
const uint8_t table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[16][3]={
|
||||
{0,2,2}, // row index 1
|
||||
{0,4,2}, // row index 2
|
||||
{0,6,2}, // row index 3
|
||||
{0,8,2}, // row index 4
|
||||
{0,10,2}, // row index 5
|
||||
{0,0,0}, // row index 6
|
||||
{0,0,0}, // row index 7
|
||||
{0,2,4}, // row index 8
|
||||
{0,4,4}, // row index 9
|
||||
{0,6,4}, // row index 10
|
||||
{0,8,4}, // row index 11
|
||||
{0,10,4}, // row index 12
|
||||
{0,2,7}, // row index 13
|
||||
{0,2,12}, // row index 14
|
||||
{0,0,6}, // row index 15
|
||||
{0,2,6} // row index 16
|
||||
};
|
||||
const uint8_t table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[16][3]={
|
||||
{0,2,2}, // row index 1
|
||||
{0,4,2}, // row index 2
|
||||
{0,6,2}, // row index 3
|
||||
{0,8,2}, // row index 4
|
||||
{0,10,2}, // row index 5
|
||||
{0,0,0}, // row index 6
|
||||
{0,0,0}, // row index 7
|
||||
{0,2,4}, // row index 8
|
||||
{0,4,4}, // row index 9
|
||||
{0,6,4}, // row index 10
|
||||
{0,8,4}, // row index 11
|
||||
{0,10,4}, // row index 12
|
||||
{0,2,7}, // row index 13
|
||||
{0,3,11}, // row index 14
|
||||
{0,0,6}, // row index 15
|
||||
{0,2,6} // row index 16
|
||||
};
|
||||
|
||||
const char *prachfmt[]={"0","1","2","3", "A1","A2","A3","B1","B4","C0","C2","A1/B1","A2/B2","A3/B3"};
|
||||
const char *duplex_mode[]={"FDD","TDD"};
|
||||
|
||||
@@ -2166,8 +2312,8 @@ int get_num_dmrs(uint16_t dmrs_mask ) {
|
||||
return(num_dmrs);
|
||||
}
|
||||
/* returns the total DMRS symbols in a slot*/
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols){
|
||||
return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols));
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol){
|
||||
return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols,startSymbol));
|
||||
}
|
||||
|
||||
// Table 5.1.2.2.1-1 38.214
|
||||
@@ -2771,7 +2917,7 @@ int is_nr_DL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slot) {
|
||||
int slots1=period1*(1<<scs)/1000;
|
||||
int slot_in_period = slot % slots;
|
||||
if (slot_in_period < slots1) return(slot_in_period <= scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots ? 1 : 0);
|
||||
else return(slot_in_period <= slots1+scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
|
||||
else return(slot_in_period <= slots1+scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
|
||||
}
|
||||
|
||||
int is_nr_UL_slot(NR_ServingCellConfigCommon_t *scc, slot_t slot, lte_frame_type_t frame_type) {
|
||||
@@ -2803,24 +2949,28 @@ int is_nr_UL_slot(NR_ServingCellConfigCommon_t *scc, slot_t slot, lte_frame_type
|
||||
int slots1=period1*(1<<scs)/1000;
|
||||
int slot_in_period = slot % slots;
|
||||
if (slot_in_period < slots1) return(slot_in_period >= scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots ? 1 : 0);
|
||||
else return(slot_in_period >= slots1+scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
|
||||
else return(slot_in_period >= slots1+scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
|
||||
}
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols) {
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol) {
|
||||
|
||||
int l0;
|
||||
int ld = NrOfSymbols+startSymbol;
|
||||
if (dmrs_TypeA_Position == NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2) l0=2;
|
||||
else if (dmrs_TypeA_Position == NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos3) l0=3;
|
||||
else AssertFatal(1==0,"Illegal dmrs_TypeA_Position %d\n",(int)dmrs_TypeA_Position);
|
||||
if (pdsch_Config == NULL) { // Initial BWP
|
||||
return(1<<l0);
|
||||
if (ld <= 7) return(1<<l0);
|
||||
else if (ld <= 9) return(1<<l0 | 1<<7);
|
||||
else if (ld <= 12) return(1<<l0 | 1<<6 | 1<<9);
|
||||
else if (ld <= 14) return(1<<l0 | 1<<7 | 1<<11);
|
||||
}
|
||||
else {
|
||||
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA &&
|
||||
pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->present == NR_SetupRelease_DMRS_DownlinkConfig_PR_setup) {
|
||||
// Relative to start of slot
|
||||
NR_DMRS_DownlinkConfig_t *dmrs_config = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
|
||||
AssertFatal(NrOfSymbols>1 && NrOfSymbols < 15,"Illegal NrOfSymbols %d\n",NrOfSymbols);
|
||||
AssertFatal(ld>1 && ld < 15,"Illegal l_d %d\n",ld);
|
||||
int pos2=0;
|
||||
if (dmrs_config->maxLength == NULL) {
|
||||
// this is Table 7.4.1.1.2-3: PDSCH DM-RS positions l for single-symbol DM-RS
|
||||
@@ -2829,7 +2979,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
||||
return(1<<l0);
|
||||
|
||||
|
||||
switch (NrOfSymbols) {
|
||||
switch (ld) {
|
||||
case 2 :
|
||||
case 3 :
|
||||
case 4 :
|
||||
@@ -2870,10 +3020,10 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
||||
}
|
||||
else {
|
||||
// Table 7.4.1.1.2-4: PDSCH DM-RS positions l for double-symbol DM-RS.
|
||||
AssertFatal(NrOfSymbols>3,"Illegal NrOfSymbols %d for len2 DMRS\n",NrOfSymbols);
|
||||
if (NrOfSymbols < 10) return(1<<l0);
|
||||
if (NrOfSymbols < 13 && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
if (NrOfSymbols < 13 && *dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0 | 1<<8);
|
||||
AssertFatal(ld>3,"Illegal l_d %d for len2 DMRS\n",ld);
|
||||
if (ld < 10) return(1<<l0);
|
||||
if (ld < 13 && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
if (ld < 13 && *dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0 | 1<<8);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1) return(1<<l0 | 1<<10);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
|
||||
@@ -47,7 +47,7 @@ uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol);
|
||||
|
||||
int is_nr_DL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slotP);
|
||||
|
||||
@@ -152,7 +152,8 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config,
|
||||
uint8_t *K_ptrs, uint8_t *L_ptrs,
|
||||
uint8_t *reOffset, uint8_t *maxNumPorts, uint8_t *ulPower,
|
||||
uint8_t NrOfSymbols);
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
|
||||
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol);
|
||||
|
||||
/* \brief Set the transform precoding according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16
|
||||
@param *pusch_config, pointer to pusch config
|
||||
|
||||
@@ -139,4 +139,13 @@ extern const float table_38213_13_12_c3[16];
|
||||
|
||||
extern const int32_t table_38213_10_1_1_c2[5];
|
||||
|
||||
extern const uint8_t table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[16][3];
|
||||
|
||||
#endif //DEF_H
|
||||
|
||||
@@ -31,9 +31,11 @@
|
||||
*/
|
||||
|
||||
//#include "mac_defs.h"
|
||||
#include <NR_MAC_gNB/mac_proto.h>
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "NR_MAC-CellGroupConfig.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
|
||||
int mu,
|
||||
@@ -309,8 +311,11 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
|
||||
else
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
|
||||
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1 = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart;
|
||||
if (get_softmodem_params()->sa) {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1 = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
} else {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1 = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
}
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_root_sequences = compute_nr_root_seq(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup, nb_preambles, mac->frame_type, frequency_range);
|
||||
//cfg->prach_config.num_prach_fd_occasions_list[i].num_unused_root_sequences = ???
|
||||
@@ -528,11 +533,13 @@ int nr_rrc_mac_config_req_ue(
|
||||
mac->servCellIndex = *cell_group_config->spCellConfig->servCellIndex;
|
||||
config_control_ue(mac);
|
||||
if (cell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||
ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink;
|
||||
mac->scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
mac->crnti = cell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||
if (cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) {
|
||||
ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink;
|
||||
}
|
||||
mac->scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
mac->crnti = cell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||
}
|
||||
|
||||
// Setup the SSB to Rach Occasions mapping according to the config
|
||||
|
||||
@@ -234,9 +234,12 @@ typedef struct {
|
||||
|
||||
typedef enum {
|
||||
RA_UE_IDLE = 0,
|
||||
WAIT_RAR = 1,
|
||||
WAIT_CONTENTION_RESOLUTION = 2,
|
||||
RA_SUCCEEDED = 3
|
||||
GENERATE_IDLE = 0,
|
||||
GENERATE_PREAMBLE = 1,
|
||||
WAIT_RAR = 2,
|
||||
WAIT_CONTENTION_RESOLUTION = 3,
|
||||
RA_SUCCEEDED = 4,
|
||||
RA_FAILED = 5
|
||||
} RA_state_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -257,8 +260,10 @@ typedef struct {
|
||||
uint8_t RA_attempt_number;
|
||||
/// Random-access procedure flag
|
||||
uint8_t RA_active;
|
||||
/// Random-access preamble index
|
||||
int ra_PreambleIndex;
|
||||
/// Flag for the Msg1 generation: enabled at every occurrence of nr prach slot
|
||||
uint8_t generate_nr_prach;
|
||||
RA_state_t generate_nr_prach;
|
||||
|
||||
/// Random-access window counter
|
||||
int16_t RA_window_cnt;
|
||||
@@ -289,6 +294,8 @@ typedef struct {
|
||||
uint8_t RA_contention_resolution_timer_active;
|
||||
/// Random-access Contention Resolution Timer count value
|
||||
uint8_t RA_contention_resolution_cnt;
|
||||
/// Transmitted UE Contention Resolution Identifier
|
||||
uint8_t cont_res_id[6];
|
||||
|
||||
/// BeamfailurerecoveryConfig
|
||||
NR_BeamFailureRecoveryConfig_t RA_BeamFailureRecoveryConfig;
|
||||
|
||||
@@ -178,7 +178,8 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
uint8_t time_domain_ind);
|
||||
uint8_t time_domain_ind,
|
||||
bool use_default);
|
||||
|
||||
uint8_t
|
||||
nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
|
||||
@@ -146,17 +146,11 @@ int nr_get_Po_NOMINAL_PUSCH(NR_PRACH_RESOURCES_t *prach_resources, module_id_t m
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
int8_t receivedTargerPower, delta_preamble;
|
||||
long preambleReceivedTargetPower = 0;
|
||||
|
||||
if (prach_resources->RA_TYPE == RA_4STEP){
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
preambleReceivedTargetPower = nr_rach_ConfigCommon->rach_ConfigGeneric.preambleReceivedTargetPower;
|
||||
} else if (prach_resources->RA_TYPE == RA_2STEP){
|
||||
// msgA-PreambleReceivedTargetPower
|
||||
LOG_E(MAC, "In %s:%d: missing implementation for 2-step RA...\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
int8_t receivedTargerPower;
|
||||
int8_t delta_preamble;
|
||||
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
long preambleReceivedTargetPower = nr_rach_ConfigCommon->rach_ConfigGeneric.preambleReceivedTargetPower;
|
||||
delta_preamble = nr_get_DELTA_PREAMBLE(mod_id, CC_id, prach_resources->prach_format);
|
||||
|
||||
receivedTargerPower = preambleReceivedTargetPower + delta_preamble + (prach_resources->RA_PREAMBLE_POWER_RAMPING_COUNTER - 1) * prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP + prach_resources->POWER_OFFSET_2STEP_RA;
|
||||
|
||||
@@ -64,6 +64,8 @@ void init_RA(module_id_t mod_id,
|
||||
|
||||
RA_config_t *ra = &mac->ra;
|
||||
ra->RA_active = 1;
|
||||
ra->ra_PreambleIndex = -1;
|
||||
ra->RA_usedGroupA = 1;
|
||||
ra->RA_RAPID_found = 0;
|
||||
ra->preambleTransMax = 0;
|
||||
ra->first_Msg3 = 1;
|
||||
@@ -79,8 +81,8 @@ void init_RA(module_id_t mod_id,
|
||||
|
||||
if (rach_ConfigDedicated) {
|
||||
if (rach_ConfigDedicated->cfra){
|
||||
LOG_I(MAC, "Initialization of 4-step contention-free random access procedure\n");
|
||||
prach_resources->RA_TYPE = RA_4STEP;
|
||||
LOG_I(MAC, "Initialization of 2-step contention-free random access procedure\n");
|
||||
prach_resources->RA_TYPE = RA_2STEP;
|
||||
ra->cfra = 1;
|
||||
} else if (rach_ConfigDedicated->ext1){
|
||||
if (rach_ConfigDedicated->ext1->cfra_TwoStep_r16){
|
||||
@@ -93,161 +95,152 @@ void init_RA(module_id_t mod_id,
|
||||
} else {
|
||||
LOG_E(MAC, "In %s: config not handled\n", __FUNCTION__);
|
||||
}
|
||||
} else if (nr_rach_ConfigCommon){
|
||||
LOG_I(MAC, "Initialization of 4-step contention-based random access procedure\n");
|
||||
prach_resources->RA_TYPE = RA_4STEP;
|
||||
ra->cfra = 0;
|
||||
} else {
|
||||
LOG_E(MAC, "In %s: config not handled\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
if (prach_resources->RA_TYPE == RA_2STEP){
|
||||
LOG_E(MAC, "Missing implementation of initialization of 2-step RA specific variables...\n");
|
||||
} else if (prach_resources->RA_TYPE == RA_4STEP){
|
||||
LOG_D(MAC, "Initialization of 4-step RA specific variables...\n");
|
||||
switch (rach_ConfigGeneric->powerRampingStep){ // in dB
|
||||
case 0:
|
||||
switch (rach_ConfigGeneric->powerRampingStep){ // in dB
|
||||
case 0:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 1:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 2;
|
||||
break;
|
||||
case 2:
|
||||
case 2:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 4;
|
||||
break;
|
||||
case 3:
|
||||
case 3:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (rach_ConfigGeneric->preambleTransMax) {
|
||||
case 0:
|
||||
ra->preambleTransMax = 3;
|
||||
break;
|
||||
case 1:
|
||||
ra->preambleTransMax = 4;
|
||||
break;
|
||||
case 2:
|
||||
ra->preambleTransMax = 5;
|
||||
break;
|
||||
case 3:
|
||||
ra->preambleTransMax = 6;
|
||||
break;
|
||||
case 4:
|
||||
ra->preambleTransMax = 7;
|
||||
break;
|
||||
case 5:
|
||||
ra->preambleTransMax = 8;
|
||||
break;
|
||||
case 6:
|
||||
ra->preambleTransMax = 10;
|
||||
break;
|
||||
case 7:
|
||||
ra->preambleTransMax = 20;
|
||||
break;
|
||||
case 8:
|
||||
ra->preambleTransMax = 50;
|
||||
break;
|
||||
case 9:
|
||||
ra->preambleTransMax = 100;
|
||||
break;
|
||||
case 10:
|
||||
ra->preambleTransMax = 200;
|
||||
break;
|
||||
}
|
||||
if (nr_rach_ConfigCommon->ext1) {
|
||||
if (nr_rach_ConfigCommon->ext1->ra_PrioritizationForAccessIdentity){
|
||||
LOG_D(MAC, "In %s:%d: Missing implementation for Access Identity initialization procedures\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
switch (rach_ConfigGeneric->preambleTransMax) {
|
||||
case 0:
|
||||
ra->preambleTransMax = 3;
|
||||
break;
|
||||
case 1:
|
||||
ra->preambleTransMax = 4;
|
||||
break;
|
||||
case 2:
|
||||
ra->preambleTransMax = 5;
|
||||
break;
|
||||
case 3:
|
||||
ra->preambleTransMax = 6;
|
||||
break;
|
||||
case 4:
|
||||
ra->preambleTransMax = 7;
|
||||
break;
|
||||
case 5:
|
||||
ra->preambleTransMax = 8;
|
||||
break;
|
||||
case 6:
|
||||
ra->preambleTransMax = 10;
|
||||
break;
|
||||
case 7:
|
||||
ra->preambleTransMax = 20;
|
||||
break;
|
||||
case 8:
|
||||
ra->preambleTransMax = 50;
|
||||
break;
|
||||
case 9:
|
||||
ra->preambleTransMax = 100;
|
||||
break;
|
||||
case 10:
|
||||
ra->preambleTransMax = 200;
|
||||
break;
|
||||
}
|
||||
|
||||
if (nr_rach_ConfigCommon->ext1) {
|
||||
if (nr_rach_ConfigCommon->ext1->ra_PrioritizationForAccessIdentity){
|
||||
LOG_D(MAC, "In %s:%d: Missing implementation for Access Identity initialization procedures\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ssb_rach_config(RA_config_t *ra, NR_PRACH_RESOURCES_t *prach_resources, NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon, fapi_nr_ul_config_prach_pdu *prach_pdu){
|
||||
|
||||
// Determine the SSB to RACH mapping ratio
|
||||
// =======================================
|
||||
if (prach_resources->RA_TYPE == RA_4STEP){
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
|
||||
boolean_t multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB
|
||||
uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB
|
||||
int total_preambles_per_ssb;
|
||||
uint8_t ssb_nb_in_ro;
|
||||
int numberOfRA_Preambles = 64;
|
||||
|
||||
switch (ssb_perRACH_config){
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 8;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 4;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 2;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 1;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 2;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 4;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 8;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 16;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Unsupported ssb_perRACH_config %d\n", ssb_perRACH_config);
|
||||
break;
|
||||
}
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
|
||||
boolean_t multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB
|
||||
uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB
|
||||
int total_preambles_per_ssb;
|
||||
uint8_t ssb_nb_in_ro;
|
||||
int numberOfRA_Preambles = 64;
|
||||
|
||||
if (nr_rach_ConfigCommon->totalNumberOfRA_Preambles)
|
||||
numberOfRA_Preambles = *(nr_rach_ConfigCommon->totalNumberOfRA_Preambles);
|
||||
switch (ssb_perRACH_config){
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 8;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 4;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 2;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 1;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 2;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 4;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 8;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 16;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Unsupported ssb_perRACH_config %d\n", ssb_perRACH_config);
|
||||
}
|
||||
|
||||
// Compute the proper Preamble selection params according to the selected SSB and the ssb_perRACH_OccasionAndCB_PreamblesPerSSB configuration
|
||||
if ((true == multiple_ssb_per_ro) &&
|
||||
(ssb_rach_ratio > 1)) {
|
||||
total_preambles_per_ssb = numberOfRA_Preambles / ssb_rach_ratio;
|
||||
if (nr_rach_ConfigCommon->totalNumberOfRA_Preambles)
|
||||
numberOfRA_Preambles = *(nr_rach_ConfigCommon->totalNumberOfRA_Preambles);
|
||||
|
||||
ssb_nb_in_ro = prach_pdu->ssb_nb_in_ro;
|
||||
ra->starting_preamble_nb = total_preambles_per_ssb * ssb_nb_in_ro;
|
||||
}
|
||||
else {
|
||||
total_preambles_per_ssb = numberOfRA_Preambles;
|
||||
ra->starting_preamble_nb = 0;
|
||||
}
|
||||
// Compute the proper Preamble selection params according to the selected SSB and the ssb_perRACH_OccasionAndCB_PreamblesPerSSB configuration
|
||||
if ((true == multiple_ssb_per_ro) && (ssb_rach_ratio > 1)) {
|
||||
total_preambles_per_ssb = numberOfRA_Preambles / ssb_rach_ratio;
|
||||
|
||||
ssb_nb_in_ro = prach_pdu->ssb_nb_in_ro;
|
||||
ra->starting_preamble_nb = total_preambles_per_ssb * ssb_nb_in_ro;
|
||||
} else {
|
||||
LOG_E(MAC, "In %s:%d: missing implementation for 2-step RA...\n", __FUNCTION__, __LINE__);
|
||||
total_preambles_per_ssb = numberOfRA_Preambles;
|
||||
ra->starting_preamble_nb = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// This routine implements RA premable configuration according to
|
||||
// This routine implements RA preamble configuration according to
|
||||
// section 5.1 (Random Access procedure) of 3GPP TS 38.321 version 16.2.1 Release 16
|
||||
void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t *mac, int16_t dl_pathloss){
|
||||
|
||||
int messageSizeGroupA = 0;
|
||||
int sizeOfRA_PreamblesGroupA = 0;
|
||||
int messagePowerOffsetGroupB = 0;
|
||||
int PLThreshold;
|
||||
int PLThreshold = 0;
|
||||
long deltaPreamble_Msg3 = 0;
|
||||
uint8_t noGroupB = 0;
|
||||
RA_config_t *ra = &mac->ra;
|
||||
@@ -255,23 +248,21 @@ void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &nr_rach_ConfigCommon->rach_ConfigGeneric;
|
||||
|
||||
if (prach_resources->RA_TYPE == RA_4STEP){
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble){
|
||||
deltaPreamble_Msg3 = (*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble) * 2; // dB
|
||||
LOG_D(MAC, "In %s: deltaPreamble_Msg3 set to %ld\n", __FUNCTION__, deltaPreamble_Msg3);
|
||||
}
|
||||
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble){
|
||||
deltaPreamble_Msg3 = (*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble) * 2; // dB
|
||||
LOG_D(MAC, "In %s: deltaPreamble_Msg3 set to %ld\n", __FUNCTION__, deltaPreamble_Msg3);
|
||||
}
|
||||
|
||||
if (!nr_rach_ConfigCommon->groupBconfigured) {
|
||||
noGroupB = 1;
|
||||
LOG_D(MAC, "In %s:%d: preambles group B is not configured...\n", __FUNCTION__, __LINE__);
|
||||
} else {
|
||||
// RA preambles group B is configured
|
||||
// - Random Access Preambles group B is configured for 4-step RA type
|
||||
// - Defining the number of RA preambles in RA Preamble Group A for each SSB
|
||||
LOG_D(MAC, "In %s:%d: preambles group B is configured...\n", __FUNCTION__, __LINE__);
|
||||
sizeOfRA_PreamblesGroupA = nr_rach_ConfigCommon->groupBconfigured->numberOfRA_PreamblesGroupA;
|
||||
switch (nr_rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA){
|
||||
if (!nr_rach_ConfigCommon->groupBconfigured) {
|
||||
noGroupB = 1;
|
||||
LOG_D(MAC, "In %s:%d: preambles group B is not configured...\n", __FUNCTION__, __LINE__);
|
||||
} else {
|
||||
// RA preambles group B is configured
|
||||
// - Random Access Preambles group B is configured for 4-step RA type
|
||||
// - Defining the number of RA preambles in RA Preamble Group A for each SSB
|
||||
LOG_D(MAC, "In %s:%d: preambles group B is configured...\n", __FUNCTION__, __LINE__);
|
||||
sizeOfRA_PreamblesGroupA = nr_rach_ConfigCommon->groupBconfigured->numberOfRA_PreamblesGroupA;
|
||||
switch (nr_rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA){
|
||||
/* - Threshold to determine the groups of RA preambles */
|
||||
case 0:
|
||||
messageSizeGroupA = 56;
|
||||
@@ -337,44 +328,42 @@ void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0,"Unknown messagePowerOffsetGroupB %lu\n", nr_rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB);
|
||||
}
|
||||
|
||||
PLThreshold = prach_resources->RA_PCMAX - rach_ConfigGeneric->preambleReceivedTargetPower - deltaPreamble_Msg3 - messagePowerOffsetGroupB;
|
||||
|
||||
}
|
||||
} else {
|
||||
// todo:
|
||||
// - groupB-ConfiguredTwoStepRA
|
||||
// - msgA-DeltaPreamble
|
||||
LOG_E(MAC, "In %s:%d: missing implementation for 2-step RA...\n", __FUNCTION__, __LINE__);
|
||||
|
||||
PLThreshold = prach_resources->RA_PCMAX - rach_ConfigGeneric->preambleReceivedTargetPower - deltaPreamble_Msg3 - messagePowerOffsetGroupB;
|
||||
|
||||
}
|
||||
|
||||
/* Msg3 has not been transmitted yet */
|
||||
if (ra->first_Msg3) {
|
||||
if (noGroupB) {
|
||||
// use Group A preamble
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % ra->cb_preambles_per_ssb);
|
||||
ra->RA_usedGroupA = 1;
|
||||
} else if ((ra->Msg3_size < messageSizeGroupA) && (dl_pathloss > PLThreshold)) {
|
||||
// Group B is configured and RA preamble Group A is used
|
||||
// - todo add condition on CCCH_sdu_size for initiation by CCCH
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
ra->RA_usedGroupA = 1;
|
||||
} else {
|
||||
// Group B preamble is configured and used
|
||||
// the first sizeOfRA_PreamblesGroupA RA preambles belong to RA Preambles Group A
|
||||
// the remaining belong to RA Preambles Group B
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (ra->cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
ra->RA_usedGroupA = 0;
|
||||
if(ra->ra_PreambleIndex < 0 || ra->ra_PreambleIndex > 63) {
|
||||
if (noGroupB) {
|
||||
// use Group A preamble
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % ra->cb_preambles_per_ssb);
|
||||
ra->RA_usedGroupA = 1;
|
||||
} else if ((ra->Msg3_size < messageSizeGroupA) && (dl_pathloss > PLThreshold)) {
|
||||
// Group B is configured and RA preamble Group A is used
|
||||
// - todo add condition on CCCH_sdu_size for initiation by CCCH
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
ra->RA_usedGroupA = 1;
|
||||
} else {
|
||||
// Group B preamble is configured and used
|
||||
// the first sizeOfRA_PreamblesGroupA RA preambles belong to RA Preambles Group A
|
||||
// the remaining belong to RA Preambles Group B
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (ra->cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
ra->RA_usedGroupA = 0;
|
||||
}
|
||||
}
|
||||
} else { // Msg3 is being retransmitted
|
||||
if (ra->RA_usedGroupA && noGroupB) {
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % ra->cb_preambles_per_ssb);
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % ra->cb_preambles_per_ssb);
|
||||
} else if (ra->RA_usedGroupA && !noGroupB){
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
} else {
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (ra->cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (ra->cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
}
|
||||
}
|
||||
prach_resources->ra_PreambleIndex = ra->ra_PreambleIndex;
|
||||
}
|
||||
|
||||
// RA-RNTI computation (associated to PRACH occasion in which the RA Preamble is transmitted)
|
||||
@@ -472,6 +461,7 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
|
||||
// start contention resolution timer
|
||||
ra->RA_contention_resolution_cnt = (nr_rach_ConfigCommon->ra_ContentionResolutionTimer + 1) * 8;
|
||||
ra->RA_contention_resolution_timer_active = 1;
|
||||
ra->ra_state = WAIT_CONTENTION_RESOLUTION;
|
||||
|
||||
}
|
||||
|
||||
@@ -503,7 +493,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
RA_config_t *ra = &mac->ra;
|
||||
uint8_t mac_sdus[MAX_NR_ULSCH_PAYLOAD_BYTES];
|
||||
uint8_t lcid = UL_SCH_LCID_CCCH_MSG3, *payload;
|
||||
uint8_t lcid = UL_SCH_LCID_CCCH;
|
||||
uint8_t *payload;
|
||||
uint16_t size_sdu = 0;
|
||||
unsigned short post_padding;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
@@ -527,7 +518,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
}
|
||||
}
|
||||
|
||||
if (prach_resources->init_msg1) {
|
||||
if (prach_resources->init_msg1 && ra->ra_state != RA_SUCCEEDED) {
|
||||
|
||||
if (ra->RA_active == 0) {
|
||||
/* RA not active - checking if RRC is ready to initiate the RA procedure */
|
||||
@@ -557,6 +548,11 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
if (size_sdu > 0) {
|
||||
|
||||
// UE Contention Resolution Identity
|
||||
// Store the first 48 bits belonging to the uplink CCCH SDU within Msg3 to determine whether or not the
|
||||
// Random Access Procedure has been successful after reception of Msg4
|
||||
memcpy(ra->cont_res_id, mac_sdus, sizeof(uint8_t) * 6);
|
||||
|
||||
LOG_D(MAC, "[UE %d][%d.%d]: starting initialisation Random Access Procedure...\n", mod_id, frame, nr_slot_tx);
|
||||
|
||||
ra->Msg3_size = size_sdu + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT);
|
||||
@@ -566,7 +562,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
nr_get_RA_window(mac);
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
if (ra->generate_nr_prach == 1)
|
||||
if (ra->generate_nr_prach == GENERATE_PREAMBLE)
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
offset = nr_generate_ulsch_pdu((uint8_t *) mac_sdus, // sdus buffer
|
||||
@@ -614,9 +610,13 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
}
|
||||
|
||||
if (ra->RA_window_cnt >= 0 && ra->RA_RAPID_found == 1) {
|
||||
// Reset RA_active flag: it disables Msg3 retransmission (8.3 of TS 38.213)
|
||||
|
||||
nr_ra_succeeded(mod_id, frame, nr_slot_tx);
|
||||
if(ra->cfra) {
|
||||
// Reset RA_active flag: it disables Msg3 retransmission (8.3 of TS 38.213)
|
||||
nr_ra_succeeded(mod_id, frame, nr_slot_tx);
|
||||
} else {
|
||||
ra->generate_nr_prach = GENERATE_IDLE;
|
||||
}
|
||||
|
||||
} else if (ra->RA_window_cnt == 0 && !ra->RA_RAPID_found) {
|
||||
|
||||
@@ -638,7 +638,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
ra->RA_backoff_cnt--;
|
||||
|
||||
if ((ra->RA_backoff_cnt > 0 && ra->generate_nr_prach == 1) || ra->RA_backoff_cnt == 0){
|
||||
if ((ra->RA_backoff_cnt > 0 && ra->generate_nr_prach == GENERATE_PREAMBLE) || ra->RA_backoff_cnt == 0){
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
}
|
||||
|
||||
@@ -650,7 +650,11 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
nr_ue_contention_resolution(mod_id, CC_id, frame, nr_slot_tx, prach_resources);
|
||||
}
|
||||
|
||||
return ra->generate_nr_prach;
|
||||
if(ra->generate_nr_prach != GENERATE_IDLE) {
|
||||
return ra->generate_nr_prach;
|
||||
} else {
|
||||
return ra->ra_state;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -744,6 +748,7 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){
|
||||
LOG_I(MAC, "[UE %d][%d.%d][RAPROC] RA procedure succeeded. CF-RA: RAR successfully received.\n", mod_id, frame, slot);
|
||||
|
||||
ra->RA_window_cnt = -1;
|
||||
mac->crnti = ra->t_crnti;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -751,6 +756,7 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){
|
||||
|
||||
ra->RA_contention_resolution_cnt = -1;
|
||||
ra->RA_contention_resolution_timer_active = 0;
|
||||
mac->crnti = ra->t_crnti;
|
||||
ra->t_crnti = 0;
|
||||
|
||||
LOG_D(MAC, "In %s: [UE %d][%d.%d] CB-RA: cleared contention resolution timer...\n", __FUNCTION__, mod_id, frame, slot);
|
||||
@@ -759,7 +765,7 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){
|
||||
|
||||
LOG_D(MAC, "In %s: [UE %d] clearing RA_active flag...\n", __FUNCTION__, mod_id);
|
||||
ra->RA_active = 0;
|
||||
ra->generate_nr_prach = 2;
|
||||
ra->generate_nr_prach = GENERATE_IDLE;
|
||||
ra->ra_state = RA_SUCCEEDED;
|
||||
|
||||
}
|
||||
@@ -774,8 +780,9 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
RA_config_t *ra = &mac->ra;
|
||||
|
||||
ra->first_Msg3 = 0;
|
||||
ra->generate_nr_prach = 3;
|
||||
ra->first_Msg3 = 1;
|
||||
ra->ra_PreambleIndex = -1;
|
||||
ra->generate_nr_prach = RA_FAILED;
|
||||
ra->ra_state = RA_UE_IDLE;
|
||||
|
||||
prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER++;
|
||||
|
||||
@@ -88,7 +88,11 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
} else {
|
||||
ss = mac->search_space_zero;
|
||||
coreset = mac->coreset0;
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
|
||||
if(rnti_type == NR_RNTI_SI) {
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
|
||||
} else {
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG_CSET_0;
|
||||
}
|
||||
}
|
||||
|
||||
rel15->coreset.duration = coreset->duration;
|
||||
@@ -144,7 +148,11 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
rel15->rnti = ra->ra_rnti;
|
||||
rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); //NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, 275);
|
||||
if (get_softmodem_params()->sa) {
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
} else { // NSA mode is not using the Initial BWP
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
}
|
||||
rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing;
|
||||
rel15->dci_length_options[0] = nr_dci_size(scc, mac->scg, def_dci_pdu_rel15, rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, bwp_id);
|
||||
break;
|
||||
@@ -153,6 +161,14 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
case NR_RNTI_CS:
|
||||
break;
|
||||
case NR_RNTI_TC:
|
||||
// we use the initial DL BWP
|
||||
sps = initialDownlinkBWP->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
rel15->rnti = ra->t_crnti;
|
||||
rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing;
|
||||
rel15->dci_length_options[0] = nr_dci_size(scc, mac->scg, def_dci_pdu_rel15, rel15->dci_format_options[0], NR_RNTI_TC, rel15->BWPSize, bwp_id);
|
||||
break;
|
||||
case NR_RNTI_SP_CSI:
|
||||
break;
|
||||
@@ -245,14 +261,22 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->ra_SearchSpace){
|
||||
switch(ra->ra_state){
|
||||
case WAIT_RAR:
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space\n");
|
||||
rel15->num_dci_options = 1;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_RA, ss_id);
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
break;
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg2)\n");
|
||||
rel15->num_dci_options = 1;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
|
||||
if (get_softmodem_params()->sa) {
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_RA, -1);
|
||||
} else {
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_RA, ss_id);
|
||||
}
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
break;
|
||||
case WAIT_CONTENTION_RESOLUTION:
|
||||
LOG_E(MAC, "In %s: CB-RA not implemented yet. Should not have fallen in this case.\n", __FUNCTION__);
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg4)\n");
|
||||
rel15->num_dci_options = 1;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_TC, -1);
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -73,10 +73,10 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){
|
||||
|
||||
if (rnti == ra->ra_rnti) {
|
||||
rnti_type = NR_RNTI_RA;
|
||||
} else if (rnti == ra->t_crnti && (ra->ra_state == WAIT_RAR || ra->ra_state == WAIT_CONTENTION_RESOLUTION) ) {
|
||||
rnti_type = NR_RNTI_TC;
|
||||
} else if (rnti == mac->crnti) {
|
||||
rnti_type = NR_RNTI_C;
|
||||
} else if (rnti == ra->t_crnti) {
|
||||
rnti_type = NR_RNTI_TC;
|
||||
} else if (rnti == 0xFFFE) {
|
||||
rnti_type = NR_RNTI_P;
|
||||
} else if (rnti == 0xFFFF) {
|
||||
@@ -106,7 +106,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
frequency_range_t frequency_range;
|
||||
nr_mac_rrc_data_ind_ue( module_id, cc_id, gNB_index, NR_BCCH_BCH, (uint8_t *) pduP, 3 ); // fixed 3 bytes MIB PDU
|
||||
nr_mac_rrc_data_ind_ue( module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_BCH, (uint8_t *) pduP, 3 ); // fixed 3 bytes MIB PDU
|
||||
|
||||
AssertFatal(mac->mib != NULL, "nr_ue_decode_mib() mac->mib == NULL\n");
|
||||
//if(mac->mib != NULL){
|
||||
@@ -188,7 +188,7 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
|
||||
uint8_t *pduP,
|
||||
uint32_t pdu_len) {
|
||||
LOG_D(NR_MAC, "Decoding NR-BCCH-DL-SCH-Message (SIB1 or SI)\n");
|
||||
nr_mac_rrc_data_ind_ue(module_id, cc_id, gNB_index, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len);
|
||||
nr_mac_rrc_data_ind_ue(module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -264,85 +264,15 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *p
|
||||
int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
uint8_t time_domain_ind
|
||||
){
|
||||
uint8_t time_domain_ind,
|
||||
bool use_default){
|
||||
|
||||
int dmrs_typeA_pos = mac->scc->dmrs_TypeA_Position;
|
||||
// uint8_t k_offset=0;
|
||||
uint8_t sliv_S=0;
|
||||
uint8_t sliv_L=0;
|
||||
uint8_t table_5_1_2_1_1_2_time_dom_res_alloc_A[16][3]={ // for PDSCH from TS 38.214 subclause 5.1.2.1.1
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?12:11}, // row index 1
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?10:9}, // row index 2
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?9:8}, // row index 3
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?7:6}, // row index 4
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?5:4}, // row index 5
|
||||
{0,(dmrs_typeA_pos == 0)?9:10,(dmrs_typeA_pos == 0)?4:4}, // row index 6
|
||||
{0,(dmrs_typeA_pos == 0)?4:6, (dmrs_typeA_pos == 0)?4:4}, // row index 7
|
||||
{0,5,7}, // row index 8
|
||||
{0,5,2}, // row index 9
|
||||
{0,9,2}, // row index 10
|
||||
{0,12,2}, // row index 11
|
||||
{0,1,13}, // row index 12
|
||||
{0,1,6}, // row index 13
|
||||
{0,2,4}, // row index 14
|
||||
{0,4,7}, // row index 15
|
||||
{0,8,4} // row index 16
|
||||
};
|
||||
/*uint8_t table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP[16][3]={ // for PDSCH from TS 38.214 subclause 5.1.2.1.1
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?6:5}, // row index 1
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?10:9}, // row index 2
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?9:8}, // row index 3
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?7:6}, // row index 4
|
||||
{0,(dmrs_typeA_pos == 0)?2:3, (dmrs_typeA_pos == 0)?5:4}, // row index 5
|
||||
{0,(dmrs_typeA_pos == 0)?6:8, (dmrs_typeA_pos == 0)?4:2}, // row index 6
|
||||
{0,(dmrs_typeA_pos == 0)?4:6, (dmrs_typeA_pos == 0)?4:4}, // row index 7
|
||||
{0,5,6}, // row index 8
|
||||
{0,5,2}, // row index 9
|
||||
{0,9,2}, // row index 10
|
||||
{0,10,2}, // row index 11
|
||||
{0,1,11}, // row index 12
|
||||
{0,1,6}, // row index 13
|
||||
{0,2,4}, // row index 14
|
||||
{0,4,6}, // row index 15
|
||||
{0,8,4} // row index 16
|
||||
};*/
|
||||
/*uint8_t table_5_1_2_1_1_4_time_dom_res_alloc_B[16][3]={ // for PDSCH from TS 38.214 subclause 5.1.2.1.1
|
||||
{0,2,2}, // row index 1
|
||||
{0,4,2}, // row index 2
|
||||
{0,6,2}, // row index 3
|
||||
{0,8,2}, // row index 4
|
||||
{0,10,2}, // row index 5
|
||||
{1,2,2}, // row index 6
|
||||
{1,4,2}, // row index 7
|
||||
{0,2,4}, // row index 8
|
||||
{0,4,4}, // row index 9
|
||||
{0,6,4}, // row index 10
|
||||
{0,8,4}, // row index 11
|
||||
{0,10,4}, // row index 12
|
||||
{0,2,7}, // row index 13
|
||||
{0,(dmrs_typeA_pos == 0)?2:3,(dmrs_typeA_pos == 0)?12:11}, // row index 14
|
||||
{1,2,4}, // row index 15
|
||||
{0,0,0} // row index 16
|
||||
};*/
|
||||
/*uint8_t table_5_1_2_1_1_5_time_dom_res_alloc_C[16][3]={ // for PDSCH from TS 38.214 subclause 5.1.2.1.1
|
||||
{0,2,2}, // row index 1
|
||||
{0,4,2}, // row index 2
|
||||
{0,6,2}, // row index 3
|
||||
{0,8,2}, // row index 4
|
||||
{0,10,2}, // row index 5
|
||||
{0,0,0}, // row index 6
|
||||
{0,0,0}, // row index 7
|
||||
{0,2,4}, // row index 8
|
||||
{0,4,4}, // row index 9
|
||||
{0,6,4}, // row index 10
|
||||
{0,8,4}, // row index 11
|
||||
{0,10,4}, // row index 12
|
||||
{0,2,7}, // row index 13
|
||||
{0,(dmrs_typeA_pos == 0)?2:3,(dmrs_typeA_pos == 0)?12:11}, // row index 14
|
||||
{0,0,6}, // row index 15
|
||||
{0,2,6} // row index 16
|
||||
};*/
|
||||
uint8_t mu_pusch = 1;
|
||||
|
||||
// definition table j Table 6.1.2.1.1-4
|
||||
uint8_t j = (mu_pusch==3)?3:(mu_pusch==2)?2:1;
|
||||
uint8_t table_6_1_2_1_1_2_time_dom_res_alloc_A[16][3]={ // for PUSCH from TS 38.214 subclause 6.1.2.1.1
|
||||
@@ -391,7 +321,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList->choice.setup;
|
||||
else if (mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
if (pdsch_TimeDomainAllocationList) {
|
||||
if (pdsch_TimeDomainAllocationList && use_default==false) {
|
||||
|
||||
if (time_domain_ind >= pdsch_TimeDomainAllocationList->list.count) {
|
||||
LOG_E(MAC, "time_domain_ind %d >= pdsch->TimeDomainAllocationList->list.count %d\n",
|
||||
@@ -414,8 +344,15 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
else {// Default configuration from tables
|
||||
// k_offset = table_5_1_2_1_1_2_time_dom_res_alloc_A[time_domain_ind-1][0];
|
||||
sliv_S = table_5_1_2_1_1_2_time_dom_res_alloc_A[time_domain_ind-1][1];
|
||||
sliv_L = table_5_1_2_1_1_2_time_dom_res_alloc_A[time_domain_ind-1][2];
|
||||
|
||||
if(dmrs_typeA_pos == 0) {
|
||||
sliv_S = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[time_domain_ind][1];
|
||||
sliv_L = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[time_domain_ind][2];
|
||||
} else {
|
||||
sliv_S = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[time_domain_ind][1];
|
||||
sliv_L = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[time_domain_ind][2];
|
||||
}
|
||||
|
||||
// k_offset = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP[nr_pdci_info_extracted->time_dom_resource_assignment][0];
|
||||
// sliv_S = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP[nr_pdci_info_extracted->time_dom_resource_assignment][1];
|
||||
// sliv_L = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP[nr_pdci_info_extracted->time_dom_resource_assignment][2];
|
||||
@@ -440,7 +377,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
|
||||
if (pusch_TimeDomainAllocationList) {
|
||||
if (pusch_TimeDomainAllocationList && use_default==false) {
|
||||
if (time_domain_ind >= pusch_TimeDomainAllocationList->list.count) {
|
||||
LOG_E(MAC, "time_domain_ind %d >= pusch->TimeDomainAllocationList->list.count %d\n",
|
||||
time_domain_ind, pusch_TimeDomainAllocationList->list.count);
|
||||
@@ -457,8 +394,8 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
else {
|
||||
// k_offset = table_6_1_2_1_1_2_time_dom_res_alloc_A[time_domain_ind-1][0];
|
||||
sliv_S = table_6_1_2_1_1_2_time_dom_res_alloc_A[time_domain_ind-1][1];
|
||||
sliv_L = table_6_1_2_1_1_2_time_dom_res_alloc_A[time_domain_ind-1][2];
|
||||
sliv_S = table_6_1_2_1_1_2_time_dom_res_alloc_A[time_domain_ind][1];
|
||||
sliv_L = table_6_1_2_1_1_2_time_dom_res_alloc_A[time_domain_ind][2];
|
||||
// k_offset = table_6_1_2_1_1_3_time_dom_res_alloc_A_extCP[nr_pdci_info_extracted->time_dom_resource_assignment][0];
|
||||
// sliv_S = table_6_1_2_1_1_3_time_dom_res_alloc_A_extCP[nr_pdci_info_extracted->time_dom_resource_assignment][1];
|
||||
// sliv_L = table_6_1_2_1_1_3_time_dom_res_alloc_A_extCP[nr_pdci_info_extracted->time_dom_resource_assignment][2];
|
||||
@@ -497,7 +434,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
AssertFatal(mac->DLbwp[0]!=NULL,"DLbwp[0] should not be zero here!\n");
|
||||
AssertFatal(mac->ULbwp[0]!=NULL,"DLbwp[0] should not be zero here!\n");
|
||||
|
||||
const uint16_t n_RB_DLBWP = (ra->ra_state == WAIT_RAR) ? NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
const uint16_t n_RB_DLBWP = (ra->ra_state == WAIT_RAR || ra->ra_state == WAIT_CONTENTION_RESOLUTION) ? NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP);
|
||||
|
||||
@@ -543,10 +480,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
// Config PUSCH PDU
|
||||
ret = nr_config_pusch_pdu(mac, pusch_config_pdu, dci, NULL, rnti, &dci_format);
|
||||
|
||||
if (ret != -1 && ra->RA_active && mac->crnti){
|
||||
nr_ra_succeeded(module_id, frame, slot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -606,10 +539,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
// Config PUSCH PDU
|
||||
ret = nr_config_pusch_pdu(mac, pusch_config_pdu, dci, NULL, rnti, &dci_format);
|
||||
|
||||
if (ret != -1 && ra->RA_active && mac->crnti){
|
||||
nr_ra_succeeded(module_id, frame, slot);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -668,7 +597,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
|
||||
dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.rnti = rnti;
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu_1_0 = &dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.dlsch_config_rel15;
|
||||
NR_PDSCH_Config_t *pdsch_config=mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup;
|
||||
NR_PDSCH_Config_t *pdsch_config = NULL;
|
||||
uint16_t BWPSize = 0;
|
||||
|
||||
if(rnti == SI_RNTI) {
|
||||
@@ -676,7 +605,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
dlsch_config_pdu_1_0->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs;
|
||||
dlsch_config_pdu_1_0->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb;
|
||||
dlsch_config_pdu_1_0->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon;
|
||||
pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL; // For PDSCH with mapping type A, the UE shall assume dmrs-AdditionalPosition='pos2'
|
||||
BWPSize = dlsch_config_pdu_1_0->BWPSize;
|
||||
} else {
|
||||
if (ra->RA_window_cnt >= 0 && rnti == ra->ra_rnti){
|
||||
@@ -684,9 +612,20 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
} else {
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH;
|
||||
}
|
||||
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_0->SubcarrierSpacing = mac->DLbwp[0]->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
if( (ra->RA_window_cnt >= 0 && rnti == ra->ra_rnti) || (rnti == ra->t_crnti) ) {
|
||||
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
if (get_softmodem_params()->sa) {
|
||||
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
} else { // NSA mode is not using the Initial BWP
|
||||
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pdsch_config = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup;
|
||||
}
|
||||
} else {
|
||||
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_0->SubcarrierSpacing = mac->DLbwp[0]->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
pdsch_config = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup;
|
||||
}
|
||||
BWPSize = n_RB_DLBWP;
|
||||
}
|
||||
|
||||
@@ -697,15 +636,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
return -1;
|
||||
}
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,dlsch_config_pdu_1_0,dci->time_domain_assignment.val) < 0) {
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,dlsch_config_pdu_1_0,dci->time_domain_assignment.val,rnti==SI_RNTI) < 0) {
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
/* dmrs symbol positions*/
|
||||
dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
|
||||
mac->scc->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_0->start_symbol+dlsch_config_pdu_1_0->number_symbols);
|
||||
dlsch_config_pdu_1_0->dmrsConfigType = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
|
||||
dlsch_config_pdu_1_0->number_symbols,
|
||||
dlsch_config_pdu_1_0->start_symbol);
|
||||
dlsch_config_pdu_1_0->dmrsConfigType = (pdsch_config) ? (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
|
||||
/* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */
|
||||
if (dlsch_config_pdu_1_0->number_symbols == 2)
|
||||
dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1;
|
||||
@@ -714,7 +654,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
/* VRB_TO_PRB_MAPPING */
|
||||
dlsch_config_pdu_1_0->vrb_to_prb_mapping = (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved:vrb_to_prb_mapping_interleaved;
|
||||
/* MCS TABLE INDEX */
|
||||
dlsch_config_pdu_1_0->mcs_table = (pdsch_config->mcs_Table) ? (*pdsch_config->mcs_Table + 1) : 0;
|
||||
dlsch_config_pdu_1_0->mcs_table = (pdsch_config) ? ((pdsch_config->mcs_Table) ? (*pdsch_config->mcs_Table + 1) : 0) : 0;
|
||||
/* MCS */
|
||||
dlsch_config_pdu_1_0->mcs = dci->mcs;
|
||||
// Basic sanity check for MCS value to check for a false or erroneous DCI
|
||||
@@ -767,7 +707,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
}
|
||||
|
||||
/* PDSCH_TO_HARQ_FEEDBACK_TIME_IND (only if CRC scrambled by C-RNTI or CS-RNTI or new-RNTI)*/
|
||||
dlsch_config_pdu_1_0->pdsch_to_harq_feedback_time_ind = dci->pdsch_to_harq_feedback_timing_indicator.val;
|
||||
dlsch_config_pdu_1_0->pdsch_to_harq_feedback_time_ind = mac->ULbwp[mac->UL_BWP_Id-1]->bwp_Dedicated->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0];
|
||||
|
||||
LOG_D(MAC,"(nr_ue_procedures.c) rnti = %x dl_config->number_pdus = %d\n",
|
||||
dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.rnti,
|
||||
@@ -797,6 +737,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
LOG_D(MAC,"(nr_ue_procedures.c) pdu_type=%d\n\n",dl_config->dl_config_list[dl_config->number_pdus].pdu_type);
|
||||
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -862,14 +803,15 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
return -1;
|
||||
}
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,dlsch_config_pdu_1_1,dci->time_domain_assignment.val) < 0) {
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,dlsch_config_pdu_1_1,dci->time_domain_assignment.val,false) < 0) {
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
/* dmrs symbol positions*/
|
||||
dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
|
||||
mac->scc->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_1->number_symbols);
|
||||
dlsch_config_pdu_1_1->number_symbols,
|
||||
dlsch_config_pdu_1_1->start_symbol);
|
||||
dlsch_config_pdu_1_1->dmrsConfigType = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
|
||||
/* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214,
|
||||
using tables 7.3.1.2.2-1, 7.3.1.2.2-2, 7.3.1.2.2-3, 7.3.1.2.2-4 of 3GPP TS 38.212 */
|
||||
@@ -1333,7 +1275,7 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
} //end else
|
||||
break;
|
||||
|
||||
|
||||
case NR_RNTI_P:
|
||||
/*
|
||||
// Short Messages Indicator E2 bits
|
||||
@@ -1402,41 +1344,74 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
break;
|
||||
|
||||
case NR_RNTI_TC:
|
||||
// indicating a DL DCI format 1bit
|
||||
|
||||
// indicating a DL DCI format - 1 bit
|
||||
pos++;
|
||||
dci_pdu_rel15->format_indicator = (*dci_pdu>>(dci_size-pos))&1;
|
||||
|
||||
if (dci_pdu_rel15->format_indicator == 0)
|
||||
return 1; // discard dci, format indicator not corresponding to dci_format
|
||||
// Freq domain assignment 0-16 bit
|
||||
|
||||
// Freq domain assignment 0-16 bit
|
||||
fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
pos+=fsize;
|
||||
dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<<fsize)-1);
|
||||
// Time domain assignment 4 bit
|
||||
|
||||
// Time domain assignment - 4 bits
|
||||
pos+=4;
|
||||
dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&0xf;
|
||||
// VRB to PRB mapping 1 bit
|
||||
|
||||
// VRB to PRB mapping - 1 bit
|
||||
pos++;
|
||||
dci_pdu_rel15->vrb_to_prb_mapping.val = (*dci_pdu>>(dci_size-pos))&1;
|
||||
|
||||
// MCS 5bit //bit over 32, so dci_pdu ++
|
||||
pos+=5;
|
||||
dci_pdu_rel15->mcs = (*dci_pdu>>(dci_size-pos))&0x1f;
|
||||
// New data indicator 1bit
|
||||
|
||||
// New data indicator - 1 bit
|
||||
pos++;
|
||||
dci_pdu_rel15->ndi = (*dci_pdu>>(dci_size-pos))&1;
|
||||
// Redundancy version 2bit
|
||||
|
||||
// Redundancy version - 2 bits
|
||||
pos+=2;
|
||||
dci_pdu_rel15->rv = (*dci_pdu>>(dci_size-pos))&3;
|
||||
// HARQ process number 4bit
|
||||
|
||||
// HARQ process number - 4 bits
|
||||
pos+=4;
|
||||
dci_pdu_rel15->harq_pid = (*dci_pdu>>(dci_size-pos))&0xf;
|
||||
// Downlink assignment index E2 bits
|
||||
|
||||
// Downlink assignment index - 2 bits
|
||||
pos+=2;
|
||||
dci_pdu_rel15->dai[0].val = (*dci_pdu>>(dci_size-pos))&3;
|
||||
// TPC command for scheduled PUCCH E2 bits
|
||||
|
||||
// TPC command for scheduled PUCCH - 2 bits
|
||||
pos+=2;
|
||||
dci_pdu_rel15->tpc = (*dci_pdu>>(dci_size-pos))&3;
|
||||
// PDSCH-to-HARQ_feedback timing indicator E3 bits
|
||||
|
||||
// PUCCH resource indicator - 3 bits
|
||||
pos+=3;
|
||||
dci_pdu_rel15->pucch_resource_indicator = (*dci_pdu>>(dci_size-pos))&7;
|
||||
|
||||
// PDSCH-to-HARQ_feedback timing indicator - 3 bits
|
||||
pos+=3;
|
||||
dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val = (*dci_pdu>>(dci_size-pos))&7;
|
||||
|
||||
|
||||
LOG_D(NR_MAC,"N_RB = %i\n", N_RB);
|
||||
LOG_D(NR_MAC,"dci_size = %i\n", dci_size);
|
||||
LOG_D(NR_MAC,"fsize = %i\n", fsize);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->format_indicator = %i\n", dci_pdu_rel15->format_indicator);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->frequency_domain_assignment.val = %i\n", dci_pdu_rel15->frequency_domain_assignment.val);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->time_domain_assignment.val = %i\n", dci_pdu_rel15->time_domain_assignment.val);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->vrb_to_prb_mapping.val = %i\n", dci_pdu_rel15->vrb_to_prb_mapping.val);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->mcs = %i\n", dci_pdu_rel15->mcs);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->rv = %i\n", dci_pdu_rel15->rv);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->harq_pid = %i\n", dci_pdu_rel15->harq_pid);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->dai[0].val = %i\n", dci_pdu_rel15->dai[0].val);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->tpc = %i\n", dci_pdu_rel15->tpc);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->pucch_resource_indicator = %i\n", dci_pdu_rel15->pucch_resource_indicator);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val = %i\n", dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -1800,16 +1775,41 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
|
||||
// MAC CE
|
||||
|
||||
case DL_SCH_LCID_CCCH:
|
||||
// MSG4 RRC Connection Setup 38.331
|
||||
// varialbe length
|
||||
mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
|
||||
// MSG4 RRC Setup 38.331
|
||||
// variable length
|
||||
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){
|
||||
mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8)
|
||||
| ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff);
|
||||
mac_subheader_len = 3;
|
||||
} else {
|
||||
mac_sdu_len = ((NR_MAC_SUBHEADER_SHORT *) pduP)->L;
|
||||
mac_subheader_len = 2;
|
||||
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){
|
||||
mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
|
||||
mac_subheader_len = 3;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if it is a valid CCCH message, we get all 00's messages very often
|
||||
int i = 0;
|
||||
for(i=0; i<(mac_subheader_len+mac_sdu_len); i++) {
|
||||
if(pduP[i] != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == (mac_subheader_len+mac_sdu_len)) {
|
||||
LOG_D(NR_MAC, "%s() Invalid CCCH message!, pdu_len: %d\n", __func__, pdu_len);
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( mac_sdu_len > 0 ) {
|
||||
LOG_D(NR_MAC,"DL_SCH_LCID_CCCH (e.g. RRCSetup) with payload len %d\n", mac_sdu_len);
|
||||
for (int i = 0; i < mac_subheader_len; i++) {
|
||||
LOG_D(NR_MAC, "MAC header %d: 0x%x\n", i, pduP[i]);
|
||||
}
|
||||
for (int i = 0; i < mac_sdu_len; i++) {
|
||||
LOG_D(NR_MAC, "%d: 0x%x\n", i, pduP[mac_subheader_len + i]);
|
||||
}
|
||||
nr_mac_rrc_data_ind_ue(module_idP, CC_id, gNB_index, frameP, 0, mac->crnti, CCCH, pduP+mac_subheader_len, mac_sdu_len);
|
||||
}
|
||||
break;
|
||||
|
||||
case DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH:
|
||||
|
||||
@@ -1916,17 +1916,34 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
|
||||
|
||||
break;
|
||||
case DL_SCH_LCID_CON_RES_ID:
|
||||
// Clause 5.1.5 and 6.1.3.3 of 3GPP TS 38.321 version 16.2.1 Release 16
|
||||
// WIP todo: handle CCCH_pdu
|
||||
mac_ce_len = 6;
|
||||
|
||||
LOG_I(MAC, "[UE %d][RAPROC] Frame %d : received contention resolution msg: %x.%x.%x.%x.%x.%x, Terminating RA procedure\n", module_idP, frameP, pduP[0], pduP[1], pduP[2], pduP[3], pduP[4], pduP[5]);
|
||||
// Clause 5.1.5 and 6.1.3.3 of 3GPP TS 38.321 version 16.2.1 Release 16
|
||||
// MAC Header: 1 byte (R/R/LCID)
|
||||
// MAC SDU: 6 bytes (UE Contention Resolution Identity)
|
||||
mac_ce_len = 6;
|
||||
|
||||
if (ra->RA_active == 1) {
|
||||
nr_ra_succeeded(module_idP, frameP, slot);
|
||||
if(ra->ra_state == WAIT_CONTENTION_RESOLUTION) {
|
||||
LOG_I(MAC, "[UE %d][RAPROC] Frame %d : received contention resolution identity: 0x%02x%02x%02x%02x%02x%02x Terminating RA procedure\n",
|
||||
module_idP, frameP, pduP[1], pduP[2], pduP[3], pduP[4], pduP[5], pduP[6]);
|
||||
|
||||
bool ra_success = true;
|
||||
for(int i = 0; i<mac_ce_len; i++) {
|
||||
if(ra->cont_res_id[i] != pduP[i+1]) {
|
||||
ra_success = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
if ( (ra->RA_active == 1) && ra_success) {
|
||||
nr_ra_succeeded(module_idP, frameP, slot);
|
||||
} else if (!ra_success){
|
||||
// TODO: Handle failure of RA procedure @ MAC layer
|
||||
// nr_ra_failed(module_idP, CC_id, prach_resources, frameP, slot); // prach_resources is a PHY structure
|
||||
ra->ra_state = RA_UE_IDLE;
|
||||
ra->RA_active = 0;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case DL_SCH_LCID_PADDING:
|
||||
done = 1;
|
||||
// end of MAC PDU, can ignore the rest.
|
||||
@@ -2044,8 +2061,9 @@ uint16_t nr_generate_ulsch_pdu(uint8_t *sdus_payload,
|
||||
last_size = 3;
|
||||
}
|
||||
} else { // UL CCCH SDU
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = sdu_lcids[i];
|
||||
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->R = 0;
|
||||
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->LCID = sdu_lcids[i];
|
||||
last_size = 1;
|
||||
}
|
||||
|
||||
mac_pdu_ptr += last_size;
|
||||
@@ -2221,27 +2239,32 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
|
||||
NR_MAC_RAR *rar = (NR_MAC_RAR *) (dlsch_buffer + 1); // RAR subPDU pointer
|
||||
uint8_t preamble_index = get_ra_PreambleIndex(mod_id, cc_id, gNB_id); //prach_resources->ra_PreambleIndex;
|
||||
|
||||
LOG_D(MAC, "In %s:[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)\n", __FUNCTION__, frame, slot, mod_id, preamble_index);
|
||||
LOG_D(NR_MAC, "In %s:[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)\n", __FUNCTION__, frame, slot, mod_id, preamble_index);
|
||||
|
||||
while (1) {
|
||||
n_subheaders++;
|
||||
if (rarh->T == 1) {
|
||||
n_subPDUs++;
|
||||
LOG_D(MAC, "[UE %d][RAPROC] Got RAPID RAR subPDU\n", mod_id);
|
||||
LOG_I(NR_MAC, "[UE %d][RAPROC] Got RAPID RAR subPDU\n", mod_id);
|
||||
} else {
|
||||
n_subPDUs++;
|
||||
ra->RA_backoff_indicator = table_7_2_1[((NR_RA_HEADER_BI *)rarh)->BI];
|
||||
ra->RA_BI_found = 1;
|
||||
LOG_D(MAC, "[UE %d][RAPROC] Got BI RAR subPDU %d\n", mod_id, ra->RA_backoff_indicator);
|
||||
LOG_I(NR_MAC, "[UE %d][RAPROC] Got BI RAR subPDU %d ms\n", mod_id, ra->RA_backoff_indicator);
|
||||
if ( ((NR_RA_HEADER_BI *)rarh)->E == 1) {
|
||||
rarh += sizeof(NR_RA_HEADER_BI);
|
||||
continue;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rarh->RAPID == preamble_index) {
|
||||
LOG_I(MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d\n", mod_id, frame, slot, rarh->RAPID);
|
||||
LOG_I(NR_MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d\n", mod_id, frame, slot, rarh->RAPID);
|
||||
rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR));
|
||||
ra->RA_RAPID_found = 1;
|
||||
break;
|
||||
}
|
||||
if (rarh->E == 0) {
|
||||
LOG_W(PHY,"[UE %d][RAPROC] Received RAR preamble (%d) doesn't match the intended RAPID...\n", mod_id, preamble_index);
|
||||
LOG_W(NR_MAC,"[UE %d][RAPROC][%d.%d] Received RAR preamble (%d) doesn't match the intended RAPID (%d)\n", mod_id, frame, slot, rarh->RAPID, preamble_index);
|
||||
break;
|
||||
} else {
|
||||
rarh += sizeof(NR_MAC_RAR) + 1;
|
||||
@@ -2317,21 +2340,37 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
|
||||
rnti = mac->crnti;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_RAR
|
||||
LOG_D(MAC, "In %s:[%d.%d]: [UE %d] Received RAR with t_alloc %d f_alloc %d ta_command %d mcs %d freq_hopping %d tpc_command %d csi_req %d t_crnti %x \n",
|
||||
__FUNCTION__,
|
||||
frame,
|
||||
slot,
|
||||
mod_id,
|
||||
rar_grant.Msg3_t_alloc,
|
||||
rar_grant.Msg3_f_alloc,
|
||||
ul_time_alignment->ta_command,
|
||||
rar_grant.mcs,
|
||||
rar_grant.freq_hopping,
|
||||
tpc_command,
|
||||
csi_req,
|
||||
ra->t_crnti);
|
||||
#endif
|
||||
#ifdef DEBUG_RAR
|
||||
LOG_I(NR_MAC, "rarh->E = 0x%x\n", rarh->E);
|
||||
LOG_I(NR_MAC, "rarh->T = 0x%x\n", rarh->T);
|
||||
LOG_I(NR_MAC, "rarh->RAPID = 0x%x (%i)\n", rarh->RAPID, rarh->RAPID);
|
||||
|
||||
LOG_I(NR_MAC, "rar->R = 0x%x\n", rar->R);
|
||||
LOG_I(NR_MAC, "rar->TA1 = 0x%x\n", rar->TA1);
|
||||
|
||||
LOG_I(NR_MAC, "rar->TA2 = 0x%x\n", rar->TA2);
|
||||
LOG_I(NR_MAC, "rar->UL_GRANT_1 = 0x%x\n", rar->UL_GRANT_1);
|
||||
|
||||
LOG_I(NR_MAC, "rar->UL_GRANT_2 = 0x%x\n", rar->UL_GRANT_2);
|
||||
LOG_I(NR_MAC, "rar->UL_GRANT_3 = 0x%x\n", rar->UL_GRANT_3);
|
||||
LOG_I(NR_MAC, "rar->UL_GRANT_4 = 0x%x\n", rar->UL_GRANT_4);
|
||||
|
||||
LOG_I(NR_MAC, "rar->TCRNTI_1 = 0x%x\n", rar->TCRNTI_1);
|
||||
LOG_I(NR_MAC, "rar->TCRNTI_2 = 0x%x\n", rar->TCRNTI_2);
|
||||
|
||||
LOG_I(NR_MAC, "In %s:[%d.%d]: [UE %d] Received RAR with t_alloc %d f_alloc %d ta_command %d mcs %d freq_hopping %d tpc_command %d t_crnti %x \n",
|
||||
__FUNCTION__,
|
||||
frame,
|
||||
slot,
|
||||
mod_id,
|
||||
rar_grant.Msg3_t_alloc,
|
||||
rar_grant.Msg3_f_alloc,
|
||||
ul_time_alignment->ta_command,
|
||||
rar_grant.mcs,
|
||||
rar_grant.freq_hopping,
|
||||
tpc_command,
|
||||
ra->t_crnti);
|
||||
#endif
|
||||
|
||||
// Schedule Msg3
|
||||
ret = nr_ue_pusch_scheduler(mac, is_Msg3, frame, slot, &frame_tx, &slot_tx, rar_grant.Msg3_t_alloc);
|
||||
|
||||
@@ -500,11 +500,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
int ibwp_size = NRRIV2BW(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
// BWP start selection according to 8.3 of TS 38.213
|
||||
pusch_config_pdu->bwp_size = ibwp_size;
|
||||
if ((ibwp_start < abwp_start) || (ibwp_size > abwp_size))
|
||||
if ((ibwp_start < abwp_start) || (ibwp_size > abwp_size)) {
|
||||
pusch_config_pdu->bwp_start = abwp_start;
|
||||
else
|
||||
pusch_config_pdu->bwp_size = abwp_size;
|
||||
} else {
|
||||
pusch_config_pdu->bwp_start = ibwp_start;
|
||||
pusch_config_pdu->bwp_size = ibwp_size;
|
||||
}
|
||||
|
||||
//// Resource assignment from RAR
|
||||
// Frequency domain allocation according to 8.3 of TS 38.213
|
||||
@@ -518,7 +520,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
return -1;
|
||||
|
||||
// virtual resource block to physical resource mapping for Msg3 PUSCH (6.3.1.7 in 38.211)
|
||||
pusch_config_pdu->rb_start += ibwp_start - abwp_start;
|
||||
//pusch_config_pdu->rb_start += ibwp_start - abwp_start;
|
||||
|
||||
// Time domain allocation
|
||||
SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols);
|
||||
@@ -645,7 +647,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
return -1;
|
||||
}
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_config_pdu, NULL, dci->time_domain_assignment.val) < 0) {
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_config_pdu, NULL, dci->time_domain_assignment.val,false) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -887,7 +889,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
|
||||
uint16_t TBS_bytes = ulcfg_pdu->pusch_config_pdu.pusch_data.tb_size;
|
||||
|
||||
if (ra->ra_state == WAIT_RAR){
|
||||
if (ra->ra_state == WAIT_RAR && !ra->cfra){
|
||||
memcpy(ulsch_input_buffer, mac->ulsch_pdu.payload, TBS_bytes);
|
||||
LOG_D(NR_MAC,"[RAPROC] Msg3 to be transmitted:\n");
|
||||
for (int k = 0; k < TBS_bytes; k++) {
|
||||
@@ -941,7 +943,8 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
tx_req.tx_request_body[0].pdu_index = j;
|
||||
tx_req.tx_request_body[0].pdu = ulsch_input_buffer;
|
||||
|
||||
if (ra->ra_state != RA_SUCCEEDED && !ra->cfra){
|
||||
if (ra->ra_state == WAIT_RAR && !ra->cfra){
|
||||
LOG_I(NR_MAC,"[RAPROC] RA-Msg3 transmitted\n");
|
||||
nr_Msg3_transmitted(ul_info->module_id, ul_info->cc_id, ul_info->frame_tx, ul_info->gNB_index);
|
||||
}
|
||||
|
||||
@@ -1668,7 +1671,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
|
||||
|
||||
ra->RA_offset = 2; // to compensate the rx frame offset at the gNB
|
||||
ra->generate_nr_prach = 0; // Reset flag for PRACH generation
|
||||
ra->generate_nr_prach = GENERATE_IDLE; // Reset flag for PRACH generation
|
||||
|
||||
if (is_nr_UL_slot(scc, slotP, mac->frame_type)) {
|
||||
|
||||
@@ -1685,7 +1688,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
|
||||
if (is_nr_prach_slot && ra->ra_state == RA_UE_IDLE) {
|
||||
AssertFatal(NULL != prach_occasion_info_p,"PRACH Occasion Info not returned in a valid NR Prach Slot\n");
|
||||
|
||||
ra->generate_nr_prach = 1;
|
||||
ra->generate_nr_prach = GENERATE_PREAMBLE;
|
||||
|
||||
format = prach_occasion_info_p->format;
|
||||
format0 = format & 0xff; // single PRACH format
|
||||
|
||||
@@ -208,8 +208,12 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.tl.tag = NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
//k1= msg1_FrequencyStart + 12 (no. of FDM)(RB for PRACH occasion);
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
if (get_softmodem_params()->sa) {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
} else {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
}
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.tl.tag = NFAPI_NR_CONFIG_K1_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
|
||||
@@ -449,6 +453,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ra->cfra = false;
|
||||
ra->rnti = 0;
|
||||
ra->preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES;
|
||||
ra->preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t));
|
||||
for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++)
|
||||
ra->preambles.preamble_list[i] = i;
|
||||
}
|
||||
LOG_I(PHY,"Added new RA process for UE RNTI %04x with initial secondaryCellGroup\n", rnti);
|
||||
} else { // secondaryCellGroup has been updated
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -159,7 +159,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
|
||||
// get MIB every 8 frames
|
||||
if((slotP == 0) && (frameP & 7) == 0) {
|
||||
|
||||
mib_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, MIBCH, 1, &cc->MIB_pdu.payload[0]);
|
||||
mib_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, MIBCH, 0, 1, &cc->MIB_pdu.payload[0]);
|
||||
|
||||
LOG_D(MAC,
|
||||
"[gNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes\n",
|
||||
@@ -320,6 +320,7 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map;
|
||||
|
||||
if (gNB_mac->sched_ctrlCommon == NULL){
|
||||
LOG_D(NR_MAC,"schedule_control_common: Filling nr_mac->sched_ctrlCommon\n");
|
||||
gNB_mac->sched_ctrlCommon = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon));
|
||||
gNB_mac->sched_ctrlCommon->search_space = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->search_space));
|
||||
gNB_mac->sched_ctrlCommon->coreset = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->coreset));
|
||||
@@ -327,7 +328,6 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
fill_default_coresetZero(gNB_mac->sched_ctrlCommon->coreset,servingcellconfigcommon);
|
||||
fill_default_initialDownlinkBWP(gNB_mac->sched_ctrlCommon->active_bwp,servingcellconfigcommon);
|
||||
}
|
||||
gNB_mac->sched_ctrlCommon->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL;
|
||||
|
||||
gNB_mac->sched_ctrlCommon->time_domain_allocation = time_domain_allocation;
|
||||
gNB_mac->sched_ctrlCommon->mcsTableIdx = mcsTableIdx;
|
||||
@@ -350,11 +350,15 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
const uint16_t bwpSize = type0_PDCCH_CSS_config->num_rbs;
|
||||
int rbStart = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
|
||||
// Calculate number of symbols
|
||||
struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = gNB_mac->sched_ctrlCommon->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
const int startSymbolAndLength = tdaList->list.array[gNB_mac->sched_ctrlCommon->time_domain_allocation]->startSymbolAndLength;
|
||||
int startSymbolIndex, nrOfSymbols;
|
||||
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
|
||||
int startSymbolIndex = 0;
|
||||
int nrOfSymbols = 0;
|
||||
if(gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position == 0) {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->time_domain_allocation][2];
|
||||
} else {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->time_domain_allocation][2];
|
||||
}
|
||||
|
||||
if (nrOfSymbols == 2) {
|
||||
gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData = 1;
|
||||
@@ -364,7 +368,7 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(gNB_mac->sched_ctrlCommon->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, startSymbolIndex+nrOfSymbols);
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex);
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
int rbSize = 0;
|
||||
@@ -379,7 +383,6 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
gNB_mac->sched_ctrlCommon->rbSize = rbSize;
|
||||
gNB_mac->sched_ctrlCommon->rbStart = 0;
|
||||
|
||||
LOG_D(MAC,"SLIV = %i\n", startSymbolAndLength);
|
||||
LOG_D(MAC,"startSymbolIndex = %i\n", startSymbolIndex);
|
||||
LOG_D(MAC,"nrOfSymbols = %i\n", nrOfSymbols);
|
||||
LOG_D(MAC,"rbSize = %i\n", gNB_mac->sched_ctrlCommon->rbSize);
|
||||
@@ -453,7 +456,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
pdsch_pdu_rel15->nrOfLayers = 1;
|
||||
pdsch_pdu_rel15->transmissionScheme = 0;
|
||||
pdsch_pdu_rel15->refPoint = 1;
|
||||
pdsch_pdu_rel15->dmrsConfigType = gNB_mac->sched_ctrlCommon->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
|
||||
pdsch_pdu_rel15->dmrsConfigType = 0;
|
||||
pdsch_pdu_rel15->dlDmrsScramblingId = *scc->physCellId;
|
||||
pdsch_pdu_rel15->SCID = 0;
|
||||
pdsch_pdu_rel15->numDmrsCdmGrpsNoData = gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData;
|
||||
@@ -468,7 +471,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex;
|
||||
pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols;
|
||||
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(bwp->bwp_Dedicated->pdsch_Config->choice.setup, scc->dmrs_TypeA_Position, pdsch_pdu_rel15->StartSymbolIndex+pdsch_pdu_rel15->NrOfSymbols);
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, scc->dmrs_TypeA_Position, pdsch_pdu_rel15->NrOfSymbols, pdsch_pdu_rel15->StartSymbolIndex);
|
||||
|
||||
LOG_D(MAC,"dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos);
|
||||
|
||||
@@ -536,8 +539,6 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
|
||||
void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) {
|
||||
|
||||
LOG_D(MAC,"Schedule_nr_sib1: frameP = %i, slotP = %i\n", frameP, slotP);
|
||||
|
||||
// TODO: Get these values from RRC
|
||||
const int CC_id = 0;
|
||||
int time_domain_allocation = 0;
|
||||
@@ -573,29 +574,32 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
|
||||
(type0_PDCCH_CSS_config->num_rbs > 0) &&
|
||||
(type0_PDCCH_CSS_config->active == true)) {
|
||||
|
||||
LOG_D(MAC,"> SIB1 transmission\n");
|
||||
LOG_D(NR_MAC,"(%d.%d) SIB1 transmission: ssb_index %d\n", frameP, slotP, type0_PDCCH_CSS_config->ssb_index);
|
||||
|
||||
// Get SIB1
|
||||
uint8_t sib1_payload[NR_MAX_SIB_LENGTH/8];
|
||||
uint8_t sib1_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, BCCH, 1, sib1_payload);
|
||||
LOG_D(MAC,"sib1_sdu_length = %i\n", sib1_sdu_length);
|
||||
LOG_D(MAC,"SIB1: \n");
|
||||
for (int i=0;i<sib1_sdu_length;i++) LOG_D(MAC,"byte %d : %x\n",i,((uint8_t*)sib1_payload)[i]);
|
||||
uint8_t sib1_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, BCCH, SI_RNTI, 1, sib1_payload);
|
||||
LOG_D(NR_MAC,"sib1_sdu_length = %i\n", sib1_sdu_length);
|
||||
LOG_D(NR_MAC,"SIB1: \n");
|
||||
for (int k=0;k<sib1_sdu_length;k++) LOG_D(NR_MAC,"byte %d : %x\n",k,((uint8_t*)sib1_payload)[k]);
|
||||
|
||||
// Configure sched_ctrlCommon for SIB1
|
||||
schedule_control_sib1(module_idP, CC_id, type0_PDCCH_CSS_config, time_domain_allocation, mcsTableIdx, mcs, candidate_idx, sib1_sdu_length);
|
||||
|
||||
// Calculate number of symbols
|
||||
int startSymbolIndex, nrOfSymbols;
|
||||
struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = gNB_mac->sched_ctrlCommon->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
const int startSymbolAndLength = tdaList->list.array[gNB_mac->sched_ctrlCommon->time_domain_allocation]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
|
||||
int startSymbolIndex = 0;
|
||||
int nrOfSymbols = 0;
|
||||
if(gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position == 0) {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->time_domain_allocation][2];
|
||||
} else {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->time_domain_allocation][2];
|
||||
}
|
||||
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(gNB_mac->sched_ctrlCommon->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup,
|
||||
gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, startSymbolIndex+nrOfSymbols);
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex);
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
const uint32_t TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->mcs, gNB_mac->sched_ctrlCommon->mcsTableIdx),
|
||||
nr_get_code_rate_dl(gNB_mac->sched_ctrlCommon->mcs, gNB_mac->sched_ctrlCommon->mcsTableIdx),
|
||||
|
||||
@@ -302,7 +302,7 @@ int nr_write_ce_dlsch_pdu(module_id_t module_idP,
|
||||
return offset;
|
||||
}
|
||||
|
||||
int getNrOfSymbols(NR_BWP_Downlink_t *bwp, int tda) {
|
||||
void getStartNrOfSymbols(NR_BWP_Downlink_t *bwp, int tda, int *startSymbol, int *nrOfSymbols) {
|
||||
struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList =
|
||||
bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
AssertFatal(tda < tdaList->list.count,
|
||||
@@ -311,9 +311,7 @@ int getNrOfSymbols(NR_BWP_Downlink_t *bwp, int tda) {
|
||||
tdaList->list.count);
|
||||
|
||||
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
|
||||
int startSymbolIndex, nrOfSymbols;
|
||||
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
|
||||
return nrOfSymbols;
|
||||
SLIV2SL(startSymbolAndLength, startSymbol, nrOfSymbols);
|
||||
}
|
||||
|
||||
nfapi_nr_dmrs_type_e getDmrsConfigType(NR_BWP_Downlink_t *bwp) {
|
||||
@@ -487,8 +485,12 @@ void pf_dl(module_id_t module_id,
|
||||
sched_ctrl->numDmrsCdmGrpsNoData = 1;
|
||||
uint8_t N_PRB_DMRS =
|
||||
getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData);
|
||||
int nrOfSymbols = getNrOfSymbols(sched_ctrl->active_bwp,
|
||||
sched_ctrl->time_domain_allocation);
|
||||
int startSymbol;
|
||||
int nrOfSymbols;
|
||||
getStartNrOfSymbols(sched_ctrl->active_bwp,
|
||||
sched_ctrl->time_domain_allocation,
|
||||
&startSymbol,
|
||||
&nrOfSymbols);
|
||||
uint32_t tbs = nr_compute_tbs(nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
|
||||
nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
|
||||
1, // rbSize
|
||||
@@ -574,13 +576,18 @@ void pf_dl(module_id_t module_id,
|
||||
|
||||
const uint8_t N_PRB_DMRS =
|
||||
getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData);
|
||||
const int nrOfSymbols = getNrOfSymbols(sched_ctrl->active_bwp,
|
||||
sched_ctrl->time_domain_allocation);
|
||||
int startSymbol;
|
||||
int nrOfSymbols;
|
||||
getStartNrOfSymbols(sched_ctrl->active_bwp,
|
||||
sched_ctrl->time_domain_allocation,
|
||||
&startSymbol,
|
||||
&nrOfSymbols);
|
||||
const NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels->ServingCellConfigCommon;
|
||||
const uint8_t N_DMRS_SLOT = get_num_dmrs_symbols(
|
||||
sched_ctrl->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup,
|
||||
scc->dmrs_TypeA_Position,
|
||||
nrOfSymbols);
|
||||
nrOfSymbols,
|
||||
startSymbol);
|
||||
|
||||
int rbSize = 0;
|
||||
uint32_t TBS = 0;
|
||||
@@ -697,7 +704,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData);
|
||||
uint8_t N_DMRS_SLOT = get_num_dmrs_symbols(sched_ctrl->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup,
|
||||
RC.nrmac[module_id]->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position ,
|
||||
nrOfSymbols);
|
||||
nrOfSymbols,
|
||||
startSymbolIndex);
|
||||
const nfapi_nr_dmrs_type_e dmrsConfigType = getDmrsConfigType(sched_ctrl->active_bwp);
|
||||
const int nrOfLayers = 1;
|
||||
const uint16_t R = nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx);
|
||||
@@ -819,7 +827,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
pdsch_pdu->dlDmrsSymbPos =
|
||||
fill_dmrs_mask(bwp->bwp_Dedicated->pdsch_Config->choice.setup,
|
||||
scc->dmrs_TypeA_Position,
|
||||
nrOfSymbols);
|
||||
nrOfSymbols,
|
||||
startSymbolIndex);
|
||||
pdsch_pdu->dmrsConfigType = dmrsConfigType;
|
||||
pdsch_pdu->dlDmrsScramblingId = *scc->physCellId;
|
||||
pdsch_pdu->SCID = 0;
|
||||
|
||||
@@ -164,7 +164,8 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols;
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL,
|
||||
scc->dmrs_TypeA_Position,
|
||||
NrOfSymbols);
|
||||
NrOfSymbols,
|
||||
StartSymbolIndex);
|
||||
|
||||
/*
|
||||
AssertFatal(k0==0,"k0 is not zero for Initial DL BWP TimeDomain Alloc\n");
|
||||
|
||||
@@ -178,7 +178,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
int coreset_id = coreset->controlResourceSetId;
|
||||
|
||||
int *cce_list;
|
||||
if(bwp->bwp_Id == 0) {
|
||||
if( bwp==NULL || bwp->bwp_Id == 0 ) {
|
||||
cce_list = nr_mac->cce_list[1][0];
|
||||
} else {
|
||||
cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id];
|
||||
@@ -563,6 +563,8 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
NR_BWP_Downlink_t *bwp)
|
||||
{
|
||||
int sps = 0;
|
||||
|
||||
if (bwp) { // This is not the InitialBWP
|
||||
pdcch_pdu->BWPSize = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pdcch_pdu->BWPStart = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
@@ -571,8 +573,18 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
|
||||
|
||||
// first symbol
|
||||
//AssertFatal(pdcch_scs==kHz15, "PDCCH SCS above 15kHz not allowed if a symbol above 2 is monitored");
|
||||
int sps = bwp->bwp_Common->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
sps = bwp->bwp_Common->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
}
|
||||
else { // this is for InitialBWP
|
||||
pdcch_pdu->BWPSize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pdcch_pdu->BWPStart = NRRIV2PRBOFFSET(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pdcch_pdu->SubcarrierSpacing = scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing;
|
||||
pdcch_pdu->CyclicPrefix = (scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.cyclicPrefix==NULL) ? 0 : *scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.cyclicPrefix;
|
||||
|
||||
// first symbol
|
||||
//AssertFatal(pdcch_scs==kHz15, "PDCCH SCS above 15kHz not allowed if a symbol above 2 is monitored");
|
||||
sps = scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
}
|
||||
AssertFatal(ss->monitoringSymbolsWithinSlot!=NULL,"ss->monitoringSymbolsWithinSlot is null\n");
|
||||
AssertFatal(ss->monitoringSymbolsWithinSlot->buf!=NULL,"ss->monitoringSymbolsWithinSlot->buf is null\n");
|
||||
|
||||
@@ -617,10 +629,6 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
|
||||
|
||||
//precoderGranularity
|
||||
pdcch_pdu->precoderGranularity = coreset->precoderGranularity;
|
||||
}
|
||||
else { // this is for InitialBWP
|
||||
AssertFatal(1==0,"Fill in InitialBWP PDCCH configuration\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1134,6 +1142,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
break;
|
||||
|
||||
case NR_RNTI_TC:
|
||||
pos = 1;
|
||||
// indicating a DL DCI format 1bit
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 1) << (dci_size - pos++);
|
||||
// Freq domain assignment 0-16 bit
|
||||
@@ -1162,9 +1171,27 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
// TPC command for scheduled PUCCH – 2 bits
|
||||
for (int i = 0; i < 2; i++)
|
||||
*dci_pdu |= (((uint64_t)dci_pdu_rel15->tpc >> (1 - i)) & 1) << (dci_size - pos++);
|
||||
// PUCCH resource indicator – 3 bits
|
||||
for (int i = 0; i < 3; i++)
|
||||
*dci_pdu |= (((uint64_t)dci_pdu_rel15->pucch_resource_indicator >> (2 - i)) & 1) << (dci_size - pos++);
|
||||
// PDSCH-to-HARQ_feedback timing indicator – 3 bits
|
||||
for (int i = 0; i < 3; i++)
|
||||
*dci_pdu |= (((uint64_t)dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val >> (2 - i)) & 1) << (dci_size - pos++);
|
||||
|
||||
LOG_D(NR_MAC,"N_RB = %i\n", N_RB);
|
||||
LOG_D(NR_MAC,"dci_size = %i\n", dci_size);
|
||||
LOG_D(NR_MAC,"fsize = %i\n", fsize);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->format_indicator = %i\n", dci_pdu_rel15->format_indicator);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->frequency_domain_assignment.val = %i\n", dci_pdu_rel15->frequency_domain_assignment.val);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->time_domain_assignment.val = %i\n", dci_pdu_rel15->time_domain_assignment.val);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->vrb_to_prb_mapping.val = %i\n", dci_pdu_rel15->vrb_to_prb_mapping.val);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->mcs = %i\n", dci_pdu_rel15->mcs);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->rv = %i\n", dci_pdu_rel15->rv);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->harq_pid = %i\n", dci_pdu_rel15->harq_pid);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->dai[0].val = %i\n", dci_pdu_rel15->dai[0].val);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->tpc = %i\n", dci_pdu_rel15->tpc);
|
||||
LOG_D(NR_MAC,"dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val = %i\n", dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -1682,7 +1709,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon
|
||||
add_tail_nr_list(&sched_ctrl->available_ul_harq, harq);
|
||||
create_nr_list(&sched_ctrl->feedback_ul_harq, 16);
|
||||
create_nr_list(&sched_ctrl->retrans_ul_harq, 16);
|
||||
LOG_I(MAC, "gNB %d] Add NR UE_id %d : rnti %x\n",
|
||||
LOG_I(MAC, "[gNB %d] Add NR UE_id %d : rnti %x\n",
|
||||
mod_idP,
|
||||
UE_id,
|
||||
rntiP);
|
||||
@@ -1738,7 +1765,7 @@ void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti)
|
||||
if (pthread_mutex_lock(&rnti_to_remove_mutex)) exit(1);
|
||||
if (rnti_to_remove_count == 10) exit(1);
|
||||
rnti_to_remove[rnti_to_remove_count] = rnti;
|
||||
LOG_W(MAC, "to remove in mac rnti_to_remove[%d]=%d\n", rnti_to_remove_count, rnti);
|
||||
LOG_W(NR_MAC, "to remove in mac rnti_to_remove[%d] = 0x%04x\n", rnti_to_remove_count, rnti);
|
||||
rnti_to_remove_count++;
|
||||
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
|
||||
}
|
||||
@@ -1758,6 +1785,16 @@ void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti)
|
||||
}
|
||||
}
|
||||
|
||||
void nr_mac_remove_ra_rnti(module_id_t mod_id, rnti_t rnti) {
|
||||
// Hack to remove UE in the phy (following the same procedure as in function mac_remove_nr_ue)
|
||||
if (pthread_mutex_lock(&rnti_to_remove_mutex)) exit(1);
|
||||
if (rnti_to_remove_count == 10) exit(1);
|
||||
rnti_to_remove[rnti_to_remove_count] = rnti;
|
||||
LOG_W(NR_MAC, "to remove in mac rnti_to_remove[%d] = 0x%04x\n", rnti_to_remove_count, rnti);
|
||||
rnti_to_remove_count++;
|
||||
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
|
||||
}
|
||||
|
||||
uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
|
||||
// al values passed to this function are x10
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
else {
|
||||
uint8_t nb_ssb_resources =0;
|
||||
//Finding the CSI_RS or SSB Resources
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP == reportQuantity_type ||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) {
|
||||
|
||||
if (NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled == csi_reportconfig->groupBasedBeamReporting.present) {
|
||||
@@ -191,18 +191,18 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
/*! From Spec 38.331
|
||||
* nrofReportedRS
|
||||
* The number (N) of measured RS resources to be reported per report setting in a non-group-based report. N <= N_max, where N_max is either 2 or 4 depending on UE
|
||||
* capability. FFS: The signaling mechanism for the gNB to select a subset of N beams for the UE to measure and report.
|
||||
* capability. FFS: The signaling mechanism for the gNB to select a subset of N beams for the UE to measure and report.
|
||||
* When the field is absent the UE applies the value 1
|
||||
*/
|
||||
csi_report->CSI_report_bitlen.nb_ssbri_cri= 1;
|
||||
}else
|
||||
}else
|
||||
csi_report->CSI_report_bitlen.nb_ssbri_cri= 2;
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == csi_report->reportQuantity_type) {
|
||||
for ( csi_ssb_idx = 0; csi_ssb_idx < csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; csi_ssb_idx++) {
|
||||
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceSetId ==
|
||||
*(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.array[0])){
|
||||
|
||||
|
||||
///We can configure only one SSB resource set from spec 38.331 IE CSI-ResourceConfig
|
||||
nb_ssb_resources= csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceList.list.count;
|
||||
csi_report->SSB_Index_list = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceList.list.array;
|
||||
@@ -226,12 +226,12 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
|
||||
if (nb_ssb_resources) {
|
||||
csi_report->CSI_report_bitlen.cri_ssbri_bitlen =ceil(log2 (nb_ssb_resources));
|
||||
csi_report->CSI_report_bitlen.rsrp_bitlen = 7; //From spec 38.212 Table 6.3.1.1.2-6: CRI, SSBRI, and RSRP
|
||||
csi_report->CSI_report_bitlen.rsrp_bitlen = 7; //From spec 38.212 Table 6.3.1.1.2-6: CRI, SSBRI, and RSRP
|
||||
csi_report->CSI_report_bitlen.diff_rsrp_bitlen =4; //From spec 38.212 Table 6.3.1.1.2-6: CRI, SSBRI, and RSRP
|
||||
} else {
|
||||
} else {
|
||||
csi_report->CSI_report_bitlen.cri_ssbri_bitlen =0;
|
||||
csi_report->CSI_report_bitlen.rsrp_bitlen = 0;
|
||||
csi_report->CSI_report_bitlen.diff_rsrp_bitlen =0;
|
||||
csi_report->CSI_report_bitlen.rsrp_bitlen = 0;
|
||||
csi_report->CSI_report_bitlen.diff_rsrp_bitlen =0;
|
||||
}
|
||||
|
||||
LOG_I (MAC, "UCI: CSI_bit len : ssbri %d, rsrp: %d, diff_rsrp: %d\n",
|
||||
@@ -270,7 +270,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
csi_report->csi_meas_bitlen.ri_bitlen=0;
|
||||
break;
|
||||
case 2:
|
||||
/* From Spec 38.212
|
||||
/* From Spec 38.212
|
||||
* If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
|
||||
* values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
|
||||
* TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
|
||||
@@ -283,7 +283,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
|
||||
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present */
|
||||
if (0==*(csi_reportconfig->dummy)){
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri);
|
||||
@@ -293,7 +293,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
ri_bitlen = ri_bitlen<1?ri_bitlen:1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
ri_bitlen = ri_bitlen<1?ri_bitlen:1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
||||
break;
|
||||
case 4:
|
||||
@@ -301,7 +301,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
|
||||
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present */
|
||||
if (0==*(csi_reportconfig->dummy)){
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri);
|
||||
@@ -311,16 +311,16 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction,&max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
ri_bitlen = ri_bitlen<2?ri_bitlen:2; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
ri_bitlen = ri_bitlen<2?ri_bitlen:2; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
||||
break;
|
||||
case 6:
|
||||
case 8:
|
||||
AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present");
|
||||
|
||||
|
||||
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present */
|
||||
if (0==*(csi_reportconfig->dummy)){
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0),&max_ri);
|
||||
@@ -353,7 +353,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
/* From Spec 38.212
|
||||
/* From Spec 38.212
|
||||
* If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
|
||||
* values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
|
||||
* TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
|
||||
@@ -383,7 +383,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
/* From Spec 38.212
|
||||
/* From Spec 38.212
|
||||
* If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
|
||||
* values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
|
||||
* TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
|
||||
@@ -392,18 +392,18 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
* But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to
|
||||
* calculate RI for antennas equal or more than two.
|
||||
* */
|
||||
|
||||
|
||||
if (max_ri > 4 && max_ri < 8){
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present){
|
||||
if (NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI==csi_reportconfig->reportFreqConfiguration->cqi_FormatIndicator)
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen = 8;
|
||||
else
|
||||
else
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen = 4;
|
||||
}
|
||||
}else{ //This condition will work even for type1-multipanel.
|
||||
if (NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI==csi_reportconfig->reportFreqConfiguration->cqi_FormatIndicator)
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen = 4;
|
||||
else
|
||||
else
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen = 2;
|
||||
}
|
||||
break;
|
||||
@@ -449,7 +449,7 @@ uint16_t nr_get_csi_bitlen(int Mod_idP,
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP==UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type){
|
||||
CSI_report_bitlen = &(UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen); //This might need to be moodif for Aperiodic CSI-RS measurements
|
||||
csi_bitlen+= ((CSI_report_bitlen->cri_ssbri_bitlen * CSI_report_bitlen->nb_ssbri_cri) +
|
||||
CSI_report_bitlen->rsrp_bitlen +(CSI_report_bitlen->diff_rsrp_bitlen *
|
||||
CSI_report_bitlen->rsrp_bitlen +(CSI_report_bitlen->diff_rsrp_bitlen *
|
||||
(CSI_report_bitlen->nb_ssbri_cri -1 )));
|
||||
} else{
|
||||
csi_meas_bitlen = &(UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen); //This might need to be moodif for Aperiodic CSI-RS measurements
|
||||
@@ -892,7 +892,7 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
reportQuantity_type = UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type;
|
||||
LOG_D(PHY,"SFN/SF:%d%d reportQuantity type = %d\n",frame,slot,reportQuantity_type);
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type ||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP == reportQuantity_type) {
|
||||
uint8_t csi_ssb_idx = 0;
|
||||
uint8_t diff_rsrp_idx = 0;
|
||||
@@ -924,12 +924,12 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
reverse_n_bits(payload, cri_ssbri_bitlen);
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type)
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
|
||||
*(UE_info->csi_report_template[UE_id][csi_report_id].SSB_Index_list[cri_ssbri_bitlen>0?((*payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
else
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
|
||||
*(UE_info->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((*payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
|
||||
|
||||
*payload >>= cri_ssbri_bitlen;
|
||||
LOG_D(PHY,"SSB_index = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]);
|
||||
}
|
||||
@@ -948,7 +948,7 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
}
|
||||
}
|
||||
|
||||
if ( !(reportQuantity_type))
|
||||
if ( !(reportQuantity_type))
|
||||
AssertFatal(reportQuantity_type, "reportQuantity is not configured");
|
||||
|
||||
}
|
||||
|
||||
@@ -237,13 +237,44 @@ void nr_process_mac_pdu(
|
||||
case UL_SCH_LCID_SRB3:
|
||||
// todo
|
||||
break;
|
||||
case UL_SCH_LCID_CCCH_MSG3:
|
||||
// todo
|
||||
break;
|
||||
|
||||
case UL_SCH_LCID_CCCH:
|
||||
// todo
|
||||
mac_subheader_len = 2;
|
||||
case UL_SCH_LCID_CCCH1:
|
||||
// fixed length
|
||||
mac_subheader_len = 1;
|
||||
|
||||
if ( rx_lcid == UL_SCH_LCID_CCCH1 ) {
|
||||
// RRCResumeRequest1 message includes the full I-RNTI and has a size of 8 bytes
|
||||
mac_sdu_len = 8;
|
||||
|
||||
// Check if it is a valid CCCH1 message, we get all 00's messages very often
|
||||
int i = 0;
|
||||
for(i=0; i<(mac_subheader_len+mac_sdu_len); i++) {
|
||||
if(pdu_ptr[i] != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == (mac_subheader_len+mac_sdu_len)) {
|
||||
LOG_D(NR_MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len);
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// fixed length of 6 bytes
|
||||
mac_sdu_len = 6;
|
||||
}
|
||||
|
||||
nr_mac_rrc_data_ind(module_idP,
|
||||
CC_id,
|
||||
frameP,
|
||||
0,
|
||||
0,
|
||||
rnti,
|
||||
CCCH,
|
||||
pdu_ptr+mac_subheader_len,
|
||||
mac_sdu_len,
|
||||
0);
|
||||
break;
|
||||
|
||||
case UL_SCH_LCID_DTCH:
|
||||
// check if LCID is valid at current time.
|
||||
@@ -329,8 +360,16 @@ void handle_nr_ul_harq(module_id_t mod_id,
|
||||
return;
|
||||
|
||||
remove_front_nr_list(&sched_ctrl->feedback_ul_harq);
|
||||
sched_ctrl->ul_harq_processes[harq_pid].round++;
|
||||
add_tail_nr_list(&sched_ctrl->retrans_ul_harq, harq_pid);
|
||||
sched_ctrl->ul_harq_processes[harq_pid].is_waiting = false;
|
||||
if(sched_ctrl->ul_harq_processes[harq_pid].round == MAX_HARQ_ROUNDS) {
|
||||
sched_ctrl->ul_harq_processes[harq_pid].ndi ^= 1;
|
||||
sched_ctrl->ul_harq_processes[harq_pid].round = 0;
|
||||
UE_info->mac_stats[UE_id].ulsch_errors++;
|
||||
add_tail_nr_list(&sched_ctrl->available_ul_harq, harq_pid);
|
||||
} else {
|
||||
sched_ctrl->ul_harq_processes[harq_pid].round++;
|
||||
add_tail_nr_list(&sched_ctrl->retrans_ul_harq, harq_pid);
|
||||
}
|
||||
harq_pid = sched_ctrl->feedback_ul_harq.head;
|
||||
}
|
||||
remove_front_nr_list(&sched_ctrl->feedback_ul_harq);
|
||||
@@ -452,9 +491,19 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
UE_scheduling_control->sched_ul_bytes = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!sduP) // check that CRC passed
|
||||
return;
|
||||
} else if(sduP) {
|
||||
|
||||
bool no_sig = true;
|
||||
for (int k = 0; k < sdu_lenP; k++) {
|
||||
if(sduP[k]!=0) {
|
||||
no_sig = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(no_sig) {
|
||||
LOG_W(NR_MAC, "No signal\n");
|
||||
}
|
||||
|
||||
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
|
||||
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
|
||||
@@ -468,40 +517,88 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
if (ra->state != WAIT_Msg3)
|
||||
continue;
|
||||
|
||||
// random access pusch with TC-RNTI
|
||||
if (ra->rnti != current_rnti) {
|
||||
LOG_W(NR_MAC,
|
||||
"expected TC-RNTI %04x to match current RNTI %04x\n",
|
||||
if(no_sig) {
|
||||
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
|
||||
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
} else {
|
||||
|
||||
// random access pusch with TC-RNTI
|
||||
if (ra->rnti != current_rnti) {
|
||||
LOG_W(NR_MAC,
|
||||
"expected TC_RNTI %04x to match current RNTI %04x\n",
|
||||
ra->rnti,
|
||||
current_rnti);
|
||||
|
||||
if( (frameP==ra->Msg3_frame) && (slotP==ra->Msg3_slot) ) {
|
||||
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
|
||||
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
const int UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti, ra->secondaryCellGroup);
|
||||
UE_info->UE_beam_index[UE_id] = ra->beam_id;
|
||||
|
||||
// re-initialize ta update variables after RA procedure completion
|
||||
UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP;
|
||||
|
||||
LOG_I(NR_MAC,
|
||||
"reset RA state information for RA-RNTI %04x/index %d\n",
|
||||
ra->rnti,
|
||||
current_rnti);
|
||||
i);
|
||||
|
||||
LOG_I(NR_MAC,
|
||||
"[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly, "
|
||||
"adding UE MAC Context UE_id %d/RNTI %04x\n",
|
||||
gnb_mod_idP,
|
||||
current_rnti,
|
||||
UE_id,
|
||||
ra->rnti);
|
||||
|
||||
if(ra->cfra) {
|
||||
|
||||
LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) CFRA procedure succeeded!\n", UE_id, ra->rnti);
|
||||
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
UE_info->active[UE_id] = true;
|
||||
|
||||
} else {
|
||||
|
||||
LOG_I(NR_MAC,"[RAPROC] RA-Msg3 received (sdu_lenP %d)\n",sdu_lenP);
|
||||
LOG_D(NR_MAC,"[RAPROC] Received Msg3:\n");
|
||||
for (int k = 0; k < sdu_lenP; k++) {
|
||||
LOG_D(NR_MAC,"(%i): 0x%x\n",k,sduP[k]);
|
||||
}
|
||||
|
||||
// UE Contention Resolution Identity
|
||||
// Store the first 48 bits belonging to the uplink CCCH SDU within Msg3 to fill in Msg4
|
||||
// First byte corresponds to R/LCID MAC sub-header
|
||||
memcpy(ra->cont_res_id, &sduP[1], sizeof(uint8_t) * 6);
|
||||
|
||||
nr_process_mac_pdu(gnb_mod_idP, current_rnti, CC_idP, frameP, sduP, sdu_lenP);
|
||||
|
||||
ra->state = Msg4;
|
||||
ra->Msg4_frame = ( frameP +2 ) % 1024;
|
||||
ra->Msg4_slot = 1;
|
||||
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot);
|
||||
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < NR_NB_RA_PROC_MAX; ++i) {
|
||||
NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[i];
|
||||
if (ra->state != WAIT_Msg3)
|
||||
continue;
|
||||
}
|
||||
const int UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti, ra->secondaryCellGroup);
|
||||
UE_info->UE_beam_index[UE_id] = ra->beam_id;
|
||||
LOG_I(NR_MAC,
|
||||
"[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly, "
|
||||
"adding UE MAC Context UE_id %d/RNTI %04x\n",
|
||||
gnb_mod_idP,
|
||||
current_rnti,
|
||||
UE_id,
|
||||
ra->rnti);
|
||||
|
||||
LOG_D(NR_MAC,"[RAPROC] Received Msg3:\n");
|
||||
for (int k = 0; k < sdu_lenP; k++) {
|
||||
LOG_D(NR_MAC,"(%i): 0x%x\n",k,sduP[k]);
|
||||
}
|
||||
|
||||
// re-initialize ta update variables afrer RA procedure completion
|
||||
UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP;
|
||||
|
||||
free(ra->preambles.preamble_list);
|
||||
ra->state = RA_IDLE;
|
||||
LOG_I(NR_MAC,
|
||||
"reset RA state information for RA-RNTI %04x/index %d\n",
|
||||
ra->rnti,
|
||||
i);
|
||||
|
||||
return;
|
||||
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
|
||||
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP);
|
||||
void nr_initiate_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP,
|
||||
uint16_t preamble_index, uint8_t freq_index, uint8_t symbol, int16_t timing_offset);
|
||||
|
||||
void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP);
|
||||
void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t *ra);
|
||||
|
||||
int nr_allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t slotP, int test_only);
|
||||
|
||||
@@ -320,6 +320,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon
|
||||
|
||||
void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti);
|
||||
|
||||
void nr_mac_remove_ra_rnti(module_id_t mod_id, rnti_t rnti);
|
||||
|
||||
int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
NR_BWP_Downlink_t *bwp,
|
||||
NR_ControlResourceSet_t *coreset,
|
||||
@@ -355,8 +357,18 @@ void config_nr_mib(int Mod_idP,
|
||||
int cellBarred,
|
||||
int intraFreqReselection);
|
||||
|
||||
int nr_write_ce_dlsch_pdu(module_id_t module_idP,
|
||||
const NR_UE_sched_ctrl_t *ue_sched_ctl,
|
||||
unsigned char *mac_pdu,
|
||||
unsigned char drx_cmd,
|
||||
unsigned char *ue_cont_res_id);
|
||||
|
||||
void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, NR_RA_t *ra);
|
||||
|
||||
void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, NR_RA_t *ra);
|
||||
|
||||
void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_frame_t slot, NR_RA_t *ra);
|
||||
|
||||
void nr_process_mac_pdu(
|
||||
module_id_t module_idP,
|
||||
rnti_t rnti,
|
||||
|
||||
@@ -805,7 +805,9 @@ void nr_DRB_preconfiguration(uint16_t crnti)
|
||||
rbconfig->securityConfig->keyToUse = calloc(1,sizeof(*rbconfig->securityConfig->keyToUse));
|
||||
*rbconfig->securityConfig->keyToUse = NR_SecurityConfig__keyToUse_master;
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig);
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig);
|
||||
}
|
||||
|
||||
NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
|
||||
nr_rlc_bearer_init(RLC_BearerConfig);
|
||||
|
||||
@@ -55,7 +55,7 @@ extern uint16_t sl_ahead;
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
||||
|
||||
if (UL_info->rach_ind.number_of_pdus>0) {
|
||||
LOG_I(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n",UL_info->frame,UL_info->slot, UL_info->rach_ind.sfn,UL_info->rach_ind.slot);
|
||||
LOG_D(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n",UL_info->frame,UL_info->slot, UL_info->rach_ind.sfn,UL_info->rach_ind.slot);
|
||||
int npdus = UL_info->rach_ind.number_of_pdus;
|
||||
for(int i = 0; i < npdus; i++) {
|
||||
UL_info->rach_ind.number_of_pdus--;
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
#include "NR_MIB.h"
|
||||
#include "NR_BCCH-BCH-Message.h"
|
||||
#include "rrc_gNB_UE_context.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
@@ -217,29 +218,22 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
const rnti_t rnti,
|
||||
const uint8_t Nb_tb,
|
||||
uint8_t *const buffer_pP ){
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
uint8_t Sdu_size = 0;
|
||||
uint8_t sfn_msb = (uint8_t)((frameP>>4)&0x3f);
|
||||
|
||||
#ifdef DEBUG_RRC
|
||||
LOG_D(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%ld\n",Mod_idP,Srb_id);
|
||||
#endif
|
||||
|
||||
rrc_gNB_carrier_data_t *carrier;
|
||||
NR_BCCH_BCH_Message_t *mib;
|
||||
NR_SRB_INFO *srb_info;
|
||||
char payload_size, *payload_pP;
|
||||
|
||||
carrier = &RC.nrrrc[Mod_idP]->carrier;
|
||||
mib = &carrier->mib;
|
||||
srb_info = &carrier->Srb0;
|
||||
|
||||
/* MIBCH */
|
||||
// MIBCH
|
||||
if ((Srb_id & RAB_OFFSET) == MIBCH) {
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
uint8_t sfn_msb = (uint8_t)((frameP>>4)&0x3f);
|
||||
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[Mod_idP]->carrier;
|
||||
NR_BCCH_BCH_Message_t *mib = &carrier->mib;
|
||||
|
||||
// Currently we are getting the pdcch_ConfigSIB1 from the configuration file.
|
||||
// Uncomment this function for a dynamic pdcch_ConfigSIB1.
|
||||
//channel_bandwidth_t min_channel_bw = bw_10MHz; // Must be obtained based on TS 38.101-1 Table 5.3.5-1
|
||||
@@ -269,7 +263,7 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
return (3);
|
||||
}
|
||||
|
||||
/* TODO BCCH SIB1 SIBs */
|
||||
// TODO BCCH SIB1 SIBs
|
||||
if ((Srb_id & RAB_OFFSET ) == BCCH) {
|
||||
memcpy(&buffer_pP[0],
|
||||
RC.nrrrc[Mod_idP]->carrier.SIB1,
|
||||
@@ -278,29 +272,54 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
return RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1;
|
||||
}
|
||||
|
||||
/* CCCH */
|
||||
// CCCH
|
||||
if( (Srb_id & RAB_OFFSET ) == CCCH) {
|
||||
//struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[Mod_idP],rnti);
|
||||
//if (ue_context_p == NULL) return(0);
|
||||
//eNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
|
||||
LOG_D(RRC,"[gNB %d] Frame %d CCCH request (Srb_id %ld)\n", Mod_idP, frameP, Srb_id);
|
||||
|
||||
// srb_info=&ue_p->Srb0;
|
||||
char *payload_pP;
|
||||
uint8_t Sdu_size = 0;
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[Mod_idP], rnti);
|
||||
|
||||
payload_size = srb_info->Tx_buffer.payload_size;
|
||||
LOG_D(NR_RRC,"[gNB %d] Frame %d CCCH request (Srb_id %ld)\n", Mod_idP, frameP, Srb_id);
|
||||
|
||||
char payload_size = ue_context_p->ue_context.Srb0.Tx_buffer.payload_size;
|
||||
|
||||
// check if data is there for MAC
|
||||
if (payload_size > 0) {
|
||||
payload_pP = srb_info->Tx_buffer.Payload;
|
||||
LOG_D(RRC,"[gNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n", Mod_idP, srb_info, payload_size, buffer_pP, payload_pP);
|
||||
payload_pP = ue_context_p->ue_context.Srb0.Tx_buffer.Payload;
|
||||
LOG_D(NR_RRC,"[gNB %d] CCCH has %d bytes (dest: %p, src %p)\n", Mod_idP, payload_size, buffer_pP, payload_pP);
|
||||
// Fill buffer
|
||||
memcpy((void *)buffer_pP, (void*)payload_pP, payload_size);
|
||||
Sdu_size = payload_size;
|
||||
srb_info->Tx_buffer.payload_size = 0;
|
||||
ue_context_p->ue_context.Srb0.Tx_buffer.payload_size = 0;
|
||||
}
|
||||
return Sdu_size;
|
||||
}
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t sub_frameP,
|
||||
const int UE_id,
|
||||
const rnti_t rntiP,
|
||||
const rb_id_t srb_idP,
|
||||
const uint8_t *sduP,
|
||||
const sdu_size_t sdu_lenP,
|
||||
const boolean_t brOption) {
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, GNB_FLAG_YES, rntiP, frameP, sub_frameP,0);
|
||||
|
||||
if((srb_idP & RAB_OFFSET) == CCCH) {
|
||||
LOG_D(NR_RRC, "[gNB %d] Received SDU for CCCH on SRB %ld\n", module_idP, srb_idP);
|
||||
ctxt.brOption = brOption;
|
||||
if (sdu_lenP > 0) {
|
||||
nr_rrc_gNB_decode_ccch(&ctxt, sduP, sdu_lenP, CC_id);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -326,7 +326,7 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
|
||||
// cellSelectionInfo
|
||||
sib1->cellSelectionInfo = CALLOC(1,sizeof(struct NR_SIB1__cellSelectionInfo));
|
||||
sib1->cellSelectionInfo->q_RxLevMin = -50;
|
||||
sib1->cellSelectionInfo->q_RxLevMin = -65;
|
||||
|
||||
// cellAccessRelatedInfo
|
||||
struct NR_PLMN_IdentityInfo *nr_plmn_info=CALLOC(1,sizeof(struct NR_PLMN_IdentityInfo));
|
||||
@@ -418,7 +418,8 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
nrMultiBandInfo->freqBandIndicatorNR = configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[i];
|
||||
ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list,nrMultiBandInfo);
|
||||
}
|
||||
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
//sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = 86;
|
||||
for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.count; i++) {
|
||||
ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list,configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[i]);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
const rnti_t rnti,
|
||||
const uint8_t Nb_tb,
|
||||
uint8_t *const buffer_pP );
|
||||
|
||||
@@ -158,6 +159,24 @@ int
|
||||
nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
rnti_t rntiP);
|
||||
|
||||
int8_t nr_mac_rrc_data_ind(
|
||||
const module_id_t module_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t sub_frameP,
|
||||
const int UE_id,
|
||||
const rnti_t rntiP,
|
||||
const rb_id_t srb_idP,
|
||||
const uint8_t *sduP,
|
||||
const sdu_size_t sdu_lenP,
|
||||
const boolean_t brOption
|
||||
);
|
||||
|
||||
int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t *buffer,
|
||||
int buffer_length,
|
||||
const int CC_id);
|
||||
|
||||
void
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration_release(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
@@ -1388,7 +1388,7 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
|
||||
break;
|
||||
|
||||
case NR_UL_CCCH_MessageType__c1_PR_rrcSetupRequest:
|
||||
LOG_I(NR_RRC, "Received RRCSetupRequest on UL-CCCH-Message (UE rnti %x)\n", ctxt_pP->rnti);
|
||||
LOG_D(NR_RRC, "Received RRCSetupRequest on UL-CCCH-Message (UE rnti %x)\n", ctxt_pP->rnti);
|
||||
ue_context_p = rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti);
|
||||
if (ue_context_p != NULL) {
|
||||
rrc_gNB_free_mem_UE_context(ctxt_pP, ue_context_p);
|
||||
@@ -1495,15 +1495,16 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
|
||||
CC_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ue_context_p != NULL) {
|
||||
ue_context_p->ue_context.establishment_cause = rrcSetupRequest->establishmentCause;
|
||||
}
|
||||
|
||||
rrc_gNB_generate_RRCSetup(ctxt_pP,
|
||||
rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti),
|
||||
CC_id);
|
||||
rrc_gNB_generate_RRCSetup(ctxt_pP,
|
||||
rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti),
|
||||
CC_id);
|
||||
|
||||
// FIXME: Check the best place to perform this DRB configuration
|
||||
nr_DRB_preconfiguration(ctxt_pP->rnti);
|
||||
}
|
||||
break;
|
||||
|
||||
case NR_UL_CCCH_MessageType__c1_PR_rrcResumeRequest:
|
||||
|
||||
@@ -228,33 +228,38 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->t304=NR_ReconfigurationWithSync__t304_ms2000;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated = NULL;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->ext1 = NULL;
|
||||
/* contention free ra */
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated = calloc(1,sizeof(struct NR_ReconfigurationWithSync__rach_ConfigDedicated));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->present= NR_ReconfigurationWithSync__rach_ConfigDedicated_PR_uplink;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink= calloc(1,sizeof(struct NR_RACH_ConfigDedicated));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra= calloc(1,sizeof(struct NR_CFRA));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->ra_Prioritization= NULL;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions= calloc(1,sizeof(struct NR_CFRA__occasions));
|
||||
memcpy(&secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->rach_ConfigGeneric,
|
||||
&servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric, sizeof(NR_RACH_ConfigGeneric_t));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->ssb_perRACH_Occasion= calloc(1,sizeof(long));
|
||||
*secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->ssb_perRACH_Occasion = NR_CFRA__occasions__ssb_perRACH_Occasion_one;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.present = NR_CFRA__resources_PR_ssb;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb = calloc(1,sizeof(struct NR_CFRA__resources__ssb));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ra_ssb_OccasionMaskIndex = 0;
|
||||
|
||||
int n_ssb = 0;
|
||||
struct NR_CFRA_SSB_Resource *ssbElem[64];
|
||||
for (int i=0;i<64;i++) {
|
||||
if ((bitmap>>(63-i))&0x01){
|
||||
ssbElem[n_ssb] = calloc(1,sizeof(struct NR_CFRA_SSB_Resource));
|
||||
ssbElem[n_ssb]->ssb = i;
|
||||
ssbElem[n_ssb]->ra_PreambleIndex = 63;
|
||||
ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list,ssbElem[n_ssb]);
|
||||
n_ssb++;
|
||||
// For 2-step contention-free random access procedure
|
||||
if(get_softmodem_params()->sa == 0) {
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated = calloc(1,sizeof(struct NR_ReconfigurationWithSync__rach_ConfigDedicated));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->present= NR_ReconfigurationWithSync__rach_ConfigDedicated_PR_uplink;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink= calloc(1,sizeof(struct NR_RACH_ConfigDedicated));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra= calloc(1,sizeof(struct NR_CFRA));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->ra_Prioritization= NULL;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions= calloc(1,sizeof(struct NR_CFRA__occasions));
|
||||
memcpy(&secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->rach_ConfigGeneric,
|
||||
&servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric, sizeof(NR_RACH_ConfigGeneric_t));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->ssb_perRACH_Occasion= calloc(1,sizeof(long));
|
||||
*secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->ssb_perRACH_Occasion = NR_CFRA__occasions__ssb_perRACH_Occasion_one;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.present = NR_CFRA__resources_PR_ssb;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb = calloc(1,sizeof(struct NR_CFRA__resources__ssb));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ra_ssb_OccasionMaskIndex = 0;
|
||||
|
||||
int n_ssb = 0;
|
||||
struct NR_CFRA_SSB_Resource *ssbElem[64];
|
||||
for (int i=0;i<64;i++) {
|
||||
if ((bitmap>>(63-i))&0x01){
|
||||
ssbElem[n_ssb] = calloc(1,sizeof(struct NR_CFRA_SSB_Resource));
|
||||
ssbElem[n_ssb]->ssb = i;
|
||||
ssbElem[n_ssb]->ra_PreambleIndex = 63;
|
||||
ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list,ssbElem[n_ssb]);
|
||||
n_ssb++;
|
||||
}
|
||||
}
|
||||
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->ext1 = NULL;
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->ext1 = NULL;
|
||||
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants));
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->present = NR_SetupRelease_RLF_TimersAndConstants_PR_setup;
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup));
|
||||
@@ -294,7 +299,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList));
|
||||
|
||||
n_ssb = 0;
|
||||
int n_ssb = 0;
|
||||
NR_TCI_State_t *tcic[64];
|
||||
for (int i=0;i<64;i++) {
|
||||
if ((bitmap>>(63-i))&0x01){
|
||||
@@ -537,7 +542,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0 = calloc(1,sizeof(*ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0));
|
||||
|
||||
ASN_SEQUENCE_ADD(&bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list,ss);
|
||||
|
||||
|
||||
|
||||
bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=calloc(1,sizeof(*bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1));
|
||||
*bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=0;
|
||||
|
||||
@@ -42,17 +42,71 @@ nr_mac_rrc_data_ind_ue(
|
||||
const module_id_t module_id,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_index,
|
||||
const frame_t frame,
|
||||
const sub_frame_t sub_frame,
|
||||
const rnti_t rnti,
|
||||
const channel_t channel,
|
||||
const uint8_t* pduP,
|
||||
const sdu_size_t pdu_len){
|
||||
sdu_size_t sdu_size = 0;
|
||||
|
||||
switch(channel){
|
||||
case NR_BCCH_BCH:
|
||||
AssertFatal( nr_rrc_ue_decode_NR_BCCH_BCH_Message(module_id, gNB_index, (uint8_t*)pduP, pdu_len) == 0, "UE decode BCCH-BCH error!\n");
|
||||
break;
|
||||
|
||||
case NR_BCCH_DL_SCH:
|
||||
AssertFatal( nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id, gNB_index, (uint8_t*)pduP, pdu_len, 0, 0) == 0, "UE decode BCCH-DL-SCH error!\n");
|
||||
if (pdu_len>0) {
|
||||
LOG_T(NR_RRC, "[UE %d] Received SDU for NR-BCCH-DL-SCH on SRB %u from gNB %d\n", module_id, channel & RAB_OFFSET,
|
||||
gNB_index);
|
||||
|
||||
MessageDef *message_p;
|
||||
int msg_sdu_size = BCCH_SDU_SIZE;
|
||||
|
||||
if (pdu_len > msg_sdu_size) {
|
||||
LOG_E(NR_RRC, "SDU larger than NR-BCCH-DL-SCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size);
|
||||
sdu_size = msg_sdu_size;
|
||||
} else {
|
||||
sdu_size = pdu_len;
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_BCCH_DATA_IND);
|
||||
memset(NR_RRC_MAC_BCCH_DATA_IND (message_p).sdu, 0, BCCH_SDU_SIZE);
|
||||
memcpy(NR_RRC_MAC_BCCH_DATA_IND (message_p).sdu, pduP, sdu_size);
|
||||
NR_RRC_MAC_BCCH_DATA_IND (message_p).frame = frame; //frameP
|
||||
NR_RRC_MAC_BCCH_DATA_IND (message_p).sub_frame = sub_frame; //sub_frameP
|
||||
NR_RRC_MAC_BCCH_DATA_IND (message_p).sdu_size = sdu_size;
|
||||
NR_RRC_MAC_BCCH_DATA_IND (message_p).gnb_index = gNB_index;
|
||||
itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p);
|
||||
}
|
||||
break;
|
||||
|
||||
case CCCH:
|
||||
if (pdu_len>0) {
|
||||
LOG_T(NR_RRC,"[UE %d] Received SDU for CCCH on SRB %u from gNB %d\n",module_id,channel & RAB_OFFSET,gNB_index);
|
||||
|
||||
MessageDef *message_p;
|
||||
int msg_sdu_size = CCCH_SDU_SIZE;
|
||||
|
||||
if (pdu_len > msg_sdu_size) {
|
||||
LOG_E(NR_RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size);
|
||||
sdu_size = msg_sdu_size;
|
||||
} else {
|
||||
sdu_size = pdu_len;
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message (TASK_MAC_UE, 0, NR_RRC_MAC_CCCH_DATA_IND);
|
||||
memset (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
|
||||
memcpy (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, pduP, sdu_size);
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).frame = frame; //frameP
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = sub_frame; //sub_frameP
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = sdu_size;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).gnb_index = gNB_index;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti; //rntiP
|
||||
itti_send_msg_to_task (TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE( module_id ), message_p);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1366,10 +1366,10 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
|
||||
(void **)&dl_ccch_msg,
|
||||
(uint8_t *)Srb_info->Rx_buffer.Payload,
|
||||
100,0,0);
|
||||
|
||||
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout,&asn_DEF_NR_DL_CCCH_Message,(void *)dl_ccch_msg);
|
||||
// }
|
||||
}
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed==0)) {
|
||||
LOG_E(RRC,"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%zu bytes)\n",ctxt_pP->module_id,ctxt_pP->frame,dec_rval.consumed);
|
||||
@@ -2473,7 +2473,6 @@ void *rrc_nrue_task( void *args_p ) {
|
||||
case NR_RRC_MAC_BCCH_DATA_IND:
|
||||
LOG_D(NR_RRC, "[UE %d] Received %s: frameP %d, gNB %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p),
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).frame, NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index);
|
||||
// PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, NOT_A_RNTI, RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0);
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NOT_A_RNTI, NR_RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0,NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index);
|
||||
nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message (ctxt.module_id,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index,
|
||||
@@ -2481,6 +2480,7 @@ void *rrc_nrue_task( void *args_p ) {
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).sdu_size,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).rsrq,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).rsrp);
|
||||
break;
|
||||
|
||||
case NR_RRC_MAC_CCCH_DATA_IND:
|
||||
LOG_D(NR_RRC, "[UE %d] RNTI %x Received %s: frameP %d, gNB %d\n",
|
||||
@@ -2569,7 +2569,7 @@ void *rrc_nrue_task( void *args_p ) {
|
||||
LOG_E(NR_RRC, "[UE %d] Received unexpected message %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
|
||||
break;
|
||||
}
|
||||
LOG_I(NR_RRC, "[UE %d] RRC Status %d\n", ue_mod_id, nr_rrc_get_state(ue_mod_id));
|
||||
LOG_D(NR_RRC, "[UE %d] RRC Status %d\n", ue_mod_id, nr_rrc_get_state(ue_mod_id));
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
msg_p = NULL;
|
||||
|
||||
@@ -109,7 +109,15 @@ int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const ui
|
||||
\param channel indicator for channel of the pdu
|
||||
\param pduP pointer to pdu
|
||||
\param pdu_len data length of pdu*/
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const channel_t channel, const uint8_t* pduP, const sdu_size_t pdu_len);
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_index,
|
||||
const frame_t frame,
|
||||
const sub_frame_t sub_frame,
|
||||
const rnti_t rnti,
|
||||
const channel_t channel,
|
||||
const uint8_t* pduP,
|
||||
const sdu_size_t pdu_len);
|
||||
|
||||
/**\brief
|
||||
\param module_id module id
|
||||
|
||||
Reference in New Issue
Block a user