Commit 6637415b authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'NR_RRCConfiguration' of...

Merge branch 'NR_RRCConfiguration' of https://gitlab.eurecom.fr/oai/openairinterface5g into NR_RRCConfiguration
parents 7580b4b2 ac092841
...@@ -46,6 +46,10 @@ void nr_fill_dci(PHY_VARS_gNB *gNB, ...@@ -46,6 +46,10 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
int frame, int frame,
int slot); int slot);
void nr_fill_ul_dci(PHY_VARS_gNB *gNB,
int frame,
int slot);
void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m); void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m);
void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset); void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset);
......
...@@ -44,7 +44,7 @@ void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot, ...@@ -44,7 +44,7 @@ void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
AssertFatal(dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag== 1, "bchPayloadFlat %d != 1\n", AssertFatal(dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag== 1, "bchPayloadFlat %d != 1\n",
dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag); dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag);
LOG_I(PHY,"%d.%d : pbch_pdu: %x\n",frame,slot,dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload,dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.SsbBlockIndex); LOG_I(PHY,"%d.%d : pbch_pdu: %x\n",frame,slot,dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload);
gNB->ssb_pdu = &dl_tti_pdu->ssb_pdu; gNB->ssb_pdu = &dl_tti_pdu->ssb_pdu;
} }
......
...@@ -367,11 +367,14 @@ void config_common(int Mod_idP, NR_ServingCellConfigCommon_t *scc) { ...@@ -367,11 +367,14 @@ void config_common(int Mod_idP, NR_ServingCellConfigCommon_t *scc) {
// SSB Table Configuration // SSB Table Configuration
int scs_scaling = 1<<(cfg->ssb_config.scs_common.value); int scs_scaling = 1<<(cfg->ssb_config.scs_common.value);
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000)
scs_scaling = scs_scaling*3;
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666)
scs_scaling = scs_scaling>>2;
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA); uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling); cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling);
cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG; cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG;
cfg->num_tlv++; cfg->num_tlv++;
cfg->ssb_table.ssb_period.value = *scc->ssb_periodicityServingCell; cfg->ssb_table.ssb_period.value = *scc->ssb_periodicityServingCell;
cfg->ssb_table.ssb_period.tl.tag = NFAPI_NR_CONFIG_SSB_PERIOD_TAG; cfg->ssb_table.ssb_period.tl.tag = NFAPI_NR_CONFIG_SSB_PERIOD_TAG;
cfg->num_tlv++; cfg->num_tlv++;
......
...@@ -69,7 +69,6 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){ ...@@ -69,7 +69,6 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
int mib_sdu_length; int mib_sdu_length;
int CC_id; int CC_id;
AssertFatal(slotP == 0, "Subframe must be 0\n"); AssertFatal(slotP == 0, "Subframe must be 0\n");
AssertFatal((frameP & 7) == 0, "Frame must be a multiple of 8\n"); AssertFatal((frameP & 7) == 0, "Frame must be a multiple of 8\n");
...@@ -107,34 +106,36 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){ ...@@ -107,34 +106,36 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
AssertFatal(cc->ServingCellConfigCommon->ssbSubcarrierSpacing,"ssbSubcarrierSpacing is null\n"); AssertFatal(cc->ServingCellConfigCommon->ssbSubcarrierSpacing,"ssbSubcarrierSpacing is null\n");
AssertFatal(cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0],"band is null\n"); AssertFatal(cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0],"band is null\n");
long band = *cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; long band = *cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
uint32_t ssb_offset0 = cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA; uint32_t ssb_offset0 = *cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
int ratio; int ratio;
switch (*cc->ServingCellConfigCommon->ssbSubcarrierSpacing) { switch (*cc->ServingCellConfigCommon->ssbSubcarrierSpacing) {
case NR_SubcarrierSpacing_kHz15: case NR_SubcarrierSpacing_kHz15:
AssertFatal(band <= 79, "Band %d is not possible for SSB with 15 kHz SCS\n",band); AssertFatal(band <= 79, "Band %ld is not possible for SSB with 15 kHz SCS\n",band);
if (band<77) // below 3GHz if (band<77) // below 3GHz
ratio=3; // NRARFCN step is 5 kHz ratio=3; // NRARFCN step is 5 kHz
else else
ratio=1; // NRARFCN step is 15 kHz ratio=1; // NRARFCN step is 15 kHz
break; break;
case NR_SubcarrierSpacing_kHz30: case NR_SubcarrierSpacing_kHz30:
AssertFatal(band <= 79, "Band %d is not possible for SSB with 15 kHz SCS\n",band); AssertFatal(band <= 79, "Band %ld is not possible for SSB with 15 kHz SCS\n",band);
if (band<77) // below 3GHz if (band<77) // below 3GHz
ratio=6; // NRARFCN step is 5 kHz ratio=6; // NRARFCN step is 5 kHz
else else
ratio=2; // NRARFCN step is 15 kHz ratio=2; // NRARFCN step is 15 kHz
break; break;
case NR_SubcarrierSpacing_kHz120: case NR_SubcarrierSpacing_kHz120:
AssertFatal(band >= 257, "Band %d is not possible for SSB with 120 kHz SCS\n",band); AssertFatal(band >= 257, "Band %ld is not possible for SSB with 120 kHz SCS\n",band);
ratio=8; // NRARFCN step is 15 kHz ratio=2; // NRARFCN step is 15 kHz
break; break;
case NR_SubcarrierSpacing_kHz240: case NR_SubcarrierSpacing_kHz240:
AssertFatal(band >= 257, "Band %d is not possible for SSB with 240 kHz SCS\n",band); AssertFatal(band >= 257, "Band %ld is not possible for SSB with 240 kHz SCS\n",band);
ratio=16; // NRARFCN step is 15 kHz ratio=4; // NRARFCN step is 15 kHz
break; break;
default:
AssertFatal(1==0,"SCS %ld not allowed for SSB \n", *cc->ServingCellConfigCommon->ssbSubcarrierSpacing);
} }
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset = 0; //kSSB dl_config_pdu->ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset = 0; //kSSB
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA = ssb_offset0/ratio; dl_config_pdu->ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA = ssb_offset0/(ratio*12);
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag = 1; dl_config_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag = 1;
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload = ((uint32_t)cc->MIB_pdu.payload[0]) & ((1<<24)-1); dl_config_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload = ((uint32_t)cc->MIB_pdu.payload[0]) & ((1<<24)-1);
dl_req->nPDUs++; dl_req->nPDUs++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment