Commit 89c5c03d authored by Cedric Roux's avatar Cedric Roux

add callback skeletons and init function

parent a1c1c0c8
......@@ -922,6 +922,7 @@ set (MAC_SRC
${MAC_DIR}/eNB_scheduler_RA.c
${MAC_DIR}/pre_processor.c
${MAC_DIR}/config.c
${MAC_DIR}/ff-mac.c
${MAC_DIR}/minifapi.c
)
......
......@@ -4,16 +4,16 @@
/* these are the callback function types from the scheduler to openair */
/* sched */
typedef void (SchedDlConfigInd_callback)(void *callback_data, const struct SchedDlConfigIndParameters *params);
typedef void (SchedUlConfigInd_callback)(void *callback_data, const struct SchedUlConfigIndParameters *params);
typedef void (SchedDlConfigInd_callback_t)(void *callback_data, const struct SchedDlConfigIndParameters *params);
typedef void (SchedUlConfigInd_callback_t)(void *callback_data, const struct SchedUlConfigIndParameters *params);
/* csched */
typedef void (CschedCellConfigCnf_callback)(void *callback_data, const struct CschedCellConfigCnfParameters *params);
typedef void (CschedUeConfigCnf_callback)(void *callback_data, const struct CschedUeConfigCnfParameters *params);
typedef void (CschedLcConfigCnf_callback)(void *callback_data, const struct CschedLcConfigCnfParameters *params);
typedef void (CschedLcReleaseCnf_callback)(void *callback_data, const struct CschedLcReleaseCnfParameters *params);
typedef void (CschedUeReleaseCnf_callback)(void *callback_data, const struct CschedUeReleaseCnfParameters *params);
typedef void (CschedUeConfigUpdateInd_callback)(void *callback_data, const struct CschedUeConfigUpdateIndParameters *params);
typedef void (CschedCellConfigUpdateInd_callback)(void *callback_data, const struct CschedCellConfigUpdateIndParameters *params);
typedef void (CschedCellConfigCnf_callback_t)(void *callback_data, const struct CschedCellConfigCnfParameters *params);
typedef void (CschedUeConfigCnf_callback_t)(void *callback_data, const struct CschedUeConfigCnfParameters *params);
typedef void (CschedLcConfigCnf_callback_t)(void *callback_data, const struct CschedLcConfigCnfParameters *params);
typedef void (CschedLcReleaseCnf_callback_t)(void *callback_data, const struct CschedLcReleaseCnfParameters *params);
typedef void (CschedUeReleaseCnf_callback_t)(void *callback_data, const struct CschedUeReleaseCnfParameters *params);
typedef void (CschedUeConfigUpdateInd_callback_t)(void *callback_data, const struct CschedUeConfigUpdateIndParameters *params);
typedef void (CschedCellConfigUpdateInd_callback_t)(void *callback_data, const struct CschedCellConfigUpdateIndParameters *params);
#endif /* FF_MAC_CALLBACK_H */
......@@ -9,16 +9,16 @@ extern "C" {
/* this function is called to create and initialize a scheduler */
void *SchedInit(
void *callback_data,
SchedDlConfigInd_callback *SchedDlConfigInd,
SchedUlConfigInd_callback *SchedUlConfigInd,
CschedCellConfigCnf_callback *CschedCellConfigCnf,
CschedUeConfigCnf_callback *CschedUeConfigCnf,
CschedLcConfigCnf_callback *CschedLcConfigCnf,
CschedLcReleaseCnf_callback *CschedLcReleaseCnf,
CschedUeReleaseCnf_callback *CschedUeReleaseCnf,
CschedUeConfigUpdateInd_callback *CschedUeConfigUpdateInd,
CschedCellConfigUpdateInd_callback *CschedCellConfigUpdateInd);
void *callback_data,
SchedDlConfigInd_callback_t *SchedDlConfigInd,
SchedUlConfigInd_callback_t *SchedUlConfigInd,
CschedCellConfigCnf_callback_t *CschedCellConfigCnf,
CschedUeConfigCnf_callback_t *CschedUeConfigCnf,
CschedLcConfigCnf_callback_t *CschedLcConfigCnf,
CschedLcReleaseCnf_callback_t *CschedLcReleaseCnf,
CschedUeReleaseCnf_callback_t *CschedUeReleaseCnf,
CschedUeConfigUpdateInd_callback_t *CschedUeConfigUpdateInd,
CschedCellConfigUpdateInd_callback_t *CschedCellConfigUpdateInd);
#if defined (__cplusplus)
}
......
#include "ff-mac.h"
#include "ff-mac-sched-sap.h"
#include "ff-mac-csched-sap.h"
#include "ff-mac-init.h"
#include "log.h"
#include <stdlib.h>
/* this structure stores required data for OAI to work with FAPI */
/* it is the private version of fapi_interface_t */
struct fapi {
fapi_interface_t fi; /* the start of the structure matches fapi_interface_t */
};
/* here come the callbacks */
void SchedDlConfigInd_callback(void *callback_data, const struct SchedDlConfigIndParameters *params)
{
}
void SchedUlConfigInd_callback(void *callback_data, const struct SchedUlConfigIndParameters *params)
{
}
void CschedCellConfigCnf_callback(void *callback_data, const struct CschedCellConfigCnfParameters *params)
{
}
void CschedUeConfigCnf_callback(void *callback_data, const struct CschedUeConfigCnfParameters *params)
{
}
void CschedLcConfigCnf_callback(void *callback_data, const struct CschedLcConfigCnfParameters *params)
{
}
void CschedLcReleaseCnf_callback(void *callback_data, const struct CschedLcReleaseCnfParameters *params)
{
}
void CschedUeReleaseCnf_callback(void *callback_data, const struct CschedUeReleaseCnfParameters *params)
{
}
void CschedUeConfigUpdateInd_callback(void *callback_data, const struct CschedUeConfigUpdateIndParameters *params)
{
}
void CschedCellConfigUpdateInd_callback(void *callback_data, const struct CschedCellConfigUpdateIndParameters *params)
{
}
fapi_interface_t *init_fapi(void)
{
struct fapi *ret;
LOG_I(MAC, "FAPI initialization\n");
ret = calloc(1, sizeof(struct fapi));
if (ret == NULL) LOG_E(MAC, "init_fapi: memory allocation error\n");
ret->fi.sched = SchedInit(ret,
SchedDlConfigInd_callback,
SchedUlConfigInd_callback,
CschedCellConfigCnf_callback,
CschedUeConfigCnf_callback,
CschedLcConfigCnf_callback,
CschedLcReleaseCnf_callback,
CschedUeReleaseCnf_callback,
CschedUeConfigUpdateInd_callback,
CschedCellConfigUpdateInd_callback);
if (ret->fi.sched == NULL) {
LOG_E(MAC, "init_fapi: SchedInit failed\n");
free(ret);
return NULL;
}
return (fapi_interface_t *)ret;
}
#ifndef FF_MAC_H
#define FF_MAC_H
/* this file contains OAI related FAPI definitions */
/* this is the public view of the FAPI's OAI interface */
typedef struct {
void *sched; /* this is the pointer returned by SchedInit */
/* to be used when calling FAPI functions */
} fapi_interface_t;
/* this function initializes OAI's FAPI interfacing
* it returns the opaque pointer given by SchedInit
*/
fapi_interface_t *init_fapi(void);
#endif /* FF_MAC_H */
......@@ -12,29 +12,29 @@
#include <stdio.h>
struct scheduler {
void *callback_data;
SchedDlConfigInd_callback *SchedDlConfigInd;
SchedUlConfigInd_callback *SchedUlConfigInd;
CschedCellConfigCnf_callback *CschedCellConfigCnf;
CschedUeConfigCnf_callback *CschedUeConfigCnf;
CschedLcConfigCnf_callback *CschedLcConfigCnf;
CschedLcReleaseCnf_callback *CschedLcReleaseCnf;
CschedUeReleaseCnf_callback *CschedUeReleaseCnf;
CschedUeConfigUpdateInd_callback *CschedUeConfigUpdateInd;
CschedCellConfigUpdateInd_callback *CschedCellConfigUpdateInd;
void *callback_data;
SchedDlConfigInd_callback_t *SchedDlConfigInd;
SchedUlConfigInd_callback_t *SchedUlConfigInd;
CschedCellConfigCnf_callback_t *CschedCellConfigCnf;
CschedUeConfigCnf_callback_t *CschedUeConfigCnf;
CschedLcConfigCnf_callback_t *CschedLcConfigCnf;
CschedLcReleaseCnf_callback_t *CschedLcReleaseCnf;
CschedUeReleaseCnf_callback_t *CschedUeReleaseCnf;
CschedUeConfigUpdateInd_callback_t *CschedUeConfigUpdateInd;
CschedCellConfigUpdateInd_callback_t *CschedCellConfigUpdateInd;
};
void *SchedInit(
void *callback_data,
SchedDlConfigInd_callback *SchedDlConfigInd,
SchedUlConfigInd_callback *SchedUlConfigInd,
CschedCellConfigCnf_callback *CschedCellConfigCnf,
CschedUeConfigCnf_callback *CschedUeConfigCnf,
CschedLcConfigCnf_callback *CschedLcConfigCnf,
CschedLcReleaseCnf_callback *CschedLcReleaseCnf,
CschedUeReleaseCnf_callback *CschedUeReleaseCnf,
CschedUeConfigUpdateInd_callback *CschedUeConfigUpdateInd,
CschedCellConfigUpdateInd_callback *CschedCellConfigUpdateInd)
void *callback_data,
SchedDlConfigInd_callback_t *SchedDlConfigInd,
SchedUlConfigInd_callback_t *SchedUlConfigInd,
CschedCellConfigCnf_callback_t *CschedCellConfigCnf,
CschedUeConfigCnf_callback_t *CschedUeConfigCnf,
CschedLcConfigCnf_callback_t *CschedLcConfigCnf,
CschedLcReleaseCnf_callback_t *CschedLcReleaseCnf,
CschedUeReleaseCnf_callback_t *CschedUeReleaseCnf,
CschedUeConfigUpdateInd_callback_t *CschedUeConfigUpdateInd,
CschedCellConfigUpdateInd_callback_t *CschedCellConfigUpdateInd)
{
struct scheduler *ret;
......@@ -52,7 +52,7 @@ void *SchedInit(
ret->CschedCellConfigCnf = CschedCellConfigCnf;
ret->CschedUeConfigCnf = CschedUeConfigCnf;
ret->CschedLcConfigCnf = CschedLcConfigCnf;
ret-> CschedLcReleaseCnf = CschedLcReleaseCnf;
ret->CschedLcReleaseCnf = CschedLcReleaseCnf;
ret->CschedUeReleaseCnf = CschedUeReleaseCnf;
ret->CschedUeConfigUpdateInd = CschedUeConfigUpdateInd;
ret->CschedCellConfigUpdateInd = CschedCellConfigUpdateInd;
......
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