Commit 0a37b83f authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'feature-31-ff-scheduler-api' of...

Merge branch 'feature-31-ff-scheduler-api' of https://gitlab.eurecom.fr/oai/openairinterface5g into feature-31-ff-scheduler-api
parents 19751e37 108f85c3
......@@ -1329,6 +1329,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
int frame = phy_vars_eNB->proc[sched_subframe].frame_tx;
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
printf("PHY TX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1);
start_meas(&phy_vars_eNB->phy_proc_tx);
......@@ -3149,6 +3150,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe);
AssertFatal(sched_subframe < NUM_ENB_THREADS, "Bad sched_subframe %d", sched_subframe);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
......
......@@ -178,6 +178,51 @@ rrc_mac_config_req(
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
if (logicalChannelConfig!= NULL) {
#if FAPI
if (eNB_flagP == 1) {
printf("MAC CONFIG lcid %d group %d\n", (int)logicalChannelIdentity, (int)*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
/* only configure DRBs, SRBs are already configured */
if (logicalChannelIdentity > 2) {
struct CschedLcConfigReqParameters lc;
struct LogicalChannelConfigListElement_s lcs;
struct CschedLcConfigCnfParameters lcr;
fapi_interface_t *fapi;
LOG_I(MAC, "eNB %d/%d: FAPI: configure DRB %d for UE %x\n", Mod_id, CC_id, logicalChannelIdentity, rntiP);
fapi = eNB_mac_inst[Mod_id].fapi;
lc.rnti = rntiP;
lc.reconfigureFlag = false;
lc.nr_logicalChannelConfigList = 1;
lc.logicalChannelConfigList = &lcs;
lc.nr_vendorSpecificList = 0;
lc.vendorSpecificList = NULL;
lcs.logicalChannelIdentity = 1;
lcs.logicalChannelGroup = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
lcs.direction = DIR_BOTH; /* TODO: not necessarily */
lcs.qosBearerType = QBT_NON_GBR; /* TODO: not necessarily */
lcs.qci = 5; /* what to put? see 23.203 table 6.1.7 */
/* TODO: bitrates not used - let's suppose we are in non GBR */
CschedLcConfigReq(fapi->sched, &lc);
CschedLcConfigCnf(fapi, &lcr);
if (lcr.rnti != rntiP)
{ LOG_E(MAC, "%s:%d:%s: possible?\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
if (lcr.result != ff_SUCCESS)
{ LOG_E(MAC, "%s:%d:%s: possible?\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
if (lcr.nr_logicalChannelIdendity != 1)
{ LOG_E(MAC, "%s:%d:%s: possible?\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
/* TODO: check other return values (see rrc_mac_fapi_configure_srb12 for why it's not done) */
}
}
#endif /* FAPI */
if (eNB_flagP==0) {
LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_id,eNB_index);
UE_mac_inst[Mod_id].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
......
This diff is collapsed.
......@@ -775,6 +775,7 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t
}
if (i == NB_RA_PROC_MAX) { printf("%s:%d:%s: handle this case\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
printf("MAC to FAPI initiate RA procedure new rnti %x f/sf %d/%d\n", r.rnti, frameP, subframeP);
LOG_I(MAC, "calling SchedDlRachInfoReq\n");
SchedDlRachInfoReq(fapi->sched, &p);
......
......@@ -615,6 +615,7 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP
sr.rnti = rntiP;
LOG_I(MAC, "eNB %d/%d f/sf %d/%d calling SchedUlSrInfoReq for rnti %x\n", mod_idP, cc_idP, frameP, subframeP, rntiP);
printf("MAC to FAPI SR indication rnti %x f/sf %d/%d\n", rntiP, frameP, subframeP);
SchedUlSrInfoReq(fapi->sched, &p);
}
......
......@@ -134,7 +134,7 @@ struct DlDciListElement_s
{
ONE, ONE_A, ONE_B, ONE_C, ONE_D, TWO, TWO_A, TWO_B
} format;
uint8_t tpc;
int8_t tpc;
uint8_t harqProcess;
uint8_t dai;
enum VrbFormat_e
......@@ -314,13 +314,14 @@ struct BuildBroadcastListElement_s
*/
struct UlInfoListElement_s
{
uint16_t puschTransmissionTimestamp; //this timestamp identifies PUSCH transmission to which below information relates to
uint16_t rnti;
uint16_t ulReception[MAX_LC_LIST+1];
enum ReceptionStatus_e
{
Ok, NotOk, NotValid
} receptionStatus;
uint8_t tpc;
int8_t tpc;
uint8_t servCellIndex; //definition according to 36.331 'ServCellIndex'
};
......
......@@ -93,7 +93,9 @@ struct fapi {
fi->rsp_id[fn]++; \
} while (0)
/* SCHED "wrappers" */
/************************************************************************/
/* SCHED "wrappers" */
/************************************************************************/
void SchedDlConfigInd(fapi_interface_t *_fi, struct SchedDlConfigIndParameters *params)
{
......@@ -142,7 +144,9 @@ void SchedUlConfigInd(fapi_interface_t *_fi, struct SchedUlConfigIndParameters *
LOG_D(MAC, "%s leave\n", __FUNCTION__);
}
/* CSCHED "wrappers" */
/************************************************************************/
/* CSCHED "wrappers" */
/************************************************************************/
void CschedCellConfigCnf(fapi_interface_t *_fi, struct CschedCellConfigCnfParameters *params)
{
......@@ -215,18 +219,53 @@ void CschedCellConfigUpdateInd(fapi_interface_t *_fi, struct CschedCellConfigUpd
int fn = CSCHED_CELL_CONFIG_UPDATE_IND;
}
/* SCHED callbacks */
/************************************************************************/
/* SCHED callbacks */
/************************************************************************/
void SchedDlConfigInd_callback(void *callback_data, const struct SchedDlConfigIndParameters *params)
{
struct fapi *fi = callback_data;
int fn = SCHED_DL_CONFIG_IND;
int i, j, k;
LOG_D(MAC, "%s enter\n", __FUNCTION__);
LOCK(fi, fn);
CHECK(fi, fn);
fi->SchedDlConfigIndParameters = *params;
/* copy from params to local structure */
fi->SchedDlConfigIndParameters.nr_buildDataList = params->nr_buildDataList;
fi->SchedDlConfigIndParameters.nr_buildRARList = params->nr_buildRARList;
fi->SchedDlConfigIndParameters.nr_buildBroadcastList = params->nr_buildBroadcastList;
for (i = 0; i < params->nr_buildDataList; i++) {
fi->SchedDlConfigIndParameters.buildDataList[i].rnti = params->buildDataList[i].rnti;
fi->SchedDlConfigIndParameters.buildDataList[i].dci = params->buildDataList[i].dci;
for (j = 0; j < MAX_TB_LIST; j++)
fi->SchedDlConfigIndParameters.buildDataList[i].ceBitmap[j] = params->buildDataList[i].ceBitmap[j];
for (j = 0; j < MAX_TB_LIST; j++) {
fi->SchedDlConfigIndParameters.buildDataList[i].nr_rlcPDU_List[j] = params->buildDataList[i].nr_rlcPDU_List[j];
for (k = 0; k < params->buildDataList[i].nr_rlcPDU_List[j]; k++)
fi->SchedDlConfigIndParameters.buildDataList[i].rlcPduList[j][k] = params->buildDataList[i].rlcPduList[j][k];
}
fi->SchedDlConfigIndParameters.buildDataList[i].servCellIndex = params->buildDataList[i].servCellIndex;
fi->SchedDlConfigIndParameters.buildDataList[i].activationDeactivationCE = params->buildDataList[i].activationDeactivationCE;
}
for (i = 0; i < params->nr_buildRARList; i++) {
fi->SchedDlConfigIndParameters.buildRarList[i] = params->buildRarList[i];
}
for (i = 0; i < params->nr_buildBroadcastList; i++) {
fi->SchedDlConfigIndParameters.buildBroadcastList[i] = params->buildBroadcastList[i];
}
/* TODO: be sure of this */
if (params->nr_ofdmSymbolsCount != 1) { printf("%s:%d: what to do?\n", __FILE__, __LINE__); abort(); }
fi->SchedDlConfigIndParameters.nr_ofdmSymbolsCount = params->nr_ofdmSymbolsCount;
for (i = 0; i < MAX_NUM_CCs; i++) {
*fi->SchedDlConfigIndParameters.nrOfPdcchOfdmSymbols[i] = *params->nrOfPdcchOfdmSymbols[i];
}
DONE_callback(fi, fn);
UNLOCK(fi, fn);
......@@ -238,12 +277,23 @@ void SchedUlConfigInd_callback(void *callback_data, const struct SchedUlConfigIn
{
struct fapi *fi = callback_data;
int fn = SCHED_UL_CONFIG_IND;
int i;
LOG_D(MAC, "%s enter\n", __FUNCTION__);
LOCK(fi, fn);
CHECK(fi, fn);
fi->SchedUlConfigIndParameters = *params;
/* copy from params to local structure */
fi->SchedUlConfigIndParameters.nr_dciList = params->nr_dciList;
fi->SchedUlConfigIndParameters.nr_phichList = params->nr_phichList;
for (i = 0; i < params->nr_dciList; i++) {
fi->SchedUlConfigIndParameters.dciList[i] = params->dciList[i];
}
for (i = 0; i < params->nr_phichList; i++) {
fi->SchedUlConfigIndParameters.phichList[i] = params->phichList[i];
}
DONE_callback(fi, fn);
UNLOCK(fi, fn);
......@@ -251,7 +301,9 @@ void SchedUlConfigInd_callback(void *callback_data, const struct SchedUlConfigIn
LOG_D(MAC, "%s leave\n", __FUNCTION__);
}
/* CSCHED callbacks */
/************************************************************************/
/* CSCHED callbacks */
/************************************************************************/
void CschedCellConfigCnf_callback(void *callback_data, const struct CschedCellConfigCnfParameters *params)
{
......@@ -262,6 +314,7 @@ void CschedCellConfigCnf_callback(void *callback_data, const struct CschedCellCo
LOCK(fi, fn);
CHECK(fi, fn);
/* copy from params to local structure */
fi->CschedCellConfigCnfParameters = *params;
DONE_callback(fi, fn);
......@@ -279,6 +332,7 @@ void CschedUeConfigCnf_callback(void *callback_data, const struct CschedUeConfig
LOCK(fi, fn);
CHECK(fi, fn);
/* copy from params to local structure */
fi->CschedUeConfigCnfParameters = *params;
DONE_callback(fi, fn);
......@@ -291,12 +345,21 @@ void CschedLcConfigCnf_callback(void *callback_data, const struct CschedLcConfig
{
struct fapi *fi = callback_data;
int fn = CSCHED_LC_CONFIG_CNF;
int i;
LOG_D(MAC, "%s enter\n", __FUNCTION__);
LOCK(fi, fn);
CHECK(fi, fn);
fi->CschedLcConfigCnfParameters = *params;
/* copy from params to local structure */
fi->CschedLcConfigCnfParameters.rnti = params->rnti;
fi->CschedLcConfigCnfParameters.result = params->result;
fi->CschedLcConfigCnfParameters.nr_logicalChannelIdendity = params->nr_logicalChannelIdendity;
for (i = 0; i < params->nr_logicalChannelIdendity; i++) {
fi->CschedLcConfigCnfParameters.logicalChannelIdentity[i] = params->logicalChannelIdentity[i];
}
DONE_callback(fi, fn);
UNLOCK(fi, fn);
......@@ -328,6 +391,10 @@ void CschedCellConfigUpdateInd_callback(void *callback_data, const struct Csched
abort();
}
/************************************************************************/
/* init function */
/************************************************************************/
fapi_interface_t *init_fapi(void)
{
struct fapi *ret;
......@@ -354,6 +421,57 @@ fapi_interface_t *init_fapi(void)
ret->rsp_id[i] = 0;
}
/* allocate memory (max size) to copy messages coming from FAPI */
/*********** CschedCellConfigCnfParameters is ok */
/*********** SchedDlConfigIndParameters */
/********************* buildDataList */
ret->SchedDlConfigIndParameters.buildDataList = calloc(MAX_BUILD_DATA_LIST, sizeof(struct BuildDataListElement_s));
if (ret->SchedDlConfigIndParameters.buildDataList == NULL) abort();
for (i = 0; i < MAX_BUILD_DATA_LIST; i++) {
struct BuildDataListElement_s *b = &ret->SchedDlConfigIndParameters.buildDataList[i];
int j;
for (j = 0; j < MAX_TB_LIST; j++) {
b->rlcPduList[j] = calloc(MAX_RLC_PDU_LIST, sizeof(struct RlcPduListElement_s));
if (b->rlcPduList[j] == NULL) abort();
}
}
/********************* buildRarList */
ret->SchedDlConfigIndParameters.buildRarList = calloc(MAX_BUILD_RAR_LIST, sizeof(struct BuildRarListElement_s));
if (ret->SchedDlConfigIndParameters.buildRarList == NULL) abort();
/********************* buildBroadcastList */
ret->SchedDlConfigIndParameters.buildBroadcastList = calloc(MAX_BUILD_BC_LIST, sizeof(struct BuildBroadcastListElement_s));
if (ret->SchedDlConfigIndParameters.buildBroadcastList == NULL) abort();
/********************* nrOfPdcchOfdmSymbols */
for (i = 0; i < MAX_NUM_CCs; i++) {
/* TODO: not sure about 1 there */
ret->SchedDlConfigIndParameters.nrOfPdcchOfdmSymbols[i] = calloc(1, sizeof(struct PdcchOfdmSymbolCountListElement_s));
if (ret->SchedDlConfigIndParameters.nrOfPdcchOfdmSymbols[i] == NULL) abort();
}
/*********** SchedUlConfigIndParameters */
/********************* dciList */
ret->SchedUlConfigIndParameters.dciList = calloc(MAX_DCI_LIST, sizeof(struct UlDciListElement_s));
if (ret->SchedUlConfigIndParameters.dciList == NULL) abort();
/********************* phichList */
ret->SchedUlConfigIndParameters.phichList = calloc(MAX_PHICH_LIST, sizeof(struct PhichListElement_s));
if (ret->SchedUlConfigIndParameters.phichList == NULL) abort();
/*********** CschedUeConfigCnfParameters is ok */
/*********** CschedLcConfigCnfParameters */
/********************* logicalChannelIdentity */
ret->CschedLcConfigCnfParameters.logicalChannelIdentity = calloc(MAX_LC_LIST, sizeof(uint8_t));
if (ret->CschedLcConfigCnfParameters.logicalChannelIdentity == NULL) abort();
ret->fi.sched = SchedInit(ret,
SchedDlConfigInd_callback,
SchedUlConfigInd_callback,
......
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