Commit d23b02af authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/mac-indentation-fix' into develop_integration_2018_w06

parents be8d32d5 01f06bcf
...@@ -215,7 +215,7 @@ void config_mib(int Mod_idP, ...@@ -215,7 +215,7 @@ void config_mib(int Mod_idP,
cfg->rf_config.dl_channel_bandwidth.value = to_prb(dl_BandwidthP); cfg->rf_config.dl_channel_bandwidth.value = to_prb(dl_BandwidthP);
cfg->rf_config.dl_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG; cfg->rf_config.dl_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG;
cfg->num_tlv++; cfg->num_tlv++;
LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP); LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP);
cfg->rf_config.ul_channel_bandwidth.value = to_prb(dl_BandwidthP); cfg->rf_config.ul_channel_bandwidth.value = to_prb(dl_BandwidthP);
cfg->rf_config.ul_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG; cfg->rf_config.ul_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG;
...@@ -267,10 +267,10 @@ LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP); ...@@ -267,10 +267,10 @@ LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP);
cfg->emtc_config.pbch_repetitions_enable_r13.tl.tag = NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG; cfg->emtc_config.pbch_repetitions_enable_r13.tl.tag = NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG;
cfg->num_tlv++; cfg->num_tlv++;
#endif #endif
LOG_I(MAC, LOG_I(MAC,
"%s() NFAPI_CONFIG_REQUEST(num_tlv:%u) DL_BW:%u UL_BW:%u Ncp %d,p_eNB %d,earfcn %d,band %d,phich_resource %u phich_duration %u phich_power_offset %u PSS %d SSS %d PCI %d" "%s() NFAPI_CONFIG_REQUEST(num_tlv:%u) DL_BW:%u UL_BW:%u Ncp %d,p_eNB %d,earfcn %d,band %d,phich_resource %u phich_duration %u phich_power_offset %u PSS %d SSS %d PCI %d"
#ifdef Rel14 #ifdef Rel14
" PBCH repetition %d" " PBCH repetition %d"
#endif #endif
"\n" "\n"
...@@ -296,6 +296,7 @@ LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP); ...@@ -296,6 +296,7 @@ LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP);
void config_sib1(int Mod_idP, int CC_idP, TDD_Config_t * tdd_ConfigP) void config_sib1(int Mod_idP, int CC_idP, TDD_Config_t * tdd_ConfigP)
{ {
nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP]; nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
if (tdd_ConfigP) { //TDD if (tdd_ConfigP) { //TDD
...@@ -396,16 +397,13 @@ config_sib2(int Mod_idP, ...@@ -396,16 +397,13 @@ config_sib2(int Mod_idP,
cfg->pucch_config.n1_pucch_an.tl.tag = NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG; cfg->pucch_config.n1_pucch_an.tl.tag = NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG;
cfg->num_tlv++; cfg->num_tlv++;
if (radioResourceConfigCommonP->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled == true) if (radioResourceConfigCommonP->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled == true) {
{
cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 1; cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 1;
} }
else if (radioResourceConfigCommonP->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled == true) else if (radioResourceConfigCommonP->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled == true) {
{
cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 2; cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 2;
} }
else // No hopping else {
{
cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 0; cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 0;
} }
cfg->uplink_reference_signal_config.uplink_rs_hopping.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG; cfg->uplink_reference_signal_config.uplink_rs_hopping.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG;
...@@ -704,7 +702,6 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -704,7 +702,6 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
#endif #endif
); );
mac_init_cell_params(Mod_idP,CC_idP); mac_init_cell_params(Mod_idP,CC_idP);
if (schedulingInfoList!=NULL) { if (schedulingInfoList!=NULL) {
...@@ -777,6 +774,7 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -777,6 +774,7 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
NULL, ul_Bandwidth, additionalSpectrumEmission, NULL, ul_Bandwidth, additionalSpectrumEmission,
mbsfn_SubframeConfigList); mbsfn_SubframeConfigList);
} }
} // mib != NULL } // mib != NULL
...@@ -926,3 +924,5 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -926,3 +924,5 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
return(0); return(0);
} }
...@@ -74,6 +74,8 @@ uint16_t pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 }; ...@@ -74,6 +74,8 @@ uint16_t pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
void void
schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
{ {
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
UE_list_t *UE_list = &eNB->UE_list; UE_list_t *UE_list = &eNB->UE_list;
nfapi_ul_config_request_body_t *ul_req; nfapi_ul_config_request_body_t *ul_req;
...@@ -92,14 +94,10 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -92,14 +94,10 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
uint16_t srsPeriodicity, srsOffset; uint16_t srsPeriodicity, srsOffset;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
soundingRS_UL_ConfigCommon = soundingRS_UL_ConfigCommon = &cc[CC_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon;
&cc[CC_id].radioResourceConfigCommon->
soundingRS_UL_ConfigCommon;
// check if SRS is enabled in this frame/subframe // check if SRS is enabled in this frame/subframe
if (soundingRS_UL_ConfigCommon) { if (soundingRS_UL_ConfigCommon) {
srs_SubframeConfig = srs_SubframeConfig = soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
soundingRS_UL_ConfigCommon->choice.setup.
srs_SubframeConfig;
if (cc[CC_id].tdd_Config == NULL) { // FDD if (cc[CC_id].tdd_Config == NULL) { // FDD
deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0]; deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0];
TSFC = deltaTSFCTabType1[srs_SubframeConfig][1]; TSFC = deltaTSFCTabType1[srs_SubframeConfig][1];
...@@ -115,88 +113,38 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -115,88 +113,38 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE) if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE)
continue; continue;
ul_req = ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
&RC.mac[module_idP]->UL_req[CC_id].
ul_config_request_body;
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
(module_idP,
UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED)
continue;
AssertFatal(UE_list->UE_template[CC_id] AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL,
[UE_id].physicalConfigDedicated != NULL,
"physicalConfigDedicated is null for UE %d\n", "physicalConfigDedicated is null for UE %d\n",
UE_id); UE_id);
if ((soundingRS_UL_ConfigDedicated = if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) {
UE_list->UE_template[CC_id] if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) {
[UE_id].
physicalConfigDedicated->soundingRS_UL_ConfigDedicated)
!= NULL) {
if (soundingRS_UL_ConfigDedicated->present ==
SoundingRS_UL_ConfigDedicated_PR_setup) {
get_srs_pos(&cc[CC_id], get_srs_pos(&cc[CC_id],
soundingRS_UL_ConfigDedicated->choice. soundingRS_UL_ConfigDedicated->choice.
setup.srs_ConfigIndex, setup.srs_ConfigIndex,
&srsPeriodicity, &srsOffset); &srsPeriodicity, &srsOffset);
if (((10 * frameP + if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) {
subframeP) % srsPeriodicity) ==
srsOffset) {
// Program SRS // Program SRS
ul_req->srs_present = 1; ul_req->srs_present = 1;
nfapi_ul_config_request_pdu_t nfapi_ul_config_request_pdu_t * ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
* ul_config_pdu = memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
&ul_req-> ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE;
ul_config_pdu_list ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu));
[ul_req->number_of_pdus];
memset((void *) ul_config_pdu, 0,
sizeof
(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type =
NFAPI_UL_CONFIG_SRS_PDU_TYPE;
ul_config_pdu->pdu_size =
2 + (uint8_t) (2 +
sizeof
(nfapi_ul_config_srs_pdu));
ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG; ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG;
ul_config_pdu->srs_pdu.srs_pdu_rel8.size = ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu);
(uint8_t) ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
sizeof(nfapi_ul_config_srs_pdu); ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
UE_list->UE_template[CC_id][UE_id]. ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;;
rnti; ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
ul_config_pdu->srs_pdu. ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
srs_pdu_rel8.srs_bandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;//
soundingRS_UL_ConfigDedicated->
choice.setup.srs_Bandwidth;
ul_config_pdu->srs_pdu.
srs_pdu_rel8.frequency_domain_position
=
soundingRS_UL_ConfigDedicated->
choice.setup.freqDomainPosition;
ul_config_pdu->srs_pdu.
srs_pdu_rel8.srs_hopping_bandwidth =
soundingRS_UL_ConfigDedicated->
choice.setup.srs_HoppingBandwidth;;
ul_config_pdu->srs_pdu.
srs_pdu_rel8.transmission_comb =
soundingRS_UL_ConfigDedicated->
choice.setup.transmissionComb;
ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs =
soundingRS_UL_ConfigDedicated->
choice.setup.srs_ConfigIndex;
ul_config_pdu->srs_pdu.
srs_pdu_rel8.sounding_reference_cyclic_shift
=
soundingRS_UL_ConfigDedicated->
choice.setup.cyclicShift;
// ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;//
// ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;// // ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;//
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
(frameP << 4) + subframeP;
RC.mac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST; RC.mac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST;
ul_req->number_of_pdus++; ul_req->number_of_pdus++;
} // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) } // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset)
...@@ -228,13 +176,10 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -228,13 +176,10 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
if (UE_list->active[UE_id] != TRUE) if (UE_list->active[UE_id] != TRUE)
continue; continue;
ul_req = ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
&RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED)
continue;
AssertFatal(UE_list-> AssertFatal(UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated UE_template[CC_id][UE_id].physicalConfigDedicated
...@@ -242,50 +187,27 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -242,50 +187,27 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
"physicalConfigDedicated is null for UE %d\n", "physicalConfigDedicated is null for UE %d\n",
UE_id); UE_id);
if (UE_list-> if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) {
UE_template[CC_id][UE_id].physicalConfigDedicated-> if ((cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) != NULL
cqi_ReportConfig) { && (cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_release)) {
if ((cqi_ReportPeriodic =
UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated->
cqi_ReportConfig->cqi_ReportPeriodic) != NULL
&& (cqi_ReportPeriodic->present !=
CQI_ReportPeriodic_PR_release)) {
//Rel8 Periodic CQI/PMI/RI reporting //Rel8 Periodic CQI/PMI/RI reporting
get_csi_params(cc, cqi_ReportPeriodic, &Npd, get_csi_params(cc, cqi_ReportPeriodic, &Npd,
&N_OFFSET_CQI, &H); &N_OFFSET_CQI, &H);
if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI opportunity if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI opportunity
UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id] = UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id] = (((frameP * 10) + subframeP) / Npd) % H;
(((frameP * 10) + subframeP) / Npd) % H;
// Program CQI // Program CQI
nfapi_ul_config_request_pdu_t *ul_config_pdu = nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
&ul_req->ul_config_pdu_list[ul_req->
number_of_pdus];
memset((void *) ul_config_pdu, 0, memset((void *) ul_config_pdu, 0,
sizeof(nfapi_ul_config_request_pdu_t)); sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
ul_config_pdu->pdu_size =
2 + (uint8_t) (2 +
sizeof
(nfapi_ul_config_uci_cqi_pdu));
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu. ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ue_information.ue_information_rel8.rnti =
UE_list->UE_template[CC_id][UE_id].rnti;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG; ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu. ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
cqi_information.cqi_information_rel8. ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc,
pucch_index =
cqi_ReportPeriodic->choice.
setup.cqi_PUCCH_ResourceIndex;
ul_config_pdu->uci_cqi_pdu.
cqi_information.cqi_information_rel8.
dl_cqi_pmi_size =
get_rel8_dl_cqi_pmi_size
(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc,
get_tmode(module_idP, CC_id, UE_id), get_tmode(module_idP, CC_id, UE_id),
cqi_ReportPeriodic); cqi_ReportPeriodic);
ul_req->number_of_pdus++; ul_req->number_of_pdus++;
...@@ -295,40 +217,23 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -295,40 +217,23 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
// PUT rel10-13 UCI options here // PUT rel10-13 UCI options here
#endif #endif
} else } else
if ((cqi_ReportPeriodic->choice.setup. if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
ri_ConfigIndex)
&& ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex % 161))) { // RI opportunity && ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex % 161))) { // RI opportunity
// Program RI // Program RI
nfapi_ul_config_request_pdu_t *ul_config_pdu = nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
&ul_req->ul_config_pdu_list[ul_req->
number_of_pdus];
memset((void *) ul_config_pdu, 0, memset((void *) ul_config_pdu, 0,
sizeof(nfapi_ul_config_request_pdu_t)); sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
ul_config_pdu->pdu_size =
2 + (uint8_t) (2 +
sizeof
(nfapi_ul_config_uci_cqi_pdu));
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu. ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ue_information.ue_information_rel8.rnti =
UE_list->UE_template[CC_id][UE_id].rnti;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG; ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu. ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
cqi_information.cqi_information_rel8. ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2;
pucch_index = RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
cqi_ReportPeriodic->choice.
setup.cqi_PUCCH_ResourceIndex;
ul_config_pdu->uci_cqi_pdu.
cqi_information.cqi_information_rel8.
dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2;
RC.mac[module_idP]->UL_req[CC_id].sfn_sf =
(frameP << 4) + subframeP;
ul_req->number_of_pdus++; ul_req->number_of_pdus++;
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
} }
} // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) { } // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) {
} // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) } // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig)
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
...@@ -351,52 +256,34 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -351,52 +256,34 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
int i; int i;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
(frameP << 4) + subframeP;
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE) if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE) continue;
continue;
ul_req = &RC.mac[module_idP]->UL_req[CC_id]; ul_req = &RC.mac[module_idP]->UL_req[CC_id];
ul_req_body = &ul_req->ul_config_request_body; ul_req_body = &ul_req->ul_config_request_body;
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED)
continue;
AssertFatal(UE_list-> AssertFatal(UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated UE_template[CC_id][UE_id].physicalConfigDedicated!= NULL,
!= NULL,
"physicalConfigDedicated is null for UE %d\n", "physicalConfigDedicated is null for UE %d\n",
UE_id); UE_id);
if ((SRconfig = if ((SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig) != NULL) {
UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated->
schedulingRequestConfig) != NULL) {
if (SRconfig->present == SchedulingRequestConfig_PR_setup) { if (SRconfig->present == SchedulingRequestConfig_PR_setup) {
if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period
if ((subframeP % 5) != if ((subframeP % 5) != SRconfig->choice.setup.sr_ConfigIndex) continue;
SRconfig->choice.setup.sr_ConfigIndex)
continue;
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period } else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period
if (subframeP != if (subframeP != (SRconfig->choice.setup.sr_ConfigIndex - 5)) continue;
(SRconfig->choice.setup.sr_ConfigIndex - 5))
continue;
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period } else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period
if ((10 * (frameP & 1) + subframeP) != if ((10 * (frameP & 1) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 15)) continue;
(SRconfig->choice.setup.sr_ConfigIndex - 15))
continue;
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period } else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period
if ((10 * (frameP & 3) + subframeP) != if ((10 * (frameP & 3) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 35)) continue;
(SRconfig->choice.setup.sr_ConfigIndex - 35))
continue;
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period } else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period
if ((10 * (frameP & 7) + subframeP) != if ((10 * (frameP & 7) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 75)) continue;
(SRconfig->choice.setup.sr_ConfigIndex - 75))
continue;
} }
} // SRconfig->present == SchedulingRequestConfig_PR_setup) } // SRconfig->present == SchedulingRequestConfig_PR_setup)
} // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) } // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL)
...@@ -424,38 +311,24 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -424,38 +311,24 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
} }
// drop the allocation because ULSCH with handle it with BSR // drop the allocation because ULSCH with handle it with BSR
if (skip_ue == 1) if (skip_ue == 1) continue;
continue;
LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x is_harq:%d\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti, is_harq); LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x is_harq:%d\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti, is_harq);
// check Rel10 or Rel8 SR // check Rel10 or Rel8 SR
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
if ((UE_list-> if ((UE_list-> UE_template[CC_id][UE_id].physicalConfigDedicated->ext2)
UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) && (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)
&& (UE_list-> && (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) {
UE_template[CC_id][UE_id].physicalConfigDedicated->
ext2->schedulingRequestConfig_v1020)
&& (UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated->
ext2->schedulingRequestConfig_v1020)) {
sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG; sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG;
sr.sr_information_rel10.number_of_pucch_resources = 1; sr.sr_information_rel10.number_of_pucch_resources = 1;
sr.sr_information_rel10.pucch_index_p1 = sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10;
*UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated->
ext2->
schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10;
LOG_D(MAC,"REL10 PUCCH INDEX P1:%d\n", sr.sr_information_rel10.pucch_index_p1); LOG_D(MAC,"REL10 PUCCH INDEX P1:%d\n", sr.sr_information_rel10.pucch_index_p1);
} else } else
#endif #endif
{ {
sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG; sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG;
sr.sr_information_rel8.pucch_index = sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated->
schedulingRequestConfig->choice.setup.
sr_PUCCH_ResourceIndex;
LOG_D(MAC,"REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index); LOG_D(MAC,"REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index);
} }
...@@ -499,33 +372,23 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, ...@@ -499,33 +372,23 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 1; UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 1;
// add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe)
nfapi_dl_config_request_pdu_t *dl_config_pdu = nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu];
&DL_req[CC_id]. memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t));
dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].
dl_config_request_body.number_pdu];
memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
NFAPI_DL_DCI_FORMAT_1A; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP, CC_id),
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level =
get_aggregation(get_bw_index(module_idP, CC_id),
UE_list->UE_sched_ctrl[UE_id]. UE_list->UE_sched_ctrl[UE_id].
dl_cqi[CC_id], format1A); dl_cqi[CC_id], format1A);
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
AssertFatal((cc[CC_id].mib->message.dl_Bandwidth >= 0) AssertFatal((cc[CC_id].mib->message.dl_Bandwidth >= 0) && (cc[CC_id].mib->message.dl_Bandwidth < 6),
&& (cc[CC_id].mib->message.dl_Bandwidth < 6),
"illegal dl_Bandwidth %d\n", "illegal dl_Bandwidth %d\n",
(int) cc[CC_id].mib->message.dl_Bandwidth); (int) cc[CC_id].mib->message.dl_Bandwidth);
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth];
resource_block_coding =
pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth];
DL_req[CC_id].dl_config_request_body.number_dci++; DL_req[CC_id].dl_config_request_body.number_dci++;
DL_req[CC_id].dl_config_request_body.number_pdu++; DL_req[CC_id].dl_config_request_body.number_pdu++;
DL_req[CC_id].dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; DL_req[CC_id].dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
...@@ -540,8 +403,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, ...@@ -540,8 +403,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n", "UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",
UE_id, rnti, UE_id, rnti,
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 40) == 0) if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 40) == 0) UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 4 frames
UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 4 frames
} }
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++;
...@@ -551,8 +413,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, ...@@ -551,8 +413,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
LOG_I(MAC, LOG_I(MAC,
"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n", "UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",
UE_id, rnti); UE_id, rnti);
mac_eNB_rrc_ul_failure(module_idP, CC_id, frameP, subframeP, mac_eNB_rrc_ul_failure(module_idP, CC_id, frameP, subframeP,rnti);
rnti);
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0;
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 1; UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 1;
} }
...@@ -614,9 +475,7 @@ copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -614,9 +475,7 @@ copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
// Restore the pointer // Restore the pointer
ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu; ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu;
ul_req->sfn_sf = (frameP<<4) + subframeP; ul_req->sfn_sf = (frameP<<4) + subframeP;
ul_req_tmp->ul_config_request_body.number_of_pdus = 0; ul_req_tmp->ul_config_request_body.number_of_pdus = 0;
if (ul_req->ul_config_request_body.number_of_pdus>0) if (ul_req->ul_config_request_body.number_of_pdus>0)
...@@ -638,7 +497,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, ...@@ -638,7 +497,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
int mbsfn_status[MAX_NUM_CCs]; int mbsfn_status[MAX_NUM_CCs];
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
int CC_id, i; //,next_i; int CC_id, i;
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
rnti_t rnti; rnti_t rnti;
...@@ -668,29 +527,6 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, ...@@ -668,29 +527,6 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
RC.mac[module_idP]->frame = frameP; RC.mac[module_idP]->frame = frameP;
RC.mac[module_idP]->subframe = subframeP; RC.mac[module_idP]->subframe = subframeP;
clear_nfapi_information(RC.mac[module_idP], CC_id, frameP,
subframeP);
}
// refresh UE list based on UEs dropped by PHY in previous subframe
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (UE_list->active[i] != TRUE)
continue;
rnti = UE_RNTI(module_idP, i);
CC_id = UE_PCCID(module_idP, i);
if ((frameP == 0) && (subframeP == 0)) {
LOG_I(MAC,
"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n",
rnti,
UE_list->UE_sched_ctrl[i].ul_out_of_sync ==
0 ? "in synch" : "out of sync",
UE_list->UE_template[CC_id][i].phr_info,
UE_list->UE_sched_ctrl[i].dl_cqi[CC_id],
(UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 128) / 2,
(UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 128) / 2);
}
RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP * 10) + RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP * 10) +
subframeP] = -63; subframeP] = -63;
...@@ -756,7 +592,42 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, ...@@ -756,7 +592,42 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
rrc_mac_remove_ue(module_idP,rnti); rrc_mac_remove_ue(module_idP,rnti);
} }
} }
}
// refresh UE list based on UEs dropped by PHY in previous subframe
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (UE_list->active[i] != TRUE) continue;
rnti = UE_RNTI(module_idP, i);
CC_id = UE_PCCID(module_idP, i);
if ((frameP == 0) && (subframeP == 0)) {
LOG_I(MAC,
"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n",
rnti,
UE_list->UE_sched_ctrl[i].ul_out_of_sync ==
0 ? "in synch" : "out of sync",
UE_list->UE_template[CC_id][i].phr_info,
UE_list->UE_sched_ctrl[i].dl_cqi[CC_id],
(UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 128) / 2,
(UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 128) / 2);
}
RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP * 10) + subframeP] = -63;
if (i == UE_list->head)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,
RC.eNB[module_idP][CC_id]->
pusch_stats_bsr[i][(frameP * 10) + subframeP]);
// increment this, it is cleared when we receive an sdu
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++;
LOG_D(MAC, "UE %d/%x : ul_inactivity %d, cqi_req %d\n", i, rnti,
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].
ul_inactivity_timer,
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer);
check_ul_failure(module_idP, CC_id, i, frameP, subframeP);
} }
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES,
...@@ -764,6 +635,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, ...@@ -764,6 +635,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
module_idP); module_idP);
pdcp_run(&ctxt); pdcp_run(&ctxt);
rrc_rx_tx(&ctxt, CC_id); rrc_rx_tx(&ctxt, CC_id);
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
...@@ -771,8 +643,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, ...@@ -771,8 +643,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
if (cc[CC_id].MBMS_flag > 0) { if (cc[CC_id].MBMS_flag > 0) {
start_meas(&RC.mac[module_idP]->schedule_mch); start_meas(&RC.mac[module_idP]->schedule_mch);
mbsfn_status[CC_id] = mbsfn_status[CC_id] = schedule_MBMS(module_idP, CC_id, frameP, subframeP);
schedule_MBMS(module_idP, CC_id, frameP, subframeP);
stop_meas(&RC.mac[module_idP]->schedule_mch); stop_meas(&RC.mac[module_idP]->schedule_mch);
} }
} }
...@@ -810,7 +681,6 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, ...@@ -810,7 +681,6 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
stop_meas(&RC.mac[module_idP]->eNB_scheduler); stop_meas(&RC.mac[module_idP]->eNB_scheduler);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,
(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,
VCD_FUNCTION_OUT); VCD_FUNCTION_OUT);
} }
...@@ -136,43 +136,30 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, ...@@ -136,43 +136,30 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
memset((void *) ul_config_pdu, 0, memset((void *) ul_config_pdu, 0,
sizeof(nfapi_ul_config_request_pdu_t)); sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
ul_config_pdu->pdu_size = ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
(uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = mac->ul_handle++; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = mac->ul_handle++;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = ra->rnti; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = ra->rnti;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = narrowband_to_first_rb(cc,
narrowband_to_first_rb(cc, ra->msg34_narrowband) + ra->msg3_first_rb;
ra->msg34_narrowband) + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = ra->msg3_nb_rb;
ra->msg3_first_rb;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks =
ra->msg3_nb_rb;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0;
0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.
frequency_hopping_enabled_flag = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = rvseq[ra->msg3_round];
rvseq[ra->msg3_round]; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = ((10 * ra->Msg3_frame) + ra->Msg3_subframe) & 7;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number =
((10 * ra->Msg3_frame) + ra->Msg3_subframe) & 7;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(ra->msg3_mcs, ra->msg3_nb_rb);
get_TBS_UL(ra->msg3_mcs, ra->msg3_nb_rb);
// Re13 fields // Re13 fields
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ra->rach_resource_type > 2 ? 2 : 1;
ra->rach_resource_type > 2 ? 2 : 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.
total_number_of_repetitions = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13. ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (ra->Msg3_frame * 10) + ra->Msg3_subframe;
initial_transmission_sf_io =
(ra->Msg3_frame * 10) + ra->Msg3_subframe;
ul_req_body->number_of_pdus++; ul_req_body->number_of_pdus++;
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe; ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe;
...@@ -191,38 +178,28 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, ...@@ -191,38 +178,28 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
frameP, subframeP, ra->Msg3_frame, ra->Msg3_subframe, frameP, subframeP, ra->Msg3_frame, ra->Msg3_subframe,
ra->msg3_nb_rb, ra->msg3_first_rb, ra->msg3_round); ra->msg3_nb_rb, ra->msg3_first_rb, ra->msg3_round);
ul_config_pdu = ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
&ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
memset((void *) ul_config_pdu, 0, memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
ul_config_pdu->pdu_size = ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
(uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = mac->ul_handle++; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = mac->ul_handle++;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = ra->rnti; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = ra->rnti;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = ra->msg3_first_rb;
ra->msg3_first_rb;
AssertFatal(ra->msg3_nb_rb > 0, "nb_rb = 0\n"); AssertFatal(ra->msg3_nb_rb > 0, "nb_rb = 0\n");
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = ra->msg3_nb_rb;
ra->msg3_nb_rb;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0;
0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.
frequency_hopping_enabled_flag = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = rvseq[ra->msg3_round];
rvseq[ra->msg3_round]; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = subframe2harqpid(cc, ra->Msg3_frame, ra->Msg3_subframe);
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number =
subframe2harqpid(cc, ra->Msg3_frame, ra->Msg3_subframe);
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10, ra->msg3_nb_rb);
get_TBS_UL(10, ra->msg3_nb_rb);
ul_req_body->number_of_pdus++; ul_req_body->number_of_pdus++;
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe; ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe;
...@@ -240,8 +217,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, ...@@ -240,8 +217,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_hi_pdu); hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_hi_pdu);
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = ra->msg3_first_rb;
ra->msg3_first_rb;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
hi_dci0_req_body->number_of_hi++; hi_dci0_req_body->number_of_hi++;
...@@ -312,11 +288,8 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -312,11 +288,8 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
if (cc[CC_idP].radioResourceConfigCommon_BR) { if (cc[CC_idP].radioResourceConfigCommon_BR) {
ext4_prach = ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
cc[CC_idP].radioResourceConfigCommon_BR->ext4-> prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13;
prach_ConfigCommon_v1310;
prach_ParametersListCE_r13 =
&ext4_prach->prach_ParametersListCE_r13;
switch (prach_ParametersListCE_r13->list.count) { switch (prach_ParametersListCE_r13->list.count) {
case 4: case 4:
...@@ -348,110 +321,71 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -348,110 +321,71 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
// rmax from SIB2 information // rmax from SIB2 information
AssertFatal(rmax < 9, "rmax>8!\n"); AssertFatal(rmax < 9, "rmax>8!\n");
rmax = rmax = 1 << p[ra->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13;
1 << p[ra->rach_resource_type -
1]->mpdcch_NumRepetition_RA_r13;
// choose r1 by default for RAR (Table 9.1.5-5) // choose r1 by default for RAR (Table 9.1.5-5)
rep = 0; rep = 0;
// get actual repetition count from Table 9.1.5-3 // get actual repetition count from Table 9.1.5-3
reps = (rmax <= 8) ? (1 << rep) : (rmax >> (3 - rep)); reps = (rmax <= 8) ? (1 << rep) : (rmax >> (3 - rep));
// get narrowband according to higher-layer config // get narrowband according to higher-layer config
num_nb = num_nb = p[ra->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.count;
p[ra->rach_resource_type - ra->msg2_narrowband = *p[ra->rach_resource_type - 1]->mpdcch_NarrowbandsToMonitor_r13.list.array[ra->preamble_index % num_nb];
1]->mpdcch_NarrowbandsToMonitor_r13.list.count; first_rb = narrowband_to_first_rb(&cc[CC_idP], ra->msg2_narrowband);
ra->msg2_narrowband =
*p[ra->rach_resource_type -
1]->mpdcch_NarrowbandsToMonitor_r13.list.array[ra->
preamble_index
% num_nb];
first_rb =
narrowband_to_first_rb(&cc[CC_idP], ra->msg2_narrowband);
if ((ra->msg2_mpdcch_repetition_cnt == 0) && if ((ra->msg2_mpdcch_repetition_cnt == 0) &&
(mpdcch_sf_condition (mpdcch_sf_condition(mac, CC_idP, frameP, subframeP, rmax, TYPE2, -1) > 0)) {
(mac, CC_idP, frameP, subframeP, rmax, TYPE2, -1) > 0)) {
// MPDCCH configuration for RAR // MPDCCH configuration for RAR
LOG_D(MAC, LOG_D(MAC,
"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming MPDCCH %d repetitions\n", "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming MPDCCH %d repetitions\n",
module_idP, frameP, subframeP, reps); module_idP, frameP, subframeP, reps);
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t));
sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_mpdcch_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_mpdcch_pdu));
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = (ra->rach_resource_type > 1) ? 11 : 10;
(ra->rach_resource_type > 1) ? 11 : 10; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = ra->msg2_narrowband;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6;
ra->msg2_narrowband;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.
number_of_prb_pairs = 6;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; // imposed (9.1.5 in 213) for Type 2 Common search space dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; // imposed (9.1.5 in 213) for Type 2 Common search space
AssertFatal(cc[CC_idP]. AssertFatal(cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13!= NULL,
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13
!= NULL,
"cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); "cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
cc[CC_idP].sib1_v13ext->
bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 2; // RA-RNTI dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 2; // RA-RNTI
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti = ra->RA_rnti; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti = ra->RA_rnti;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = (ra->rach_resource_type < 3) ? 1 : 2;
(ra->rach_resource_type < 3) ? 1 : 2; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = cc[CC_idP].physCellId;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.initial_transmission_sf_io = (frameP * 10) + subframeP;
drms_scrambling_init = cc[CC_idP].physCellId;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.
initial_transmission_sf_io = (frameP * 10) + subframeP;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(6, 0, 6); // Note: still to be checked if it should not be (getRIV(N_RB_DL,first_rb,6)) : Check nFAPI specifications and what is done L1 with this parameter dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(6, 0, 6); // Note: still to be checked if it should not be (getRIV(N_RB_DL,first_rb,6)) : Check nFAPI specifications and what is done L1 with this parameter
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB=3 dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB=3
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0;
0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator =
0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_resource_offset = 0;
harq_resource_offset = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_subframe_repetition_number = rep;
dl_config_pdu->mpdcch_pdu.
mpdcch_pdu_rel13.dci_subframe_repetition_number = rep;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpc = 1; // N1A_PRB=3 (36.212); => 208 bits for mcs=4, choose mcs according t message size TBD dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpc = 1; // N1A_PRB=3 (36.212); => 208 bits for mcs=4, choose mcs according t message size TBD
dl_config_pdu->mpdcch_pdu. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index_length = 0;
mpdcch_pdu_rel13.downlink_assignment_index_length = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.allocate_prach_flag = 0;
downlink_assignment_index = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.
allocate_prach_flag = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = 0;
0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level =
0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.srs_request = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.srs_request = 0;
dl_config_pdu->mpdcch_pdu. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag = 0;
mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = 0;
= 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.frequency_hopping_enabled_flag = 0;
dl_config_pdu->mpdcch_pdu. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag = 0;
mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication = 0;
dl_config_pdu->mpdcch_pdu.
mpdcch_pdu_rel13.frequency_hopping_enabled_flag = 0;
dl_config_pdu->mpdcch_pdu.
mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag
= 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication =
0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1;
number_of_tx_antenna_ports = 1;
ra->msg2_mpdcch_repetition_cnt++; ra->msg2_mpdcch_repetition_cnt++;
dl_req->number_pdu++; dl_req->number_pdu++;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
...@@ -489,65 +423,43 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -489,65 +423,43 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
ra->state = WAITMSG3; ra->state = WAITMSG3;
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP); LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP);
dl_config_pdu = dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
&dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t));
memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = mac->pdu_index[CC_idP];
mac->pdu_index[CC_idP];
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2;
resource_allocation_type = 2;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 6);
resource_block_coding = getRIV(N_RB_DL, first_rb, 6);
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
redundancy_version = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers =
1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
number_of_subbands = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
ue_category_capacity = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
delta_power_offset_index = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB == 1) ? 1 : 2;
(cc->p_eNB == 1) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
// Rel10 fields // Rel10 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
cc[CC_idP].
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->
startSymbolBR_r13;
// Rel13 fields // Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (ra->rach_resource_type < 3) ? 1 : 2;
(ra->rach_resource_type < 3) ? 1 : 2;;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10 * frameP) + subframeP;
initial_transmission_sf_io = (10 * frameP) + subframeP; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag =
0;
dl_req->number_pdu++; dl_req->number_pdu++;
mac->DL_req[CC_idP].sfn_sf = (frameP<<4)+subframeP; mac->DL_req[CC_idP].sfn_sf = (frameP<<4)+subframeP;
...@@ -567,16 +479,12 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -567,16 +479,12 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
mac->TX_req[CC_idP].header.message_id = NFAPI_TX_REQUEST; mac->TX_req[CC_idP].header.message_id = NFAPI_TX_REQUEST;
mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP; mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
TX_req = TX_req =
&mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac-> &mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac->TX_req[CC_idP].tx_request_body.number_of_pdus];
TX_req
[CC_idP].
tx_request_body.number_of_pdus];
TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble
TX_req->pdu_index = mac->pdu_index[CC_idP]++; TX_req->pdu_index = mac->pdu_index[CC_idP]++;
TX_req->num_segments = 1; TX_req->num_segments = 1;
TX_req->segments[0].segment_length = 7; TX_req->segments[0].segment_length = 7;
TX_req->segments[0].segment_data = TX_req->segments[0].segment_data = cc[CC_idP].RAR_pdu.payload;
cc[CC_idP].RAR_pdu.payload;
mac->TX_req[CC_idP].tx_request_body.number_of_pdus++; mac->TX_req[CC_idP].tx_request_body.number_of_pdus++;
} }
} }
...@@ -597,100 +505,73 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -597,100 +505,73 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
vrb_map[first_rb + 2] = 1; vrb_map[first_rb + 2] = 1;
vrb_map[first_rb + 3] = 1; vrb_map[first_rb + 3] = 1;
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t));
sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
NFAPI_DL_DCI_FORMAT_1A; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level =
4;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = ra->RA_rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = ra->RA_rnti;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // RA-RNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // RA-RNTI : see Table 4-10 from SCF082 - nFAPI specifications
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1;
new_data_indicator_1 = 1;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 0;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0;
redundancy_version_1 = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0;
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
// This checks if the above DCI allocation is feasible in current subframe // This checks if the above DCI allocation is feasible in current subframe
if (!CCE_allocation_infeasible if (!CCE_allocation_infeasible(module_idP, CC_idP, 0, subframeP,
(module_idP, CC_idP, 0, subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, ra->RA_rnti)) {
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.
aggregation_level, ra->RA_rnti)) {
LOG_D(MAC, LOG_D(MAC,
"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", "Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n",
frameP, subframeP, ra->RA_rnti); frameP, subframeP, ra->RA_rnti);
dl_req->number_dci++; dl_req->number_dci++;
dl_req->number_pdu++; dl_req->number_pdu++;
dl_config_pdu = dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
&dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t));
memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = mac->pdu_index[CC_idP];
mac->pdu_index[CC_idP];
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
redundancy_version = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers =
1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
number_of_subbands = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
ue_category_capacity = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
delta_power_offset_index = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB == 1) ? 1 : 2;
(cc->p_eNB == 1) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
dl_req->number_pdu++; dl_req->number_pdu++;
mac->DL_req[CC_idP].sfn_sf = frameP<<4 | subframeP; mac->DL_req[CC_idP].sfn_sf = frameP<<4 | subframeP;
// Program UL processing for Msg3 // Program UL processing for Msg3
get_Msg3alloc(&cc[CC_idP], subframeP, frameP, get_Msg3alloc(&cc[CC_idP], subframeP, frameP,&ra->Msg3_frame, &ra->Msg3_subframe);
&ra->Msg3_frame, &ra->Msg3_subframe);
LOG_D(MAC, LOG_D(MAC,
"Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n", "Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n",
frameP, subframeP, ra->Msg3_frame, frameP, subframeP, ra->Msg3_frame,
ra->Msg3_subframe); ra->Msg3_subframe);
fill_rar(module_idP, CC_idP, ra, frameP, fill_rar(module_idP, CC_idP, ra, frameP, cc[CC_idP].RAR_pdu.payload, N_RB_DL, 7);
cc[CC_idP].RAR_pdu.payload, N_RB_DL, 7);
add_msg3(module_idP, CC_idP, ra, frameP, subframeP); add_msg3(module_idP, CC_idP, ra, frameP, subframeP);
ra->state = WAITMSG3; ra->state = WAITMSG3;
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP); LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP);
...@@ -698,10 +579,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -698,10 +579,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
// DL request // DL request
mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP; mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
TX_req = TX_req =
&mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac-> &mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac->TX_req[CC_idP].tx_request_body.number_of_pdus];
TX_req
[CC_idP].
tx_request_body.number_of_pdus];
TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble
TX_req->pdu_index = mac->pdu_index[CC_idP]++; TX_req->pdu_index = mac->pdu_index[CC_idP]++;
TX_req->num_segments = 1; TX_req->num_segments = 1;
...@@ -759,63 +637,42 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -759,63 +637,42 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
if (cc[CC_idP].radioResourceConfigCommon_BR) { if (cc[CC_idP].radioResourceConfigCommon_BR) {
ext4_prach = ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
cc[CC_idP].radioResourceConfigCommon_BR->ext4-> ext4_pucch = cc[CC_idP].radioResourceConfigCommon_BR->ext4->pucch_ConfigCommon_v1310;
prach_ConfigCommon_v1310; prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13;
ext4_pucch = pucch_N1PUCCH_AN_InfoList_r13 = ext4_pucch->n1PUCCH_AN_InfoList_r13;
cc[CC_idP].radioResourceConfigCommon_BR->ext4-> AssertFatal(prach_ParametersListCE_r13 != NULL,"prach_ParametersListCE_r13 is null\n");
pucch_ConfigCommon_v1310; AssertFatal(pucch_N1PUCCH_AN_InfoList_r13 != NULL,"pucch_N1PUCCH_AN_InfoList_r13 is null\n");
prach_ParametersListCE_r13 =
&ext4_prach->prach_ParametersListCE_r13;
pucch_N1PUCCH_AN_InfoList_r13 =
ext4_pucch->n1PUCCH_AN_InfoList_r13;
AssertFatal(prach_ParametersListCE_r13 != NULL,
"prach_ParametersListCE_r13 is null\n");
AssertFatal(pucch_N1PUCCH_AN_InfoList_r13 != NULL,
"pucch_N1PUCCH_AN_InfoList_r13 is null\n");
// check to verify CE-Level compatibility in SIB2_BR // check to verify CE-Level compatibility in SIB2_BR
AssertFatal(prach_ParametersListCE_r13->list.count == AssertFatal(prach_ParametersListCE_r13->list.count == pucch_N1PUCCH_AN_InfoList_r13->list.count,
pucch_N1PUCCH_AN_InfoList_r13->list.count,
"prach_ParametersListCE_r13->list.count!= pucch_N1PUCCH_AN_InfoList_r13->list.count\n"); "prach_ParametersListCE_r13->list.count!= pucch_N1PUCCH_AN_InfoList_r13->list.count\n");
switch (prach_ParametersListCE_r13->list.count) { switch (prach_ParametersListCE_r13->list.count) {
case 4: case 4:
p[3] = prach_ParametersListCE_r13->list.array[3]; p[3] = prach_ParametersListCE_r13->list.array[3];
n1pucchan[3] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[3]; n1pucchan[3] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[3];
AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13 AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13 != NULL,
!= NULL,
"pucch_NumRepetitionCE_Msg4_Level3 shouldn't be NULL\n"); "pucch_NumRepetitionCE_Msg4_Level3 shouldn't be NULL\n");
pucchreps[3] = pucchreps[3] = (int) (4 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13);
(int) (4 << *ext4_pucch->
pucch_NumRepetitionCE_Msg4_Level3_r13);
case 3: case 3:
p[2] = prach_ParametersListCE_r13->list.array[2]; p[2] = prach_ParametersListCE_r13->list.array[2];
n1pucchan[2] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[2]; n1pucchan[2] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[2];
AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13 AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13!= NULL,
!= NULL,
"pucch_NumRepetitionCE_Msg4_Level2 shouldn't be NULL\n"); "pucch_NumRepetitionCE_Msg4_Level2 shouldn't be NULL\n");
pucchreps[2] = pucchreps[2] =(int) (4 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13);
(int) (4 << *ext4_pucch->
pucch_NumRepetitionCE_Msg4_Level2_r13);
case 2: case 2:
p[1] = prach_ParametersListCE_r13->list.array[1]; p[1] = prach_ParametersListCE_r13->list.array[1];
n1pucchan[1] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[1]; n1pucchan[1] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[1];
AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13 AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13 != NULL,
!= NULL,
"pucch_NumRepetitionCE_Msg4_Level1 shouldn't be NULL\n"); "pucch_NumRepetitionCE_Msg4_Level1 shouldn't be NULL\n");
pucchreps[1] = pucchreps[1] = (int) (1 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level1_r13);
(int) (1 << *ext4_pucch->
pucch_NumRepetitionCE_Msg4_Level1_r13);
case 1: case 1:
p[0] = prach_ParametersListCE_r13->list.array[0]; p[0] = prach_ParametersListCE_r13->list.array[0];
n1pucchan[0] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[0]; n1pucchan[0] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[0];
AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13 AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13 != NULL,
!= NULL,
"pucch_NumRepetitionCE_Msg4_Level0 shouldn't be NULL\n"); "pucch_NumRepetitionCE_Msg4_Level0 shouldn't be NULL\n");
pucchreps[0] = pucchreps[0] =(int) (1 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level0_r13);
(int) (1 << *ext4_pucch->
pucch_NumRepetitionCE_Msg4_Level0_r13);
default: default:
AssertFatal(1 == 0, AssertFatal(1 == 0,
"Illegal count for prach_ParametersListCE_r13 %d\n", "Illegal count for prach_ParametersListCE_r13 %d\n",
...@@ -887,80 +744,53 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -887,80 +744,53 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_mpdcch_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_mpdcch_pdu));
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = (ra->rach_resource_type > 1) ? 11 : 10;
(ra->rach_resource_type > 1) ? 11 : 10; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = ra->msg34_narrowband;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6;
ra->msg34_narrowband;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.
number_of_prb_pairs = 6;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1;
mpdcch_tansmission_type = 1;
AssertFatal(cc[CC_idP]. AssertFatal(cc[CC_idP].
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13
!= NULL, != NULL,
"cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); "cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
cc[CC_idP].sib1_v13ext->
bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 0; // t-C-RNTI dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 0; // t-C-RNTI
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti = ra->RA_rnti; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti = ra->RA_rnti;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = (ra->rach_resource_type < 3) ? 1 : 2;
(ra->rach_resource_type < 3) ? 1 : 2;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = cc[CC_idP].physCellId; /// Check this is still N_id_cell for type2 common dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = cc[CC_idP].physCellId; /// Check this is still N_id_cell for type2 common
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.initial_transmission_sf_io = (frameP * 10) + subframeP;
initial_transmission_sf_io = (frameP * 10) + subframeP;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(6, 0, 6); // check if not getRIV(N_RB_DL,first_rb,6); dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(6, 0, 6); // check if not getRIV(N_RB_DL,first_rb,6);
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 4; // adjust according to size of Msg4, 208 bits with N1A_PRB=3 dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 4; // adjust according to size of Msg4, 208 bits with N1A_PRB=3
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0;
0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = ra->harq_pid;
0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process =
ra->harq_pid;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_resource_offset = 0;
harq_resource_offset = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_subframe_repetition_number = rep;
dl_config_pdu->mpdcch_pdu.
mpdcch_pdu_rel13.dci_subframe_repetition_number = rep;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpc = 1; // N1A_PRB=3; => 208 bits dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpc = 1; // N1A_PRB=3; => 208 bits
dl_config_pdu->mpdcch_pdu. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index_length = 0;
mpdcch_pdu_rel13.downlink_assignment_index_length = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.allocate_prach_flag = 0;
downlink_assignment_index = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.
allocate_prach_flag = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = 0;
0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level =
0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.srs_request = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.srs_request = 0;
dl_config_pdu->mpdcch_pdu. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag = 0;
mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = 0;
= 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.frequency_hopping_enabled_flag = 0;
dl_config_pdu->mpdcch_pdu. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag = 0;
mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication = 0;
dl_config_pdu->mpdcch_pdu.
mpdcch_pdu_rel13.frequency_hopping_enabled_flag = 0;
dl_config_pdu->mpdcch_pdu.
mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag
= 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication =
0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13. dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1;
number_of_tx_antenna_ports = 1;
ra->msg4_mpdcch_repetition_cnt++; ra->msg4_mpdcch_repetition_cnt++;
dl_req_body->number_pdu++; dl_req_body->number_pdu++;
dl_req_body->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req_body->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
...@@ -983,8 +813,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -983,8 +813,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
AssertFatal(1 == 0, "TDD case not done yet\n"); AssertFatal(1 == 0, "TDD case not done yet\n");
} }
} // mpdcch_repetition_count == reps } // mpdcch_repetition_count == reps
if ((ra->Msg4_frame == frameP) if ((ra->Msg4_frame == frameP) && (ra->Msg4_subframe == subframeP)) {
&& (ra->Msg4_subframe == subframeP)) {
// Program PDSCH // Program PDSCH
...@@ -995,62 +824,42 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -995,62 +824,42 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
AssertFatal(1 == 0, AssertFatal(1 == 0,
"Msg4 generation not finished for BL/CE UE\n"); "Msg4 generation not finished for BL/CE UE\n");
dl_config_pdu = dl_config_pdu = &dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu];
&dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu]; memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t));
memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = mac->pdu_index[CC_idP];
mac->pdu_index[CC_idP];
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->rnti; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->rnti;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 6); // check that this isn't getRIV(6,0,6) dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 6); // check that this isn't getRIV(6,0,6)
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
redundancy_version = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers =
1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
number_of_subbands = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
ue_category_capacity = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
delta_power_offset_index = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB == 1) ? 1 : 2;
(cc->p_eNB == 1) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
cc[CC_idP].
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->
startSymbolBR_r13;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (ra->rach_resource_type < 3) ? 1 : 2;
(ra->rach_resource_type < 3) ? 1 : 2;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10 * frameP) + subframeP;
initial_transmission_sf_io = (10 * frameP) + subframeP; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag =
0;
dl_req_body->number_pdu++; dl_req_body->number_pdu++;
dl_req_body->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req_body->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
...@@ -1062,18 +871,15 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1062,18 +871,15 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
lcid = 0; lcid = 0;
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0;
0;
msg4_header = 1 + 6 + 1; // CR header, CR CE, SDU header msg4_header = 1 + 6 + 1; // CR header, CR CE, SDU header
if ((ra->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { if ((ra->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) {
msg4_padding = msg4_padding = ra->msg4_TBsize - rrc_sdu_length - msg4_header;
ra->msg4_TBsize - rrc_sdu_length - msg4_header;
msg4_post_padding = 0; msg4_post_padding = 0;
} else { } else {
msg4_padding = 0; msg4_padding = 0;
msg4_post_padding = msg4_post_padding = ra->msg4_TBsize - rrc_sdu_length - msg4_header - 1;
ra->msg4_TBsize - rrc_sdu_length - msg4_header - 1;
} }
LOG_D(MAC, LOG_D(MAC,
...@@ -1093,10 +899,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1093,10 +899,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
msg4_post_padding); msg4_post_padding);
memcpy((void *) &mac->UE_list. memcpy((void *) &mac->UE_list.
DLSCH_pdu[CC_idP][0][(unsigned char) DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
UE_id].payload[0][(unsigned
char)
offset],
&cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length); &cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length);
// DL request // DL request
...@@ -1105,17 +908,12 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1105,17 +908,12 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
mac->TX_req[CC_idP].header.message_id = NFAPI_TX_REQUEST; mac->TX_req[CC_idP].header.message_id = NFAPI_TX_REQUEST;
TX_req = TX_req =
&mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac-> &mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac->TX_req[CC_idP].tx_request_body.number_of_pdus];
TX_req
[CC_idP].
tx_request_body.number_of_pdus];
TX_req->pdu_length = rrc_sdu_length; TX_req->pdu_length = rrc_sdu_length;
TX_req->pdu_index = mac->pdu_index[CC_idP]++; TX_req->pdu_index = mac->pdu_index[CC_idP]++;
TX_req->num_segments = 1; TX_req->num_segments = 1;
TX_req->segments[0].segment_length = rrc_sdu_length; TX_req->segments[0].segment_length = rrc_sdu_length;
TX_req->segments[0].segment_data = TX_req->segments[0].segment_data = mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0];
mac->UE_list.
DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0];
mac->TX_req[CC_idP].tx_request_body.number_of_pdus++; mac->TX_req[CC_idP].tx_request_body.number_of_pdus++;
// Program ACK/NAK for Msg4 PDSCH // Program ACK/NAK for Msg4 PDSCH
...@@ -1128,41 +926,26 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1128,41 +926,26 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
ul_req_body = &ul_req->ul_config_request_body; ul_req_body = &ul_req->ul_config_request_body;
ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
ul_config_pdu->pdu_type = ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE;
NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_uci_harq_pdu));
ul_config_pdu->pdu_size =
(uint8_t) (2 + sizeof(nfapi_ul_config_uci_harq_pdu));
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this
ul_config_pdu->uci_harq_pdu. ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = ra->rnti;
ue_information.ue_information_rel8.rnti = ra->rnti;
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG; ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG;
ul_config_pdu->uci_harq_pdu. ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.ue_type = (ra->rach_resource_type < 3) ? 1 : 2;
ue_information.ue_information_rel13.ue_type = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.empty_symbols = 0;
(ra->rach_resource_type < 3) ? 1 : 2; ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.total_number_of_repetitions = pucchreps[ra->rach_resource_type - 1];
ul_config_pdu->uci_harq_pdu. ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.repetition_number = 0;
ue_information.ue_information_rel13.empty_symbols = 0;
ul_config_pdu->uci_harq_pdu.ue_information.
ue_information_rel13.total_number_of_repetitions =
pucchreps[ra->rach_resource_type - 1];
ul_config_pdu->uci_harq_pdu.
ue_information.ue_information_rel13.repetition_number =
0;
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
ul_req->sfn_sf = sfnsf_add_subframe(ra->Msg3_frame, ra->Msg3_subframe, 4); ul_req->sfn_sf = sfnsf_add_subframe(ra->Msg3_frame, ra->Msg3_subframe, 4);
ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST; ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
LOG_D(MAC,"UL_req_tmp[CC_idP:%d][ackNAK_absSF mod 10:%d] ra->Msg3_frame:%d ra->Msg3_subframe:%d + 4 sfn_sf:%d\n", CC_idP, ackNAK_absSF%10, ra->Msg3_frame, ra->Msg3_subframe, NFAPI_SFNSF2DEC(ul_req->sfn_sf)); LOG_D(MAC,"UL_req_tmp[CC_idP:%d][ackNAK_absSF mod 10:%d] ra->Msg3_frame:%d ra->Msg3_subframe:%d + 4 sfn_sf:%d\n", CC_idP, ackNAK_absSF%10, ra->Msg3_frame, ra->Msg3_subframe, NFAPI_SFNSF2DEC(ul_req->sfn_sf));
// Note need to keep sending this across reptitions!!!! Not really for PUCCH, to ask small-cell forum, we'll see for the other messages, maybe parameters change across repetitions and FAPI has to provide for that // Note need to keep sending this across reptitions!!!! Not really for PUCCH, to ask small-cell forum, we'll see for the other messages, maybe parameters change across repetitions and FAPI has to provide for that
if (cc[CC_idP].tdd_Config == NULL) { // FDD case if (cc[CC_idP].tdd_Config == NULL) { // FDD case
ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG; ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG;
ul_config_pdu->uci_harq_pdu. ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.n_pucch_1_0 = n1pucchan[ra->rach_resource_type - 1];
harq_information.harq_information_rel8_fdd.
n_pucch_1_0 =
n1pucchan[ra->rach_resource_type - 1];
// NOTE: How to fill in the rest of the n_pucch_1_0 information 213 Section 10.1.2.1 in the general case // NOTE: How to fill in the rest of the n_pucch_1_0 information 213 Section 10.1.2.1 in the general case
// = N_ECCE_q + Delta_ARO + n1pucchan[ce_level] // = N_ECCE_q + Delta_ARO + n1pucchan[ce_level]
// higher in the MPDCCH configuration, N_ECCE_q is hard-coded to 0, and harq resource offset to 0 => // higher in the MPDCCH configuration, N_ECCE_q is hard-coded to 0, and harq resource offset to 0 =>
...@@ -1182,15 +965,12 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1182,15 +965,12 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
if (opt_enabled == 1) { if (opt_enabled == 1) {
trace_pdu(1, trace_pdu(1,
(uint8_t *) mac-> (uint8_t *) mac->
UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], rrc_sdu_length, UE_id, 3,
UE_id].payload
[0], rrc_sdu_length, UE_id, 3,
UE_RNTI(module_idP, UE_id), mac->frame, UE_RNTI(module_idP, UE_id), mac->frame,
mac->subframe, 0, 0); mac->subframe, 0, 0);
LOG_D(OPT, LOG_D(OPT,
"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", "[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n",
module_idP, CC_idP, frameP, UE_RNTI(module_idP, module_idP, CC_idP, frameP, UE_RNTI(module_idP,UE_id),
UE_id),
rrc_sdu_length); rrc_sdu_length);
} }
} // Msg4 frame/subframe } // Msg4 frame/subframe
...@@ -1253,19 +1033,15 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1253,19 +1033,15 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process,
&dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. &dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding,
resource_block_coding, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding);
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.
resource_block_coding);
AssertFatal(dl_config_pdu->dci_dl_pdu. AssertFatal(dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.resource_block_coding < 8192, dci_dl_pdu_rel8.resource_block_coding < 8192,
"resource_block_coding %u < 8192\n", "resource_block_coding %u < 8192\n",
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.resource_block_coding); dci_dl_pdu_rel8.resource_block_coding);
if (!CCE_allocation_infeasible if (!CCE_allocation_infeasible(module_idP, CC_idP, 1, subframeP,
(module_idP, CC_idP, 1, subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, ra->rnti)) {
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.
aggregation_level, ra->rnti)) {
dl_req_body->number_dci++; dl_req_body->number_dci++;
dl_req_body->number_pdu++; dl_req_body->number_pdu++;
...@@ -1288,21 +1064,17 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1288,21 +1064,17 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
lcid = 0; lcid = 0;
// put HARQ process round to 0 // put HARQ process round to 0
if (cc->tdd_Config) if (cc->tdd_Config) ra->harq_pid = ((frameP * 10) + subframeP) % 10;
ra->harq_pid = ((frameP * 10) + subframeP) % 10;
else else
ra->harq_pid = ((frameP * 10) + subframeP) & 7; ra->harq_pid = ((frameP * 10) + subframeP) & 7;
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0;
0;
if ((ra->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { if ((ra->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) {
msg4_padding = msg4_padding = ra->msg4_TBsize - rrc_sdu_length - msg4_header;
ra->msg4_TBsize - rrc_sdu_length - msg4_header;
msg4_post_padding = 0; msg4_post_padding = 0;
} else { } else {
msg4_padding = 0; msg4_padding = 0;
msg4_post_padding = msg4_post_padding = ra->msg4_TBsize - rrc_sdu_length - msg4_header - 1;
ra->msg4_TBsize - rrc_sdu_length - msg4_header - 1;
} }
LOG_D(MAC, LOG_D(MAC,
...@@ -1321,11 +1093,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1321,11 +1093,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
msg4_padding, // no padding msg4_padding, // no padding
msg4_post_padding); msg4_post_padding);
memcpy((void *) &mac->UE_list. memcpy((void *) &mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
DLSCH_pdu[CC_idP][0][(unsigned char)
UE_id].payload[0][(unsigned
char)
offset],
&cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length); &cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length);
// DLSCH Config // DLSCH Config
...@@ -1359,9 +1127,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1359,9 +1127,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
rrc_sdu_length, rrc_sdu_length,
mac->pdu_index[CC_idP], mac->pdu_index[CC_idP],
mac->UE_list. mac->UE_list.
DLSCH_pdu[CC_idP][0][(unsigned char) DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]);
UE_id].payload
[0]);
mac->pdu_index[CC_idP]++; mac->pdu_index[CC_idP]++;
dl_req->sfn_sf = mac->TX_req[CC_idP].sfn_sf; dl_req->sfn_sf = mac->TX_req[CC_idP].sfn_sf;
...@@ -1374,8 +1140,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1374,8 +1140,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
CC_idP, CC_idP,
ra->rnti, ra->rnti,
(frameP * 10) + subframeP, (frameP * 10) + subframeP,
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
dci_dl_pdu_rel8.cce_idx);
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP),
...@@ -1387,9 +1152,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -1387,9 +1152,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
if (opt_enabled == 1) { if (opt_enabled == 1) {
trace_pdu(1, trace_pdu(1,
(uint8_t *) mac-> (uint8_t *) mac->
UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], rrc_sdu_length, UE_id, 3,
UE_id].payload
[0], rrc_sdu_length, UE_id, 3,
UE_RNTI(module_idP, UE_id), mac->frame, UE_RNTI(module_idP, UE_id), mac->frame,
mac->subframe, 0, 0); mac->subframe, 0, 0);
LOG_D(OPT, LOG_D(OPT,
...@@ -1578,8 +1341,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP, ...@@ -1578,8 +1341,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:IDLE\n", module_idP, frameP, subframeP); LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:IDLE\n", module_idP, frameP, subframeP);
UE_id = find_UE_id(module_idP, ra->rnti); UE_id = find_UE_id(module_idP, ra->rnti);
DevAssert(UE_id != -1); DevAssert(UE_id != -1);
mac->UE_list.UE_template[UE_PCCID(module_idP, UE_id)][UE_id]. mac->UE_list.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].configured = TRUE;
configured = TRUE;
} }
} }
...@@ -1647,11 +1409,8 @@ initiate_ra_proc(module_id_t module_idP, ...@@ -1647,11 +1409,8 @@ initiate_ra_proc(module_id_t module_idP,
if (cc->radioResourceConfigCommon_BR if (cc->radioResourceConfigCommon_BR
&& cc->radioResourceConfigCommon_BR->ext4) { && cc->radioResourceConfigCommon_BR->ext4) {
ext4_prach = ext4_prach = cc->radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
cc->radioResourceConfigCommon_BR->ext4-> prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13;
prach_ConfigCommon_v1310;
prach_ParametersListCE_r13 =
&ext4_prach->prach_ParametersListCE_r13;
} }
LOG_D(MAC, LOG_D(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n", "[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",
...@@ -1675,10 +1434,8 @@ initiate_ra_proc(module_id_t module_idP, ...@@ -1675,10 +1434,8 @@ initiate_ra_proc(module_id_t module_idP,
return; return;
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 1);
(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 0);
for (i = 0; i < NB_RA_PROC_MAX; i++) { for (i = 0; i < NB_RA_PROC_MAX; i++) {
if (ra[i].state == IDLE) { if (ra[i].state == IDLE) {
......
...@@ -235,35 +235,28 @@ schedule_SIB1_BR(module_id_t module_idP, ...@@ -235,35 +235,28 @@ schedule_SIB1_BR(module_id_t module_idP,
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = TBS; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = TBS;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
eNB->pdu_index[CC_id];
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 6);
getRIV(N_RB_DL, first_rb, 6);
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = rvidx; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = rvidx;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme =
(cc->p_eNB == 1) ? 0 : 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB == 1) ? 1 : 2;
(cc->p_eNB == 1) ? 1 : 2;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// Rel10 fields // Rel10 fields
...@@ -280,10 +273,7 @@ schedule_SIB1_BR(module_id_t module_idP, ...@@ -280,10 +273,7 @@ schedule_SIB1_BR(module_id_t module_idP,
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
// Program TX Request // Program TX Request
TX_req = TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
&eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->
TX_req
[CC_id].tx_request_body.number_of_pdus];
TX_req->pdu_length = bcch_sdu_length; TX_req->pdu_length = bcch_sdu_length;
TX_req->pdu_index = eNB->pdu_index[CC_id]++; TX_req->pdu_index = eNB->pdu_index[CC_id]++;
TX_req->num_segments = 1; TX_req->num_segments = 1;
...@@ -315,11 +305,8 @@ schedule_SIB1_BR(module_id_t module_idP, ...@@ -315,11 +305,8 @@ schedule_SIB1_BR(module_id_t module_idP,
} }
} }
int si_WindowLength_BR_r13tab int si_WindowLength_BR_r13tab[SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_spare] = { 20, 40, 60, 80, 120, 160, 200 };
[SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_spare] int si_TBS_r13tab[SchedulingInfo_BR_r13__si_TBS_r13_b936 + 1] = { 152, 208, 256, 328, 408, 504, 600, 712, 808, 936 };
= { 20, 40, 60, 80, 120, 160, 200 };
int si_TBS_r13tab[SchedulingInfo_BR_r13__si_TBS_r13_b936 + 1] =
{ 152, 208, 256, 328, 408, 504, 600, 712, 808, 936 };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
...@@ -354,65 +341,40 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP, ...@@ -354,65 +341,40 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
if (cc->mib->message.schedulingInfoSIB1_BR_r13 == 0) if (cc->mib->message.schedulingInfoSIB1_BR_r13 == 0)
continue; continue;
else { else {
AssertFatal(cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 != NULL,
AssertFatal(cc->
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13
!= NULL,
"sib_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); "sib_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
SchedulingInfoList_BR_r13_t *schedulingInfoList_BR_r13 = SchedulingInfoList_BR_r13_t *schedulingInfoList_BR_r13 = cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->schedulingInfoList_BR_r13;
cc->sib1_v13ext->
bandwidthReducedAccessRelatedInfo_r13->schedulingInfoList_BR_r13;
AssertFatal(schedulingInfoList_BR_r13 != NULL, AssertFatal(schedulingInfoList_BR_r13 != NULL,
"sib_v13ext->schedulingInfoList_BR_r13 is null\n"); "sib_v13ext->schedulingInfoList_BR_r13 is null\n");
SchedulingInfoList_t *schedulingInfoList = SchedulingInfoList_t *schedulingInfoList = cc->schedulingInfoList;
cc->schedulingInfoList; AssertFatal(schedulingInfoList_BR_r13->list.count == schedulingInfoList->list.count,
AssertFatal(schedulingInfoList_BR_r13->list.count ==
schedulingInfoList->list.count,
"schedulingInfolist_BR.r13->list.count %d != schedulingInfoList.list.count %d\n", "schedulingInfolist_BR.r13->list.count %d != schedulingInfoList.list.count %d\n",
schedulingInfoList_BR_r13->list.count, schedulingInfoList_BR_r13->list.count,
schedulingInfoList->list.count); schedulingInfoList->list.count);
AssertFatal(cc-> AssertFatal(cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13<=SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_ms200,
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13
<=
SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_ms200,
"si_WindowLength_BR_r13 %d > %d\n", "si_WindowLength_BR_r13 %d > %d\n",
(int) cc-> (int) cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13,
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13,
SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_ms200); SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_ms200);
// check that SI frequency-hopping is disabled // check that SI frequency-hopping is disabled
AssertFatal(cc-> AssertFatal(cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_HoppingConfigCommon_r13 == SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_HoppingConfigCommon_r13_off,
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_HoppingConfigCommon_r13
==
SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_HoppingConfigCommon_r13_off,
"Deactivate SI_HoppingConfigCommon_r13 in configuration file, not supported for now\n"); "Deactivate SI_HoppingConfigCommon_r13 in configuration file, not supported for now\n");
long si_WindowLength_BR_r13 = long si_WindowLength_BR_r13 = si_WindowLength_BR_r13tab[cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13];
si_WindowLength_BR_r13tab[cc->
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13]; long si_RepetitionPattern_r13 = cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_RepetitionPattern_r13;
AssertFatal(si_RepetitionPattern_r13<=SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_RepetitionPattern_r13_every8thRF,
long si_RepetitionPattern_r13 =
cc->sib1_v13ext->
bandwidthReducedAccessRelatedInfo_r13->si_RepetitionPattern_r13;
AssertFatal(si_RepetitionPattern_r13 <=
SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_RepetitionPattern_r13_every8thRF,
"si_RepetitionPattern_r13 %d > %d\n", "si_RepetitionPattern_r13 %d > %d\n",
(int) si_RepetitionPattern_r13, (int) si_RepetitionPattern_r13,
SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_RepetitionPattern_r13_every8thRF); SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_RepetitionPattern_r13_every8thRF);
// cycle through SIB list // cycle through SIB list
for (i = 0; i < schedulingInfoList_BR_r13->list.count; i++) { for (i = 0; i < schedulingInfoList_BR_r13->list.count; i++) {
long si_Periodicity = long si_Periodicity = schedulingInfoList->list.array[i]->si_Periodicity;
schedulingInfoList->list.array[i]->si_Periodicity; long si_Narrowband_r13 = schedulingInfoList_BR_r13->list.array[i]->si_Narrowband_r13;
long si_Narrowband_r13 = long si_TBS_r13 = si_TBS_r13tab[schedulingInfoList_BR_r13->list.array[i]->si_TBS_r13];
schedulingInfoList_BR_r13->list.array[i]->
si_Narrowband_r13;
long si_TBS_r13 =
si_TBS_r13tab[schedulingInfoList_BR_r13->
list.array[i]->si_TBS_r13];
// check if the SI is to be scheduled now // check if the SI is to be scheduled now
int period_in_sf = 80 << si_Periodicity; // 2^i * 80 subframes, note: si_Periodicity is 2^i * 80ms int period_in_sf = 80 << si_Periodicity; // 2^i * 80 subframes, note: si_Periodicity is 2^i * 80ms
...@@ -434,18 +396,14 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP, ...@@ -434,18 +396,14 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
"RRC provided bcch with length %d > %d (si_TBS_r13 %d)\n", "RRC provided bcch with length %d > %d (si_TBS_r13 %d)\n",
bcch_sdu_length, bcch_sdu_length,
(int) (si_TBS_r13 >> 3), (int) (si_TBS_r13 >> 3),
(int) schedulingInfoList_BR_r13-> (int) schedulingInfoList_BR_r13->list.array[i]->si_TBS_r13);
list.array[i]->si_TBS_r13);
// allocate all 6 PRBs in narrowband for SIB1_BR // allocate all 6 PRBs in narrowband for SIB1_BR
// check that SIB1 didn't take this narrowband // check that SIB1 didn't take this narrowband
if (vrb_map[first_rb] > 0) if (vrb_map[first_rb] > 0) continue;
continue;
first_rb = first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13 - 1);
narrowband_to_first_rb(cc,
si_Narrowband_r13 - 1);
vrb_map[first_rb] = 1; vrb_map[first_rb] = 1;
vrb_map[first_rb + 1] = 1; vrb_map[first_rb + 1] = 1;
vrb_map[first_rb + 2] = 1; vrb_map[first_rb + 2] = 1;
...@@ -465,89 +423,54 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP, ...@@ -465,89 +423,54 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
dl_config_pdu = dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
&dl_req->dl_config_pdu_list[dl_req-> memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t));
number_pdu]; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
memset((void *) dl_config_pdu, 0, dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type =
NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
dl_config_pdu->pdu_size =
(uint8_t) (2 +
sizeof(nfapi_dl_config_dlsch_pdu));
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = si_TBS_r13 >> 3;
si_TBS_r13 >> 3; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF;
eNB->pdu_index[CC_id];
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti =
0xFFFF;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 6);
dlsch_pdu_rel8.resource_block_coding =
getRIV(N_RB_DL, first_rb, 6);
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = rvidx;
dlsch_pdu_rel8.redundancy_version = rvidx;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
dlsch_pdu_rel8.transport_block_to_codeword_swap_flag dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
= 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
dlsch_pdu_rel8.transmission_scheme =
(cc->p_eNB == 1) ? 0 : 1;
dl_config_pdu->dlsch_pdu.
dlsch_pdu_rel8.number_of_layers = 1;
dl_config_pdu->dlsch_pdu.
dlsch_pdu_rel8.number_of_subbands = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
dlsch_pdu_rel8.ue_category_capacity = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
dlsch_pdu_rel8.delta_power_offset_index = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB == 1) ? 1 : 2;
dlsch_pdu_rel8.transmission_mode = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
(cc->p_eNB == 1) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
dl_config_pdu->dlsch_pdu.
dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
num_bf_vector = 1;
// Rel10 fields (for PDSCH starting symbol) // Rel10 fields (for PDSCH starting symbol)
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
pdsch_start =
cc[CC_id].
sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
// Rel13 fields // Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 1; // SI-BR dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 1; // SI-BR
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = absSF - sf_mod_period;
dlsch_pdu_rel13.initial_transmission_sf_io =
absSF - sf_mod_period;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
dl_req->number_pdu++; dl_req->number_pdu++;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
// Program TX Request // Program TX Request
TX_req = TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
&eNB->TX_req[CC_id].
tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].
tx_request_body.number_of_pdus];
TX_req->pdu_length = bcch_sdu_length; TX_req->pdu_length = bcch_sdu_length;
TX_req->pdu_index = eNB->pdu_index[CC_id]++; TX_req->pdu_index = eNB->pdu_index[CC_id]++;
TX_req->num_segments = 1; TX_req->num_segments = 1;
TX_req->segments[0].segment_length = TX_req->segments[0].segment_length = bcch_sdu_length;
bcch_sdu_length; TX_req->segments[0].segment_data = cc->BCCH_BR_pdu[i + 1].payload;
TX_req->segments[0].segment_data = eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
cc->BCCH_BR_pdu[i + 1].payload;
eNB->TX_req[CC_id].tx_request_body.
number_of_pdus++;
eNB->TX_req[CC_id].sfn_sf = sfn_sf; eNB->TX_req[CC_id].sfn_sf = sfn_sf;
eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG; eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST; eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
...@@ -620,17 +543,14 @@ schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -620,17 +543,14 @@ schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
module_idP, frameP, CC_id, mib_sdu_length, module_idP, frameP, CC_id, mib_sdu_length,
(int) cc->mib->message.schedulingInfoSIB1_BR_r13); (int) cc->mib->message.schedulingInfoSIB1_BR_r13);
dl_config_pdu = dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
&dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_BCH_PDU_TYPE, dl_config_pdu->pdu_size =
NFAPI_DL_CONFIG_BCH_PDU_TYPE, dl_config_pdu->pdu_size =
2 + sizeof(nfapi_dl_config_bch_pdu); 2 + sizeof(nfapi_dl_config_bch_pdu);
dl_config_pdu->bch_pdu.bch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG; dl_config_pdu->bch_pdu.bch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG;
dl_config_pdu->bch_pdu.bch_pdu_rel8.length = mib_sdu_length; dl_config_pdu->bch_pdu.bch_pdu_rel8.length = mib_sdu_length;
dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index = dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
eNB->pdu_index[CC_id];
dl_config_pdu->bch_pdu.bch_pdu_rel8.transmission_power = 6000; dl_config_pdu->bch_pdu.bch_pdu_rel8.transmission_power = 6000;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
dl_req->number_pdu++; dl_req->number_pdu++;
...@@ -641,9 +561,7 @@ schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -641,9 +561,7 @@ schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
LOG_D(MAC, "eNB->DL_req[0].number_pdu %d (%p)\n", dl_req->number_pdu, &dl_req->number_pdu); LOG_D(MAC, "eNB->DL_req[0].number_pdu %d (%p)\n", dl_req->number_pdu, &dl_req->number_pdu);
// DL request // DL request
TX_req = TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
&eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req
[CC_id].tx_request_body.number_of_pdus];
TX_req->pdu_length = 3; TX_req->pdu_length = 3;
TX_req->pdu_index = eNB->pdu_index[CC_id]++; TX_req->pdu_index = eNB->pdu_index[CC_id]++;
TX_req->num_segments = 1; TX_req->num_segments = 1;
...@@ -753,88 +671,59 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -753,88 +671,59 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
} }
dl_config_pdu = dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
&dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
NFAPI_DL_DCI_FORMAT_1A; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.
aggregation_level = 4;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = 0xFFFF; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = 0xFFFF;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // S-RNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // S-RNTI : see Table 4-10 from SCF082 - nFAPI specifications
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 0;
new_data_indicator_1 = 0;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0;
redundancy_version_1 = 0;
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
dci_dl_pdu_rel8.resource_block_coding =
getRIV(N_RB_DL, first_rb, 4);
dl_config_request->sfn_sf = sfn_sf; dl_config_request->sfn_sf = sfn_sf;
if (!CCE_allocation_infeasible if (!CCE_allocation_infeasible(module_idP, CC_id, 0, subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, SI_RNTI)) {
(module_idP, CC_id, 0, subframeP,
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.aggregation_level, SI_RNTI)) {
LOG_D(MAC, "Frame %d: Subframe %d : Adding common DCI for S_RNTI\n", frameP, subframeP); LOG_D(MAC, "Frame %d: Subframe %d : Adding common DCI for S_RNTI\n", frameP, subframeP);
dl_req->number_dci++; dl_req->number_dci++;
dl_req->number_pdu++; dl_req->number_pdu++;
dl_config_pdu = dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
&dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
dl_config_pdu->pdu_size = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
(uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index =
eNB->pdu_index[CC_id];
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = bcch_sdu_length; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = bcch_sdu_length;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
dlsch_pdu_rel8.resource_block_coding =
getRIV(N_RB_DL, first_rb, 4);
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
redundancy_version = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
dlsch_pdu_rel8.transport_block_to_codeword_swap_flag dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB == 1) ? 0 : 1;
= 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
dlsch_pdu_rel8.transmission_scheme =
(cc->p_eNB == 1) ? 0 : 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
number_of_layers = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
number_of_subbands = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
dlsch_pdu_rel8.ue_category_capacity = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
dlsch_pdu_rel8.delta_power_offset_index = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB == 1) ? 1 : 2;
transmission_mode = (cc->p_eNB == 1) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector =
1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
dl_req->number_pdu++; dl_req->number_pdu++;
...@@ -851,16 +740,12 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -851,16 +740,12 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
dl_config_request->sfn_sf = sfn_sf; dl_config_request->sfn_sf = sfn_sf;
// Program TX Request // Program TX Request
TX_req = TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
&eNB->TX_req[CC_id].
tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].
tx_request_body.number_of_pdus];
TX_req->pdu_length = bcch_sdu_length; TX_req->pdu_length = bcch_sdu_length;
TX_req->pdu_index = eNB->pdu_index[CC_id]++; TX_req->pdu_index = eNB->pdu_index[CC_id]++;
TX_req->num_segments = 1; TX_req->num_segments = 1;
TX_req->segments[0].segment_length = bcch_sdu_length; TX_req->segments[0].segment_length = bcch_sdu_length;
TX_req->segments[0].segment_data = TX_req->segments[0].segment_data = cc->BCCH_pdu.payload;
cc->BCCH_pdu.payload;
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
eNB->TX_req[CC_id].sfn_sf = sfn_sf; eNB->TX_req[CC_id].sfn_sf = sfn_sf;
eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG; eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
......
...@@ -104,10 +104,8 @@ schedule_next_dlue(module_id_t module_idP, int CC_id, ...@@ -104,10 +104,8 @@ schedule_next_dlue(module_id_t module_idP, int CC_id,
for (next_ue = UE_list->head; next_ue >= 0; for (next_ue = UE_list->head; next_ue >= 0;
next_ue = UE_list->next[next_ue]) { next_ue = UE_list->next[next_ue]) {
if (eNB_dlsch_info[module_idP][CC_id][next_ue].status == if (eNB_dlsch_info[module_idP][CC_id][next_ue].status == S_DL_BUFFERED) {
S_DL_BUFFERED) { eNB_dlsch_info[module_idP][CC_id][next_ue].status = S_DL_WAITING;
eNB_dlsch_info[module_idP][CC_id][next_ue].status =
S_DL_WAITING;
} }
} }
...@@ -129,8 +127,7 @@ generate_dlsch_header(unsigned char *mac_header, ...@@ -129,8 +127,7 @@ generate_dlsch_header(unsigned char *mac_header,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
SCH_SUBHEADER_FIXED *mac_header_ptr = SCH_SUBHEADER_FIXED *mac_header_ptr = (SCH_SUBHEADER_FIXED *) mac_header;
(SCH_SUBHEADER_FIXED *) mac_header;
uint8_t first_element = 0, last_size = 0, i; uint8_t first_element = 0, last_size = 0, i;
uint8_t mac_header_control_elements[16], *ce_ptr; uint8_t mac_header_control_elements[16], *ce_ptr;
...@@ -244,18 +241,15 @@ generate_dlsch_header(unsigned char *mac_header, ...@@ -244,18 +241,15 @@ generate_dlsch_header(unsigned char *mac_header,
((SCH_SUBHEADER_SHORT *) mac_header_ptr)->E = 0; ((SCH_SUBHEADER_SHORT *) mac_header_ptr)->E = 0;
((SCH_SUBHEADER_SHORT *) mac_header_ptr)->F = 0; ((SCH_SUBHEADER_SHORT *) mac_header_ptr)->F = 0;
((SCH_SUBHEADER_SHORT *) mac_header_ptr)->LCID = sdu_lcids[i]; ((SCH_SUBHEADER_SHORT *) mac_header_ptr)->LCID = sdu_lcids[i];
((SCH_SUBHEADER_SHORT *) mac_header_ptr)->L = ((SCH_SUBHEADER_SHORT *) mac_header_ptr)->L = (unsigned char) sdu_lengths[i];
(unsigned char) sdu_lengths[i];
last_size = 2; last_size = 2;
} else { } else {
((SCH_SUBHEADER_LONG *) mac_header_ptr)->R = 0; ((SCH_SUBHEADER_LONG *) mac_header_ptr)->R = 0;
((SCH_SUBHEADER_LONG *) mac_header_ptr)->E = 0; ((SCH_SUBHEADER_LONG *) mac_header_ptr)->E = 0;
((SCH_SUBHEADER_LONG *) mac_header_ptr)->F = 1; ((SCH_SUBHEADER_LONG *) mac_header_ptr)->F = 1;
((SCH_SUBHEADER_LONG *) mac_header_ptr)->LCID = sdu_lcids[i]; ((SCH_SUBHEADER_LONG *) mac_header_ptr)->LCID = sdu_lcids[i];
((SCH_SUBHEADER_LONG *) mac_header_ptr)->L_MSB = ((SCH_SUBHEADER_LONG *) mac_header_ptr)->L_MSB = ((unsigned short) sdu_lengths[i] >> 8) & 0x7f;
((unsigned short) sdu_lengths[i] >> 8) & 0x7f; ((SCH_SUBHEADER_LONG *) mac_header_ptr)->L_LSB = (unsigned short) sdu_lengths[i] & 0xff;
((SCH_SUBHEADER_LONG *) mac_header_ptr)->L_LSB =
(unsigned short) sdu_lengths[i] & 0xff;
((SCH_SUBHEADER_LONG *) mac_header_ptr)->padding = 0x00; ((SCH_SUBHEADER_LONG *) mac_header_ptr)->padding = 0x00;
last_size = 3; last_size = 3;
#ifdef DEBUG_HEADER_PARSING #ifdef DEBUG_HEADER_PARSING
...@@ -527,18 +521,15 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -527,18 +521,15 @@ schedule_ue_spec(module_id_t module_idP,
// store the global enb stats: // store the global enb stats:
eNB->eNB_stats[CC_id].num_dlactive_UEs = UE_list->num_UEs; eNB->eNB_stats[CC_id].num_dlactive_UEs = UE_list->num_UEs;
eNB->eNB_stats[CC_id].available_prbs = eNB->eNB_stats[CC_id].available_prbs = total_nb_available_rb[CC_id];
total_nb_available_rb[CC_id]; eNB->eNB_stats[CC_id].total_available_prbs += total_nb_available_rb[CC_id];
eNB->eNB_stats[CC_id].total_available_prbs +=
total_nb_available_rb[CC_id];
eNB->eNB_stats[CC_id].dlsch_bytes_tx = 0; eNB->eNB_stats[CC_id].dlsch_bytes_tx = 0;
eNB->eNB_stats[CC_id].dlsch_pdus_tx = 0; eNB->eNB_stats[CC_id].dlsch_pdus_tx = 0;
} }
/// CALLING Pre_Processor for downlink scheduling (Returns estimation of RBs required by each UE and the allocation on sub-band) /// CALLING Pre_Processor for downlink scheduling (Returns estimation of RBs required by each UE and the allocation on sub-band)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR, VCD_FUNCTION_IN);
(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR, VCD_FUNCTION_IN);
start_meas(&eNB->schedule_dlsch_preprocessor); start_meas(&eNB->schedule_dlsch_preprocessor);
dlsch_scheduler_pre_processor(module_idP, dlsch_scheduler_pre_processor(module_idP,
frameP, subframeP, N_RBG, mbsfn_flag); frameP, subframeP, N_RBG, mbsfn_flag);
...@@ -631,23 +622,18 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -631,23 +622,18 @@ schedule_ue_spec(module_id_t module_idP,
nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id];
if (cc->tdd_Config) if (cc->tdd_Config) harq_pid = ((frameP * 10) + subframeP) % 10;
harq_pid = ((frameP * 10) + subframeP) % 10; else harq_pid = ((frameP * 10) + subframeP) & 7;
else
harq_pid = ((frameP * 10) + subframeP) & 7;
round = ue_sched_ctl->round[CC_id][harq_pid]; round = ue_sched_ctl->round[CC_id][harq_pid];
UE_list->eNB_UE_stats[CC_id][UE_id].crnti = rnti; UE_list->eNB_UE_stats[CC_id][UE_id].crnti = rnti;
UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status = UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status = mac_eNB_get_rrc_status(module_idP, rnti);
mac_eNB_get_rrc_status(module_idP, rnti);
UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid; UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid;
UE_list->eNB_UE_stats[CC_id][UE_id].harq_round = round; UE_list->eNB_UE_stats[CC_id][UE_id].harq_round = round;
if (UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status < if (UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status < RRC_CONNECTED) continue;
RRC_CONNECTED)
continue;
sdu_length_total = 0; sdu_length_total = 0;
num_sdus = 0; num_sdus = 0;
...@@ -670,9 +656,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -670,9 +656,7 @@ schedule_ue_spec(module_id_t module_idP,
// initializing the rb allocation indicator for each UE // initializing the rb allocation indicator for each UE
for (j = 0; j < N_RBG[CC_id]; j++) { for (j = 0; j < N_RBG[CC_id]; j++) {
UE_list-> UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = 0;
UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j]
= 0;
} }
LOG_D(MAC, LOG_D(MAC,
...@@ -690,9 +674,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -690,9 +674,7 @@ schedule_ue_spec(module_id_t module_idP,
// get freq_allocation // get freq_allocation
nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
TBS = TBS = get_TBS_DL(UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid],
get_TBS_DL(UE_list->
UE_template[CC_id][UE_id].oldmcs1[harq_pid],
nb_rb); nb_rb);
if (nb_rb <= nb_available_rb) { if (nb_rb <= nb_available_rb) {
...@@ -709,36 +691,24 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -709,36 +691,24 @@ schedule_ue_spec(module_id_t module_idP,
if (nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) { if (nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) {
for (j = 0; j < N_RBG[CC_id]; j++) { // for indicating the rballoc for each sub-band for (j = 0; j < N_RBG[CC_id]; j++) { // for indicating the rballoc for each sub-band
UE_list->UE_template[CC_id][UE_id]. UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j];
rballoc_subband[harq_pid][j] =
ue_sched_ctl->rballoc_sub_UE[CC_id][j];
} }
} else { } else {
nb_rb_temp = nb_rb; nb_rb_temp = nb_rb;
j = 0; j = 0;
while ((nb_rb_temp > 0) && (j < N_RBG[CC_id])) { while ((nb_rb_temp > 0) && (j < N_RBG[CC_id])) {
if (ue_sched_ctl->rballoc_sub_UE[CC_id][j] == if (ue_sched_ctl->rballoc_sub_UE[CC_id][j] == 1) {
1) { if (UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j])
if (UE_list-> printf("WARN: rballoc_subband not free for retrans?\n");
UE_template[CC_id] UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j];
[UE_id].rballoc_subband[harq_pid][j])
printf
("WARN: rballoc_subband not free for retrans?\n");
UE_list->
UE_template[CC_id]
[UE_id].rballoc_subband[harq_pid][j] =
ue_sched_ctl->rballoc_sub_UE[CC_id][j];
if ((j == N_RBG[CC_id] - 1) && if ((j == N_RBG[CC_id] - 1) &&
((N_RB_DL[CC_id] == 25) || ((N_RB_DL[CC_id] == 25) ||
(N_RB_DL[CC_id] == 50))) { (N_RB_DL[CC_id] == 50))) {
nb_rb_temp = nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id] + 1;
nb_rb_temp - min_rb_unit[CC_id] +
1;
} else { } else {
nb_rb_temp = nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id];
nb_rb_temp - min_rb_unit[CC_id];
} }
} }
...@@ -763,70 +733,42 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -763,70 +733,42 @@ schedule_ue_spec(module_id_t module_idP,
default: default:
LOG_D(MAC,"retransmission DL_REQ: rnti:%x\n",rnti); LOG_D(MAC,"retransmission DL_REQ: rnti:%x\n",rnti);
dl_config_pdu = dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
&dl_req->dl_config_pdu_list[dl_req->
number_pdu];
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
dl_config_pdu->pdu_size =
(uint8_t) (2 +
sizeof(nfapi_dl_config_dci_dl_pdu));
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1;
dci_format = NFAPI_DL_DCI_FORMAT_1; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP, CC_id),
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.aggregation_level =
get_aggregation(get_bw_index
(module_idP, CC_id),
ue_sched_ctl->dl_cqi[CC_id], ue_sched_ctl->dl_cqi[CC_id],
format1); format1);
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
rnti;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = harq_pid;
harq_process = harq_pid;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // dont adjust power when retransmitting dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // dont adjust power when retransmitting
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
dci_dl_pdu_rel8.new_data_indicator_1 = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid];
UE_list->UE_template[CC_id][UE_id]. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = round & 3;
oldNDI[harq_pid];
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 =
UE_list->UE_template[CC_id][UE_id].
oldmcs1[harq_pid];
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.redundancy_version_1 =
round & 3;
if (cc[CC_id].tdd_Config != NULL) { //TDD if (cc[CC_id].tdd_Config != NULL) { //TDD
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.downlink_assignment_index = (UE_list->UE_template[CC_id][UE_id].DAI - 1) & 3;
dci_dl_pdu_rel8.downlink_assignment_index =
(UE_list->UE_template[CC_id][UE_id].DAI -
1) & 3;
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, dai %d, mcs %d\n", "[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, dai %d, mcs %d\n",
module_idP, CC_id, harq_pid, round, module_idP, CC_id, harq_pid, round,
(UE_list->UE_template[CC_id][UE_id].DAI - (UE_list->UE_template[CC_id][UE_id].DAI - 1),
1), UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid]);
UE_list->
UE_template[CC_id][UE_id].oldmcs1
[harq_pid]);
} else { } else {
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, mcs %d\n", "[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, mcs %d\n",
module_idP, CC_id, harq_pid, round, module_idP, CC_id, harq_pid, round,
UE_list-> UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid]);
UE_template[CC_id][UE_id].oldmcs1
[harq_pid]);
} }
if (!CCE_allocation_infeasible if (!CCE_allocation_infeasible(module_idP, CC_id, 1, subframeP,
(module_idP, CC_id, 1, subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, rnti)) {
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.aggregation_level, rnti)) {
dl_req->number_dci++; dl_req->number_dci++;
dl_req->number_pdu++; dl_req->number_pdu++;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
...@@ -878,16 +820,11 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -878,16 +820,11 @@ schedule_ue_spec(module_id_t module_idP,
S_DL_SCHEDULED); S_DL_SCHEDULED);
//eNB_UE_stats->dlsch_trials[round]++; //eNB_UE_stats->dlsch_trials[round]++;
UE_list->eNB_UE_stats[CC_id][UE_id]. UE_list->eNB_UE_stats[CC_id][UE_id].num_retransmission += 1;
num_retransmission += 1; UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx = nb_rb;
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx = UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_retx += nb_rb;
nb_rb; UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1 = eNB_UE_stats->dlsch_mcs1;
UE_list->eNB_UE_stats[CC_id][UE_id]. UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2 = eNB_UE_stats->dlsch_mcs1;
total_rbs_used_retx += nb_rb;
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1 =
eNB_UE_stats->dlsch_mcs1;
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2 =
eNB_UE_stats->dlsch_mcs1;
} else { } else {
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n", "[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n",
...@@ -906,8 +843,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -906,8 +843,7 @@ schedule_ue_spec(module_id_t module_idP,
if (ue_sched_ctl->ta_timer == 0) { if (ue_sched_ctl->ta_timer == 0) {
ta_update = ue_sched_ctl->ta_update; ta_update = ue_sched_ctl->ta_update;
/* if we send TA then set timer to not send it for a while */ /* if we send TA then set timer to not send it for a while */
if (ta_update != 31) if (ta_update != 31) ue_sched_ctl->ta_timer = 20;
ue_sched_ctl->ta_timer = 20;
/* reset ta_update */ /* reset ta_update */
ue_sched_ctl->ta_update = 31; ue_sched_ctl->ta_update = 31;
} else { } else {
...@@ -943,11 +879,8 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -943,11 +879,8 @@ schedule_ue_spec(module_id_t module_idP,
module_idP, CC_id, sdu_lengths[0]); module_idP, CC_id, sdu_lengths[0]);
sdu_length_total = sdu_lengths[0]; sdu_length_total = sdu_lengths[0];
sdu_lcids[0] = DCCH; sdu_lcids[0] = DCCH;
UE_list->eNB_UE_stats[CC_id][UE_id]. UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[DCCH] += 1;
num_pdu_tx[DCCH] += 1; UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH] += sdu_lengths[0];
UE_list->
eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH]
+= sdu_lengths[0];
num_sdus = 1; num_sdus = 1;
#ifdef DEBUG_eNB_SCHEDULER #ifdef DEBUG_eNB_SCHEDULER
LOG_T(MAC, LOG_T(MAC,
...@@ -991,9 +924,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -991,9 +924,7 @@ schedule_ue_spec(module_id_t module_idP,
header_len_dcch += 2; header_len_dcch += 2;
UE_list->eNB_UE_stats[CC_id][UE_id]. UE_list->eNB_UE_stats[CC_id][UE_id].
num_pdu_tx[DCCH1] += 1; num_pdu_tx[DCCH1] += 1;
UE_list-> UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH1] += sdu_lengths[num_sdus];
eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH1]
+= sdu_lengths[num_sdus];
num_sdus++; num_sdus++;
#ifdef DEBUG_eNB_SCHEDULER #ifdef DEBUG_eNB_SCHEDULER
LOG_T(MAC, LOG_T(MAC,
...@@ -1132,31 +1063,22 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1132,31 +1063,22 @@ schedule_ue_spec(module_id_t module_idP,
if (nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) { if (nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) {
for (j = 0; j < N_RBG[CC_id]; j++) { // for indicating the rballoc for each sub-band for (j = 0; j < N_RBG[CC_id]; j++) { // for indicating the rballoc for each sub-band
UE_list->UE_template[CC_id][UE_id]. UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j];
rballoc_subband[harq_pid][j] =
ue_sched_ctl->rballoc_sub_UE[CC_id][j];
} }
} else { } else {
nb_rb_temp = nb_rb; nb_rb_temp = nb_rb;
j = 0; j = 0;
while ((nb_rb_temp > 0) && (j < N_RBG[CC_id])) { while ((nb_rb_temp > 0) && (j < N_RBG[CC_id])) {
if (ue_sched_ctl->rballoc_sub_UE[CC_id][j] == if (ue_sched_ctl->rballoc_sub_UE[CC_id][j] == 1) {
1) { UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j];
UE_list->
UE_template[CC_id]
[UE_id].rballoc_subband[harq_pid][j] =
ue_sched_ctl->rballoc_sub_UE[CC_id][j];
if ((j == N_RBG[CC_id] - 1) && if ((j == N_RBG[CC_id] - 1) &&
((N_RB_DL[CC_id] == 25) || ((N_RB_DL[CC_id] == 25) ||
(N_RB_DL[CC_id] == 50))) { (N_RB_DL[CC_id] == 50))) {
nb_rb_temp = nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id] + 1;
nb_rb_temp - min_rb_unit[CC_id] +
1;
} else { } else {
nb_rb_temp = nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id];
nb_rb_temp - min_rb_unit[CC_id];
} }
} }
...@@ -1165,17 +1087,13 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1165,17 +1087,13 @@ schedule_ue_spec(module_id_t module_idP,
} }
// decrease mcs until TBS falls below required length // decrease mcs until TBS falls below required length
while ((TBS > while ((TBS > (sdu_length_total + header_len_dcch + header_len_dtch + ta_len)) && (mcs > 0)) {
(sdu_length_total + header_len_dcch +
header_len_dtch + ta_len)) && (mcs > 0)) {
mcs--; mcs--;
TBS = get_TBS_DL(mcs, nb_rb); TBS = get_TBS_DL(mcs, nb_rb);
} }
// if we have decreased too much or we don't have enough RBs, increase MCS // if we have decreased too much or we don't have enough RBs, increase MCS
while ((TBS < while ((TBS < (sdu_length_total + header_len_dcch + header_len_dtch + ta_len))
(sdu_length_total + header_len_dcch +
header_len_dtch + ta_len))
&& (((ue_sched_ctl->dl_pow_off[CC_id] > 0) && (((ue_sched_ctl->dl_pow_off[CC_id] > 0)
&& (mcs < 28)) && (mcs < 28))
|| ((ue_sched_ctl->dl_pow_off[CC_id] == 0) || ((ue_sched_ctl->dl_pow_off[CC_id] == 0)
...@@ -1196,11 +1114,8 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1196,11 +1114,8 @@ schedule_ue_spec(module_id_t module_idP,
// TBS, sdu_length_total, offset, TBS-sdu_length_total-offset); // TBS, sdu_length_total, offset, TBS-sdu_length_total-offset);
#endif #endif
if ((TBS - header_len_dcch - header_len_dtch - if ((TBS - header_len_dcch - header_len_dtch - sdu_length_total - ta_len) <= 2) {
sdu_length_total - ta_len) <= 2) { padding = (TBS - header_len_dcch - header_len_dtch - sdu_length_total - ta_len);
padding =
(TBS - header_len_dcch - header_len_dtch -
sdu_length_total - ta_len);
post_padding = 0; post_padding = 0;
} else { } else {
padding = 0; padding = 0;
...@@ -1245,16 +1160,13 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1245,16 +1160,13 @@ schedule_ue_spec(module_id_t module_idP,
#endif #endif
// cycle through SDUs and place in dlsch_buffer // cycle through SDUs and place in dlsch_buffer
memcpy(&UE_list-> memcpy(&UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset],
DLSCH_pdu[CC_id][0][UE_id].payload[0][offset],
dlsch_buffer, sdu_length_total); dlsch_buffer, sdu_length_total);
// memcpy(RC.mac[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]); // memcpy(RC.mac[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]);
// fill remainder of DLSCH with random data // fill remainder of DLSCH with random data
for (j = 0; j < (TBS - sdu_length_total - offset); j++) { for (j = 0; j < (TBS - sdu_length_total - offset); j++) {
UE_list->DLSCH_pdu[CC_id][0][UE_id]. UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset + sdu_length_total + j] = (char) (taus() & 0xff);
payload[0][offset + sdu_length_total + j] =
(char) (taus() & 0xff);
} }
...@@ -1276,33 +1188,25 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1276,33 +1188,25 @@ schedule_ue_spec(module_id_t module_idP,
T_BUFFER(UE_list->DLSCH_pdu[CC_id][0][UE_id]. T_BUFFER(UE_list->DLSCH_pdu[CC_id][0][UE_id].
payload[0], TBS)); payload[0], TBS));
UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb;
nb_rb;
add_ue_dlsch_info(module_idP, add_ue_dlsch_info(module_idP,
CC_id, UE_id, subframeP, CC_id, UE_id, subframeP,
S_DL_SCHEDULED); S_DL_SCHEDULED);
// store stats // store stats
eNB->eNB_stats[CC_id].dlsch_bytes_tx += eNB->eNB_stats[CC_id].dlsch_bytes_tx += sdu_length_total;
sdu_length_total;
eNB->eNB_stats[CC_id].dlsch_pdus_tx += 1; eNB->eNB_stats[CC_id].dlsch_pdus_tx += 1;
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb; UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb;
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used += UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used += nb_rb;
nb_rb; UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1 = eNB_UE_stats->dlsch_mcs1;
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1 =
eNB_UE_stats->dlsch_mcs1;
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2 = mcs; UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2 = mcs;
UE_list->eNB_UE_stats[CC_id][UE_id].TBS = TBS; UE_list->eNB_UE_stats[CC_id][UE_id].TBS = TBS;
UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes = UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes = TBS - sdu_length_total;
TBS - sdu_length_total; UE_list->eNB_UE_stats[CC_id][UE_id].total_sdu_bytes += sdu_length_total;
UE_list->eNB_UE_stats[CC_id][UE_id].total_sdu_bytes += UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes += TBS;
sdu_length_total; UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus += 1;
UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes +=
TBS;
UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus +=
1;
if (cc[CC_id].tdd_Config != NULL) { // TDD if (cc[CC_id].tdd_Config != NULL) { // TDD
UE_list->UE_template[CC_id][UE_id].DAI++; UE_list->UE_template[CC_id][UE_id].DAI++;
...@@ -1320,29 +1224,19 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1320,29 +1224,19 @@ schedule_ue_spec(module_id_t module_idP,
// this assumes accumulated tpc // this assumes accumulated tpc
// make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
int32_t framex10psubframe = int32_t framex10psubframe = UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame * 10 + UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe;
UE_list->UE_template[CC_id][UE_id].
pucch_tpc_tx_frame * 10 +
UE_list->UE_template[CC_id][UE_id].
pucch_tpc_tx_subframe;
if (((framex10psubframe + 10) <= (frameP * 10 + subframeP)) || //normal case if (((framex10psubframe + 10) <= (frameP * 10 + subframeP)) || //normal case
((framex10psubframe > (frameP * 10 + subframeP)) && (((10240 - framex10psubframe + frameP * 10 + subframeP) >= 10)))) //frame wrap-around ((framex10psubframe > (frameP * 10 + subframeP)) && (((10240 - framex10psubframe + frameP * 10 + subframeP) >= 10)))) //frame wrap-around
if (ue_sched_ctl->pucch1_cqi_update[CC_id] == 1) { if (ue_sched_ctl->pucch1_cqi_update[CC_id] == 1) {
ue_sched_ctl->pucch1_cqi_update[CC_id] = 0; ue_sched_ctl->pucch1_cqi_update[CC_id] = 0;
UE_list-> UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame = frameP;
UE_template[CC_id] UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe = subframeP;
[UE_id].pucch_tpc_tx_frame = frameP;
UE_list->
UE_template[CC_id]
[UE_id].pucch_tpc_tx_subframe = subframeP;
if (normalized_rx_power > if (normalized_rx_power > (target_rx_power + 4)) {
(target_rx_power + 4)) {
tpc = 0; //-1 tpc = 0; //-1
tpc_accumulated--; tpc_accumulated--;
} else if (normalized_rx_power < } else if (normalized_rx_power < (target_rx_power - 4)) {
(target_rx_power - 4)) {
tpc = 2; //+1 tpc = 2; //+1
tpc_accumulated++; tpc_accumulated++;
} else { } else {
...@@ -1363,19 +1257,13 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1363,19 +1257,13 @@ schedule_ue_spec(module_id_t module_idP,
tpc = 1; //0 tpc = 1; //0
} }
dl_config_pdu = dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
&dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
dl_config_pdu->pdu_size = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1;
(uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu)); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP, CC_id),
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format =
NFAPI_DL_DCI_FORMAT_1;
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.aggregation_level =
get_aggregation(get_bw_index(module_idP, CC_id),
ue_sched_ctl->dl_cqi[CC_id], ue_sched_ctl->dl_cqi[CC_id],
format1); format1);
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
...@@ -1383,26 +1271,16 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1383,26 +1271,16 @@ schedule_ue_spec(module_id_t module_idP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = harq_pid;
harq_process = harq_pid;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = tpc; // dont adjust power when retransmitting dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = tpc; // dont adjust power when retransmitting
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1 - UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
dci_dl_pdu_rel8.new_data_indicator_1 =
1 -
UE_list->UE_template[CC_id][UE_id].
oldNDI[harq_pid];
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs;
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0;
dci_dl_pdu_rel8.redundancy_version_1 = 0;
//deactivate second codeword //deactivate second codeword
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_2 = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_2 = 0;
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_2 = 1;
dci_dl_pdu_rel8.redundancy_version_2 = 1;
if (cc[CC_id].tdd_Config != NULL) { //TDD if (cc[CC_id].tdd_Config != NULL) { //TDD
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.downlink_assignment_index = (UE_list->UE_template[CC_id][UE_id].DAI - 1) & 3;
dci_dl_pdu_rel8.downlink_assignment_index =
(UE_list->UE_template[CC_id][UE_id].DAI -
1) & 3;
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] Initial transmission CC_id %d : harq_pid %d, dai %d, mcs %d\n", "[eNB %d] Initial transmission CC_id %d : harq_pid %d, dai %d, mcs %d\n",
module_idP, CC_id, harq_pid, module_idP, CC_id, harq_pid,
...@@ -1416,8 +1294,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1416,8 +1294,7 @@ schedule_ue_spec(module_id_t module_idP,
} }
LOG_D(MAC, "Checking feasibility pdu %d (new sdu)\n", LOG_D(MAC, "Checking feasibility pdu %d (new sdu)\n",
dl_req->number_pdu); dl_req->number_pdu);
if (!CCE_allocation_infeasible if (!CCE_allocation_infeasible(module_idP, CC_id, 1, subframeP,
(module_idP, CC_id, 1, subframeP,
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.aggregation_level, rnti)) { dci_dl_pdu_rel8.aggregation_level, rnti)) {
...@@ -1438,23 +1315,13 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1438,23 +1315,13 @@ schedule_ue_spec(module_id_t module_idP,
UE_list-> UE_list->
UE_template[CC_id][UE_id].oldNDI[harq_pid]); UE_template[CC_id][UE_id].oldNDI[harq_pid]);
UE_list->UE_template[CC_id][UE_id]. UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid] = 1 - UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
oldNDI[harq_pid] = UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid] = mcs;
1 - UE_list->UE_template[CC_id][UE_id].oldmcs2[harq_pid] = 0;
UE_list->UE_template[CC_id][UE_id]. AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated !=
oldNDI[harq_pid];
UE_list->UE_template[CC_id][UE_id].
oldmcs1[harq_pid] = mcs;
UE_list->UE_template[CC_id][UE_id].
oldmcs2[harq_pid] = 0;
AssertFatal(UE_list->UE_template[CC_id]
[UE_id].physicalConfigDedicated !=
NULL, NULL,
"physicalConfigDedicated is NULL\n"); "physicalConfigDedicated is NULL\n");
AssertFatal(UE_list->UE_template[CC_id] AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->pdsch_ConfigDedicated != NULL,
[UE_id].
physicalConfigDedicated->pdsch_ConfigDedicated
!= NULL,
"physicalConfigDedicated->pdsch_ConfigDedicated is NULL\n"); "physicalConfigDedicated->pdsch_ConfigDedicated is NULL\n");
fill_nfapi_dlsch_config(eNB, dl_req, TBS, eNB->pdu_index[CC_id], rnti, 0, // type 0 allocation from 7.1.6 in 36.213 fill_nfapi_dlsch_config(eNB, dl_req, TBS, eNB->pdu_index[CC_id], rnti, 0, // type 0 allocation from 7.1.6 in 36.213
...@@ -1475,8 +1342,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1475,8 +1342,7 @@ schedule_ue_spec(module_id_t module_idP,
0, //number of PRBs treated as one subband, not used here 0, //number of PRBs treated as one subband, not used here
0 // number of beamforming vectors, not used here 0 // number of beamforming vectors, not used here
); );
eNB->TX_req[CC_id].sfn_sf = eNB->TX_req[CC_id].sfn_sf = fill_nfapi_tx_req(&eNB->
fill_nfapi_tx_req(&eNB->
TX_req TX_req
[CC_id].tx_request_body, [CC_id].tx_request_body,
(frameP * 10) + subframeP, (frameP * 10) + subframeP,
...@@ -1519,8 +1385,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1519,8 +1385,7 @@ schedule_ue_spec(module_id_t module_idP,
fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_flag); fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_flag);
stop_meas(&eNB->schedule_dlsch); stop_meas(&eNB->schedule_dlsch);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_OUT);
(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_OUT);
} }
...@@ -1569,63 +1434,37 @@ fill_DLSCH_dci(module_id_t module_idP, ...@@ -1569,63 +1434,37 @@ fill_DLSCH_dci(module_id_t module_idP,
LOG_T(MAC, "CC_id %d, UE_id: %d => status %d\n", CC_id, UE_id, LOG_T(MAC, "CC_id %d, UE_id: %d => status %d\n", CC_id, UE_id,
eNB_dlsch_info[module_idP][CC_id][UE_id].status); eNB_dlsch_info[module_idP][CC_id][UE_id].status);
if (eNB_dlsch_info[module_idP][CC_id][UE_id].status == if (eNB_dlsch_info[module_idP][CC_id][UE_id].status == S_DL_SCHEDULED) {
S_DL_SCHEDULED) {
// clear scheduling flag // clear scheduling flag
eNB_dlsch_info[module_idP][CC_id][UE_id].status = eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING;
S_DL_WAITING;
rnti = UE_RNTI(module_idP, UE_id); rnti = UE_RNTI(module_idP, UE_id);
if (cc->tdd_Config) if (cc->tdd_Config) harq_pid = ((frameP * 10) + subframeP) % 10;
harq_pid = ((frameP * 10) + subframeP) % 10; else harq_pid = ((frameP * 10) + subframeP) & 7;
else
harq_pid = ((frameP * 10) + subframeP) & 7;
nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
/// Synchronizing rballoc with rballoc_sub /// Synchronizing rballoc with rballoc_sub
for (i = 0; i < N_RBG; i++) { for (i = 0; i < N_RBG; i++) {
rballoc_sub[i] = rballoc_sub[i] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][i];
UE_list->
UE_template[CC_id][UE_id].rballoc_subband[harq_pid]
[i];
} }
nfapi_dl_config_request_t *DL_req = nfapi_dl_config_request_t *DL_req = &RC.mac[module_idP]->DL_req[0];
&RC.mac[module_idP]->DL_req[0];
nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_dl_config_request_pdu_t *dl_config_pdu;
for (i = 0; for (i = 0;
i < DL_req[CC_id].dl_config_request_body.number_pdu; i < DL_req[CC_id].dl_config_request_body.number_pdu;
i++) { i++) {
dl_config_pdu = dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[i];
&DL_req[CC_id]. if ((dl_config_pdu->pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)
dl_config_request_body.dl_config_pdu_list[i]; && (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti == rnti)
if ((dl_config_pdu->pdu_type == && (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format != 1)) {
NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = allocate_prbs_sub(nb_rb, N_RB_DL, N_RBG,rballoc_sub);
&& (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_allocation_type = 0;
rnti == rnti)
&& (dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.dci_format != 1)) {
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.resource_block_coding =
allocate_prbs_sub(nb_rb, N_RB_DL, N_RBG,
rballoc_sub);
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.resource_allocation_type = 0;
} else } else
if ((dl_config_pdu->pdu_type == if ((dl_config_pdu->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE)
NFAPI_DL_CONFIG_DLSCH_PDU_TYPE) && (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == rnti)
&& (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8. && (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type == 0)) {
rnti == rnti) dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding =allocate_prbs_sub(nb_rb, N_RB_DL, N_RBG,rballoc_sub);
&& (dl_config_pdu->dlsch_pdu.
dlsch_pdu_rel8.resource_allocation_type ==
0)) {
dl_config_pdu->dlsch_pdu.
dlsch_pdu_rel8.resource_block_coding =
allocate_prbs_sub(nb_rb, N_RB_DL, N_RBG,
rballoc_sub);
} }
} }
} }
...@@ -1634,8 +1473,7 @@ fill_DLSCH_dci(module_id_t module_idP, ...@@ -1634,8 +1473,7 @@ fill_DLSCH_dci(module_id_t module_idP,
} }
stop_meas(&eNB->fill_DLSCH_dci); stop_meas(&eNB->fill_DLSCH_dci);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI, VCD_FUNCTION_OUT);
(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI, VCD_FUNCTION_OUT);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -1652,8 +1490,7 @@ unsigned char *get_dlsch_sdu(module_id_t module_idP, ...@@ -1652,8 +1490,7 @@ unsigned char *get_dlsch_sdu(module_id_t module_idP,
LOG_D(MAC, "[eNB %d] CC_id %d Frame %d Get DLSCH sdu for BCCH \n", LOG_D(MAC, "[eNB %d] CC_id %d Frame %d Get DLSCH sdu for BCCH \n",
module_idP, CC_id, frameP); module_idP, CC_id, frameP);
return ((unsigned char *) &eNB->common_channels[CC_id]. return ((unsigned char *) &eNB->common_channels[CC_id].BCCH_pdu.payload[0]);
BCCH_pdu.payload[0]);
} }
if (rntiP==P_RNTI) { if (rntiP==P_RNTI) {
...@@ -1668,8 +1505,7 @@ unsigned char *get_dlsch_sdu(module_id_t module_idP, ...@@ -1668,8 +1505,7 @@ unsigned char *get_dlsch_sdu(module_id_t module_idP,
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] Frame %d: CC_id %d Get DLSCH sdu for rnti %x => UE_id %d\n", "[eNB %d] Frame %d: CC_id %d Get DLSCH sdu for rnti %x => UE_id %d\n",
module_idP, frameP, CC_id, rntiP, UE_id); module_idP, frameP, CC_id, rntiP, UE_id);
return ((unsigned char *) &eNB-> return ((unsigned char *) &eNB->UE_list.DLSCH_pdu[CC_id][TBindex][UE_id].payload[0]);
UE_list.DLSCH_pdu[CC_id][TBindex][UE_id].payload[0]);
} else { } else {
LOG_E(MAC, LOG_E(MAC,
"[eNB %d] Frame %d: CC_id %d UE with RNTI %x does not exist\n", "[eNB %d] Frame %d: CC_id %d UE with RNTI %x does not exist\n",
...@@ -1697,14 +1533,12 @@ update_ul_dci(module_id_t module_idP, ...@@ -1697,14 +1533,12 @@ update_ul_dci(module_id_t module_idP,
if (cc->tdd_Config != NULL) { // TDD if (cc->tdd_Config != NULL) { // TDD
for (i = 0; for (i = 0;
i < i <HI_DCI0_req->hi_dci0_request_body.number_of_dci + HI_DCI0_req->hi_dci0_request_body.number_of_dci;
HI_DCI0_req->hi_dci0_request_body.number_of_dci + i++) {
HI_DCI0_req->hi_dci0_request_body.number_of_dci; i++) {
if ((hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) && if ((hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) &&
(hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti == rntiP)) (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti == rntiP))
hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.dl_assignment_index = hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.dl_assignment_index = (daiP - 1) & 3;
(daiP - 1) & 3;
} }
} }
...@@ -1811,7 +1645,7 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) ...@@ -1811,7 +1645,7 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP)
uint8_t n_vrb_dl = 0; uint8_t n_vrb_dl = 0;
uint8_t Lcrbs = 0; uint8_t Lcrbs = 0;
uint16_t rb_bit = 168; /* RB bit number value is unsure */ uint16_t rb_bit = 168; /* RB bit number value is unsure */
#endif #endif
start_meas(&eNB->schedule_pch); start_meas(&eNB->schedule_pch);
......
...@@ -141,29 +141,25 @@ uint16_t mac_computeRIV(uint16_t N_RB_DL, uint16_t RBstart, uint16_t Lcrbs) ...@@ -141,29 +141,25 @@ uint16_t mac_computeRIV(uint16_t N_RB_DL, uint16_t RBstart, uint16_t Lcrbs)
{ {
uint16_t RIV; uint16_t RIV;
if (Lcrbs <= (1 + (N_RB_DL >> 1))) if (Lcrbs <= (1 + (N_RB_DL >> 1))) RIV = (N_RB_DL * (Lcrbs - 1)) + RBstart;
RIV = (N_RB_DL * (Lcrbs - 1)) + RBstart; else RIV = (N_RB_DL * (N_RB_DL + 1 - Lcrbs)) + (N_RB_DL - 1 - RBstart);
else
RIV = (N_RB_DL * (N_RB_DL + 1 - Lcrbs)) + (N_RB_DL - 1 - RBstart);
return (RIV); return (RIV);
} }
uint8_t getQm(uint8_t mcs) uint8_t getQm(uint8_t mcs)
{ {
if (mcs < 10) if (mcs < 10) return (2);
return (2); else if (mcs < 17) return (4);
else if (mcs < 17) else return (6);
return (4);
else
return (6);
} }
void void
get_Msg3alloc(COMMON_channels_t * cc, get_Msg3alloc(COMMON_channels_t *cc,
sub_frame_t current_subframe, sub_frame_t current_subframe,
frame_t current_frame, frame_t * frame, frame_t current_frame,
sub_frame_t * subframe) frame_t *frame,
sub_frame_t *subframe)
{ {
// Fill in other TDD Configuration!!!! // Fill in other TDD Configuration!!!!
...@@ -330,12 +326,10 @@ subframe2harqpid(COMMON_channels_t * cc, frame_t frame, ...@@ -330,12 +326,10 @@ subframe2harqpid(COMMON_channels_t * cc, frame_t frame,
case 3: case 3:
ret = (subframe - 2); ret = (subframe - 2);
break; break;
case 7: case 7:
case 8: case 8:
ret = (subframe - 5); ret = (subframe - 5);
break; break;
default: default:
AssertFatal(1 == 0, AssertFatal(1 == 0,
"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n", "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",
...@@ -408,16 +402,12 @@ get_Msg3harqpid(COMMON_channels_t * cc, ...@@ -408,16 +402,12 @@ get_Msg3harqpid(COMMON_channels_t * cc,
case 0: case 0:
ul_subframe = 7; ul_subframe = 7;
break; break;
case 5: case 5:
case 7: case 7:
ul_subframe = 2; ul_subframe = 2;
break; break;
} }
break; break;
case 3: case 3:
switch (current_subframe) { switch (current_subframe) {
case 0: case 0:
...@@ -425,22 +415,17 @@ get_Msg3harqpid(COMMON_channels_t * cc, ...@@ -425,22 +415,17 @@ get_Msg3harqpid(COMMON_channels_t * cc,
case 6: case 6:
ul_subframe = 2; ul_subframe = 2;
break; break;
case 7: case 7:
ul_subframe = 3; ul_subframe = 3;
break; break;
case 8: case 8:
ul_subframe = 4; ul_subframe = 4;
break; break;
case 9: case 9:
ul_subframe = 2; ul_subframe = 2;
break; break;
} }
break; break;
case 4: case 4:
switch (current_subframe) { switch (current_subframe) {
case 0: case 0:
...@@ -450,18 +435,14 @@ get_Msg3harqpid(COMMON_channels_t * cc, ...@@ -450,18 +435,14 @@ get_Msg3harqpid(COMMON_channels_t * cc,
case 9: case 9:
ul_subframe = 2; ul_subframe = 2;
break; break;
case 7: case 7:
ul_subframe = 3; ul_subframe = 3;
break; break;
} }
break; break;
case 5: case 5:
ul_subframe = 2; ul_subframe = 2;
break; break;
default: default:
LOG_E(PHY, LOG_E(PHY,
"get_Msg3_harq_pid: Unsupported TDD configuration %d\n", "get_Msg3_harq_pid: Unsupported TDD configuration %d\n",
...@@ -530,20 +511,17 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP) ...@@ -530,20 +511,17 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP)
case 9: case 9:
return (0); return (0);
break; break;
case 2: case 2:
case 3: case 3:
case 7: case 7:
case 8: case 8:
return (1); return (1);
break; break;
default: default:
return (0); return (0);
break; break;
} }
break; break;
case 3: case 3:
if ((subframeP <= 1) || (subframeP >= 5)) if ((subframeP <= 1) || (subframeP >= 5))
return (0); return (0);
...@@ -552,7 +530,6 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP) ...@@ -552,7 +530,6 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP)
else else
AssertFatal(1 == 0, "Unknown subframe number\n"); AssertFatal(1 == 0, "Unknown subframe number\n");
break; break;
case 4: case 4:
if ((subframeP <= 1) || (subframeP >= 4)) if ((subframeP <= 1) || (subframeP >= 4))
return (0); return (0);
...@@ -561,7 +538,6 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP) ...@@ -561,7 +538,6 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP)
else else
AssertFatal(1 == 0, "Unknown subframe number\n"); AssertFatal(1 == 0, "Unknown subframe number\n");
break; break;
case 5: case 5:
if ((subframeP <= 1) || (subframeP >= 3)) if ((subframeP <= 1) || (subframeP >= 3))
return (0); return (0);
...@@ -570,7 +546,6 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP) ...@@ -570,7 +546,6 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP)
else else
AssertFatal(1 == 0, "Unknown subframe number\n"); AssertFatal(1 == 0, "Unknown subframe number\n");
break; break;
default: default:
AssertFatal(1 == 0, AssertFatal(1 == 0,
"subframe %d Unsupported TDD configuration %d\n", "subframe %d Unsupported TDD configuration %d\n",
...@@ -965,12 +940,10 @@ get_rel8_dl_cqi_pmi_size(UE_sched_ctrl * sched_ctl, int CC_idP, ...@@ -965,12 +940,10 @@ get_rel8_dl_cqi_pmi_size(UE_sched_ctrl * sched_ctl, int CC_idP,
AssertFatal(cqi_ReportPeriodic != NULL, AssertFatal(cqi_ReportPeriodic != NULL,
"cqi_ReportPeriodic is null!\n"); "cqi_ReportPeriodic is null!\n");
AssertFatal(cqi_ReportPeriodic->present != AssertFatal(cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_NOTHING,
CQI_ReportPeriodic_PR_NOTHING,
"cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n"); "cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n");
AssertFatal(cqi_ReportPeriodic->choice. AssertFatal(cqi_ReportPeriodic->choice.
setup.cqi_FormatIndicatorPeriodic.present != setup.cqi_FormatIndicatorPeriodic.present != CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING,
CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING,
"cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n"); "cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n");
switch (tmode) { switch (tmode) {
...@@ -985,75 +958,58 @@ get_rel8_dl_cqi_pmi_size(UE_sched_ctrl * sched_ctl, int CC_idP, ...@@ -985,75 +958,58 @@ get_rel8_dl_cqi_pmi_size(UE_sched_ctrl * sched_ctl, int CC_idP,
no_pmi = 0; no_pmi = 0;
} }
if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic. if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI)
present ==
CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI)
|| (sched_ctl->feedback_cnt[CC_idP] == 0)) { || (sched_ctl->feedback_cnt[CC_idP] == 0)) {
// send wideband report every opportunity if wideband reporting mode is selected, else every H opportunities // send wideband report every opportunity if wideband reporting mode is selected, else every H opportunities
if (no_pmi == 1) if (no_pmi == 1) return (4);
return (4); else if ((cc->p_eNB == 2) && (ri == 1)) return (6);
else if ((cc->p_eNB == 2) && (ri == 1)) else if ((cc->p_eNB == 2) && (ri == 2)) return (8);
return (6); else if ((cc->p_eNB == 4) && (ri == 1)) return (8);
else if ((cc->p_eNB == 2) && (ri == 2)) else if ((cc->p_eNB == 4) && (ri == 2)) return (11);
return (8);
else if ((cc->p_eNB == 4) && (ri == 1))
return (8);
else if ((cc->p_eNB == 4) && (ri == 2))
return (11);
else else
AssertFatal(1 == 0, AssertFatal(1 == 0,
"illegal combination p %d, ri %d, no_pmi %d\n", "illegal combination p %d, ri %d, no_pmi %d\n",
cc->p_eNB, ri, no_pmi); cc->p_eNB, ri, no_pmi);
} else if (cqi_ReportPeriodic->choice. } else if (cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI) {
setup.cqi_FormatIndicatorPeriodic.present == if ((no_pmi == 1) || ri == 1) return (4 + Ltab[cc->mib->message.dl_Bandwidth]);
CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI) else return (7 + Ltab[cc->mib->message.dl_Bandwidth]);
{
if ((no_pmi == 1) || ri == 1)
return (4 + Ltab[cc->mib->message.dl_Bandwidth]);
else
return (7 + Ltab[cc->mib->message.dl_Bandwidth]);
} }
AssertFatal(1 == 0, AssertFatal(1 == 0,
"Shouldn't get here : cqi_ReportPeriodic->present %d\n", "Shouldn't get here : cqi_ReportPeriodic->present %d\n",
cqi_ReportPeriodic->choice. cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present);
setup.cqi_FormatIndicatorPeriodic.present);
} }
void void
fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t * dl_config_pdu, fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t *dl_config_pdu,
uint8_t aggregation_level, uint8_t aggregation_level,
uint16_t rnti, uint16_t rnti,
uint8_t rnti_type, uint8_t rnti_type,
uint8_t harq_process, uint8_t harq_process,
uint8_t tpc, uint8_t tpc,
uint16_t resource_block_coding, uint16_t resource_block_coding,
uint8_t mcs, uint8_t ndi, uint8_t rv, uint8_t mcs,
uint8_t ndi,
uint8_t rv,
uint8_t vrb_flag) uint8_t vrb_flag)
{ {
memset((void *) dl_config_pdu, 0, memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu)); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation_level;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format =
NFAPI_DL_DCI_FORMAT_1A;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level =
aggregation_level;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = rnti_type; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = rnti_type;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = harq_process; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = harq_process;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = tpc; // no TPC dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = tpc;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = resource_block_coding;
resource_block_coding;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = ndi; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = ndi;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = rv; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = rv;
dl_config_pdu->dci_dl_pdu. dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = vrb_flag;
dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = vrb_flag;
} }
void void
...@@ -1067,43 +1023,29 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, ...@@ -1067,43 +1023,29 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
rnti_t rnti = UE_RNTI(module_idP, UE_idP); rnti_t rnti = UE_RNTI(module_idP, UE_idP);
nfapi_ul_config_request_body_t *ul_req; nfapi_ul_config_request_body_t *ul_req;
nfapi_ul_config_request_pdu_t *ul_config_pdu; nfapi_ul_config_request_pdu_t *ul_config_pdu;
int use_simultaneous_pucch_pusch = 0; int use_simultaneous_pucch_pusch = 0;
nfapi_ul_config_ulsch_harq_information *ulsch_harq_information = NULL; nfapi_ul_config_ulsch_harq_information *ulsch_harq_information = NULL;
nfapi_ul_config_harq_information *harq_information = NULL; nfapi_ul_config_harq_information *harq_information = NULL;
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
if ((UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated-> if ((UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2)
ext2) && (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020)
&& (UE_list->UE_template[CC_idP][UE_idP]. && (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10)
physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020) && (*UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10 == PUCCH_ConfigDedicated_v1020__simultaneousPUCCH_PUSCH_r10_true))
&& (UE_list->UE_template[CC_idP][UE_idP].
physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->
simultaneousPUCCH_PUSCH_r10)
&& (*UE_list->UE_template[CC_idP][UE_idP].
physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->
simultaneousPUCCH_PUSCH_r10 ==
PUCCH_ConfigDedicated_v1020__simultaneousPUCCH_PUSCH_r10_true))
use_simultaneous_pucch_pusch = 1; use_simultaneous_pucch_pusch = 1;
#endif #endif
// pucch1 and pusch feedback is similar, namely in n+k subframes from now // pucch1 and pusch feedback is similar, namely in n+k subframes from now
// This is used in the following "if/else" condition to check if there isn't or is already an UL grant in n+k // This is used in the following "if/else" condition to check if there isn't or is already an UL grant in n+k
int16_t ul_absSF = int16_t ul_absSF = get_pucch1_absSF(&cc[CC_idP], subframeP + (10 * frameP));
get_pucch1_absSF(&cc[CC_idP], subframeP + (10 * frameP));
if ((ul_config_pdu = has_ul_grant(module_idP, CC_idP, if ((ul_config_pdu = has_ul_grant(module_idP, CC_idP,ul_absSF, rnti)) == NULL) {
ul_absSF, rnti)) == NULL) {
// no UL grant so // no UL grant so
// Program ACK/NAK alone Format 1a/b or 3 // Program ACK/NAK alone Format 1a/b or 3
ul_req = ul_req = &RC.mac[module_idP]->UL_req_tmp[CC_idP][ul_absSF %10].ul_config_request_body;
&RC.mac[module_idP]->UL_req_tmp[CC_idP][ul_absSF % ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
10].
ul_config_request_body;
ul_config_pdu =
&ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
// Do PUCCH // Do PUCCH
fill_nfapi_uci_acknak(module_idP, fill_nfapi_uci_acknak(module_idP,
CC_idP, CC_idP,
...@@ -1119,20 +1061,16 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, ...@@ -1119,20 +1061,16 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE:
if (use_simultaneous_pucch_pusch == 1) { if (use_simultaneous_pucch_pusch == 1) {
// Convert it to an NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE // Convert it to an NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE
harq_information = harq_information = &ul_config_pdu->ulsch_uci_harq_pdu.harq_information;
&ul_config_pdu->ulsch_uci_harq_pdu.harq_information; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE;
ul_config_pdu->pdu_type =
NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE;
LOG_D(MAC, LOG_D(MAC,
"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH UCI HARQ\n", "Frame %d, Subframe %d: Switched UCI HARQ to ULSCH UCI HARQ\n",
frameP, subframeP); frameP, subframeP);
} else { } else {
// Convert it to an NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE // Convert it to an NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE
ulsch_harq_information = ulsch_harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information;
&ul_config_pdu->ulsch_harq_pdu.harq_information; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE;
ul_config_pdu->pdu_type = ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG;
NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE;
ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag=NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG;
ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured
ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet
LOG_D(MAC, LOG_D(MAC,
...@@ -1153,17 +1091,15 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, ...@@ -1153,17 +1091,15 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE:
// Convert it to an NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE // Convert it to an NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE
ulsch_harq_information = ulsch_harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information;
&ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE;
ul_config_pdu->pdu_type =
NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE;
/* TODO: check this - when converting from nfapi_ul_config_ulsch_cqi_ri_pdu to /* TODO: check this - when converting from nfapi_ul_config_ulsch_cqi_ri_pdu to
* nfapi_ul_config_ulsch_cqi_harq_ri_pdu, shouldn't we copy initial_transmission_parameters * nfapi_ul_config_ulsch_cqi_harq_ri_pdu, shouldn't we copy initial_transmission_parameters
* from the one to the other? * from the one to the other?
* Those two types are not compatible. 'initial_transmission_parameters' is not at the * Those two types are not compatible. 'initial_transmission_parameters' is not at the
* place in both. * place in both.
*/ */
ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag=NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG; ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG;
ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured
ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet
break; break;
...@@ -1176,10 +1112,8 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, ...@@ -1176,10 +1112,8 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE:
// convert it to an NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE // convert it to an NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE
harq_information = harq_information = &ul_config_pdu->ulsch_csi_uci_harq_pdu.harq_information;
&ul_config_pdu->ulsch_csi_uci_harq_pdu.harq_information; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE;
ul_config_pdu->pdu_type =
NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE;
break; break;
case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE:
AssertFatal(use_simultaneous_pucch_pusch == 1, AssertFatal(use_simultaneous_pucch_pusch == 1,
...@@ -1191,34 +1125,25 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, ...@@ -1191,34 +1125,25 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE:
// convert to NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE // convert to NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
harq_information = harq_information = &ul_config_pdu->uci_sr_harq_pdu.harq_information;
&ul_config_pdu->uci_sr_harq_pdu.harq_information;
break; break;
case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE:
/* nothing to do */ /* nothing to do */
break; break;
/* [cqi] to [cqi + harq] */ /* [cqi] to [cqi + harq] */
case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE:
// convert to NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE // convert to NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE
ul_config_pdu->pdu_type = ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE;
NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE; harq_information = &ul_config_pdu->uci_cqi_harq_pdu.harq_information;
harq_information =
&ul_config_pdu->uci_cqi_harq_pdu.harq_information;
break; break;
case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE:
/* nothing to do */ /* nothing to do */
break; break;
/* [cqi + sr] to [cqr + sr + harq] */ /* [cqi + sr] to [cqr + sr + harq] */
case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE:
// convert to NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE // convert to NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE
ul_config_pdu->pdu_type = ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE;
NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE; harq_information = &ul_config_pdu->uci_cqi_sr_harq_pdu.harq_information;
harq_information =
&ul_config_pdu->uci_cqi_sr_harq_pdu.harq_information;
break; break;
case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE:
/* nothing to do */ /* nothing to do */
...@@ -1226,12 +1151,9 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, ...@@ -1226,12 +1151,9 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
} }
} }
if (ulsch_harq_information) if (ulsch_harq_information) fill_nfapi_ulsch_harq_information(module_idP, CC_idP, rnti, ulsch_harq_information);
fill_nfapi_ulsch_harq_information(module_idP, CC_idP,
rnti, ulsch_harq_information);
if (harq_information) if (harq_information) fill_nfapi_harq_information(module_idP, CC_idP,
fill_nfapi_harq_information(module_idP, CC_idP,
rnti, rnti,
(frameP * 10) + subframeP, (frameP * 10) + subframeP,
harq_information, cce_idx); harq_information, cce_idx);
...@@ -1239,16 +1161,13 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, ...@@ -1239,16 +1161,13 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
uint8_t get_V_UL_DAI(module_id_t module_idP, int CC_idP, uint16_t rntiP) uint8_t get_V_UL_DAI(module_id_t module_idP, int CC_idP, uint16_t rntiP)
{ {
nfapi_hi_dci0_request_body_t *HI_DCI0_req = nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body;
&RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[0];
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu =
&HI_DCI0_req->hi_dci0_pdu_list[0];
for (int i = 0; i < HI_DCI0_req->number_of_dci; i++) { for (int i = 0; i < HI_DCI0_req->number_of_dci; i++) {
if ((hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) && if ((hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) &&
(hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti == rntiP)) (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti == rntiP))
return (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8. return (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.dl_assignment_index);
dl_assignment_index);
} }
return (4); // this is rule from Section 7.3 in 36.213 return (4); // this is rule from Section 7.3 in 36.213
} }
...@@ -1257,8 +1176,7 @@ void ...@@ -1257,8 +1176,7 @@ void
fill_nfapi_ulsch_harq_information(module_id_t module_idP, fill_nfapi_ulsch_harq_information(module_id_t module_idP,
int CC_idP, int CC_idP,
uint16_t rntiP, uint16_t rntiP,
nfapi_ul_config_ulsch_harq_information nfapi_ul_config_ulsch_harq_information *harq_information)
* harq_information)
{ {
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
...@@ -1273,12 +1191,10 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP, ...@@ -1273,12 +1191,10 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP,
AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n"); AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n");
AssertFatal(UE_list != NULL, "UE_list is null\n"); AssertFatal(UE_list != NULL, "UE_list is null\n");
AssertFatal(UE_list->UE_template[CC_idP][UE_id]. AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL,
physicalConfigDedicated != NULL,
"physicalConfigDedicated for rnti %x is null\n", rntiP); "physicalConfigDedicated for rnti %x is null\n", rntiP);
AssertFatal((puschConfigDedicated = (PUSCH_ConfigDedicated_t *) AssertFatal((puschConfigDedicated = (PUSCH_ConfigDedicated_t *)
UE_list->UE_template[CC_idP][UE_id]. UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pusch_ConfigDedicated) != NULL,
physicalConfigDedicated->pusch_ConfigDedicated) != NULL,
"physicalConfigDedicated->puschConfigDedicated for rnti %x is null\n", "physicalConfigDedicated->puschConfigDedicated for rnti %x is null\n",
rntiP); rntiP);
#if defined(Rel14) || defined(Rel14) #if defined(Rel14) || defined(Rel14)
...@@ -1289,19 +1205,11 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP, ...@@ -1289,19 +1205,11 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP,
if (UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext5) puschConfigDedicated_v1250 = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext5->pusch_ConfigDedicated_v1250; if (UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext5) puschConfigDedicated_v1250 = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext5->pusch_ConfigDedicated_v1250;
*/ */
#endif #endif
harq_information->harq_information_rel10.delta_offset_harq = harq_information->harq_information_rel10.delta_offset_harq = puschConfigDedicated->betaOffset_ACK_Index;
puschConfigDedicated->betaOffset_ACK_Index; AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL,
AssertFatal(UE_list->
UE_template[CC_idP][UE_id].physicalConfigDedicated->
pucch_ConfigDedicated != NULL,
"pucch_ConfigDedicated is null!\n"); "pucch_ConfigDedicated is null!\n");
if ((UE_list->UE_template[CC_idP][UE_id]. if ((UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL)
physicalConfigDedicated->pucch_ConfigDedicated-> && (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode == PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing))
tdd_AckNackFeedbackMode != NULL)
&& (*UE_list->UE_template[CC_idP][UE_id].
physicalConfigDedicated->pucch_ConfigDedicated->
tdd_AckNackFeedbackMode ==
PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing))
harq_information->harq_information_rel10.ack_nack_mode = 1; // multiplexing harq_information->harq_information_rel10.ack_nack_mode = 1; // multiplexing
else else
harq_information->harq_information_rel10.ack_nack_mode = 0; // bundling harq_information->harq_information_rel10.ack_nack_mode = 0; // bundling
...@@ -1315,10 +1223,8 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP, ...@@ -1315,10 +1223,8 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP,
if (cc->tdd_Config == NULL) // FDD if (cc->tdd_Config == NULL) // FDD
harq_information->harq_information_rel10.harq_size = 1; harq_information->harq_information_rel10.harq_size = 1;
else { else {
if (harq_information->harq_information_rel10.ack_nack_mode == if (harq_information->harq_information_rel10.ack_nack_mode == 1)
1) harq_information->harq_information_rel10.harq_size = get_V_UL_DAI(module_idP, CC_idP, rntiP);
harq_information->harq_information_rel10.harq_size =
get_V_UL_DAI(module_idP, CC_idP, rntiP);
else else
harq_information->harq_information_rel10.harq_size = 1; harq_information->harq_information_rel10.harq_size = 1;
} }
...@@ -1327,10 +1233,8 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP, ...@@ -1327,10 +1233,8 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP,
if (cc->tdd_Config == NULL) { if (cc->tdd_Config == NULL) {
harq_information->harq_information_rel10.harq_size = 2; harq_information->harq_information_rel10.harq_size = 2;
} else { } else {
if (harq_information->harq_information_rel10.ack_nack_mode == if (harq_information->harq_information_rel10.ack_nack_mode == 1)
1) harq_information->harq_information_rel10.harq_size = get_V_UL_DAI(module_idP, CC_idP, rntiP);
harq_information->harq_information_rel10.harq_size =
get_V_UL_DAI(module_idP, CC_idP, rntiP);
else else
harq_information->harq_information_rel10.harq_size = 2; harq_information->harq_information_rel10.harq_size = 2;
} }
...@@ -1343,8 +1247,8 @@ fill_nfapi_harq_information(module_id_t module_idP, ...@@ -1343,8 +1247,8 @@ fill_nfapi_harq_information(module_id_t module_idP,
int CC_idP, int CC_idP,
uint16_t rntiP, uint16_t rntiP,
uint16_t absSFP, uint16_t absSFP,
nfapi_ul_config_harq_information * nfapi_ul_config_harq_information *harq_information,
harq_information, uint8_t cce_idxP) uint8_t cce_idxP)
{ {
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
...@@ -1358,8 +1262,7 @@ fill_nfapi_harq_information(module_id_t module_idP, ...@@ -1358,8 +1262,7 @@ fill_nfapi_harq_information(module_id_t module_idP,
/* TODO: revisit, don't use Assert, it's perfectly possible to /* TODO: revisit, don't use Assert, it's perfectly possible to
* have physicalConfigDedicated NULL here * have physicalConfigDedicated NULL here
*/ */
AssertFatal(UE_list->UE_template[CC_idP][UE_id]. AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL,
physicalConfigDedicated != NULL,
"physicalConfigDedicated for rnti %x is null\n", rntiP); "physicalConfigDedicated for rnti %x is null\n", rntiP);
#endif #endif
...@@ -1373,18 +1276,10 @@ fill_nfapi_harq_information(module_id_t module_idP, ...@@ -1373,18 +1276,10 @@ fill_nfapi_harq_information(module_id_t module_idP,
case 6: case 6:
case 7: case 7:
if (cc->tdd_Config != NULL) { if (cc->tdd_Config != NULL) {
AssertFatal(UE_list-> AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL,
UE_template[CC_idP]
[UE_id].physicalConfigDedicated->
pucch_ConfigDedicated != NULL,
"pucch_ConfigDedicated is null for TDD!\n"); "pucch_ConfigDedicated is null for TDD!\n");
if ((UE_list-> if ((UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL)
UE_template[CC_idP][UE_id].physicalConfigDedicated-> && (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode == PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing))
pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL)
&& (*UE_list->
UE_template[CC_idP][UE_id].physicalConfigDedicated->
pucch_ConfigDedicated->tdd_AckNackFeedbackMode ==
PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing))
{ {
harq_information->harq_information_rel10_tdd.harq_size = 2; // 2-bit ACK/NAK harq_information->harq_information_rel10_tdd.harq_size = 2; // 2-bit ACK/NAK
harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing
...@@ -1393,56 +1288,35 @@ fill_nfapi_harq_information(module_id_t module_idP, ...@@ -1393,56 +1288,35 @@ fill_nfapi_harq_information(module_id_t module_idP,
harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling
} }
harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG; harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG;
harq_information->harq_information_rel10_tdd.n_pucch_1_0 = harq_information->harq_information_rel10_tdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP;
cc->radioResourceConfigCommon->pucch_ConfigCommon. harq_information->harq_information_rel10_tdd.number_of_pucch_resources = 1;
n1PUCCH_AN + cce_idxP;
harq_information->
harq_information_rel10_tdd.number_of_pucch_resources = 1;
} else { } else {
harq_information->harq_information_rel9_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG; harq_information->harq_information_rel9_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG;
harq_information-> harq_information->harq_information_rel9_fdd.number_of_pucch_resources = 1;
harq_information_rel9_fdd.number_of_pucch_resources = 1;
harq_information->harq_information_rel9_fdd.harq_size = 1; // 1-bit ACK/NAK harq_information->harq_information_rel9_fdd.harq_size = 1; // 1-bit ACK/NAK
harq_information->harq_information_rel9_fdd.n_pucch_1_0 = harq_information->harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP;
cc->radioResourceConfigCommon->pucch_ConfigCommon.
n1PUCCH_AN + cce_idxP;
} }
break; break;
default: // for any other TM we need 2 bits harq default: // for any other TM we need 2 bits harq
if (cc->tdd_Config != NULL) { if (cc->tdd_Config != NULL) {
AssertFatal(UE_list-> AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL,
UE_template[CC_idP]
[UE_id].physicalConfigDedicated->
pucch_ConfigDedicated != NULL,
"pucch_ConfigDedicated is null for TDD!\n"); "pucch_ConfigDedicated is null for TDD!\n");
if ((UE_list-> if ((UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL)
UE_template[CC_idP][UE_id].physicalConfigDedicated-> && (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode == PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) {
pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL)
&& (*UE_list->
UE_template[CC_idP][UE_id].physicalConfigDedicated->
pucch_ConfigDedicated->tdd_AckNackFeedbackMode ==
PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing))
{
harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing
} else { } else {
harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling
} }
harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG; harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG;
harq_information->harq_information_rel10_tdd.harq_size = 2; harq_information->harq_information_rel10_tdd.harq_size = 2;
harq_information->harq_information_rel10_tdd.n_pucch_1_0 = harq_information->harq_information_rel10_tdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP;
cc->radioResourceConfigCommon->pucch_ConfigCommon. harq_information->harq_information_rel10_tdd.number_of_pucch_resources = 1;
n1PUCCH_AN + cce_idxP;
harq_information->
harq_information_rel10_tdd.number_of_pucch_resources = 1;
} else { } else {
harq_information->harq_information_rel9_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG; harq_information->harq_information_rel9_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG;
harq_information-> harq_information->harq_information_rel9_fdd.number_of_pucch_resources = 1;
harq_information_rel9_fdd.number_of_pucch_resources = 1;
harq_information->harq_information_rel9_fdd.ack_nack_mode = 0; // 1a/b harq_information->harq_information_rel9_fdd.ack_nack_mode = 0; // 1a/b
harq_information->harq_information_rel9_fdd.harq_size = 2; harq_information->harq_information_rel9_fdd.harq_size = 2;
harq_information->harq_information_rel9_fdd.n_pucch_1_0 = harq_information->harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP;
cc->radioResourceConfigCommon->pucch_ConfigCommon.
n1PUCCH_AN + cce_idxP;
} }
break; break;
} // get Tmode } // get Tmode
...@@ -1451,32 +1325,28 @@ fill_nfapi_harq_information(module_id_t module_idP, ...@@ -1451,32 +1325,28 @@ fill_nfapi_harq_information(module_id_t module_idP,
uint16_t uint16_t
fill_nfapi_uci_acknak(module_id_t module_idP, fill_nfapi_uci_acknak(module_id_t module_idP,
int CC_idP, int CC_idP,
uint16_t rntiP, uint16_t absSFP, uint8_t cce_idxP) uint16_t rntiP,
uint16_t absSFP,
uint8_t cce_idxP)
{ {
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
int ackNAK_absSF = get_pucch1_absSF(cc, absSFP); int ackNAK_absSF = get_pucch1_absSF(cc, absSFP);
nfapi_ul_config_request_t *ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF % 10]; nfapi_ul_config_request_t *ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF % 10];
nfapi_ul_config_request_body_t *ul_req_body = &ul_req->ul_config_request_body; nfapi_ul_config_request_body_t *ul_req_body = &ul_req->ul_config_request_body;
nfapi_ul_config_request_pdu_t *ul_config_pdu = nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
&ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
memset((void *) ul_config_pdu, 0, memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE;
ul_config_pdu->pdu_size = ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_uci_harq_pdu));
(uint8_t) (2 + sizeof(nfapi_ul_config_uci_harq_pdu));
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = rntiP;
rntiP;
fill_nfapi_harq_information(module_idP, CC_idP, fill_nfapi_harq_information(module_idP, CC_idP,
rntiP, rntiP,
absSFP, absSFP,
&ul_config_pdu->uci_harq_pdu. &ul_config_pdu->uci_harq_pdu.harq_information, cce_idxP);
harq_information, cce_idxP);
LOG_D(MAC, LOG_D(MAC,
"Filled in UCI HARQ request for rnti %x SF %d.%d acknakSF %d.%d, cce_idxP %d-> n1_pucch %d\n", "Filled in UCI HARQ request for rnti %x SF %d.%d acknakSF %d.%d, cce_idxP %d-> n1_pucch %d\n",
rntiP, absSFP / 10, absSFP % 10, ackNAK_absSF / 10, rntiP, absSFP / 10, absSFP % 10, ackNAK_absSF / 10,
...@@ -1486,7 +1356,6 @@ fill_nfapi_uci_acknak(module_id_t module_idP, ...@@ -1486,7 +1356,6 @@ fill_nfapi_uci_acknak(module_id_t module_idP,
ul_req_body->number_of_pdus++; ul_req_body->number_of_pdus++;
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST; ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
ul_req->sfn_sf = (ackNAK_absSF/10) << 4 | ackNAK_absSF%10; ul_req->sfn_sf = (ackNAK_absSF/10) << 4 | ackNAK_absSF%10;
...@@ -1526,58 +1395,44 @@ fill_nfapi_dlsch_config(eNB_MAC_INST * eNB, ...@@ -1526,58 +1395,44 @@ fill_nfapi_dlsch_config(eNB_MAC_INST * eNB,
sizeof(nfapi_dl_config_request_pdu_t)); sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
(uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = length; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = length;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = pdu_index; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = pdu_index;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = rnti; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = rnti;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = resource_allocation_type;
resource_allocation_type; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = virtual_resource_block_assignment_flag;
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = resource_block_coding;
dlsch_pdu_rel8.virtual_resource_block_assignment_flag =
virtual_resource_block_assignment_flag;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding =
resource_block_coding;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = modulation; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = modulation;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = redundancy_version;
redundancy_version; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = transport_blocks;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = transport_block_to_codeword_swap_flag;
transport_blocks; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = transmission_scheme;
dl_config_pdu->dlsch_pdu. dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = number_of_layers;
dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = number_of_subbands;
transport_block_to_codeword_swap_flag;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme =
transmission_scheme;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers =
number_of_layers;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands =
number_of_subbands;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = codebook_index; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = codebook_index;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = ue_category_capacity;
ue_category_capacity;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = pa; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = pa;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = delta_power_offset_index;
delta_power_offset_index;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = ngap; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = ngap;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = nprb; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = nprb;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = transmission_mode;
transmission_mode; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = num_bf_prb_per_subband;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband =
num_bf_prb_per_subband;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = num_bf_vector; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = num_bf_vector;
dl_req->number_pdu++; dl_req->number_pdu++;
} }
uint16_t uint16_t
fill_nfapi_tx_req(nfapi_tx_request_body_t * tx_req_body, fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,
uint16_t absSF, uint16_t pdu_length, uint16_t absSF,
uint16_t pdu_index, uint8_t * pdu) uint16_t pdu_length,
uint16_t pdu_index,
uint8_t *pdu)
{ {
nfapi_tx_request_pdu_t *TX_req = nfapi_tx_request_pdu_t *TX_req = &tx_req_body->tx_pdu_list[tx_req_body->number_of_pdus];
&tx_req_body->tx_pdu_list[tx_req_body->number_of_pdus];
LOG_D(MAC, "Filling TX_req %d for pdu length %d\n", LOG_D(MAC, "Filling TX_req %d for pdu length %d\n",
tx_req_body->number_of_pdus, pdu_length); tx_req_body->number_of_pdus, pdu_length);
TX_req->pdu_length = pdu_length; TX_req->pdu_length = pdu_length;
TX_req->pdu_index = pdu_index; TX_req->pdu_index = pdu_index;
TX_req->num_segments = 1; TX_req->num_segments = 1;
...@@ -1590,59 +1445,45 @@ fill_nfapi_tx_req(nfapi_tx_request_body_t * tx_req_body, ...@@ -1590,59 +1445,45 @@ fill_nfapi_tx_req(nfapi_tx_request_body_t * tx_req_body,
} }
void void
fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t * fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_config_pdu,
ul_config_pdu, uint8_t cqi_req, uint8_t cqi_req,
COMMON_channels_t * cc, COMMON_channels_t *cc,
struct PhysicalConfigDedicated struct PhysicalConfigDedicated *physicalConfigDedicated,
*physicalConfigDedicated, uint8_t tmode,
uint8_t tmode, uint32_t handle, uint32_t handle,
uint16_t rnti, uint16_t rnti,
uint8_t resource_block_start, uint8_t resource_block_start,
uint8_t uint8_t number_of_resource_blocks,
number_of_resource_blocks,
uint8_t mcs, uint8_t mcs,
uint8_t cyclic_shift_2_for_drms, uint8_t cyclic_shift_2_for_drms,
uint8_t uint8_t frequency_hopping_enabled_flag,
frequency_hopping_enabled_flag,
uint8_t frequency_hopping_bits, uint8_t frequency_hopping_bits,
uint8_t new_data_indication, uint8_t new_data_indication,
uint8_t redundancy_version, uint8_t redundancy_version,
uint8_t harq_process_number, uint8_t harq_process_number,
uint8_t ul_tx_mode, uint8_t ul_tx_mode,
uint8_t current_tx_nb, uint8_t current_tx_nb,
uint8_t n_srs, uint16_t size) uint8_t n_srs,
uint16_t size)
{ {
memset((void *) ul_config_pdu, 0, memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
ul_config_pdu->pdu_size = ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
(uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = handle; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = handle;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = resource_block_start;
resource_block_start; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = number_of_resource_blocks;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = if (mcs < 11) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
number_of_resource_blocks; else if (mcs < 21) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4;
if (mcs < 11) else ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cyclic_shift_2_for_drms;
else if (mcs < 21) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = frequency_hopping_enabled_flag;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = frequency_hopping_bits;
else ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = new_data_indication;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = redundancy_version;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = harq_process_number;
cyclic_shift_2_for_drms;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.
frequency_hopping_enabled_flag = frequency_hopping_enabled_flag;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits =
frequency_hopping_bits;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication =
new_data_indication;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version =
redundancy_version;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number =
harq_process_number;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = ul_tx_mode; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = ul_tx_mode;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = current_tx_nb; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = current_tx_nb;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs;
...@@ -1651,60 +1492,29 @@ fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t * ...@@ -1651,60 +1492,29 @@ fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *
if (cqi_req == 1) { if (cqi_req == 1) {
// Add CQI portion // Add CQI portion
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
ul_config_pdu->pdu_size = ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu));
(uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu));
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG; ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG;
ul_config_pdu->ulsch_cqi_ri_pdu. ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type = 1;
cqi_ri_information.cqi_ri_information_rel9.report_type = 1; ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1;
ul_config_pdu->ulsch_cqi_ri_pdu. LOG_D(MAC, "report_type %d\n",ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type);
cqi_ri_information.cqi_ri_information_rel9.
aperiodic_cqi_pmi_ri_report.number_of_cc = 1;
LOG_D(MAC, "report_type %d\n",
ul_config_pdu->ulsch_cqi_ri_pdu.
cqi_ri_information.cqi_ri_information_rel9.report_type);
if (cc->p_eNB <= 2 if (cc->p_eNB <= 2
&& (tmode == 3 || tmode == 4 || tmode == 8 || tmode == 9 && (tmode == 3 || tmode == 4 || tmode == 8 || tmode == 9 || tmode == 10))
|| tmode == 10)) ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1;
ul_config_pdu->ulsch_cqi_ri_pdu. else if (cc->p_eNB <= 2) ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0;
cqi_ri_information.cqi_ri_information_rel9. else if (cc->p_eNB == 4) ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2;
aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1;
else if (cc->p_eNB <= 2) AssertFatal(physicalConfigDedicated->cqi_ReportConfig != NULL,"physicalConfigDedicated->cqi_ReportConfig is null!\n");
ul_config_pdu->ulsch_cqi_ri_pdu. AssertFatal(physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic != NULL,"physicalConfigDedicated->cqi_ReportModeAperiodic is null!\n");
cqi_ri_information.cqi_ri_information_rel9. AssertFatal(physicalConfigDedicated->pusch_ConfigDedicated != NULL,"physicalConfigDedicated->puschConfigDedicated is null!\n");
aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0;
else if (cc->p_eNB == 4)
ul_config_pdu->ulsch_cqi_ri_pdu.
cqi_ri_information.cqi_ri_information_rel9.
aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2;
AssertFatal(physicalConfigDedicated->cqi_ReportConfig != NULL,
"physicalConfigDedicated->cqi_ReportConfig is null!\n");
AssertFatal(physicalConfigDedicated->
cqi_ReportConfig->cqi_ReportModeAperiodic != NULL,
"physicalConfigDedicated->cqi_ReportModeAperiodic is null!\n");
AssertFatal(physicalConfigDedicated->pusch_ConfigDedicated != NULL,
"physicalConfigDedicated->puschConfigDedicated is null!\n");
for (int ri = 0; for (int ri = 0;
ri < ri < (1 << ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size);
(1 << ul_config_pdu->ulsch_cqi_ri_pdu. ri++)
cqi_ri_information.cqi_ri_information_rel9. ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = get_dl_cqi_pmi_size_pusch(cc,tmode,1 + ri,physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic);
aperiodic_cqi_pmi_ri_report.cc[0].ri_size); ri++)
ul_config_pdu->ulsch_cqi_ri_pdu. ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
cqi_ri_information.cqi_ri_information_rel9. ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] =
get_dl_cqi_pmi_size_pusch(cc, tmode, 1 + ri,
physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic);
ul_config_pdu->ulsch_cqi_ri_pdu.
cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi =
physicalConfigDedicated->pusch_ConfigDedicated->
betaOffset_CQI_Index;
ul_config_pdu->ulsch_cqi_ri_pdu.
cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri =
physicalConfigDedicated->pusch_ConfigDedicated->
betaOffset_RI_Index;
} }
} }
...@@ -1721,20 +1531,16 @@ fill_nfapi_ulsch_config_request_emtc(nfapi_ul_config_request_pdu_t * ...@@ -1721,20 +1531,16 @@ fill_nfapi_ulsch_config_request_emtc(nfapi_ul_config_request_pdu_t *
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ue_type; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ue_type;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = total_number_of_repetitions;
total_number_of_repetitions; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = repetition_number;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = initial_transmission_sf_io;
repetition_number;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io =
initial_transmission_sf_io;
} }
int get_numnarrowbands(long dl_Bandwidth) int get_numnarrowbands(long dl_Bandwidth)
{ {
int nb_tab[6] = { 1, 2, 4, 8, 12, 16 }; int nb_tab[6] = { 1, 2, 4, 8, 12, 16 };
AssertFatal(dl_Bandwidth < 7 AssertFatal(dl_Bandwidth < 7 || dl_Bandwidth >= 0, "dl_Bandwidth not in [0..6]\n");
|| dl_Bandwidth >= 0, "dl_Bandwidth not in [0..6]\n");
return (nb_tab[dl_Bandwidth]); return (nb_tab[dl_Bandwidth]);
} }
...@@ -1742,8 +1548,7 @@ int get_numnarrowbandbits(long dl_Bandwidth) ...@@ -1742,8 +1548,7 @@ int get_numnarrowbandbits(long dl_Bandwidth)
{ {
int nbbits_tab[6] = { 0, 1, 2, 3, 4, 4 }; int nbbits_tab[6] = { 0, 1, 2, 3, 4, 4 };
AssertFatal(dl_Bandwidth < 7 AssertFatal(dl_Bandwidth < 7 || dl_Bandwidth >= 0, "dl_Bandwidth not in [0..6]\n");
|| dl_Bandwidth >= 0, "dl_Bandwidth not in [0..6]\n");
return (nbbits_tab[dl_Bandwidth]); return (nbbits_tab[dl_Bandwidth]);
} }
...@@ -1778,13 +1583,11 @@ mpdcch_sf_condition(eNB_MAC_INST * eNB, int CC_id, frame_t frameP, ...@@ -1778,13 +1583,11 @@ mpdcch_sf_condition(eNB_MAC_INST * eNB, int CC_id, frame_t frameP,
"mpdcch_startSF_CSS_RA_r13 is null\n"); "mpdcch_startSF_CSS_RA_r13 is null\n");
AssertFatal(rmax > 0, "rmax is 0!\b"); AssertFatal(rmax > 0, "rmax is 0!\b");
if (eNB->common_channels[CC_id].tdd_Config == NULL) //FDD if (eNB->common_channels[CC_id].tdd_Config == NULL) //FDD
T = rmax * T = rmax *startSF_fdd_RA_times2[ext4_prach->
startSF_fdd_RA_times2[ext4_prach->
mpdcch_startSF_CSS_RA_r13-> mpdcch_startSF_CSS_RA_r13->
choice.fdd_r13] >> 1; choice.fdd_r13] >> 1;
else //TDD else //TDD
T = rmax * T = rmax *startSF_tdd_RA[ext4_prach->
startSF_tdd_RA[ext4_prach->
mpdcch_startSF_CSS_RA_r13->choice.tdd_r13]; mpdcch_startSF_CSS_RA_r13->choice.tdd_r13];
break; break;
case TYPE2A: case TYPE2A:
...@@ -1792,9 +1595,7 @@ mpdcch_sf_condition(eNB_MAC_INST * eNB, int CC_id, frame_t frameP, ...@@ -1792,9 +1595,7 @@ mpdcch_sf_condition(eNB_MAC_INST * eNB, int CC_id, frame_t frameP,
break; break;
case TYPEUESPEC: case TYPEUESPEC:
epdcch_setconfig_r11 = epdcch_setconfig_r11 =
eNB->UE_list.UE_template[CC_id][UE_id]. eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0];
physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.
choice.setup.setConfigToAddModList_r11->list.array[0];
AssertFatal(epdcch_setconfig_r11 != NULL, AssertFatal(epdcch_setconfig_r11 != NULL,
" epdcch_setconfig_r11 is null for UE specific \n"); " epdcch_setconfig_r11 is null for UE specific \n");
...@@ -1802,28 +1603,17 @@ mpdcch_sf_condition(eNB_MAC_INST * eNB, int CC_id, frame_t frameP, ...@@ -1802,28 +1603,17 @@ mpdcch_sf_condition(eNB_MAC_INST * eNB, int CC_id, frame_t frameP,
" ext2 doesn't exist in epdcch config ' \n"); " ext2 doesn't exist in epdcch config ' \n");
if (eNB->common_channels[CC_id].tdd_Config == NULL) //FDD if (eNB->common_channels[CC_id].tdd_Config == NULL) //FDD
T = rmax * T = rmax *startSF_fdd_RA_times2[epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.fdd_r13] >> 1;
startSF_fdd_RA_times2[epdcch_setconfig_r11->
ext2->mpdcch_config_r13->choice.
setup.mpdcch_StartSF_UESS_r13.choice.
fdd_r13] >> 1;
else //TDD else //TDD
T = rmax * T = rmax *startSF_tdd_RA[epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.tdd_r13];
startSF_tdd_RA[epdcch_setconfig_r11->
ext2->mpdcch_config_r13->choice.
setup.mpdcch_StartSF_UESS_r13.choice.
tdd_r13];
break; break;
default: default:
return (0); return (0);
} }
AssertFatal(T > 0, "T is 0!\n"); AssertFatal(T > 0, "T is 0!\n");
if (((10 * frameP) + subframeP) % T == 0) if (((10 * frameP) + subframeP) % T == 0) return (1);
return (1); else return (0);
else
return (0);
} }
int narrowband_to_first_rb(COMMON_channels_t * cc, int nb_index) int narrowband_to_first_rb(COMMON_channels_t * cc, int nb_index)
...@@ -1974,31 +1764,6 @@ boolean_t is_UE_active(module_id_t mod_idP, int ue_idP) ...@@ -1974,31 +1764,6 @@ boolean_t is_UE_active(module_id_t mod_idP, int ue_idP)
return (RC.mac[mod_idP]->UE_list.active[ue_idP]); return (RC.mac[mod_idP]->UE_list.active[ue_idP]);
} }
/*
uint8_t find_active_UEs(module_id_t module_idP,int CC_id){
module_id_t ue_mod_id = 0;
rnti_t rnti = 0;
uint8_t nb_active_ue = 0;
for (ue_mod_id=0;ue_mod_id<NUMBER_OF_UE_MAX;ue_mod_id++) {
if (((rnti=eNB_mac_inst[module_idP][CC_id].UE_template[ue_mod_id].rnti) !=0)&&(eNB_mac_inst[module_idP][CC_id].UE_template[ue_mod_id].ul_active==TRUE)){
if (mac_xface->get_eNB_UE_stats(module_idP,rnti) != NULL){ // check at the phy enb_ue state for this rnti
nb_active_ue++;
}
else { // this ue is removed at the phy => remove it at the mac as well
mac_remove_ue(module_idP, CC_id, ue_mod_id);
}
}
}
return(nb_active_ue);
}
*/
// get aggregation (L) form phy for a give UE
unsigned char unsigned char
get_aggregation(uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt) get_aggregation(uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt)
{ {
...@@ -2096,6 +1861,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP ...@@ -2096,6 +1861,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP
sizeof(eNB_UE_STATS)); sizeof(eNB_UE_STATS));
UE_list->UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0; UE_list->UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0;
UE_list->UE_sched_ctrl[UE_id].ta_update = 31; UE_list->UE_sched_ctrl[UE_id].ta_update = 31;
for (j = 0; j < 8; j++) { for (j = 0; j < 8; j++) {
...@@ -2124,6 +1890,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP ...@@ -2124,6 +1890,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP
int rrc_mac_remove_ue(module_id_t mod_idP, rnti_t rntiP) int rrc_mac_remove_ue(module_id_t mod_idP, rnti_t rntiP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
int i; int i;
int j; int j;
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
...@@ -2352,119 +2119,6 @@ void swap_UEs(UE_list_t * listP, int nodeiP, int nodejP, int ul_flag) ...@@ -2352,119 +2119,6 @@ void swap_UEs(UE_list_t * listP, int nodeiP, int nodejP, int ul_flag)
dump_ue_list(listP, ul_flag); dump_ue_list(listP, ul_flag);
} }
/*
#if defined(Rel10) || defined(Rel14)
unsigned char generate_mch_header( unsigned char *mac_header,
unsigned char num_sdus,
unsigned short *sdu_lengths,
unsigned char *sdu_lcids,
unsigned char msi,
unsigned char short_padding,
unsigned short post_padding) {
SCH_SUBHEADER_FIXED *mac_header_ptr = (SCH_SUBHEADER_FIXED *)mac_header;
uint8_t first_element=0,last_size=0,i;
uint8_t mac_header_control_elements[2*num_sdus],*ce_ptr;
ce_ptr = &mac_header_control_elements[0];
if ((short_padding == 1) || (short_padding == 2)) {
mac_header_ptr->R = 0;
mac_header_ptr->E = 0;
mac_header_ptr->LCID = SHORT_PADDING;
first_element=1;
last_size=1;
}
if (short_padding == 2) {
mac_header_ptr->E = 1;
mac_header_ptr++;
mac_header_ptr->R = 0;
mac_header_ptr->E = 0;
mac_header_ptr->LCID = SHORT_PADDING;
last_size=1;
}
// SUBHEADER for MSI CE
if (msi != 0) {// there is MSI MAC Control Element
if (first_element>0) {
mac_header_ptr->E = 1;
mac_header_ptr+=last_size;
}
else {
first_element = 1;
}
if (num_sdus*2 < 128) {
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->R = 0;
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->E = 0;
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F = 0;
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->LCID = MCH_SCHDL_INFO;
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->L = num_sdus*2;
last_size=2;
}
else {
((SCH_SUBHEADER_LONG *)mac_header_ptr)->R = 0;
((SCH_SUBHEADER_LONG *)mac_header_ptr)->E = 0;
((SCH_SUBHEADER_LONG *)mac_header_ptr)->F = 1;
((SCH_SUBHEADER_LONG *)mac_header_ptr)->LCID = MCH_SCHDL_INFO;
((SCH_SUBHEADER_LONG *)mac_header_ptr)->L = (num_sdus*2)&0x7fff;
last_size=3;
}
// Create the MSI MAC Control Element here
}
// SUBHEADER for MAC SDU (MCCH+MTCHs)
for (i=0;i<num_sdus;i++) {
if (first_element>0) {
mac_header_ptr->E = 1;
mac_header_ptr+=last_size;
}
else {
first_element = 1;
}
if (sdu_lengths[i] < 128) {
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->R = 0;
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->E = 0;
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F = 0;
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->LCID = sdu_lcids[i];
((SCH_SUBHEADER_SHORT *)mac_header_ptr)->L = (unsigned char)sdu_lengths[i];
last_size=2;
}
else {
((SCH_SUBHEADER_LONG *)mac_header_ptr)->R = 0;
((SCH_SUBHEADER_LONG *)mac_header_ptr)->E = 0;
((SCH_SUBHEADER_LONG *)mac_header_ptr)->F = 1;
((SCH_SUBHEADER_LONG *)mac_header_ptr)->LCID = sdu_lcids[i];
((SCH_SUBHEADER_LONG *)mac_header_ptr)->L = (unsigned short) sdu_lengths[i]&0x7fff;
last_size=3;
}
}
if (post_padding>0) {// we have lots of padding at the end of the packet
mac_header_ptr->E = 1;
mac_header_ptr+=last_size;
// add a padding element
mac_header_ptr->R = 0;
mac_header_ptr->E = 0;
mac_header_ptr->LCID = SHORT_PADDING;
mac_header_ptr++;
}
else { // no end of packet padding
// last SDU subhead is of fixed type (sdu length implicitly to be computed at UE)
mac_header_ptr++;
}
// Copy MSI Control Element to the end of the MAC Header if it presents
if ((ce_ptr-mac_header_control_elements) > 0) {
// printf("Copying %d bytes for control elements\n",ce_ptr-mac_header_control_elements);
memcpy((void*)mac_header_ptr,mac_header_control_elements,ce_ptr-mac_header_control_elements);
mac_header_ptr+=(unsigned char)(ce_ptr-mac_header_control_elements);
}
return((unsigned char*)mac_header_ptr - mac_header);
}
#endif
*/
// This has to be updated to include BSR information // This has to be updated to include BSR information
uint8_t uint8_t
UE_is_to_be_scheduled(module_id_t module_idP, int CC_id, uint8_t UE_id) UE_is_to_be_scheduled(module_id_t module_idP, int CC_id, uint8_t UE_id)
...@@ -3204,8 +2858,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3204,8 +2858,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max = get_nCCE_max(&RC.mac[module_idP]->
get_nCCE_max(&RC.mac[module_idP]->
common_channels[CC_idP], common_channels[CC_idP],
DL_req->number_pdcch_ofdm_symbols, DL_req->number_pdcch_ofdm_symbols,
subframeP); subframeP);
...@@ -3213,9 +2866,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3213,9 +2866,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
} // fCCE==-1 } // fCCE==-1
// the allocation is feasible, rnti rule passes // the allocation is feasible, rnti rule passes
nCCE += nCCE += dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level;
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.
aggregation_level;
LOG_D(MAC, "Allocating at nCCE %d\n", fCCE); LOG_D(MAC, "Allocating at nCCE %d\n", fCCE);
if (test_onlyP == 0) { if (test_onlyP == 0) {
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = fCCE; dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = fCCE;
...@@ -3244,9 +2895,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3244,9 +2895,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level, hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level,
nCCE, nCCE_max, DL_req->number_pdcch_ofdm_symbols); nCCE, nCCE_max, DL_req->number_pdcch_ofdm_symbols);
if (nCCE + if (nCCE + (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level) > nCCE_max) {
(hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level) >
nCCE_max) {
if (DL_req->number_pdcch_ofdm_symbols == 3) if (DL_req->number_pdcch_ofdm_symbols == 3)
goto failed; goto failed;
LOG_D(MAC, LOG_D(MAC,
...@@ -3255,8 +2904,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3255,8 +2904,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max =
get_nCCE_max(&RC.mac[module_idP]-> get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],
common_channels[CC_idP],
DL_req->number_pdcch_ofdm_symbols, DL_req->number_pdcch_ofdm_symbols,
subframeP); subframeP);
goto try_again; goto try_again;
...@@ -3280,8 +2928,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3280,8 +2928,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
LOG_D(MAC, LOG_D(MAC,
"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", "DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
j, j,
DL_req->number_dci + DL_req->number_dci + HI_DCI0_req->number_of_dci,
HI_DCI0_req->number_of_dci,
DL_req->number_dci, DL_req->number_dci,
HI_DCI0_req->number_of_dci, HI_DCI0_req->number_of_dci,
hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.rnti, hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.rnti,
...@@ -3301,8 +2948,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3301,8 +2948,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max =
get_nCCE_max(&RC.mac[module_idP]-> get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],
common_channels[CC_idP],
DL_req->number_pdcch_ofdm_symbols, DL_req->number_pdcch_ofdm_symbols,
subframeP); subframeP);
goto try_again; goto try_again;
...@@ -3334,9 +2980,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3334,9 +2980,7 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
dci_dl_pdu_rel8.aggregation_level, nCCE, nCCE_max, dci_dl_pdu_rel8.aggregation_level, nCCE, nCCE_max,
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
if (nCCE + if (nCCE + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) {
(dl_config_pdu[i].dci_dl_pdu.
dci_dl_pdu_rel8.aggregation_level) > nCCE_max) {
if (DL_req->number_pdcch_ofdm_symbols == 3) if (DL_req->number_pdcch_ofdm_symbols == 3)
goto failed; goto failed;
LOG_D(MAC, LOG_D(MAC,
...@@ -3344,20 +2988,15 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3344,20 +2988,15 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],
get_nCCE_max(&RC.mac[module_idP]->
common_channels[CC_idP],
DL_req->number_pdcch_ofdm_symbols, DL_req->number_pdcch_ofdm_symbols,
subframeP); subframeP);
goto try_again; goto try_again;
} }
// number of CCEs left can potentially hold this allocation // number of CCEs left can potentially hold this allocation
fCCE = get_nCCE_offset(CCE_table, fCCE = get_nCCE_offset(CCE_table,
dl_config_pdu[i]. dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, nCCE_max, 0,
dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti,
aggregation_level, nCCE_max, 0,
dl_config_pdu[i].
dci_dl_pdu.dci_dl_pdu_rel8.rnti,
subframeP); subframeP);
if (fCCE == -1) { if (fCCE == -1) {
if (DL_req->number_pdcch_ofdm_symbols == 3) { if (DL_req->number_pdcch_ofdm_symbols == 3) {
...@@ -3367,22 +3006,19 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3367,22 +3006,19 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.
rnti); rnti);
for (j = 0; j <= i; j++) { for (j = 0; j <= i; j++) {
if (dl_config_pdu[j].pdu_type == if (dl_config_pdu[j].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)
NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)
LOG_I(MAC, LOG_I(MAC,
"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", "DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
j, j,
DL_req->number_dci + DL_req->number_dci + HI_DCI0_req->number_of_dci,
HI_DCI0_req->number_of_dci,
DL_req->number_dci, DL_req->number_dci,
HI_DCI0_req->number_of_dci, HI_DCI0_req->number_of_dci,
dl_config_pdu[j]. dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.rnti,
dci_dl_pdu.dci_dl_pdu_rel8.rnti, dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.dci_format,
dl_config_pdu[j]. dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.
dci_dl_pdu.dci_dl_pdu_rel8.dci_format, aggregation_level,
dl_config_pdu[j]. nCCE,
dci_dl_pdu.dci_dl_pdu_rel8. nCCE_max,
aggregation_level, nCCE, nCCE_max,
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
} }
//dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L);
...@@ -3394,17 +3030,14 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3394,17 +3030,14 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max =
get_nCCE_max(&RC.mac[module_idP]-> get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],
common_channels[CC_idP],
DL_req->number_pdcch_ofdm_symbols, DL_req->number_pdcch_ofdm_symbols,
subframeP); subframeP);
goto try_again; goto try_again;
} // fCCE==-1 } // fCCE==-1
// the allocation is feasible, rnti rule passes // the allocation is feasible, rnti rule passes
nCCE += nCCE += dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level;
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.
aggregation_level;
LOG_D(MAC, "Allocating at nCCE %d\n", fCCE); LOG_D(MAC, "Allocating at nCCE %d\n", fCCE);
if (test_onlyP == 0) { if (test_onlyP == 0) {
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = fCCE; dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = fCCE;
...@@ -3421,43 +3054,6 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP) ...@@ -3421,43 +3054,6 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
return -1; return -1;
} }
/*
uint8_t get_ul_req_index(module_id_t module_idP, int CC_idP, sub_frame_t subframeP)
{
if (RC.mac[module_idP]->common_channels[CC_idP].tdd_Config == NULL)
return(0);
switch (RC.mac[module_idP]->common_channels[CC_idP].tdd_Config->subframeAssignment) {
case 0:
case 1:
case 2:
case 6:
return(0);
case 3:
// 1,5,6 -> 2, prog. 8, buffer 0
// 7,8 -> 3, prog. 9, buffer 1
// 9,0 -> 4, prog. 0, buffer 0
if ((subframeP == 7) || (subframeP == 8)) return(1);
else return(0);
case 4:
// 0,1,4,5 -> 2, prog. 8, buffer 0
// 6,7,8,9 -> 3, prog. 9, buffer 1
if (subframeP<6) return(0);
else return(1);
return(1);
break;
case 5:
// 9(-1),0,1,3,4,5,6,7,8,9 -> 2, prog 8, buffer 0
return(0);
break;
default:
AssertFatal(1==0,"Should not get here, why is tdd_Config->subframeAssignment = %d\n",(int)RC.mac[module_idP]->common_channels[CC_idP].tdd_Config->subframeAssignment);
break;
}
return(0);
}
*/
nfapi_ul_config_request_pdu_t *has_ul_grant(module_id_t module_idP, nfapi_ul_config_request_pdu_t *has_ul_grant(module_id_t module_idP,
int CC_idP, uint16_t absSFP, int CC_idP, uint16_t absSFP,
uint16_t rnti) uint16_t rnti)
...@@ -3465,84 +3061,57 @@ nfapi_ul_config_request_pdu_t *has_ul_grant(module_id_t module_idP, ...@@ -3465,84 +3061,57 @@ nfapi_ul_config_request_pdu_t *has_ul_grant(module_id_t module_idP,
nfapi_ul_config_request_body_t *ul_req; nfapi_ul_config_request_body_t *ul_req;
nfapi_ul_config_request_pdu_t *ul_config_pdu; nfapi_ul_config_request_pdu_t *ul_config_pdu;
ul_req = ul_req = &RC.mac[module_idP]->UL_req_tmp[CC_idP][absSFP % 10].ul_config_request_body;
&RC.mac[module_idP]->UL_req_tmp[CC_idP][absSFP %
10].ul_config_request_body;
ul_config_pdu = &ul_req->ul_config_pdu_list[0]; ul_config_pdu = &ul_req->ul_config_pdu_list[0];
LOG_D(MAC, LOG_D(MAC,
"Checking for rnti %x UL grant in subframeP %d (num pdu %d)\n", "Checking for rnti %x UL grant in subframeP %d (num pdu %d)\n",
rnti, absSFP % 10, ul_req->number_of_pdus); rnti, absSFP % 10, ul_req->number_of_pdus);
for (int i = 0; i < ul_req->number_of_pdus; i++) { for (int i = 0; i < ul_req->number_of_pdus; i++) {
LOG_D(MAC, "PDU %d : type %d,rnti %x\n", i, LOG_D(MAC, "PDU %d : type %d,rnti %x\n", i,ul_config_pdu[i].pdu_type, rnti);
ul_config_pdu[i].pdu_type, rnti);
if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)
&& (ul_config_pdu[i].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) && (ul_config_pdu[i].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)
NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) && (ul_config_pdu[i].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
&& (ul_config_pdu[i].ulsch_cqi_ri_pdu.ulsch_pdu.
ulsch_pdu_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)
NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) && (ul_config_pdu[i].ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
&& (ul_config_pdu[i].ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.
rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)
NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE) && (ul_config_pdu[i].ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
&& (ul_config_pdu[i].ulsch_cqi_harq_ri_pdu.
ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE)
&& (ul_config_pdu[i].uci_cqi_pdu. && (ul_config_pdu[i].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti))
ue_information.ue_information_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE)
&& (ul_config_pdu[i].uci_sr_pdu. && (ul_config_pdu[i].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti))
ue_information.ue_information_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)
NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) && (ul_config_pdu[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti))
&& (ul_config_pdu[i].uci_harq_pdu.
ue_information.ue_information_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE)
NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) && (ul_config_pdu[i].uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti == rnti))
&& (ul_config_pdu[i].uci_sr_harq_pdu.
ue_information.ue_information_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE)
NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) && (ul_config_pdu[i].uci_cqi_harq_pdu.ue_information.ue_information_rel8.rnti == rnti))
&& (ul_config_pdu[i].uci_cqi_harq_pdu.
ue_information.ue_information_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE)
NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) && (ul_config_pdu[i].uci_cqi_sr_pdu.ue_information.ue_information_rel8.rnti == rnti))
&& (ul_config_pdu[i].uci_cqi_sr_pdu.
ue_information.ue_information_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE)
NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE) && (ul_config_pdu[i].uci_cqi_sr_harq_pdu.ue_information.ue_information_rel8.rnti == rnti))
&& (ul_config_pdu[i].uci_cqi_sr_harq_pdu.
ue_information.ue_information_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE)
NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE) && (ul_config_pdu[i].ulsch_uci_csi_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
&& (ul_config_pdu[i].ulsch_uci_csi_pdu.
ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE)
NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE) && (ul_config_pdu[i].ulsch_uci_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
&& (ul_config_pdu[i].ulsch_uci_harq_pdu.
ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
if ((ul_config_pdu[i].pdu_type == if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE)
NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE) && (ul_config_pdu[i].ulsch_csi_uci_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
&& (ul_config_pdu[i].ulsch_csi_uci_harq_pdu.
ulsch_pdu.ulsch_pdu_rel8.rnti == rnti))
return (&ul_config_pdu[i]); return (&ul_config_pdu[i]);
} }
...@@ -3555,15 +3124,10 @@ CCE_allocation_infeasible(int module_idP, ...@@ -3555,15 +3124,10 @@ CCE_allocation_infeasible(int module_idP,
int format_flag, int format_flag,
int subframe, int aggregation, int rnti) int subframe, int aggregation, int rnti)
{ {
nfapi_dl_config_request_body_t *DL_req = nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body;
&RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body; nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu];
nfapi_dl_config_request_pdu_t *dl_config_pdu = nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body;
&DL_req->dl_config_pdu_list[DL_req->number_pdu]; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi];
nfapi_hi_dci0_request_body_t *HI_DCI0_req =
&RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu =
&HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci +
HI_DCI0_req->number_of_hi];
int ret; int ret;
boolean_t res = FALSE; boolean_t res = FALSE;
...@@ -3576,10 +3140,8 @@ CCE_allocation_infeasible(int module_idP, ...@@ -3576,10 +3140,8 @@ CCE_allocation_infeasible(int module_idP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = (format_flag == 0) ? 2 : 1;
(format_flag == 0) ? 2 : 1; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level =
aggregation;
DL_req->number_pdu++; DL_req->number_pdu++;
LOG_D(MAC, LOG_D(MAC,
"Subframe %d: Checking CCE feasibility format %d : (%x,%d) (%x,%d,%d)\n", "Subframe %d: Checking CCE feasibility format %d : (%x,%d) (%x,%d,%d)\n",
...@@ -3589,13 +3151,11 @@ CCE_allocation_infeasible(int module_idP, ...@@ -3589,13 +3151,11 @@ CCE_allocation_infeasible(int module_idP,
aggregation_level, aggregation_level,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type);
ret = allocate_CCEs(module_idP, CC_idP, subframe, 0); ret = allocate_CCEs(module_idP, CC_idP, subframe, 0);
if (ret == -1) if (ret == -1) res = TRUE;
res = TRUE;
DL_req->number_pdu--; DL_req->number_pdu--;
} }
} else { // ue-specific UL DCI } else { // ue-specific UL DCI
if (HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi == if (HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi == MAX_NUM_HI_DCI0_PDU) {
MAX_NUM_HI_DCI0_PDU) {
LOG_W(MAC, LOG_W(MAC,
"Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n", "Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n",
subframe, rnti); subframe, rnti);
...@@ -3603,12 +3163,10 @@ CCE_allocation_infeasible(int module_idP, ...@@ -3603,12 +3163,10 @@ CCE_allocation_infeasible(int module_idP,
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation;
aggregation;
HI_DCI0_req->number_of_dci++; HI_DCI0_req->number_of_dci++;
ret = allocate_CCEs(module_idP, CC_idP, subframe, 0); ret = allocate_CCEs(module_idP, CC_idP, subframe, 0);
if (ret == -1) if (ret == -1) res = TRUE;
res = TRUE;
HI_DCI0_req->number_of_dci--; HI_DCI0_req->number_of_dci--;
} }
} }
...@@ -3639,17 +3197,9 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -3639,17 +3197,9 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
if (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated != NULL && if (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated != NULL &&
UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL && UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL &&
(UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7) (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7)
&& (UE_list->UE_template[pCCid][UE_id]. && (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13)
physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13) && (((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->spatialBundlingPUCCH_r13) && (format == 0))
&& || ((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->spatialBundlingPUSCH_r13)
(((UE_list->UE_template[pCCid][UE_id].
physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->
spatialBundlingPUCCH_r13)
&& (format == 0))
||
((UE_list->UE_template[pCCid][UE_id].
physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->
spatialBundlingPUSCH_r13)
&& (format == 1)))) && (format == 1))))
spatial_bundling = 1; spatial_bundling = 1;
#endif #endif
...@@ -3658,8 +3208,7 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -3658,8 +3208,7 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
tmode[i] = get_tmode(mod_idP, i, UE_id); tmode[i] = get_tmode(mod_idP, i, UE_id);
if (cc->tdd_Config) { if (cc->tdd_Config) {
harq_indication_tdd = harq_indication_tdd = (nfapi_harq_indication_tdd_rel13_t *) harq_indication;
(nfapi_harq_indication_tdd_rel13_t *) harq_indication;
// pdu = &harq_indication_tdd->harq_tb_n[0]; // pdu = &harq_indication_tdd->harq_tb_n[0];
num_ack_nak = harq_indication_tdd->number_of_ack_nack; num_ack_nak = harq_indication_tdd->number_of_ack_nack;
...@@ -3680,8 +3229,7 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -3680,8 +3229,7 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
break; break;
} }
} else { } else {
harq_indication_fdd = harq_indication_fdd = (nfapi_harq_indication_fdd_rel13_t *) harq_indication;
(nfapi_harq_indication_fdd_rel13_t *) harq_indication;
num_ack_nak = harq_indication_fdd->number_of_ack_nack; num_ack_nak = harq_indication_fdd->number_of_ack_nack;
pdu = &harq_indication_fdd->harq_tb_n[0]; pdu = &harq_indication_fdd->harq_tb_n[0];
...@@ -3969,26 +3517,18 @@ extract_pucch_csi(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -3969,26 +3517,18 @@ extract_pucch_csi(module_id_t mod_idP, int CC_idP, int UE_id,
uint8_t Jtab[6] = { 0, 2, 2, 3, 4, 4 }; uint8_t Jtab[6] = { 0, 2, 2, 3, 4, 4 };
int feedback_cnt; int feedback_cnt;
AssertFatal(UE_list->UE_template[CC_idP][UE_id]. AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL,
physicalConfigDedicated != NULL,
"physicalConfigDedicated is null for UE %d\n", UE_id); "physicalConfigDedicated is null for UE %d\n", UE_id);
AssertFatal(UE_list-> AssertFatal(UE_list->
UE_template[CC_idP][UE_id].physicalConfigDedicated-> UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL,
cqi_ReportConfig != NULL,
"cqi_ReportConfig is null for UE %d\n", UE_id); "cqi_ReportConfig is null for UE %d\n", UE_id);
AssertFatal((cqi_ReportPeriodic = AssertFatal((cqi_ReportPeriodic = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) != NULL,
UE_list->
UE_template[CC_idP][UE_id].physicalConfigDedicated->
cqi_ReportConfig->cqi_ReportPeriodic) != NULL,
"cqi_ReportPeriodic is null for UE %d\n", UE_id); "cqi_ReportPeriodic is null for UE %d\n", UE_id);
// determine feedback mode // determine feedback mode
AssertFatal(cqi_ReportPeriodic->present != AssertFatal(cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_NOTHING,
CQI_ReportPeriodic_PR_NOTHING,
"cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n"); "cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n");
AssertFatal(cqi_ReportPeriodic->choice. AssertFatal(cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present != CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING,
setup.cqi_FormatIndicatorPeriodic.present !=
CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING,
"cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n"); "cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n");
uint16_t Npd, N_OFFSET_CQI; uint16_t Npd, N_OFFSET_CQI;
...@@ -4023,9 +3563,7 @@ extract_pucch_csi(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -4023,9 +3563,7 @@ extract_pucch_csi(module_id_t mod_idP, int CC_idP, int UE_id,
no_pmi = 0; no_pmi = 0;
} }
if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic. if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI)
present ==
CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI)
|| (feedback_cnt == 0)) { || (feedback_cnt == 0)) {
// Note: This implements only Tables: 5.3.3.1-1,5.3.3.1-1A and 5.3.3.1-2 from 36.213 (1,2,4 antenna ports Wideband CQI/PMI) // Note: This implements only Tables: 5.3.3.1-1,5.3.3.1-1A and 5.3.3.1-2 from 36.213 (1,2,4 antenna ports Wideband CQI/PMI)
...@@ -4048,7 +3586,6 @@ extract_pucch_csi(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -4048,7 +3586,6 @@ extract_pucch_csi(module_id_t mod_idP, int CC_idP, int UE_id,
sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0] & 0xF; sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0] & 0xF;
sched_ctl->periodic_wideband_pmi[CC_idP] = sched_ctl->periodic_wideband_pmi[CC_idP] =
(pdu[0] >> 4) & 0x0F; (pdu[0] >> 4) & 0x0F;
} else if ((cc->p_eNB == 4) && (ri > 1)) { } else if ((cc->p_eNB == 4) && (ri > 1)) {
// p=4 Rank 2 wideband CQI/PMI 11 bits // p=4 Rank 2 wideband CQI/PMI 11 bits
sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0] & 0xF; sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0] & 0xF;
...@@ -4059,28 +3596,16 @@ extract_pucch_csi(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -4059,28 +3596,16 @@ extract_pucch_csi(module_id_t mod_idP, int CC_idP, int UE_id,
AssertFatal(1 == 0, AssertFatal(1 == 0,
"illegal combination p %d, ri %d, no_pmi %d\n", "illegal combination p %d, ri %d, no_pmi %d\n",
cc->p_eNB, ri, no_pmi); cc->p_eNB, ri, no_pmi);
} else if (cqi_ReportPeriodic->choice. } else if (cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI)
setup.cqi_FormatIndicatorPeriodic.present ==
CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI)
{ {
// This is Table 5.2.3.3.2-2 for 36.213 // This is Table 5.2.3.3.2-2 for 36.213
if (ri == 1) { if (ri == 1) {
//4+Ltab[cc->mib->message.dl_Bandwidth] bits //4+Ltab[cc->mib->message.dl_Bandwidth] bits
sched_ctl->periodic_subband_cqi[CC_idP][(bandwidth_part * L) + sched_ctl->periodic_subband_cqi[CC_idP][(bandwidth_part * L) +((pdu[0] >> 4) & Lmask)] = pdu[0] & 0xF;
((pdu[0] >> 4) &
Lmask)] =
pdu[0] & 0xF;
} else if (ri > 1) { } else if (ri > 1) {
//7+Ltab[cc->mib->message.dl_Bandwidth] bits; //7+Ltab[cc->mib->message.dl_Bandwidth] bits;
sched_ctl-> sched_ctl->periodic_subband_spatial_diffcqi[CC_idP][(bandwidth_part * L) + ((pdu[0] >> 7) & Lmask)] = (pdu[0] >> 4) & 7;
periodic_subband_spatial_diffcqi[CC_idP][(bandwidth_part * sched_ctl->periodic_subband_cqi[CC_idP][(bandwidth_part * L) + ((pdu[0] >> 7) & Lmask)] =
L) +
((pdu[0] >> 7) &
Lmask)] =
(pdu[0] >> 4) & 7;
sched_ctl->periodic_subband_cqi[CC_idP][(bandwidth_part * L) +
((pdu[0] >> 7) &
Lmask)] =
pdu[0] & 0xF; pdu[0] & 0xF;
} }
} }
...@@ -4104,17 +3629,11 @@ extract_pusch_csi(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -4104,17 +3629,11 @@ extract_pusch_csi(module_id_t mod_idP, int CC_idP, int UE_id,
int curbyte, curbit; int curbyte, curbit;
CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic; CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic;
AssertFatal(UE_list->UE_template[CC_idP][UE_id]. AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL,
physicalConfigDedicated != NULL,
"physicalConfigDedicated is null for UE %d\n", UE_id); "physicalConfigDedicated is null for UE %d\n", UE_id);
AssertFatal(UE_list-> AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL,
UE_template[CC_idP][UE_id].physicalConfigDedicated->
cqi_ReportConfig != NULL,
"cqi_ReportConfig is null for UE %d\n", UE_id); "cqi_ReportConfig is null for UE %d\n", UE_id);
AssertFatal((cqi_ReportModeAperiodic = AssertFatal((cqi_ReportModeAperiodic = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic) != NULL,
UE_list->
UE_template[CC_idP][UE_id].physicalConfigDedicated->
cqi_ReportConfig->cqi_ReportModeAperiodic) != NULL,
"cqi_ReportModeAperiodic is null for UE %d\n", UE_id); "cqi_ReportModeAperiodic is null for UE %d\n", UE_id);
int N = Ntab[cc->mib->message.dl_Bandwidth]; int N = Ntab[cc->mib->message.dl_Bandwidth];
...@@ -4128,54 +3647,43 @@ extract_pusch_csi(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -4128,54 +3647,43 @@ extract_pusch_csi(module_id_t mod_idP, int CC_idP, int UE_id,
case CQI_ReportModeAperiodic_rm12: case CQI_ReportModeAperiodic_rm12:
AssertFatal(0 == 1, "to be fixed, don't use p but pdu directly\n"); AssertFatal(0 == 1, "to be fixed, don't use p but pdu directly\n");
// wideband multiple PMI (TM4/6), Table 5.2.2.6.1-1 (for TM4/6) // wideband multiple PMI (TM4/6), Table 5.2.2.6.1-1 (for TM4/6)
AssertFatal(tmode == 4 || tmode == 6 || tmode == 8 || tmode == 9 AssertFatal(tmode == 4 || tmode == 6 || tmode == 8 || tmode == 9 || tmode == 10,
|| tmode == 10,
"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm12\n", "Illegal transmission mode %d for CQI_ReportModeAperiodic_rm12\n",
tmode); tmode);
if (tmode <= 6) { //Table 5.2.2.6.1-1 36.213 if (tmode <= 6) { //Table 5.2.2.6.1-1 36.213
if ((ri == 1) && (cc->p_eNB == 2)) { if ((ri == 1) && (cc->p_eNB == 2)) {
sched_ctl->aperiodic_wideband_cqi0[CC_idP] = sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t) (p & 0x0F);
(uint8_t) (p & 0x0F);
p >>= 4; p >>= 4;
for (i = 0; i < N; i++) { for (i = 0; i < N; i++) {
sched_ctl->aperiodic_subband_pmi[CC_idP][i] = sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t) (p & 0x03);
(uint8_t) (p & 0x03);
p >>= 2; p >>= 2;
} }
} }
if ((ri == 2) && (cc->p_eNB == 2)) { if ((ri == 2) && (cc->p_eNB == 2)) {
sched_ctl->aperiodic_wideband_cqi0[CC_idP] = sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t) (p & 0x0F);
(uint8_t) (p & 0x0F);
p >>= 4; p >>= 4;
sched_ctl->aperiodic_wideband_cqi1[CC_idP] = sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t) (p & 0x0F);
(uint8_t) (p & 0x0F);
p >>= 4; p >>= 4;
for (i = 0; i < N; i++) { for (i = 0; i < N; i++) {
sched_ctl->aperiodic_subband_pmi[CC_idP][i] = sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t) (p & 0x01);
(uint8_t) (p & 0x01);
p >>= 1; p >>= 1;
} }
} }
if ((ri == 1) && (cc->p_eNB == 4)) { if ((ri == 1) && (cc->p_eNB == 4)) {
sched_ctl->aperiodic_wideband_cqi0[CC_idP] = sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t) (p & 0x0F);
(uint8_t) (p & 0x0F);
p >>= 4; p >>= 4;
for (i = 0; i < N; i++) { for (i = 0; i < N; i++) {
sched_ctl->aperiodic_subband_pmi[CC_idP][i] = sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t) (p & 0x03);
(uint8_t) (p & 0x03);
p >>= 4; p >>= 4;
} }
} }
if ((ri == 2) && (cc->p_eNB == 4)) { if ((ri == 2) && (cc->p_eNB == 4)) {
sched_ctl->aperiodic_wideband_cqi0[CC_idP] = sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t) (p & 0x0F);
(uint8_t) (p & 0x0F);
p >>= 4; p >>= 4;
sched_ctl->aperiodic_wideband_cqi1[CC_idP] = sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t) (p & 0x0F);
(uint8_t) (p & 0x0F);
p >>= 4; p >>= 4;
for (i = 0; i < N; i++) { for (i = 0; i < N; i++) {
sched_ctl->aperiodic_subband_pmi[CC_idP][i] = sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t) (p & 0x01);
(uint8_t) (p & 0x01);
p >>= 4; p >>= 4;
} }
} }
......
...@@ -74,7 +74,7 @@ extern uint8_t nfapi_mode; ...@@ -74,7 +74,7 @@ extern uint8_t nfapi_mode;
uint8_t rb_table[34] = uint8_t rb_table[34] =
{ 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, { 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32,
36, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80, 81, 90, 96, 100 36, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80, 81, 90, 96, 100
}; };
void void
rx_sdu(const module_id_t enb_mod_idP, rx_sdu(const module_id_t enb_mod_idP,
...@@ -132,20 +132,16 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -132,20 +132,16 @@ rx_sdu(const module_id_t enb_mod_idP,
if (sduP != NULL) { if (sduP != NULL) {
UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0;
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0;
UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1 << harq_pid));
(~(1 << harq_pid));
/* Update with smoothing: 3/4 of old value and 1/4 of new. /* Update with smoothing: 3/4 of old value and 1/4 of new.
* This is the logic that was done in the function * This is the logic that was done in the function
* lte_est_timing_advance_pusch, maybe it's not necessary? * lte_est_timing_advance_pusch, maybe it's not necessary?
* maybe it's even not correct at all? * maybe it's even not correct at all?
*/ */
UE_list->UE_sched_ctrl[UE_id].ta_update = UE_list->UE_sched_ctrl[UE_id].ta_update = (UE_list->UE_sched_ctrl[UE_id].ta_update * 3 + timing_advance) / 4;
(UE_list->UE_sched_ctrl[UE_id].ta_update * 3 +
timing_advance) / 4;
UE_list->UE_sched_ctrl[UE_id].pusch_snr[CC_idP] = ul_cqi; UE_list->UE_sched_ctrl[UE_id].pusch_snr[CC_idP] = ul_cqi;
UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors = 0; UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors = 0;
first_rb = first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid];
UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid];
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) {
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 0; UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 0;
...@@ -161,14 +157,10 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -161,14 +157,10 @@ rx_sdu(const module_id_t enb_mod_idP,
ul_cqi); ul_cqi);
// AssertFatal(1==0,"ulsch in error\n"); // AssertFatal(1==0,"ulsch in error\n");
if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == 3) {
3) { UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1 << harq_pid));
UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0;
(~(1 << harq_pid)); if (UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors++ == 10)
UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] =
0;
if (UE_list->UE_sched_ctrl[UE_id].
ul_consecutive_errors++ == 10)
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 1; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 1;
} else } else
UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]++; UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]++;
...@@ -199,22 +191,17 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -199,22 +191,17 @@ rx_sdu(const module_id_t enb_mod_idP,
(int) mac->common_channels[CC_idP]. (int) mac->common_channels[CC_idP].
radioResourceConfigCommon->rach_ConfigCommon. radioResourceConfigCommon->rach_ConfigCommon.
maxHARQ_Msg3Tx); maxHARQ_Msg3Tx);
if (ra[RA_id].msg3_round == if (ra[RA_id].msg3_round == mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx - 1) {
mac->common_channels[CC_idP].radioResourceConfigCommon->
rach_ConfigCommon.maxHARQ_Msg3Tx - 1) {
cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti); cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti);
} }
else { else {
first_rb = first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid];
UE_list->UE_template[CC_idP][UE_id].
first_rb_ul[harq_pid];
ra[RA_id].msg3_round++; ra[RA_id].msg3_round++;
// prepare handling of retransmission // prepare handling of retransmission
ra[RA_id].Msg3_frame = (ra[RA_id].Msg3_frame + ((ra[RA_id].Msg3_subframe > 1) ? 1 : 0)) % 1024; ra[RA_id].Msg3_frame = (ra[RA_id].Msg3_frame + ((ra[RA_id].Msg3_subframe > 1) ? 1 : 0)) % 1024;
ra[RA_id].Msg3_subframe = (ra[RA_id].Msg3_subframe + 8) % 10; ra[RA_id].Msg3_subframe = (ra[RA_id].Msg3_subframe + 8) % 10;
add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP, add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP, subframeP);
subframeP);
} }
return; return;
} }
...@@ -224,9 +211,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -224,9 +211,7 @@ rx_sdu(const module_id_t enb_mod_idP,
current_rnti); current_rnti);
return; return;
} }
payload_ptr = payload_ptr = parse_ulsch_header(sduP, &num_ce, &num_sdu, rx_ces, rx_lcids, rx_lengths, sdu_lenP);
parse_ulsch_header(sduP, &num_ce, &num_sdu, rx_ces, rx_lcids,
rx_lengths, sdu_lenP);
T(T_ENB_MAC_UE_UL_PDU, T_INT(enb_mod_idP), T_INT(CC_idP), T(T_ENB_MAC_UE_UL_PDU, T_INT(enb_mod_idP), T_INT(CC_idP),
T_INT(current_rnti), T_INT(frameP), T_INT(subframeP), T_INT(current_rnti), T_INT(frameP), T_INT(subframeP),
...@@ -322,38 +307,23 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -322,38 +307,23 @@ rx_sdu(const module_id_t enb_mod_idP,
payload_ptr[0] & 0x3f); payload_ptr[0] & 0x3f);
if (UE_id != -1) { if (UE_id != -1) {
UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f);
(payload_ptr[0] & 0x3f);
// update buffer info // update buffer info
UE_list->UE_template[CC_idP][UE_id]. UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid] = BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid]];
ul_buffer_info[lcgid] =
BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].
bsr_info[lcgid]];
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid];
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_info[lcgid];
RC.eNB[enb_mod_idP][CC_idP]-> RC.eNB[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP * 10) + subframeP] = (payload_ptr[0] & 0x3f);
pusch_stats_bsr[UE_id][(frameP * 10) + subframeP]
= (payload_ptr[0] & 0x3f);
if (UE_id == UE_list->head) if (UE_id == UE_list->head)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,
(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,
RC.eNB[enb_mod_idP][CC_idP]->pusch_stats_bsr RC.eNB[enb_mod_idP][CC_idP]->pusch_stats_bsr
[UE_id][(frameP * 10) + subframeP]); [UE_id][(frameP * 10) + subframeP]);
if (UE_list->UE_template[CC_idP][UE_id]. if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0) {
ul_buffer_creation_time[lcgid] UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] = frameP;
== 0) { }
UE_list->UE_template[CC_idP] if (mac_eNB_get_rrc_status(enb_mod_idP,UE_RNTI(enb_mod_idP, UE_id)) < RRC_CONNECTED)
[UE_id].ul_buffer_creation_time[lcgid] =
frameP;
}
if (mac_eNB_get_rrc_status
(enb_mod_idP,
UE_RNTI(enb_mod_idP, UE_id)) < RRC_CONNECTED)
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n", "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n",
enb_mod_idP, CC_idP, rx_ces[i], enb_mod_idP, CC_idP, rx_ces[i],
...@@ -370,90 +340,44 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -370,90 +340,44 @@ rx_sdu(const module_id_t enb_mod_idP,
case LONG_BSR: case LONG_BSR:
if (UE_id != -1) { if (UE_id != -1) {
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] = UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] = ((payload_ptr[0] & 0xFC) >> 2);
((payload_ptr[0] & 0xFC) >> 2); UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1] = ((payload_ptr[0] & 0x03) << 4) | ((payload_ptr[1] & 0xF0) >> 4);
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1] = UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2] = ((payload_ptr[1] & 0x0F) << 2) | ((payload_ptr[2] & 0xC0) >> 6);
((payload_ptr[0] & 0x03) << 4) | UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3] = (payload_ptr[2] & 0x3F);
((payload_ptr[1] & 0xF0) >> 4);
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2] =
((payload_ptr[1] & 0x0F) << 2) |
((payload_ptr[2] & 0xC0) >> 6);
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3] =
(payload_ptr[2] & 0x3F);
// update buffer info // update buffer info
old_buffer_info = old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0];
UE_list->UE_template[CC_idP][UE_id]. UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0] = BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0]];
ul_buffer_info[LCGID0];
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_info[LCGID0] =
BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].
bsr_info[LCGID0]];
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer += UE_list->UE_template[CC_idP][UE_id].ul_total_buffer += UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0];
UE_list->UE_template[CC_idP][UE_id]. if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
ul_buffer_info[LCGID0]; UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >=
old_buffer_info)
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -=
old_buffer_info;
else else
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
0;
old_buffer_info = old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1];
UE_list->UE_template[CC_idP][UE_id]. UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1] = BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1]];
ul_buffer_info[LCGID1]; UE_list->UE_template[CC_idP][UE_id].ul_total_buffer += UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1];
UE_list->UE_template[CC_idP][UE_id]. if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -=
ul_buffer_info[LCGID1] =
BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].
bsr_info[LCGID1]];
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer +=
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_info[LCGID1];
if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >=
old_buffer_info)
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -=
old_buffer_info; old_buffer_info;
else else
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
0;
old_buffer_info = old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2];
UE_list->UE_template[CC_idP][UE_id]. UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2] = BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2]];
ul_buffer_info[LCGID2]; UE_list->UE_template[CC_idP][UE_id].ul_total_buffer += UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2];
UE_list->UE_template[CC_idP][UE_id]. if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
ul_buffer_info[LCGID2] = UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].
bsr_info[LCGID2]];
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer +=
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_info[LCGID2];
if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >=
old_buffer_info)
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -=
old_buffer_info;
else else
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
0;
old_buffer_info = old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3];
UE_list->UE_template[CC_idP][UE_id]. UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3] = BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]];
ul_buffer_info[LCGID3]; UE_list->UE_template[CC_idP][UE_id].ul_total_buffer += UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3];
UE_list->UE_template[CC_idP][UE_id]. if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
ul_buffer_info[LCGID3] = UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].
bsr_info[LCGID3]];
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer +=
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_info[LCGID3];
if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >=
old_buffer_info)
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -=
old_buffer_info;
else else
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
0;
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = " "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = "
...@@ -478,44 +402,28 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -478,44 +402,28 @@ rx_sdu(const module_id_t enb_mod_idP,
UE_list->UE_template[CC_idP][UE_id]. UE_list->UE_template[CC_idP][UE_id].
bsr_info[LCGID3]); bsr_info[LCGID3]);
if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] == if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] == 0) {
0) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID0] = 0;
UE_list->UE_template[CC_idP][UE_id]. } else if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID0] == 0) {
ul_buffer_creation_time[LCGID0] = 0; UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID0] = frameP;
} else if (UE_list->UE_template[CC_idP]
[UE_id].ul_buffer_creation_time[LCGID0] == 0) {
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_creation_time[LCGID0] = frameP;
} }
if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1] == if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1] == 0) {
0) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID1] = 0;
UE_list->UE_template[CC_idP][UE_id]. } else if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID1] == 0) {
ul_buffer_creation_time[LCGID1] = 0; UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID1] = frameP;
} else if (UE_list->UE_template[CC_idP]
[UE_id].ul_buffer_creation_time[LCGID1] == 0) {
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_creation_time[LCGID1] = frameP;
} }
if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2] == if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2] == 0) {
0) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID2] = 0;
UE_list->UE_template[CC_idP][UE_id]. } else if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID2] == 0) {
ul_buffer_creation_time[LCGID2] = 0; UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID2] = frameP;
} else if (UE_list->UE_template[CC_idP]
[UE_id].ul_buffer_creation_time[LCGID2] == 0) {
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_creation_time[LCGID2] = frameP;
} }
if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3] == if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3] == 0) {
0) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID3] = 0;
UE_list->UE_template[CC_idP][UE_id]. } else if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID3] == 0) {
ul_buffer_creation_time[LCGID3] = 0; UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID3] = frameP;
} else if (UE_list->UE_template[CC_idP]
[UE_id].ul_buffer_creation_time[LCGID3] == 0) {
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_creation_time[LCGID3] = frameP;
} }
} }
...@@ -558,10 +466,8 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -558,10 +466,8 @@ rx_sdu(const module_id_t enb_mod_idP,
enb_mod_idP, CC_idP, frameP, payload_ptr[0], enb_mod_idP, CC_idP, frameP, payload_ptr[0],
payload_ptr[1], payload_ptr[2], payload_ptr[3], payload_ptr[1], payload_ptr[2], payload_ptr[3],
payload_ptr[4], payload_ptr[5], current_rnti); payload_ptr[4], payload_ptr[5], current_rnti);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC, 1);
(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC, 1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC, 0);
for (ii = 0; ii < NB_RA_PROC_MAX; ii++) { for (ii = 0; ii < NB_RA_PROC_MAX; ii++) {
RA_t *ra = &mac->common_channels[CC_idP].ra[ii]; RA_t *ra = &mac->common_channels[CC_idP].ra[ii];
...@@ -581,8 +487,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -581,8 +487,7 @@ rx_sdu(const module_id_t enb_mod_idP,
enb_mod_idP, CC_idP, frameP, rx_lengths[i], enb_mod_idP, CC_idP, frameP, rx_lengths[i],
payload_ptr - sduP); payload_ptr - sduP);
if ((UE_id = if ((UE_id = add_new_ue(enb_mod_idP, CC_idP,
add_new_ue(enb_mod_idP, CC_idP,
mac->common_channels[CC_idP]. mac->common_channels[CC_idP].
ra[ii].rnti, harq_pid ra[ii].rnti, harq_pid
#ifdef Rel14 #ifdef Rel14
...@@ -650,18 +555,10 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -650,18 +555,10 @@ rx_sdu(const module_id_t enb_mod_idP,
if (UE_id != -1) { if (UE_id != -1) {
// adjust buffer occupancy of the correponding logical channel group // adjust buffer occupancy of the correponding logical channel group
if (UE_list->UE_template[CC_idP][UE_id]. if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i])
ul_buffer_info[UE_list->UE_template[CC_idP] UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
[UE_id].lcgidmap[rx_lcids[i]]] >=
rx_lengths[i])
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_info[UE_list->UE_template[CC_idP]
[UE_id].lcgidmap[rx_lcids[i]]] -=
rx_lengths[i];
else else
UE_list->UE_template[CC_idP][UE_id]. UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
ul_buffer_info[UE_list->UE_template[CC_idP]
[UE_id].lcgidmap[rx_lcids[i]]] = 0;
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n", "[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n",
...@@ -669,11 +566,8 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -669,11 +566,8 @@ rx_sdu(const module_id_t enb_mod_idP,
rx_lcids[i]); rx_lcids[i]);
mac_rlc_data_ind(enb_mod_idP, current_rnti, enb_mod_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL); //(unsigned int*)crc_status); mac_rlc_data_ind(enb_mod_idP, current_rnti, enb_mod_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL); //(unsigned int*)crc_status);
UE_list->eNB_UE_stats[CC_idP][UE_id]. UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]] += 1;
num_pdu_rx[rx_lcids[i]] += 1; UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]] += rx_lengths[i];
UE_list->eNB_UE_stats[CC_idP][UE_id].
num_bytes_rx[rx_lcids[i]]
+= rx_lengths[i];
} }
...@@ -712,31 +606,19 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -712,31 +606,19 @@ rx_sdu(const module_id_t enb_mod_idP,
ul_buffer_info[UE_list->UE_template[CC_idP] ul_buffer_info[UE_list->UE_template[CC_idP]
[UE_id].lcgidmap[rx_lcids[i]]]); [UE_id].lcgidmap[rx_lcids[i]]]);
if (UE_list->UE_template[CC_idP][UE_id]. if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i])
ul_buffer_info[UE_list->UE_template[CC_idP] UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
[UE_id].lcgidmap[rx_lcids[i]]]
>= rx_lengths[i])
UE_list->UE_template[CC_idP][UE_id].
ul_buffer_info[UE_list->UE_template[CC_idP]
[UE_id].lcgidmap[rx_lcids[i]]]
-= rx_lengths[i];
else else
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
[UE_list->UE_template[CC_idP][UE_id].lcgidmap if ((rx_lengths[i] < SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0)) { // MAX SIZE OF transport block
[rx_lcids[i]]] = 0;
if ((rx_lengths[i] < SCH_PAYLOAD_SIZE_MAX)
&& (rx_lengths[i] > 0)) { // MAX SIZE OF transport block
mac_rlc_data_ind(enb_mod_idP, current_rnti, enb_mod_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL); //(unsigned int*)crc_status); mac_rlc_data_ind(enb_mod_idP, current_rnti, enb_mod_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL); //(unsigned int*)crc_status);
UE_list->eNB_UE_stats[CC_idP][UE_id]. UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]] += 1;
num_pdu_rx[rx_lcids[i]] += 1; UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]] += rx_lengths[i];
UE_list->eNB_UE_stats[CC_idP][UE_id].
num_bytes_rx[rx_lcids[i]] += rx_lengths[i];
//clear uplane_inactivity_timer //clear uplane_inactivity_timer
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
} else { /* rx_length[i] */ } else { /* rx_length[i] */
UE_list->eNB_UE_stats[CC_idP][UE_id]. UE_list->eNB_UE_stats[CC_idP][UE_id].num_errors_rx += 1;
num_errors_rx += 1;
LOG_E(MAC, LOG_E(MAC,
"[eNB %d] CC_id %d Frame %d : Max size of transport block reached LCID %d from UE %d ", "[eNB %d] CC_id %d Frame %d : Max size of transport block reached LCID %d from UE %d ",
enb_mod_idP, CC_idP, frameP, rx_lcids[i], enb_mod_idP, CC_idP, frameP, rx_lcids[i],
...@@ -790,14 +672,12 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -790,14 +672,12 @@ rx_sdu(const module_id_t enb_mod_idP,
} else { } else {
if (UE_id != -1) { if (UE_id != -1) {
UE_list->eNB_UE_stats[CC_idP][UE_id].pdu_bytes_rx = sdu_lenP; UE_list->eNB_UE_stats[CC_idP][UE_id].pdu_bytes_rx = sdu_lenP;
UE_list->eNB_UE_stats[CC_idP][UE_id].total_pdu_bytes_rx += UE_list->eNB_UE_stats[CC_idP][UE_id].total_pdu_bytes_rx += sdu_lenP;
sdu_lenP;
UE_list->eNB_UE_stats[CC_idP][UE_id].total_num_pdus_rx += 1; UE_list->eNB_UE_stats[CC_idP][UE_id].total_num_pdus_rx += 1;
} }
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU, 0);
(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU, 0);
stop_meas(&mac->rx_ulsch_sdu); stop_meas(&mac->rx_ulsch_sdu);
} }
...@@ -820,8 +700,7 @@ void ...@@ -820,8 +700,7 @@ void
add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id,
sub_frame_t subframeP, UE_ULSCH_STATUS status) sub_frame_t subframeP, UE_ULSCH_STATUS status)
{ {
eNB_ulsch_info[module_idP][CC_id][UE_id].rnti = eNB_ulsch_info[module_idP][CC_id][UE_id].rnti = UE_RNTI(module_idP, UE_id);
UE_RNTI(module_idP, UE_id);
eNB_ulsch_info[module_idP][CC_id][UE_id].subframe = subframeP; eNB_ulsch_info[module_idP][CC_id][UE_id].subframe = subframeP;
eNB_ulsch_info[module_idP][CC_id][UE_id].status = status; eNB_ulsch_info[module_idP][CC_id][UE_id].status = status;
...@@ -852,8 +731,7 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header, ...@@ -852,8 +731,7 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
if (lcid < EXTENDED_POWER_HEADROOM) { if (lcid < EXTENDED_POWER_HEADROOM) {
if (not_done == 0) { // last MAC SDU, length is implicit if (not_done == 0) { // last MAC SDU, length is implicit
mac_header_ptr++; mac_header_ptr++;
length = length = tb_length - (mac_header_ptr - mac_header) - ce_len;
tb_length - (mac_header_ptr - mac_header) - ce_len;
for (num_sdu_cnt = 0; num_sdu_cnt < num_sdus; for (num_sdu_cnt = 0; num_sdu_cnt < num_sdus;
num_sdu_cnt++) { num_sdu_cnt++) {
...@@ -1133,7 +1011,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1133,7 +1011,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
} }
} */ } */
if (drop_ue == 1) { if (drop_ue == 1) {
/* we can't come here, ulsch_scheduler_pre_processor won't put in the list a UE with no PHY context */ /* we can't come here, ulsch_scheduler_pre_processor won't put in the list a UE with no PHY context */
abort(); abort();
/* TODO: this is a hack. Sometimes the UE has no PHY context but /* TODO: this is a hack. Sometimes the UE has no PHY context but
* is still present in the MAC with 'ul_failure_timer' = 0 and * is still present in the MAC with 'ul_failure_timer' = 0 and
...@@ -1186,8 +1064,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1186,8 +1064,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id];
UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
harq_pid = harq_pid = subframe2harqpid(&cc[CC_id], sched_frame, sched_subframeP);
subframe2harqpid(&cc[CC_id], sched_frame, sched_subframeP);
round = UE_sched_ctrl->round_UL[CC_id][harq_pid]; round = UE_sched_ctrl->round_UL[CC_id][harq_pid];
AssertFatal(round < 8, "round %d > 7 for UE %d/%x\n", round, AssertFatal(round < 8, "round %d > 7 for UE %d/%x\n", round,
UE_id, rnti); UE_id, rnti);
...@@ -1200,9 +1077,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1200,9 +1077,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
10) + 10) +
subframeP] = subframeP] =
UE_template->ul_total_buffer; UE_template->ul_total_buffer;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP *
(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,
RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP *
10) + 10) +
subframeP]); subframeP]);
if (UE_is_to_be_scheduled(module_idP, CC_id, UE_id) > 0 || round > 0) // || ((frameP%10)==0)) if (UE_is_to_be_scheduled(module_idP, CC_id, UE_id) > 0 || round > 0) // || ((frameP%10)==0))
...@@ -1239,9 +1114,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1239,9 +1114,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
// this assumes accumulated tpc // this assumes accumulated tpc
// make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
int32_t framex10psubframe = int32_t framex10psubframe = UE_template->pusch_tpc_tx_frame * 10 + UE_template->pusch_tpc_tx_subframe;
UE_template->pusch_tpc_tx_frame * 10 +
UE_template->pusch_tpc_tx_subframe;
if (((framex10psubframe + 10) <= (frameP * 10 + subframeP)) || //normal case if (((framex10psubframe + 10) <= (frameP * 10 + subframeP)) || //normal case
((framex10psubframe > (frameP * 10 + subframeP)) && (((10240 - framex10psubframe + frameP * 10 + subframeP) >= 10)))) //frame wrap-around ((framex10psubframe > (frameP * 10 + subframeP)) && (((10240 - framex10psubframe + frameP * 10 + subframeP) >= 10)))) //frame wrap-around
{ {
...@@ -1274,10 +1147,8 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1274,10 +1147,8 @@ schedule_ulsch_rnti(module_id_t module_idP,
UE_template->oldNDI_UL[harq_pid] = ndi; UE_template->oldNDI_UL[harq_pid] = ndi;
UE_list->eNB_UE_stats[CC_id][UE_id]. UE_list->eNB_UE_stats[CC_id][UE_id].
normalized_rx_power = normalized_rx_power; normalized_rx_power = normalized_rx_power;
UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power = UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power = target_rx_power;
target_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1 = UE_template->pre_assigned_mcs_ul;
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1 =
UE_template->pre_assigned_mcs_ul;
UE_template->mcs_UL[harq_pid] = UE_template->pre_assigned_mcs_ul; //cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS UE_template->mcs_UL[harq_pid] = UE_template->pre_assigned_mcs_ul; //cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS
if (UE_template->pre_allocated_rb_table_index_ul >= 0) { if (UE_template->pre_allocated_rb_table_index_ul >= 0) {
rb_table_index = rb_table_index =
...@@ -1287,8 +1158,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1287,8 +1158,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
rb_table_index = 5; // for PHR rb_table_index = 5; // for PHR
} }
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2 = UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2 = UE_template->mcs_UL[harq_pid];
UE_template->mcs_UL[harq_pid];
// buffer_occupancy = UE_template->ul_total_buffer; // buffer_occupancy = UE_template->ul_total_buffer;
...@@ -1299,13 +1169,10 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1299,13 +1169,10 @@ schedule_ulsch_rnti(module_id_t module_idP,
rb_table_index--; rb_table_index--;
} }
UE_template->TBS_UL[harq_pid] = UE_template->TBS_UL[harq_pid] = get_TBS_UL(UE_template->mcs_UL[harq_pid],
get_TBS_UL(UE_template->mcs_UL[harq_pid],
rb_table[rb_table_index]); rb_table[rb_table_index]);
UE_list->eNB_UE_stats[CC_id][UE_id]. UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx += rb_table[rb_table_index];
total_rbs_used_rx += rb_table[rb_table_index]; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS = UE_template->TBS_UL[harq_pid];
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS =
UE_template->TBS_UL[harq_pid];
// buffer_occupancy -= TBS; // buffer_occupancy -= TBS;
T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP), T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP),
...@@ -1316,8 +1183,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1316,8 +1183,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
T_INT(rb_table[rb_table_index]), T_INT(rb_table[rb_table_index]),
T_INT(UE_template->TBS_UL[harq_pid]), T_INT(ndi)); T_INT(UE_template->TBS_UL[harq_pid]), T_INT(ndi));
if (mac_eNB_get_rrc_status(module_idP, rnti) < if (mac_eNB_get_rrc_status(module_idP, rnti) < RRC_CONNECTED)
RRC_CONNECTED)
LOG_D(MAC, LOG_D(MAC,
"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", "[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
module_idP, harq_pid, rnti, CC_id, frameP, module_idP, harq_pid, rnti, CC_id, frameP,
...@@ -1329,14 +1195,12 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1329,14 +1195,12 @@ schedule_ulsch_rnti(module_id_t module_idP,
// bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
//store for possible retransmission //store for possible retransmission
UE_template->nb_rb_ul[harq_pid] = UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index];
rb_table[rb_table_index];
UE_template->first_rb_ul[harq_pid] = first_rb[CC_id]; UE_template->first_rb_ul[harq_pid] = first_rb[CC_id];
UE_sched_ctrl->ul_scheduled |= (1 << harq_pid); UE_sched_ctrl->ul_scheduled |= (1 << harq_pid);
if (UE_id == UE_list->head) if (UE_id == UE_list->head)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,
(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,
UE_sched_ctrl->ul_scheduled); UE_sched_ctrl->ul_scheduled);
// adjust total UL buffer status by TBS, wait for UL sdus to do final update // adjust total UL buffer status by TBS, wait for UL sdus to do final update
...@@ -1345,10 +1209,8 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1345,10 +1209,8 @@ schedule_ulsch_rnti(module_id_t module_idP,
module_idP, CC_id, UE_id, rnti, module_idP, CC_id, UE_id, rnti,
UE_template->ul_total_buffer, UE_template->ul_total_buffer,
UE_template->TBS_UL[harq_pid]); UE_template->TBS_UL[harq_pid]);
if (UE_template->ul_total_buffer > if (UE_template->ul_total_buffer > UE_template->TBS_UL[harq_pid])
UE_template->TBS_UL[harq_pid]) UE_template->ul_total_buffer -= UE_template->TBS_UL[harq_pid];
UE_template->ul_total_buffer -=
UE_template->TBS_UL[harq_pid];
else else
UE_template->ul_total_buffer = 0; UE_template->ul_total_buffer = 0;
LOG_D(MAC, "ul_total_buffer, new %d\n", LOG_D(MAC, "ul_total_buffer, new %d\n",
...@@ -1359,37 +1221,23 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1359,37 +1221,23 @@ schedule_ulsch_rnti(module_id_t module_idP,
UE_template->cshift[harq_pid] = cshift; UE_template->cshift[harq_pid] = cshift;
hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi]; hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi];
memset((void *) hi_dci0_pdu, 0, memset((void *) hi_dci0_pdu, 0,sizeof(nfapi_hi_dci0_request_pdu_t));
sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
hi_dci0_pdu->pdu_size = hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_dci_pdu);
2 + sizeof(nfapi_hi_dci0_dci_pdu);
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format = hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format = NFAPI_UL_DCI_FORMAT_0;
NFAPI_UL_DCI_FORMAT_0; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level =
aggregation;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000;
6000; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = first_rb[CC_id];
hi_dci0_pdu->dci_pdu.dci_pdu_rel8. hi_dci0_pdu->dci_pdu.dci_pdu_rel8.number_of_resource_block = rb_table[rb_table_index];
resource_block_start = first_rb[CC_id]; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.mcs_1 = UE_template->mcs_UL[harq_pid];
hi_dci0_pdu->dci_pdu.dci_pdu_rel8. hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cyclic_shift_2_for_drms = cshift;
number_of_resource_block = hi_dci0_pdu->dci_pdu.dci_pdu_rel8.frequency_hopping_enabled_flag = 0;
rb_table[rb_table_index]; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.new_data_indication_1 = ndi;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.mcs_1 =
UE_template->mcs_UL[harq_pid];
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.
cyclic_shift_2_for_drms = cshift;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.
frequency_hopping_enabled_flag = 0;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.
new_data_indication_1 = ndi;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tpc = tpc; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tpc = tpc;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req;
cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP];
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index =
UE_template->DAI_ul[sched_subframeP];
hi_dci0_req_body->number_of_dci++; hi_dci0_req_body->number_of_dci++;
hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP, subframeP, 4); hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP, subframeP, 4);
...@@ -1464,14 +1312,10 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1464,14 +1312,10 @@ schedule_ulsch_rnti(module_id_t module_idP,
memset((void *) hi_dci0_pdu, 0, memset((void *) hi_dci0_pdu, 0,
sizeof(nfapi_hi_dci0_request_pdu_t)); sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
hi_dci0_pdu->pdu_size = hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_hi_pdu);
2 + sizeof(nfapi_hi_dci0_hi_pdu);
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = UE_template->first_rb_ul[harq_pid];
UE_template->first_rb_ul[harq_pid]; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = UE_template->cshift[harq_pid];
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.
cyclic_shift_2_for_drms =
UE_template->cshift[harq_pid];
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
hi_dci0_req_body->number_of_hi++; hi_dci0_req_body->number_of_hi++;
hi_dci0_req_body->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0); hi_dci0_req_body->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0);
......
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