Commit e7285feb authored by Cedric Roux's avatar Cedric Roux

Setup structure for calling CschedCellConfigReq.

This is not correct, notably regarding SIB settings.
When openair (at least oaisim) calls mac_top_init the SIBs
are done generated yet. Their sizes are thus unknown.
We cheat.
parent 4e533244
......@@ -70,9 +70,13 @@
#include "SCHED/defs.h"
#if FAPI
#include "ff-mac-common.h"
#include "ff-mac-csched-sap.h"
#include "ff-mac-sched-sap.h"
/* for enb_config_get() and Enb_properties_array_t */
#include "enb_config.h"
#endif
void dl_phy_sync_success(module_id_t module_idP,
frame_t frameP,
......@@ -353,18 +357,105 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
//end ALU's algo
#ifdef FAPI
/// setup FAPI interface
/* setup FAPI interface */
/* this should be done differently/somewhere else */
const Enb_properties_array_t *conf = enb_config_get();
for (i=0; i<NB_eNB_INST; i++) {
eNB_mac_inst[i].fapi = init_fapi();
AssertFatal(eNB_mac_inst[i].fapi != NULL, "error calling init_fapi()\n");
}
/* test code, to remove */
struct CschedCellConfigReqParameters p;
struct CschedCellConfigCnfParameters r;
CschedCellConfigReq(eNB_mac_inst[0].fapi->sched, &p);
CschedCellConfigCnf(eNB_mac_inst[0].fapi, &r);
if (r.result != ff_SUCCESS) abort();
struct CschedCellConfigReqParametersListElement l;
struct SiMessageListElement_s sib23;
#if MAX_NUM_CCs > 1
#error we do not work with FAPI with more than 1 CC yet
#endif
p.nr_carriers = 1;
p.ccConfigList[0] = &l;
p.nr_vendorSpecificList = 0;
l.puschHoppingOffset = conf->properties[i]->pusch_hoppingOffset[0];
l.hoppingMode = conf->properties[i]->pusch_hoppingMode[0];
l.nSb = conf->properties[i]->pusch_n_SB[0];
switch (conf->properties[i]->phich_resource[0]) {
case oneSixth: l.phichResource = PHICH_R_ONE_SIXTH; break;
case half: l.phichResource = PHICH_R_HALF; break;
case one: l.phichResource = PHICH_R_ONE; break;
case two: l.phichResource = PHICH_R_TWO; break;
}
switch (conf->properties[i]->phich_duration[0]) {
case normal: l.phichDuration = ff_normal; break;
case extended: l.phichDuration = ff_extended; break;
}
l.initialNrOfPdcchOfdmSymbols = 0; LOG_W(MAC, "set initialNrOfPdcchOfdmSymbols to its real value\n");
l.siConfiguration.sfn = 0; LOG_W(MAC, "what to set for siConfiguration.sfn?\n");
/* when mac_top_init is called, the SIBs are not generated yet, so we don't
know their sizes. As a quick and dirty hack, let's hardcode them.
It's "safe" though because in openair2/RRC/LITE/rrc_eNB.c we crash
if the values are not the ones we put here */
/* the length of sib1 is hardcoded to 15, see also openair2/RRC/LITE/rrc_eNB.c */
l.siConfiguration.sib1Length = 15; LOG_W(MAC, "get the real siConfiguration.sib1Length\n");
l.siConfiguration.siWindowLength = 1; LOG_W(MAC, "get the real siConfiguration.siWindowLength\n");
l.siConfiguration.nrSI_Message_List = 1;
l.siConfiguration.siMessageList = &sib23;
sib23.periodicity = 8; LOG_W(MAC, "get the real sib23.periodicity\n");
/* the length of sib2/3 is hardcoded to 30, see also openair2/RRC/LITE/rrc_eNB.c */
sib23.length = 30; LOG_W(MAC, "get the real sib23.length\n");
l.ulBandwidth = conf->properties[i]->N_RB_DL[0];
l.dlBandwidth = conf->properties[i]->N_RB_DL[0];
switch (conf->properties[i]->prefix_type[0]) {
case NORMAL:
l.ulCyclicPrefixLength = ff_normal;
l.dlCyclicPrefixLength = ff_normal;
break;
case EXTENDED:
l.ulCyclicPrefixLength = ff_extended;
l.dlCyclicPrefixLength = ff_extended;
break;
}
l.antennaPortsCount = conf->properties[i]->nb_antennas_tx[0]; LOG_W(MAC, "is antennaPortsCount equal to nb_antennas_tx?\n");
switch (conf->properties[i]->frame_type[0]) {
case FDD: l.duplexMode = DFDD; break;
case TDD: l.duplexMode = DTDD; break;
}
l.subframeAssignment = conf->properties[i]->tdd_config[0];
l.specialSubframePatterns = conf->properties[i]->tdd_config_s[0];
#warning TODO: mbsfn stuff (when mbsfn_SubframeConfigPresent will be added to the structure CschedCellConfigReqParametersListElement)
l.prachConfigurationIndex = conf->properties[i]->prach_config_index[0];
l.prachFreqOffset = conf->properties[i]->prach_freq_offset[0];
l.raResponseWindowSize = conf->properties[i]->rach_raResponseWindowSize[0];
l.macContentionResolutionTimer = conf->properties[i]->rach_macContentionResolutionTimer[0];
l.maxHarqMsg3Tx = conf->properties[i]->rach_maxHARQ_Msg3Tx[0];
#warning TODO: get real n1PucchAn (fix pucch_n1_AN thing for Rel10, remove #ifndefs)
l.n1PucchAn = 0; //conf->properties[i]->pucch_n1_AN[0];
l.deltaPucchShift = conf->properties[i]->pucch_delta_shift[0];
l.nrbCqi = conf->properties[i]->pucch_nRB_CQI[0];
l.ncsAn = conf->properties[i]->pucch_nCS_AN[0];
#warning TODO: what about srs_enable of the config file (it's not in FAPI)?
l.srsSubframeConfiguration = conf->properties[i]->srs_SubframeConfig[0];
l.srsSubframeOffset = 0; LOG_W(MAC, "what value for srsSubframeOffset?\n");
l.srsBandwidthConfiguration = conf->properties[i]->srs_BandwidthConfig[0];
switch (conf->properties[i]->srs_MaxUpPts[0]) {
case TRUE: l.srsMaxUpPts = true; break;
case FALSE: l.srsMaxUpPts = false; break;
}
#warning TODO: what about srs_ackNackST of the config file (it's not in FAPI)?
switch (conf->properties[i]->pusch_enable64QAM[0]) {
case TRUE: l.enable64Qam = true; break;
case FALSE: l.enable64Qam = false; break;
}
l.carrierIndex = 0;
LOG_I(MAC, "calling CschedCellConfigReq\n");
CschedCellConfigReq(eNB_mac_inst[i].fapi->sched, &p);
LOG_I(MAC, "calling CschedCellConfigCnf\n");
CschedCellConfigCnf(eNB_mac_inst[i].fapi, &r);
if (r.result != ff_SUCCESS) { LOG_E(MAC, "CschedCellConfigCnf failed\n"); abort(); }
LOG_I(MAC, "CschedCellConfigCnf succeeded\n");
}
#endif
......
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