Merge remote-tracking branch 'origin/develop' into enhancement-ltem
Conflicts: openair1/PHY/INIT/lte_init.c openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c openair1/PHY/LTE_TRANSPORT/dci.c openair1/PHY/LTE_TRANSPORT/dci_tools.c openair1/PHY/LTE_TRANSPORT/dlsch_coding.c openair1/PHY/LTE_TRANSPORT/edci.c openair1/PHY/LTE_TRANSPORT/if4_tools.c openair1/PHY/LTE_TRANSPORT/prach.c openair1/PHY/LTE_TRANSPORT/print_stats.c openair1/PHY/LTE_TRANSPORT/pucch.c openair1/PHY/LTE_TRANSPORT/transport_eNB.h openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h openair1/PHY/impl_defs_lte.h openair1/SCHED/fapi_l1.c openair1/SCHED/phy_procedures_lte_eNb.c openair2/COMMON/rrc_messages_types.h openair2/ENB_APP/enb_config.c openair2/ENB_APP/enb_paramdef.h openair2/LAYER2/MAC/config.c openair2/LAYER2/MAC/defs.h openair2/LAYER2/MAC/eNB_scheduler.c openair2/LAYER2/MAC/eNB_scheduler_RA.c openair2/LAYER2/MAC/eNB_scheduler_bch.c openair2/LAYER2/MAC/eNB_scheduler_dlsch.c openair2/LAYER2/MAC/eNB_scheduler_primitives.c openair2/LAYER2/MAC/eNB_scheduler_ulsch.c openair2/LAYER2/MAC/pre_processor.c openair2/LAYER2/MAC/rar_tools.c openair2/LAYER2/MAC/ue_procedures.c openair2/PHY_INTERFACE/IF_Module.c openair2/RRC/LITE/rrc_common.c openair2/RRC/LTE/L2_interface_ue.c openair2/RRC/LTE/MESSAGES/asn1_msg.c openair2/RRC/LTE/rrc_eNB.c targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp targets/RT/USER/lte-enb.c targets/RT/USER/lte-ru.c
This commit is contained in:
+251
-151
@@ -1,8 +1,8 @@
|
||||
#include "openair1/PHY/defs.h"
|
||||
#include "openair1/PHY/defs_eNB.h"
|
||||
#include "openair2/PHY_INTERFACE/IF_Module.h"
|
||||
#include "openair1/PHY/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "openair1/PHY/phy_extern.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#define MAX_IF_MODULES 100
|
||||
@@ -10,47 +10,57 @@
|
||||
IF_Module_t *if_inst[MAX_IF_MODULES];
|
||||
Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs];
|
||||
|
||||
extern int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind);
|
||||
extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
|
||||
extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind);
|
||||
extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
|
||||
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
|
||||
extern uint8_t nfapi_mode;
|
||||
extern uint16_t sf_ahead;
|
||||
uint16_t frame_cnt=0;
|
||||
void handle_rach(UL_IND_t *UL_info) {
|
||||
int i;
|
||||
|
||||
if (UL_info->rach_ind.number_of_preambles>0) {
|
||||
if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
|
||||
|
||||
AssertFatal(UL_info->rach_ind.number_of_preambles==1,"More than 1 preamble not supported\n");
|
||||
UL_info->rach_ind.number_of_preambles=0;
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc\n",UL_info->frame,UL_info->subframe);
|
||||
AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
|
||||
UL_info->rach_ind.rach_indication_body.number_of_preambles=0;
|
||||
LOG_D(MAC,"UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->subframe, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf));
|
||||
initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->rach_ind.preamble_list[0].preamble_rel8.preamble,
|
||||
UL_info->rach_ind.preamble_list[0].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind.preamble_list[0].preamble_rel8.rnti
|
||||
#ifdef Rel14
|
||||
NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,0
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
#ifdef Rel14
|
||||
if (UL_info->rach_ind_br.number_of_preambles>0) {
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) {
|
||||
|
||||
AssertFatal(UL_info->rach_ind_br.number_of_preambles<5,"More than 4 preambles not supported\n");
|
||||
for (i=0;i<UL_info->rach_ind_br.number_of_preambles;i++) {
|
||||
AssertFatal(UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type>0,
|
||||
AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n");
|
||||
for (i=0;i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles;i++) {
|
||||
AssertFatal(UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type>0,
|
||||
"Got regular PRACH preamble, not BL/CE\n");
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe,
|
||||
|
||||
UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type-1);
|
||||
UL_info->rach_ind_br.number_of_preambles=0;
|
||||
|
||||
initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->rach_ind_br.preamble_list[i].preamble_rel8.preamble,
|
||||
UL_info->rach_ind_br.preamble_list[i].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind_br.preamble_list[i].preamble_rel8.rnti,
|
||||
UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type);
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.preamble,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.rnti,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type);
|
||||
}
|
||||
UL_info->rach_ind.number_of_preambles=0;
|
||||
UL_info->rach_ind_br.rach_indication_body.number_of_preambles=0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -59,91 +69,164 @@ void handle_sr(UL_IND_t *UL_info) {
|
||||
|
||||
int i;
|
||||
|
||||
for (i=0;i<UL_info->sr_ind.number_of_srs;i++)
|
||||
SR_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->sr_ind.sr_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->sr_ind.sr_pdu_list[i].ul_cqi_information.ul_cqi);
|
||||
if (nfapi_mode == 1) // PNF
|
||||
{
|
||||
if (UL_info->sr_ind.sr_indication_body.number_of_srs>0)
|
||||
{
|
||||
oai_nfapi_sr_indication(&UL_info->sr_ind);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
|
||||
SR_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
|
||||
}
|
||||
|
||||
UL_info->sr_ind.number_of_srs=0;
|
||||
UL_info->sr_ind.sr_indication_body.number_of_srs=0;
|
||||
}
|
||||
|
||||
void handle_cqi(UL_IND_t *UL_info) {
|
||||
|
||||
int i;
|
||||
|
||||
for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++)
|
||||
cqi_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
|
||||
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
|
||||
if (nfapi_mode == 1)
|
||||
{
|
||||
if (UL_info->cqi_ind.number_of_cqis>0)
|
||||
{
|
||||
LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis);
|
||||
nfapi_cqi_indication_t ind;
|
||||
|
||||
UL_info->cqi_ind.number_of_cqis=0;
|
||||
ind.header.message_id = NFAPI_RX_CQI_INDICATION;
|
||||
ind.sfn_sf = UL_info->frame<<4 | UL_info->subframe;
|
||||
ind.cqi_indication_body = UL_info->cqi_ind;
|
||||
|
||||
oai_nfapi_cqi_indication(&ind);
|
||||
|
||||
UL_info->cqi_ind.number_of_cqis=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++)
|
||||
cqi_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
|
||||
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
|
||||
|
||||
UL_info->cqi_ind.number_of_cqis=0;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_harq(UL_IND_t *UL_info) {
|
||||
|
||||
int i;
|
||||
|
||||
for (i=0;i<UL_info->harq_ind.number_of_harqs;i++)
|
||||
harq_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
&UL_info->harq_ind.harq_pdu_list[i]);
|
||||
if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) // PNF
|
||||
{
|
||||
//LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs);
|
||||
|
||||
UL_info->harq_ind.number_of_harqs=0;
|
||||
int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
|
||||
|
||||
if (retval!=0)
|
||||
{
|
||||
LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval);
|
||||
}
|
||||
|
||||
UL_info->harq_ind.harq_indication_body.number_of_harqs = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++)
|
||||
harq_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf),
|
||||
&UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]);
|
||||
|
||||
UL_info->harq_ind.harq_indication_body.number_of_harqs=0;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_ulsch(UL_IND_t *UL_info) {
|
||||
|
||||
int i,j;
|
||||
|
||||
for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) {
|
||||
if(nfapi_mode == 1)
|
||||
{
|
||||
if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0)
|
||||
{
|
||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
||||
|
||||
for (j=0;j<UL_info->crc_ind.number_of_crcs;j++) {
|
||||
// find crc_indication j corresponding rx_indication i
|
||||
if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) {
|
||||
if (UL_info->crc_ind.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe);
|
||||
rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
else {
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe);
|
||||
rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
break;
|
||||
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
// UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) {
|
||||
} // for (j=0;j<UL_info->crc_ind.number_of_crcs;j++) {
|
||||
AssertFatal(j<UL_info->crc_ind.number_of_crcs,"Couldn't find matchin CRC indication\n");
|
||||
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) {
|
||||
|
||||
UL_info->rx_ind.number_of_pdus=0;
|
||||
UL_info->crc_ind.number_of_crcs=0;
|
||||
oai_nfapi_crc_indication(&UL_info->crc_ind);
|
||||
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
}
|
||||
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0)
|
||||
{
|
||||
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
|
||||
oai_nfapi_rx_ind(&UL_info->rx_ind);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
for (i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) {
|
||||
for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) {
|
||||
// find crc_indication j corresponding rx_indication i
|
||||
LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) {
|
||||
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag);
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe);
|
||||
rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
else {
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe);
|
||||
rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
break;
|
||||
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
// UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti)
|
||||
} // for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++)
|
||||
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs=0;
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
} // UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->subframe && UL_info->crc_ind.crc_indication_body.number_of_crcs>0
|
||||
else if (UL_info->rx_ind.rx_indication_body.number_of_pdus!=0 || UL_info->crc_ind.crc_indication_body.number_of_crcs!=0) {
|
||||
LOG_E(PHY,"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SF:%05d) crc_ind:%d(SFN/SF:%05d) UL_info(SFN/SF):%04d%d\n",
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf),
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf),
|
||||
UL_info->frame, UL_info->subframe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@@ -157,16 +240,15 @@ void handle_ulsch(UL_IND_t *UL_info) {
|
||||
#define C do { size = 0; put(0); } while (0)
|
||||
#define A(...) do { char t[4096]; sprintf(t, __VA_ARGS__); append_string(t); } while (0)
|
||||
|
||||
static char *s;
|
||||
/* eats nothing at startup, but fixed size */
|
||||
#define SMAX 65536
|
||||
static char s[SMAX];
|
||||
static int size;
|
||||
static int maxsize;
|
||||
static int maxsize = SMAX;
|
||||
|
||||
static void put(char x)
|
||||
{
|
||||
if (size == maxsize) {
|
||||
maxsize += 32768;
|
||||
s = realloc(s, maxsize); if (s == NULL) abort();
|
||||
}
|
||||
if (size == maxsize) { printf("incrase SMAX\n"); exit(1); }
|
||||
s[size++] = x;
|
||||
}
|
||||
|
||||
@@ -185,24 +267,24 @@ static void dump_ul(UL_IND_t *u)
|
||||
A("XXXX UL mod %d CC %d f.sf %d.%d\n",
|
||||
u->module_id, u->CC_id, u->frame, u->subframe);
|
||||
|
||||
A("XXXX harq_ind %d\n", u->harq_ind.number_of_harqs);
|
||||
for (i = 0; i < u->harq_ind.number_of_harqs; i++) {
|
||||
nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_pdu_list[i];
|
||||
A("XXXX harq_ind %d\n", u->harq_ind.harq_indication_body.number_of_harqs);
|
||||
for (i = 0; i < u->harq_ind.harq_indication_body.number_of_harqs; i++) {
|
||||
nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_indication_body.harq_pdu_list[i];
|
||||
A("XXXX harq ind %d\n", i);
|
||||
A("XXXX rnti %d\n", v->rx_ue_information.rnti);
|
||||
A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1,
|
||||
v->harq_indication_fdd_rel8.harq_tb2);
|
||||
A("XXXX number_of_ack_nack %d\n",
|
||||
v->harq_indication_fdd_rel9.number_of_ack_nack);
|
||||
A("XXXX rnti %d\n", v->rx_ue_information.rnti);
|
||||
A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1,
|
||||
v->harq_indication_fdd_rel8.harq_tb2);
|
||||
A("XXXX number_of_ack_nack %d\n",
|
||||
v->harq_indication_fdd_rel9.number_of_ack_nack);
|
||||
A("XXXX harq[0] = %d\n",
|
||||
v->harq_indication_fdd_rel9.harq_tb_n[0]);
|
||||
A("XXXX harq ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi,
|
||||
v->ul_cqi_information.channel);
|
||||
v->ul_cqi_information.channel);
|
||||
}
|
||||
|
||||
A("XXXX crc_ind %d\n", u->crc_ind.number_of_crcs);
|
||||
A("XXXX crc_ind %d\n", u->crc_ind.crc_indication_body.number_of_crcs);
|
||||
|
||||
A("XXXX sr_ind %d\n", u->sr_ind.number_of_srs);
|
||||
A("XXXX sr_ind %d\n", u->sr_ind.sr_indication_body.number_of_srs);
|
||||
|
||||
A("XXXX cqi_ind %d\n", u->cqi_ind.number_of_cqis);
|
||||
for (i = 0; i < u->cqi_ind.number_of_cqis; i++) {
|
||||
@@ -212,11 +294,11 @@ static void dump_ul(UL_IND_t *u)
|
||||
v->ul_cqi_information.channel);
|
||||
}
|
||||
|
||||
A("XXXX rach_ind %d\n", u->rach_ind.number_of_preambles);
|
||||
A("XXXX rach_ind %d\n", u->rach_ind.rach_indication_body.number_of_preambles);
|
||||
|
||||
A("XXXX rx_ind %d\n", u->rx_ind.number_of_pdus);
|
||||
for (i = 0; i < u->rx_ind.number_of_pdus; i++) {
|
||||
nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_pdu_list[i];
|
||||
A("XXXX rx_ind %d\n", u->rx_ind.rx_indication_body.number_of_pdus);
|
||||
for (i = 0; i < u->rx_ind.rx_indication_body.number_of_pdus; i++) {
|
||||
nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_indication_body.rx_pdu_list[i];
|
||||
A("XXXX rx ind %d\n", i);
|
||||
A("XXXX timing_advance %d\n",
|
||||
v->rx_indication_rel8.timing_advance);
|
||||
@@ -443,26 +525,33 @@ void UL_indication(UL_IND_t *UL_info)
|
||||
IF_Module_t *ifi = if_inst[module_id];
|
||||
eNB_MAC_INST *mac = RC.mac[module_id];
|
||||
|
||||
LOG_D(PHY,"UL_Indication: frame %d, subframe %d, module_id %d, CC_id %d\n",
|
||||
UL_info->frame,UL_info->subframe,
|
||||
module_id,CC_id);
|
||||
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
|
||||
UL_info->frame,UL_info->subframe,
|
||||
module_id,CC_id,
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
|
||||
if(UL_info->frame==1023&&UL_info->subframe==6){ // dl scheduling (0,0)
|
||||
frame_cnt= (frame_cnt + 1)%7; // to prevent frame_cnt get too big
|
||||
LOG_D(MAC,"current (%d,%d) frame count dl is %d\n",UL_info->frame,UL_info->subframe,frame_cnt);
|
||||
}
|
||||
|
||||
if (ifi->CC_mask==0) {
|
||||
ifi->current_frame = UL_info->frame;
|
||||
ifi->current_subframe = UL_info->subframe;
|
||||
if (nfapi_mode != 1)
|
||||
{
|
||||
if (ifi->CC_mask==0) {
|
||||
ifi->current_frame = UL_info->frame;
|
||||
ifi->current_subframe = UL_info->subframe;
|
||||
}
|
||||
else {
|
||||
AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask);
|
||||
AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask);
|
||||
}
|
||||
ifi->CC_mask |= (1<<CC_id);
|
||||
}
|
||||
else {
|
||||
AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask);
|
||||
AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask);
|
||||
}
|
||||
ifi->CC_mask |= (1<<CC_id);
|
||||
|
||||
|
||||
|
||||
// clear DL/UL info for new scheduling round
|
||||
clear_nfapi_information(RC.mac[module_id],CC_id,
|
||||
UL_info->frame,UL_info->subframe);
|
||||
|
||||
|
||||
handle_rach(UL_info);
|
||||
|
||||
handle_sr(UL_info);
|
||||
@@ -471,61 +560,72 @@ void UL_indication(UL_IND_t *UL_info)
|
||||
|
||||
handle_harq(UL_info);
|
||||
|
||||
// clear HI prior to hanling ULSCH
|
||||
mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0;
|
||||
// clear HI prior to handling ULSCH
|
||||
uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_id] , UL_info->subframe);
|
||||
if(sf_ahead_dl!=255){
|
||||
mac->HI_DCI0_req[CC_id][(UL_info->subframe+sf_ahead_dl)%10].hi_dci0_request_body.number_of_hi = 0;
|
||||
LOG_D(MAC,"current (%d,%d) clear HI_DCI0_req[0][%d]\n",UL_info->frame,UL_info->subframe,(UL_info->subframe+sf_ahead_dl)%10);
|
||||
}
|
||||
|
||||
handle_ulsch(UL_info);
|
||||
|
||||
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
|
||||
if (nfapi_mode != 1)
|
||||
{
|
||||
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
|
||||
|
||||
eNB_dlsch_ulsch_scheduler(module_id,
|
||||
(UL_info->frame+((UL_info->subframe>5)?1:0)) % 1024,
|
||||
(UL_info->subframe+4)%10);
|
||||
eNB_dlsch_ulsch_scheduler(module_id,
|
||||
(UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024,
|
||||
(UL_info->subframe+sf_ahead)%10);
|
||||
|
||||
ifi->CC_mask = 0;
|
||||
ifi->CC_mask = 0;
|
||||
|
||||
sched_info->module_id = module_id;
|
||||
sched_info->CC_id = CC_id;
|
||||
sched_info->frame = (UL_info->frame + ((UL_info->subframe>5) ? 1 : 0)) % 1024;
|
||||
sched_info->subframe = (UL_info->subframe+4)%10;
|
||||
sched_info->DL_req = &mac->DL_req[CC_id];
|
||||
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
|
||||
if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
|
||||
(is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+4)%10)>0))
|
||||
sched_info->UL_req = &mac->UL_req[CC_id];
|
||||
else
|
||||
sched_info->UL_req = NULL;
|
||||
sched_info->module_id = module_id;
|
||||
sched_info->CC_id = CC_id;
|
||||
sched_info->frame = (UL_info->frame + ((UL_info->subframe>(9-sf_ahead)) ? 1 : 0)) % 1024;
|
||||
sched_info->subframe = (UL_info->subframe+sf_ahead)%10;
|
||||
sched_info->DL_req = &mac->DL_req[CC_id];
|
||||
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id][sched_info->subframe];
|
||||
if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
|
||||
(is_UL_sf(&mac->common_channels[CC_id],sched_info->subframe)>0))
|
||||
sched_info->UL_req = &mac->UL_req[CC_id];
|
||||
else
|
||||
sched_info->UL_req = NULL;
|
||||
|
||||
sched_info->TX_req = &mac->TX_req[CC_id];
|
||||
sched_info->TX_req = &mac->TX_req[CC_id];
|
||||
|
||||
#ifdef DUMP_FAPI
|
||||
dump_dl(sched_info);
|
||||
dump_dl(sched_info);
|
||||
#endif
|
||||
|
||||
AssertFatal(ifi->schedule_response!=NULL,
|
||||
"UL_indication is null (mod %d, cc %d)\n",
|
||||
module_id,
|
||||
CC_id);
|
||||
ifi->schedule_response(sched_info);
|
||||
if (ifi->schedule_response)
|
||||
{
|
||||
AssertFatal(ifi->schedule_response!=NULL,
|
||||
"schedule_response is null (mod %d, cc %d)\n",
|
||||
module_id,
|
||||
CC_id);
|
||||
ifi->schedule_response(sched_info);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"Schedule_response: frame %d, subframe %d (dl_pdus %d / %p)\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu,
|
||||
&sched_info->DL_req->dl_config_request_body.number_pdu);
|
||||
}
|
||||
LOG_D(PHY,"Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IF_Module_t *IF_Module_init(int Mod_id){
|
||||
|
||||
AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
|
||||
|
||||
LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n");
|
||||
|
||||
if (if_inst[Mod_id]==NULL) {
|
||||
if_inst[Mod_id] = (IF_Module_t*)malloc(sizeof(IF_Module_t));
|
||||
memset((void*)if_inst[Mod_id],0,sizeof(IF_Module_t));
|
||||
|
||||
|
||||
if_inst[Mod_id]->CC_mask=0;
|
||||
if_inst[Mod_id]->UL_indication = UL_indication;
|
||||
|
||||
AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0,
|
||||
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
|
||||
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
|
||||
}
|
||||
return if_inst[Mod_id];
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -34,9 +34,10 @@
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "openair1/PHY/LTE_TRANSPORT/defs.h"
|
||||
//#include "openair1/PHY/LTE_TRANSPORT/transport_eNB.h"
|
||||
#include "nfapi_interface.h"
|
||||
|
||||
#include "platform_constants.h"
|
||||
#include "platform_types.h"
|
||||
|
||||
#define MAX_NUM_DL_PDU 100
|
||||
#define MAX_NUM_UL_PDU 100
|
||||
@@ -61,30 +62,30 @@ typedef struct{
|
||||
sub_frame_t subframe;
|
||||
|
||||
/// harq indication list
|
||||
nfapi_harq_indication_body_t harq_ind;
|
||||
nfapi_harq_indication_t harq_ind;
|
||||
|
||||
/// crc indication list
|
||||
nfapi_crc_indication_body_t crc_ind;
|
||||
nfapi_crc_indication_t crc_ind;
|
||||
|
||||
/// SR indication list
|
||||
nfapi_sr_indication_body_t sr_ind;
|
||||
nfapi_sr_indication_t sr_ind;
|
||||
|
||||
/// CQI indication list
|
||||
nfapi_cqi_indication_body_t cqi_ind;
|
||||
|
||||
/// RACH indication list
|
||||
nfapi_rach_indication_body_t rach_ind;
|
||||
nfapi_rach_indication_t rach_ind;
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// RACH indication list for BR UEs
|
||||
nfapi_rach_indication_body_t rach_ind_br;
|
||||
nfapi_rach_indication_t rach_ind_br;
|
||||
#endif
|
||||
|
||||
/// SRS indication list
|
||||
nfapi_srs_indication_body_t srs_ind;
|
||||
|
||||
/// RX indication
|
||||
nfapi_rx_indication_body_t rx_ind;
|
||||
nfapi_rx_indication_t rx_ind;
|
||||
|
||||
} UL_IND_t;
|
||||
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
|
||||
/*This is the interface module between PHY
|
||||
*Provided the FAPI style interface structures for P7.
|
||||
*Provide the semi-FAPI style interface for P5 (configuration)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __IF_MODULE_NB_IoT__H__
|
||||
#define __IF_MODULE_NB_IoT__H__
|
||||
|
||||
#include "nfapi_interface.h"
|
||||
//#include "openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
#include "PhysicalConfigDedicated-NB-r13.h"
|
||||
//#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
|
||||
#include "openair2/COMMON/platform_types.h"
|
||||
//#include "openair1/SCHED/IF_Module_L1_primitives_NB_IoT.h"
|
||||
|
||||
//#define SCH_PAYLOAD_SIZE_MAX 4096
|
||||
#define BCCH_PAYLOAD_SIZE_MAX_NB_IoT 128
|
||||
|
||||
|
||||
|
||||
// P5 FAPI-like configuration structures-------------------------------------------------------------------------------
|
||||
|
||||
/*MP: MISSED COMMON CONFIG. of SIB2-NB in FAPI SPECS
|
||||
* some of them may not needed because are used only at UE side
|
||||
* some of them are not needed because not necessary at PHY level
|
||||
* other have to be clarified since seems to be needed at PHY layer
|
||||
* there is no UE_Config. request message carrying NB-IoT parameters???
|
||||
*
|
||||
* */
|
||||
typedef struct{
|
||||
//nprach_config
|
||||
uint16_t nprach_config_0_subcarrier_MSG3_range_start;
|
||||
uint16_t nprach_config_1_subcarrier_MSG3_range_start;
|
||||
uint16_t nprach_config_2_subcarrier_MSG3_range_start;
|
||||
uint16_t nprach_config_0_max_num_preamble_attempt_CE;
|
||||
uint16_t nprach_config_1_max_num_preamble_attempt_CE;
|
||||
uint16_t nprach_config_2_max_num_preamble_attempt_CE;
|
||||
uint16_t nprach_config_0_npdcch_num_repetitions_RA; //Rmax (see TS 36.213 ch 16.6) -->only this is managed at PHY layer
|
||||
uint16_t nprach_config_1_npdcch_num_repetitions_RA;
|
||||
uint16_t nprach_config_2_npdcch_num_repetitions_RA;
|
||||
uint16_t nprach_config_0_npdcch_startSF_CSS_RA; //G (see TS 36.213 ch 16.6)
|
||||
uint16_t nprach_config_1_npdcch_startSF_CSS_RA;
|
||||
uint16_t nprach_config_2_npdcch_startSF_CSS_RA;
|
||||
uint16_t nprach_config_0_npdcch_offset_RA; //Alfa_offset (see TS 36.213 ch 16.6)
|
||||
uint16_t nprach_config_1_npdcch_offset_RA;
|
||||
uint16_t nprach_config_2_npdcch_offset_RA;
|
||||
|
||||
//configured through the phy_config_dedicated
|
||||
//Higher layer parameter for NPDCCH UE-spec search space
|
||||
uint16_t npdcch_NumRepetitions;//Rmax (see TS 36.213 ch 16.6) -->only this is managed at PHY layer
|
||||
uint16_t npdcch_StartSF_USS; //G (see TS 36.213 ch 16.6)
|
||||
uint16_t npdcch_Offset_USS; //Alfa_offset (see TS 36.213 ch 16.6)
|
||||
|
||||
|
||||
ACK_NACK_NumRepetitions_NB_r13_t *ack_nack_numRepetitions_MSG4; //pointer to the first cell of a list of ack_nack_num_repetitions
|
||||
|
||||
//ulPowerControlCommon (UE side)
|
||||
uint16_t p0_nominal_npusch;
|
||||
uint16_t alpha;
|
||||
uint16_t delta_preamle_MSG3;
|
||||
|
||||
|
||||
/*Dedicated configuration -->not supported by FAPI (may not needed)
|
||||
* In OAI at least are needed when we manage the phy_procedures_eNB_TX in which we call the phy_config_dedicated_eNB_step2
|
||||
* that use the physicalConfigDedicated info previously stored in the PHY_VARS_eNB_NB_IoT structure through the phy_config_dedicated procedure
|
||||
*/
|
||||
//PhysicalConfigDedicated_NB_r13_t *phy_config_dedicated;
|
||||
|
||||
|
||||
|
||||
|
||||
}extra_phyConfig_t;
|
||||
|
||||
typedef struct{
|
||||
|
||||
/*OAI config. parameters*/
|
||||
module_id_t mod_id;
|
||||
int CC_id;
|
||||
uint16_t rnti;
|
||||
int get_MIB; //should be different from 0 only when the mib!= null (NB_rrc_mac_config_req_eNB_IoT)
|
||||
int get_COMMON;
|
||||
int get_DEDICATED;
|
||||
|
||||
//ID of the Resource Block dedicated to NB-IoT
|
||||
//For Nb-IoT only a restricted values of PRB indexes are allowed (see Rhode&Shwartz pag9)
|
||||
//unsigned short NB_IoT_RB_ID; (should coincide with PRB index)
|
||||
|
||||
|
||||
|
||||
|
||||
/*FAPI useful config. parameters used in the code
|
||||
*
|
||||
* -nfapi_uplink_reference_signal_config_t uplink_reference_signal_config
|
||||
* -nfapi_subframe_config_t subframe_config;
|
||||
* -nfapi_rf_config_t rf_config;
|
||||
* -nfapi_sch_config_t sch_config;
|
||||
* -nfapi_nb_iot_config_t config_NB_IoT;
|
||||
* -nfapi_l23_config_t l23_config;
|
||||
* -nfapi_config --> EARFCN (for the transport of the dl_CarrierFreq
|
||||
* */
|
||||
|
||||
//XXX where allocate memory??
|
||||
nfapi_config_request_t* cfg;
|
||||
|
||||
/*MP: MISSED COMMON CONFIG. of SIB2-NB in FAPI SPECS (may non needed)*/
|
||||
extra_phyConfig_t extra_phy_parms;
|
||||
|
||||
}PHY_Config_NB_IoT_t;
|
||||
|
||||
|
||||
|
||||
// uplink subframe P7---------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/*UL_IND_t:
|
||||
* A structure handles all the uplink information.
|
||||
* Corresponding to the NRACH.indicaiton, UL_Config_indication, RX_ULSCH.indication, CRC.inidcation, NB_HARQ.indication in FAPI
|
||||
*/
|
||||
typedef struct{
|
||||
|
||||
/*Start at the common part*/
|
||||
|
||||
int test;
|
||||
|
||||
//Module ID
|
||||
module_id_t module_id;
|
||||
//CC ID
|
||||
int CC_id;
|
||||
//frame
|
||||
frame_t frame;
|
||||
//subframe
|
||||
sub_frame_t subframe;
|
||||
//Hyper frame for NB-IoT implementation
|
||||
uint32_t hypersfn;
|
||||
|
||||
/*preamble part*/
|
||||
|
||||
nfapi_nrach_indication_body_t NRACH;
|
||||
|
||||
/*Uplink data part*/
|
||||
|
||||
/*indication of the harq feedback*/
|
||||
nfapi_nb_harq_indication_t nb_harq_ind;
|
||||
/*indication of the uplink data PDU*/
|
||||
nfapi_rx_indication_body_t RX_NPUSCH;
|
||||
/*crc_indication*/
|
||||
nfapi_crc_indication_body_t crc_ind;
|
||||
|
||||
}UL_IND_NB_IoT_t;
|
||||
|
||||
// Downlink subframe P7
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
/*Start at the common part*/
|
||||
|
||||
//Module ID
|
||||
module_id_t module_id;
|
||||
//CC ID
|
||||
int CC_id;
|
||||
// hyper subframe
|
||||
uint32_t hypersfn;
|
||||
//frame
|
||||
frame_t frame;
|
||||
//subframe
|
||||
sub_frame_t subframe;
|
||||
|
||||
/// nFAPI DL Config Request
|
||||
nfapi_dl_config_request_t *DL_req;
|
||||
/// nFAPI UL Config Request
|
||||
nfapi_ul_config_request_t *UL_req;
|
||||
/// nFAPI HI_DCI Request
|
||||
nfapi_hi_dci0_request_t *HI_DCI0_req;
|
||||
/// nFAPI TX Request
|
||||
nfapi_tx_request_t *TX_req;
|
||||
/// Pointers to DL SDUs
|
||||
//uint8_t **sdu;
|
||||
|
||||
}Sched_Rsp_NB_IoT_t;
|
||||
|
||||
|
||||
/*IF_Module_t a group for gathering the Interface
|
||||
It should be allocated at the main () in lte-softmodem.c*/
|
||||
typedef struct IF_Module_NB_IoT_s{
|
||||
//define the function pointer
|
||||
void (*UL_indication)(UL_IND_NB_IoT_t *UL_INFO);
|
||||
void (*schedule_response)(Sched_Rsp_NB_IoT_t *Sched_INFO);
|
||||
void (*PHY_config_req)(PHY_Config_NB_IoT_t* config_INFO);
|
||||
}IF_Module_NB_IoT_t;
|
||||
|
||||
/*Initial */
|
||||
|
||||
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
|
||||
void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO);
|
||||
|
||||
/*Interface for PHY Configuration
|
||||
* Trigger the phy_config_xxx functions using parameters from the shared PHY_Config structure
|
||||
* */
|
||||
void PHY_config_req_NB_IoT(PHY_Config_NB_IoT_t* config_INFO);
|
||||
|
||||
//int IF_Module_init(IF_Module_t *if_inst);
|
||||
|
||||
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
|
||||
//void Schedule_Response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO);
|
||||
|
||||
/*Interface for uplink, transmitting the Preamble(list), ULSCH SDU, NAK, Tick (trigger scheduler)
|
||||
*/
|
||||
void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO);
|
||||
|
||||
IF_Module_NB_IoT_t *IF_Module_init_NB_IoT(int Mod_id);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,498 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/* This is the interface module between PHY
|
||||
* Provided the FAPI style interface structures for P7.
|
||||
*/
|
||||
|
||||
/*! \file openair2/PHY_INTERFACE/IF_Module.h
|
||||
* \brief data structures for PHY/MAC interface modules
|
||||
* \author EURECOM/NTUST
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: raymond.knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef __UE_MAC_INTERFACE__H__
|
||||
#define __UE_MAC_INTERFACE__H__
|
||||
|
||||
#include "nfapi_interface.h"
|
||||
#include "openair1/PHY/impl_defs_lte.h"
|
||||
#include "targets/COMMON/openairinterface5g_limits.h"
|
||||
|
||||
|
||||
|
||||
#define MAX_NUM_DL_PDU 100
|
||||
#define MAX_NUM_UL_PDU 100
|
||||
#define MAX_NUM_HI_DCI0_PDU 100
|
||||
#define MAX_NUM_TX_REQUEST_PDU 100
|
||||
|
||||
#define MAX_NUM_HARQ_IND 100
|
||||
#define MAX_NUM_CRC_IND 100
|
||||
#define MAX_NUM_SR_IND 100
|
||||
#define MAX_NUM_CQI_IND 100
|
||||
#define MAX_NUM_RACH_IND 100
|
||||
#define MAX_NUM_SRS_IND 100
|
||||
|
||||
|
||||
// UE_MAC enums
|
||||
typedef enum {
|
||||
UE_MAC_DL_IND_PDSCH_PDU_TYPE =0,
|
||||
UE_MAC_DL_IND_SI_PDSCH_PDU_TYPE,
|
||||
UE_MAC_DL_IND_P_PDSCH_PDU_TYPE,
|
||||
UE_MAC_DL_IND_DLSCH_RAR_PDU_TYPE
|
||||
} UE_MAC_dl_ind_pdu_type_e;
|
||||
|
||||
// UE_MAC enums
|
||||
typedef enum {
|
||||
UE_MAC_Tx_IND_Msg1_TYPE =0,
|
||||
UE_MAC_Tx_IND_Msg3_TYPE
|
||||
} UE_MAC_Tx_ind_type_e;
|
||||
|
||||
|
||||
|
||||
// *** UE_UL_Config.request related structures
|
||||
|
||||
|
||||
typedef struct{
|
||||
//module_id_t module_idP;
|
||||
//int CC_id;
|
||||
//frame_t frameP;
|
||||
uint8_t eNB_id;
|
||||
//uint16_t rnti;
|
||||
//sub_frame_t subframe_tx;
|
||||
uint32_t SR_payload; //0 or 1
|
||||
}UE_MAC_ul_config_SR;
|
||||
|
||||
|
||||
|
||||
typedef struct{
|
||||
//module_id_t module_idP;
|
||||
//int CC_id;
|
||||
//frame_t frameP;
|
||||
uint8_t eNB_indexP;
|
||||
//sub_frame_t subframeP;
|
||||
|
||||
uint8_t ra_RACH_MaskIndex;
|
||||
int8_t ra_PREAMBLE_RECEIVED_TARGET_POWER;
|
||||
uint8_t ra_TDD_map_index;
|
||||
uint16_t ra_RNTI;
|
||||
uint8_t *Msg3;
|
||||
}UE_MAC_ul_config_rach;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
UE_MAC_ul_config_rach ue_rach_config;
|
||||
//UE_MAC_ul_config_ULSCH ue_ULSCH_pdu;
|
||||
UE_MAC_ul_config_SR ue_SR_config;
|
||||
};
|
||||
} UE_MAC_ul_config_request_list;
|
||||
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
uint16_t length_list;
|
||||
UE_MAC_ul_config_request_list* ue_ul_config_list;
|
||||
} UE_MAC_ul_config_request_body_t;
|
||||
|
||||
typedef struct {
|
||||
//nfapi_p7_message_header_t header;
|
||||
uint16_t sfn_sf;
|
||||
UE_MAC_ul_config_request_body_t ue_ul_config_request_body; //nfapi_dl_config_request_body_t
|
||||
} UE_MAC_ul_config_request_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// *** UE_Tx.request related structures
|
||||
|
||||
typedef struct {
|
||||
uint16_t pdu_length;
|
||||
uint16_t pdu_index;
|
||||
uint8_t num_segments;
|
||||
struct {
|
||||
uint32_t segment_length;
|
||||
uint8_t* segment_data;
|
||||
} segments[NFAPI_TX_MAX_SEGMENTS];
|
||||
} UE_MAC_tx_request_pdu_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
uint16_t number_of_pdus;
|
||||
UE_MAC_tx_request_pdu_t* ue_tx_pdu_list;
|
||||
} UE_MAC_tx_request_body_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
//nfapi_p7_message_header_t header;
|
||||
uint16_t sfn_sf;
|
||||
UE_MAC_tx_request_body_t ue_tx_request_body;
|
||||
} UE_MAC_tx_request_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
|
||||
}UE_MAC_sl_config_request_Tx_t;
|
||||
|
||||
typedef struct{
|
||||
|
||||
|
||||
}UE_MAC_sl_config_request_Rx_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
|
||||
}UE_MAC_sl_tx_request_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// *** UE_DL.indication related structures
|
||||
|
||||
typedef struct{
|
||||
unsigned char eNB_index;
|
||||
uint8_t first_sync; //boolean 0 or 1
|
||||
uint8_t sync; // boolean 0 or 1 to indicate whether rrc_out_of_sync_ind() or dl_phy_sync_success()
|
||||
// should be called from the handler function of the interface respectively.
|
||||
}UE_MAC_bch_indication_pdu_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
nfapi_tl_t tl;
|
||||
UE_MAC_bch_indication_pdu_t* bch_ind_list;
|
||||
}UE_MAC_BCH_indication_body_t;
|
||||
|
||||
|
||||
// Corresponding to inputs of MAC functions: ue_send_sdu(), ue_decode_si(), ue_decode_p().
|
||||
typedef struct{
|
||||
uint8_t* data;
|
||||
uint16_t data_len;
|
||||
}UE_MAC_dlsch_pdu;
|
||||
|
||||
|
||||
// Corresponding to inputs of MAC function: process_rar().
|
||||
typedef struct{
|
||||
rnti_t ra_rnti;
|
||||
uint8_t* rar_input_buffer; // Originating from PHY
|
||||
rnti_t* t_crnti;
|
||||
uint8_t preamble_index;
|
||||
uint8_t* rar_output_buffer; //should be returned to PHY: dlsch0->harq_processes[0]->b
|
||||
}UE_MAC_dlsch_rar_pdu;
|
||||
|
||||
|
||||
typedef struct{
|
||||
uint8_t pdu_type;
|
||||
uint8_t eNB_index;
|
||||
union{
|
||||
UE_MAC_dlsch_pdu dlsch_pdu_ind;
|
||||
UE_MAC_dlsch_rar_pdu dlsch_rar_pdu_ind;
|
||||
};
|
||||
}UE_MAC_dlsch_indication_pdu_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
nfapi_tl_t tl;
|
||||
uint16_t number_of_pdus;
|
||||
UE_MAC_dlsch_indication_pdu_t* dlsch_ind_list;
|
||||
}UE_MAC_DLSCH_indication_body_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// *** UE_SL.indication related structures
|
||||
|
||||
typedef struct{
|
||||
|
||||
}ue_sci_indication_body_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
}ue_SLSCH_indication_body_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
}ue_SLDCH_indication_body_t;
|
||||
|
||||
typedef struct{
|
||||
|
||||
}ue_SLBCH_indication_body_t;
|
||||
|
||||
|
||||
// *** UE_Config_common.request related structures
|
||||
|
||||
typedef struct {
|
||||
uint8_t subframeAssignment;
|
||||
uint8_t specialSubframePatterns;
|
||||
}UE_PHY_tdd_frame_structure_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint16_t rootSequenceIndex;
|
||||
uint8_t prach_Config_enabled;
|
||||
uint8_t prach_ConfigIndex;
|
||||
uint8_t highSpeedFlag;
|
||||
uint8_t zeroCorrelationZoneConfig;
|
||||
uint8_t prach_FreqOffset;
|
||||
}UE_PHY_prach_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t deltaPUCCH_Shift;
|
||||
uint8_t nRB_CQI;
|
||||
uint8_t nCS_AN;
|
||||
uint16_t n1PUCCH_AN;
|
||||
}UE_PHY_pucch_config_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int8_t referenceSignalPower;
|
||||
uint8_t p_b;
|
||||
}UE_PHY_pdsch_config_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t n_SB;
|
||||
PUSCH_HOPPING_t hoppingMode;
|
||||
uint8_t pusch_HoppingOffset;
|
||||
uint8_t enable64QAM;
|
||||
uint8_t groupHoppingEnabled;
|
||||
uint8_t groupAssignmentPUSCH;
|
||||
uint8_t sequenceHoppingEnabled;
|
||||
uint8_t cyclicShift;
|
||||
}UE_PHY_pusch_config_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
uint8_t enabled_flag;
|
||||
uint8_t srs_BandwidthConfig;
|
||||
uint8_t srs_SubframeConfig;
|
||||
uint8_t ackNackSRS_SimultaneousTransmission;
|
||||
uint8_t srs_MaxUpPts;
|
||||
}UE_PHY_SRS_config_t;
|
||||
|
||||
typedef struct{
|
||||
int8_t p0_NominalPUSCH;
|
||||
PUSCH_alpha_t alpha;
|
||||
int8_t p0_NominalPUCCH;
|
||||
int8_t deltaPreambleMsg3;
|
||||
long deltaF_PUCCH_Format1;
|
||||
long deltaF_PUCCH_Format1b;
|
||||
long deltaF_PUCCH_Format2;
|
||||
long deltaF_PUCCH_Format2a;
|
||||
long deltaF_PUCCH_Format2b;
|
||||
}UE_PHY_UL_power_control_config_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
uint8_t maxHARQ_Msg3Tx;
|
||||
}UE_PHY_HARQ_Msg3_config_t;
|
||||
|
||||
typedef struct{
|
||||
uint8_t nb_antennas_tx;
|
||||
}UE_PHY_antenna_config_t;
|
||||
|
||||
typedef struct{
|
||||
PHICH_RESOURCE_t phich_resource;
|
||||
PHICH_DURATION_t phich_duration;
|
||||
}UE_PHY_phich_config_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
UE_PHY_tdd_frame_structure_t ue_tdd_frame_structure_config;
|
||||
UE_PHY_prach_config_t ue_prach_config;
|
||||
UE_PHY_pucch_config_t ue_pucch_config;
|
||||
UE_PHY_pdsch_config_t ue_pdsch_config;
|
||||
UE_PHY_pusch_config_t ue_pusch_config;
|
||||
UE_PHY_SRS_config_t ue_srs_config;
|
||||
UE_PHY_UL_power_control_config_t ue_ul_pow_cntl_config;
|
||||
UE_PHY_HARQ_Msg3_config_t ue_harq_msg3_config;
|
||||
/* Where can we find the types and values of the configuration for the PCH?
|
||||
UE_MAC_pusch_config_t ue_pch_config
|
||||
radioResourceConfigCommon->pcch_Config.defaultPagingCycle, radioResourceConfigCommon->pcch_Config.nB*/
|
||||
UE_PHY_antenna_config_t ue_ant_config;
|
||||
UE_PHY_phich_config_t ue_phich_config;
|
||||
/* MBSFN?*/
|
||||
}UE_PHY_config_common_request_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// *** UE_Config_dedicated. request related structures
|
||||
|
||||
typedef struct{
|
||||
PA_t p_a;
|
||||
}UE_PHY_pdsch_config_dedicated_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
uint8_t ackNackRepetition;
|
||||
ANFBmode_t tdd_AckNackFeedbackMode;
|
||||
//ACKNAKREP_t repetitionFactor;
|
||||
//uint16_t n1PUCCH_AN_Rep;
|
||||
}UE_PHY_pucch_config_dedicated_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
uint16_t betaOffset_ACK_Index;
|
||||
uint16_t betaOffset_RI_Index;
|
||||
uint16_t betaOffset_CQI_Index;
|
||||
}UE_PHY_pusch_config_dedicated_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
int8_t p0_UE_PUSCH;
|
||||
uint8_t deltaMCS_Enabled;
|
||||
uint8_t accumulationEnabled;
|
||||
int8_t p0_UE_PUCCH;
|
||||
int8_t pSRS_Offset;
|
||||
uint8_t filterCoefficient;
|
||||
}UE_PHY_ul_power_control_config_dedicated_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
uint16_t sr_PUCCH_ResourceIndex;
|
||||
uint8_t sr_ConfigIndex;
|
||||
DSR_TRANSMAX_t dsr_TransMax;
|
||||
}UE_PHY_SR_config_dedicated_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
uint8_t srsConfigDedicatedSetup;
|
||||
uint8_t duration;
|
||||
uint8_t cyclicShift;
|
||||
uint8_t freqDomainPosition;
|
||||
uint8_t srs_Bandwidth;
|
||||
uint16_t srs_ConfigIndex;
|
||||
uint8_t srs_HoppingBandwidth;
|
||||
uint8_t transmissionComb;
|
||||
//uint8_t srsCellSubframe;
|
||||
//uint8_t srsUeSubframe;
|
||||
}UE_PHY_srs_ul_config_dedicated_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
CQI_REPORTMODEAPERIODIC cqi_ReportModeAperiodic;
|
||||
CQI_REPORTPERIODIC CQI_ReportPeriodic;
|
||||
//int8_t nomPDSCH_RS_EPRE_Offset;
|
||||
}UE_PHY_cqi_report_config_dedicated_t;
|
||||
|
||||
|
||||
|
||||
typedef struct{
|
||||
uint8_t transmission_mode [NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
UE_PHY_pdsch_config_dedicated_t ue_pdsch_config;
|
||||
UE_PHY_pucch_config_dedicated_t ue_pucch_config;
|
||||
UE_PHY_pusch_config_dedicated_t ue_pusch_config;
|
||||
UE_PHY_ul_power_control_config_dedicated_t ue_ul_pow_cntrl_config;
|
||||
UE_PHY_SR_config_dedicated_t ue_SR_config;
|
||||
UE_PHY_srs_ul_config_dedicated_t ue_srs_ul_config;
|
||||
UE_PHY_cqi_report_config_dedicated_t ue_cqi_report_config;
|
||||
}UE_PHY_config_dedicated_request_t;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
typedef struct {
|
||||
nfapi_p4_p5_message_header_t header;
|
||||
uint8_t num_tlv;
|
||||
nfapi_subframe_config_t subframe_config;
|
||||
nfapi_rf_config_t rf_config;
|
||||
nfapi_phich_config_t phich_config;
|
||||
nfapi_sch_config_t sch_config;
|
||||
nfapi_prach_config_t prach_config;
|
||||
nfapi_pusch_config_t pusch_config;
|
||||
nfapi_pucch_config_t pucch_config;
|
||||
nfapi_srs_config_t srs_config;
|
||||
nfapi_uplink_reference_signal_config_t uplink_reference_signal_config;
|
||||
nfapi_laa_config_t laa_config;
|
||||
nfapi_emtc_config_t emtc_config;
|
||||
nfapi_tdd_frame_structure_t tdd_frame_structure_config;
|
||||
nfapi_l23_config_t l23_config;
|
||||
nfapi_nb_iot_config_t nb_iot_config;
|
||||
|
||||
// addition nfapi tlvs as per table 2-16 in idle or configure
|
||||
nfapi_nfapi_t nfapi_config;
|
||||
|
||||
nfapi_vendor_extension_tlv_t vendor_extension;
|
||||
} nfapi_config_request_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
uint8_t dci_format;
|
||||
uint8_t cce_index;
|
||||
uint8_t aggregation_level;
|
||||
uint16_t rnti;
|
||||
uint8_t resource_block_start;
|
||||
uint8_t number_of_resource_block;
|
||||
uint8_t mcs_1;
|
||||
uint8_t cyclic_shift_2_for_drms;
|
||||
uint8_t frequency_hopping_enabled_flag;
|
||||
uint8_t frequency_hopping_bits;
|
||||
uint8_t new_data_indication_1;
|
||||
uint8_t ue_tx_antenna_seleciton;
|
||||
uint8_t tpc;
|
||||
uint8_t cqi_csi_request;
|
||||
uint8_t ul_index;
|
||||
uint8_t dl_assignment_index;
|
||||
uint32_t tpc_bitmap;
|
||||
uint16_t transmission_power;
|
||||
} nfapi_hi_dci0_dci_pdu_rel8_t;
|
||||
|
||||
*/
|
||||
@@ -1,373 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY_INTERFACE/defs.h
|
||||
* \brief mac phy interface primitives
|
||||
* \author Raymond Knopp and Navid Nikaein
|
||||
* \date 2011
|
||||
* \version 0.5
|
||||
* \mail navid.nikaein@eurecom.fr or openair_tech@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __MAC_PHY_PRIMITIVES_H__
|
||||
# define __MAC_PHY_PRIMITIVES_H__
|
||||
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
|
||||
|
||||
#define MAX_NUMBER_OF_MAC_INSTANCES 16
|
||||
|
||||
#define NULL_PDU 255
|
||||
#define DCI 0
|
||||
#define DLSCH 1
|
||||
#define ULSCH 2
|
||||
|
||||
#define mac_exit_wrapper(sTRING) \
|
||||
do { \
|
||||
char temp[300]; \
|
||||
snprintf(temp, sizeof(temp), "%s in file "__FILE__" at line %d\n", sTRING, __LINE__); \
|
||||
mac_xface->macphy_exit(temp); \
|
||||
} while(0)
|
||||
|
||||
/** @defgroup _phy_if MAC-PHY interface
|
||||
* @ingroup _oai2
|
||||
* @{
|
||||
*/
|
||||
/*! \brief MACPHY Interface */
|
||||
/*
|
||||
typedef struct {
|
||||
/// Pointer function that initializes L2
|
||||
int (*macphy_init)(int eMBMS_active, char *uecap_xer, uint8_t CBA_active,uint8_t HO_active);
|
||||
|
||||
/// Pointer function that stops the low-level scheduler due an exit condition
|
||||
void (*macphy_exit)(const char *);
|
||||
|
||||
// eNB functions
|
||||
/// Invoke dlsch/ulsch scheduling procedure for new subframe
|
||||
void (*eNB_dlsch_ulsch_scheduler)(module_id_t Mod_id,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP);//, int calibration_flag);
|
||||
|
||||
/// Fill random access response sdu, passing timing advance
|
||||
uint16_t (*fill_rar)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t *dlsch_buffer,uint16_t N_RB_UL, uint8_t input_buffer_length);
|
||||
|
||||
/// Initiate the RA procedure upon reception (hypothetical) of a valid preamble
|
||||
void (*initiate_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble,int16_t timing_offset,uint8_t sect_id,sub_frame_t subframe,uint8_t f_id);
|
||||
|
||||
/// cancel an ongoing RA procedure
|
||||
void (*cancel_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble);
|
||||
|
||||
/// Inform MAC layer that an uplink is scheduled for Msg3 in given subframe.
|
||||
/// This is used so that the MAC scheduler marks as busy the RBs used by the Msg3.
|
||||
void (*set_msg3_subframe)(module_id_t Mod_id,
|
||||
int CC_id,
|
||||
int frame,
|
||||
int subframe,
|
||||
int rnti,
|
||||
int Msg3_frame,
|
||||
int Msg3_subframe);
|
||||
|
||||
/// Get DCI for current subframe from MAC
|
||||
DCI_PDU* (*get_dci_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe);
|
||||
|
||||
/// Get DLSCH sdu for particular RNTI and Transport block index
|
||||
uint8_t* (*get_dlsch_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TB_index);
|
||||
|
||||
/// Send ULSCH sdu to MAC for given rnti
|
||||
void (*rx_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP, sub_frame_t sub_frameP,rnti_t rnti, uint8_t *sdu,uint16_t sdu_len, int harq_pid,uint8_t *msg3_flag);
|
||||
|
||||
/// Indicate failure to synch to external source
|
||||
void (*mrbch_phy_sync_failure) (module_id_t Mod_id,frame_t frameP, uint8_t free_eNB_index);
|
||||
|
||||
/// Indicate Scheduling Request from UE
|
||||
void (*SR_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
|
||||
/// Indicate UL Failure to eNodeB MAC
|
||||
void (*UL_failure_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
|
||||
|
||||
/// Configure Common PHY parameters from SIB1
|
||||
void (*phy_config_mib_eNB)(module_id_t Mod_id,int CC_id,
|
||||
int eutra_band,
|
||||
int N_RB_DL,
|
||||
PHICH_Config_t *phich_Config,
|
||||
int Nid_cell,
|
||||
int Ncp,
|
||||
int p_eNB,
|
||||
uint32_t dl_CarrierFreq,
|
||||
uint32_t ul_CarrierFreq);
|
||||
|
||||
/// Configure Common PHY parameters from SIB1
|
||||
void (*phy_config_sib1_eNB)(module_id_t Mod_id,int CC_id,
|
||||
TDD_Config_t *tdd_config,
|
||||
uint8_t SIwindowsize,
|
||||
uint16_t SIperiod);
|
||||
|
||||
/// Configure Common PHY parameters from SIB2
|
||||
void (*phy_config_sib2_eNB)(module_id_t Mod_id, int CC_id,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/// Configure Common PHY parameters from SIB13
|
||||
void (*phy_config_sib13_eNB)(module_id_t Mod_id,int CC_id, int mbsfn_Area_idx,
|
||||
long mbsfn_AreaId_r9);
|
||||
|
||||
void (*phy_config_dedicated_scell_eNB)(uint8_t Mod_id,
|
||||
uint16_t rnti,
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
int CC_id);
|
||||
#endif
|
||||
|
||||
/// PHY-Config-Dedicated eNB
|
||||
void (*phy_config_dedicated_eNB)(module_id_t Mod_id,int CC_id,rnti_t rnti,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated);
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/// Get MCH sdu and corresponding MCS for particular MBSFN subframe
|
||||
MCH_PDU* (*get_mch_sdu)(module_id_t Mod_id, int CC_id, frame_t frameP,sub_frame_t subframe);
|
||||
#endif
|
||||
// configure the cba rnti at the physical layer
|
||||
void (*phy_config_cba_rnti)(module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, uint16_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
|
||||
/// get delta mcs for fast UL AMC
|
||||
int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
|
||||
|
||||
int (*mac_phy_remove_ue)(module_id_t Mod_idP,rnti_t rntiP);
|
||||
/// UE functions
|
||||
|
||||
/// reset the ue phy
|
||||
void (*phy_reset_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Indicate loss of synchronization of PBCH for this eNB to MAC layer
|
||||
void (*out_of_sync_ind)(module_id_t Mod_id,frame_t frameP,uint16_t eNB_index);
|
||||
|
||||
/// Send a received SI sdu
|
||||
void (*ue_decode_si)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
|
||||
|
||||
/// Send a received Paging sdu
|
||||
void (*ue_decode_p)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
|
||||
|
||||
/// Send a received DLSCH sdu to MAC
|
||||
void (*ue_send_sdu)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,sub_frame_t subframe,uint8_t *sdu,uint16_t sdu_len,uint8_t CH_index);
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/// Send a received MCH sdu to MAC
|
||||
void (*ue_send_mch_sdu)(module_id_t Mod_id,uint8_t CC_id, frame_t frameP,uint8_t *sdu,uint16_t sdu_len,uint8_t eNB_index,uint8_t sync_area);
|
||||
|
||||
/// Function to check if UE PHY needs to decode MCH for MAC
|
||||
/// get the sync area id, and return MCS value if need to decode, otherwise -1
|
||||
int (*ue_query_mch)(module_id_t Mod_id, uint8_t CC_id,frame_t frameP,sub_frame_t subframe,uint8_t eNB_index,uint8_t *sync_area, uint8_t *mcch_active);
|
||||
#endif
|
||||
|
||||
/// Retrieve ULSCH sdu from MAC
|
||||
void (*ue_get_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe, uint8_t CH_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
|
||||
|
||||
/// Retrieve RRCConnectionReq from MAC
|
||||
PRACH_RESOURCES_t* (*ue_get_rach)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t Msg3_flag,sub_frame_t subframe);
|
||||
|
||||
/// Process Random-Access Response
|
||||
uint16_t (*ue_process_rar)(module_id_t Mod_id,int CC_id,frame_t frameP, uint16_t ra_rnti, uint8_t *dlsch_buffer, uint16_t *t_crnti,uint8_t preamble_index, uint8_t* selected_rar_buffer);
|
||||
|
||||
/// Get SR payload (0,1) from UE MAC
|
||||
uint32_t (*ue_get_SR)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t eNB_id,rnti_t rnti,sub_frame_t subframe);
|
||||
|
||||
/// Indicate synchronization with valid PBCH
|
||||
void (*dl_phy_sync_success) (module_id_t Mod_id,frame_t frameP, uint8_t CH_index,uint8_t first_sync);
|
||||
|
||||
/// Only calls the PDCP for now
|
||||
UE_L2_STATE_t (*ue_scheduler)(module_id_t Mod_id, frame_t rxFrameP,sub_frame_t rxSubframe, frame_t txFrameP,sub_frame_t txSubframe, lte_subframe_t direction, uint8_t eNB_id, int CC_id);
|
||||
|
||||
/// PHY-Config-Dedicated UE
|
||||
void (*phy_config_dedicated_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated);
|
||||
|
||||
/// PHY-Config-harq UE
|
||||
void (*phy_config_harq_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
|
||||
uint16_t max_harq_tx);
|
||||
/// Configure Common PHY parameters from SIB1
|
||||
void (*phy_config_sib1_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
|
||||
TDD_Config_t *tdd_config,
|
||||
uint8_t SIwindowsize,
|
||||
uint16_t SIperiod);
|
||||
|
||||
/// Configure Common PHY parameters from SIB2
|
||||
void (*phy_config_sib2_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/// Configure Common PHY parameters from SIB13
|
||||
void (*phy_config_sib13_ue)(uint8_t Mod_id,int CC_id, uint8_t eNB_index,int mbsfn_Area_idx,
|
||||
long mbsfn_AreaId_r9);
|
||||
|
||||
void (*phy_config_dedicated_scell_ue)(uint8_t Mod_id,
|
||||
uint8_t eNB_index,
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
int CC_id);
|
||||
#endif
|
||||
/// Configure Common PHY parameters from mobilityControlInfo
|
||||
void (*phy_config_afterHO_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
|
||||
MobilityControlInfo_t *mobilityControlInfo,
|
||||
uint8_t ho_failed);
|
||||
|
||||
/// Function to indicate failure of contention resolution or RA procedure
|
||||
void (*ra_failed)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function to indicate success of contention resolution or RA procedure
|
||||
void (*ra_succeeded)(module_id_t Mod_id,uint8_t CC_id, uint8_t eNB_index);
|
||||
|
||||
/// Function to indicate the transmission of msg1/rach to MAC
|
||||
void (*Msg1_transmitted)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t eNB_id);
|
||||
|
||||
/// Function to indicate Msg3 transmission/retransmission which initiates/reset Contention Resolution Timer
|
||||
void (*Msg3_transmitted)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t eNB_id);
|
||||
|
||||
/// Function to pass inter-cell measurement parameters to PHY (cell Ids)
|
||||
void (*phy_config_meas_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n_adj_cells,uint32_t *adj_cell_id);
|
||||
|
||||
// PHY Helper Functions
|
||||
|
||||
/// RIV computation from PHY
|
||||
uint16_t (*computeRIV)(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
|
||||
|
||||
/// Downlink TBS table lookup from PHY
|
||||
uint32_t (*get_TBS_DL)(uint8_t mcs, uint16_t nb_rb);
|
||||
|
||||
/// Uplink TBS table lookup from PHY
|
||||
uint32_t (*get_TBS_UL)(uint8_t mcs, uint16_t nb_rb);
|
||||
|
||||
/// Function to retrieve the HARQ round index for a particular UL/DLSCH and harq_pid
|
||||
int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag);
|
||||
|
||||
/// Function to retrieve number of CCE
|
||||
uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
|
||||
|
||||
|
||||
int (*get_nCCE_offset)(int *CCE_table,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe);
|
||||
|
||||
/// Function to retrieve number of PRB in an rb_alloc
|
||||
uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl);
|
||||
|
||||
/// Function to convert VRB to PRB for distributed allocation
|
||||
uint32_t (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
|
||||
|
||||
/// Function to retrieve transmission mode for UE
|
||||
uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti);
|
||||
|
||||
/// Function to retrieve rb_alloc bitmap from dci rballoc field and VRB type
|
||||
uint32_t (*get_rballoc)(vrb_t vrb_type, uint16_t rb_alloc_dci);
|
||||
|
||||
/// Function for UE MAC to retrieve current PHY connectivity mode (PRACH,RA_RESPONSE,PUSCH)
|
||||
UE_MODE_t (*get_ue_mode)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE MAC to retrieve measured Path Loss
|
||||
int16_t (*get_PL)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE MAC to retrieve the rssi
|
||||
uint32_t (*get_RSSI)(uint8_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE MAC to retrieve the total gain
|
||||
uint32_t (*get_rx_total_gain_dB)(uint8_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE MAC to retrieve the number of adjustent cells
|
||||
uint8_t (*get_n_adj_cells)(uint8_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
|
||||
uint32_t (*get_RSRP)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
|
||||
uint32_t (*get_RSRQ)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
|
||||
uint8_t (*set_RSRP_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
|
||||
|
||||
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
|
||||
uint8_t (*set_RSRQ_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
|
||||
|
||||
/// Function for UE/eNB MAC to retrieve number of PRACH in TDD
|
||||
uint8_t (*get_num_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
/// Function for UE/eNB MAC to retrieve f_id of particular PRACH resource in TDD
|
||||
uint8_t (*get_fid_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms,uint8_t tdd_map_index);
|
||||
|
||||
/// Function for eNB MAC to retrieve subframe direction
|
||||
lte_subframe_t (*get_subframe_direction)(module_id_t Mod_id, uint8_t CC_id, uint8_t subframe);
|
||||
|
||||
// MAC Helper functions
|
||||
/// Function for UE/PHY to compute PUSCH transmit power in power-control procedure (Po_NOMINAL_PUSCH parameter)
|
||||
int8_t (*get_Po_NOMINAL_PUSCH)(module_id_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE/PHY to compute PUSCH transmit power in power-control procedure (deltaP_rampup parameter)
|
||||
int8_t (*get_deltaP_rampup)(module_id_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE/PHY to compute PHR
|
||||
int8_t (*get_PHR)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE to process the timing advance command
|
||||
void (*process_timing_advance)(module_id_t Mod_id,uint8_t CC_id, int16_t timing_advance);
|
||||
|
||||
/// Function for MAC to get the UE stats from the PHY
|
||||
LTE_eNB_UE_stats* (*get_eNB_UE_stats)(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
|
||||
|
||||
/// get the frame parameters from the PHY
|
||||
LTE_DL_FRAME_PARMS* (*get_lte_frame_parms)(module_id_t Mod_id, uint8_t CC_id);
|
||||
|
||||
/// get the Multiuser mimo mode
|
||||
MU_MIMO_mode* (*get_mu_mimo_mode) (module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
|
||||
|
||||
/// get the delta TF for Uplink Power Control Calculation
|
||||
int16_t (*get_hundred_times_delta_TF) (module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid);
|
||||
/// get target PUSCH received power
|
||||
int16_t (*get_target_pusch_rx_power) (module_id_t module_idP, uint8_t CC_id);
|
||||
/// get target PUSCH received power
|
||||
int16_t (*get_target_pucch_rx_power) (module_id_t module_idP, uint8_t CC_id);
|
||||
|
||||
unsigned char is_cluster_head;
|
||||
unsigned char is_primary_cluster_head;
|
||||
unsigned char is_secondary_cluster_head;
|
||||
unsigned char cluster_head_index;
|
||||
|
||||
/// PHY Frame Configuration
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
uint8_t (*get_prach_prb_offset)(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
|
||||
|
||||
int (*is_prach_subframe)(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe);
|
||||
|
||||
/// ICIC algos
|
||||
uint8_t (*get_SB_size)(uint8_t n_rb_dl);
|
||||
///end ALU's algo
|
||||
|
||||
} MAC_xface;
|
||||
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/** @} */
|
||||
@@ -187,9 +187,6 @@ MACPHY_DATA_REQ *new_macphy_data_req(unsigned char Mod_id)
|
||||
|
||||
return((MACPHY_DATA_REQ*)0);
|
||||
}
|
||||
#ifndef USER_MODE
|
||||
EXPORT_SYMBOL(new_macphy_data_req);
|
||||
#endif
|
||||
|
||||
|
||||
#endif //PHY_CONTEXT
|
||||
@@ -262,13 +259,7 @@ void macphy_data_ind(unsigned char Mod_id,unsigned char Pdu_type,void *pdu,unsig
|
||||
}
|
||||
}
|
||||
msg("[OPENAIR][MAC][ERROR] No more PHY_RESOURCES !!!!\n");
|
||||
#ifdef USER_MODE
|
||||
exit(-1);
|
||||
#else
|
||||
print_active_indications();
|
||||
print_active_requests();
|
||||
mac_xface->macphy_exit();
|
||||
#endif
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY_INTERFACE/defs.h
|
||||
* \brief mac phy interface primitives
|
||||
* \author Raymond Knopp and Navid Nikaein
|
||||
* \date 2011
|
||||
* \version 0.5
|
||||
* \mail navid.nikaein@eurecom.fr or openair_tech@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __PHY_INTERFACE_H__
|
||||
# define __PHY_INTERFACE_H__
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
|
||||
|
||||
#define MAX_NUMBER_OF_MAC_INSTANCES 16
|
||||
|
||||
#define NULL_PDU 255
|
||||
#define DCI 0
|
||||
#define DLSCH 1
|
||||
#define ULSCH 2
|
||||
|
||||
#define mac_exit_wrapper(sTRING) \
|
||||
do { \
|
||||
char temp[300]; \
|
||||
snprintf(temp, sizeof(temp), "%s in file "__FILE__" at line %d\n", sTRING, __LINE__); \
|
||||
mac_xface->macphy_exit(temp); \
|
||||
} while(0)
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/** @} */
|
||||
@@ -23,7 +23,7 @@
|
||||
#define __PHY_INTERFACE_VARS_H__
|
||||
|
||||
//#include "SIMULATION/PHY_EMULATION/spec_defs.h"
|
||||
#include "defs.h"
|
||||
#include "phy_interface.h"
|
||||
|
||||
#ifdef PHY_EMUL
|
||||
#include "SIMULATION/PHY_EMULATION/DEVICE_DRIVER/defs.h"
|
||||
@@ -42,7 +42,3 @@ unsigned int mac_registered;
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef USER_MODE
|
||||
EXPORT_SYMBOL(mac_xface);
|
||||
#endif //PHY_EMUL
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* phy_stub_UE.h
|
||||
*
|
||||
* Created on: Sep 14, 2017
|
||||
* Author: montre
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PHY_STUB_UE__H__
|
||||
#define __PHY_STUB_UE__H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include "openair2/PHY_INTERFACE/IF_Module.h"
|
||||
#include "nfapi_interface.h"
|
||||
#include "nfapi_pnf_interface.h"
|
||||
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
|
||||
//#include "openair1/PHY/defs.h"
|
||||
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
|
||||
|
||||
UL_IND_t *UL_INFO;
|
||||
|
||||
nfapi_tx_request_pdu_t* tx_request_pdu_list;
|
||||
// New
|
||||
/// Pointers to config_request types. Used from nfapi callback functions.
|
||||
nfapi_dl_config_request_t* dl_config_req;
|
||||
nfapi_ul_config_request_t* ul_config_req;
|
||||
nfapi_hi_dci0_request_t* hi_dci0_req;
|
||||
|
||||
int tx_req_num_elems;
|
||||
|
||||
int next_ra_frame;
|
||||
module_id_t next_Mod_id;
|
||||
eth_params_t stub_eth_params;
|
||||
|
||||
|
||||
|
||||
|
||||
// This function should return all the sched_response config messages which concern a specific UE. Inside this
|
||||
// function we should somehow make the translation of config message's rnti to Mod_ID.
|
||||
Sched_Rsp_t get_nfapi_sched_response(uint8_t Mod_id);
|
||||
|
||||
// This function will be processing DL_config and Tx.requests and trigger all the MAC Rx related calls at the UE side,
|
||||
// namely:ue_send_sdu(), or ue_decode_si(), or ue_decode_p(), or ue_process_rar() based on the rnti type.
|
||||
//void handle_nfapi_UE_Rx(uint8_t Mod_id, Sched_Rsp_t *Sched_INFO, int eNB_id);
|
||||
|
||||
int pnf_ul_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req);
|
||||
|
||||
// This function will be processing UL and HI_DCI0 config requests to trigger all the MAC Tx related calls
|
||||
// at the UE side, namely: ue_get_SR(), ue_get_rach(), ue_get_sdu() based on the pdu configuration type.
|
||||
// The output of these calls will be put to an UL_IND_t structure which will then be the input to
|
||||
// send_nfapi_UL_indications().
|
||||
UL_IND_t generate_nfapi_UL_indications(Sched_Rsp_t sched_response);
|
||||
|
||||
// This function should pass the UL indication messages to the eNB side through the socket interface.
|
||||
void send_nfapi_UL_indications(UL_IND_t UL_INFO);
|
||||
|
||||
// This function should be filling the nfapi ULSCH indications at the MAC level of the UE in a similar manner
|
||||
// as fill_rx_indication() does. It should get called from ue_get_SDU()
|
||||
|
||||
//void fill_rx_indication_UE_MAC(module_id_t Mod_id,int frame,int subframe);
|
||||
|
||||
void fill_rx_indication_UE_MAC(module_id_t Mod_id,int frame,int subframe, UL_IND_t *UL_INFO, uint8_t *ulsch_buffer, uint16_t buflen, uint16_t rnti, int index);
|
||||
|
||||
|
||||
// This function should be indicating directly to the eNB when there is a planned scheduling request at the MAC layer
|
||||
// of the UE. It should get called from ue_get_SR()
|
||||
void fill_sr_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL_INFO, uint16_t rnti);
|
||||
|
||||
// In our case the this function will be always indicating ACK to the MAC of the eNB (i.e. always assuming)
|
||||
// successful decoding.
|
||||
void fill_crc_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL_INFO, uint8_t crc_flag, int index, uint16_t rnti);
|
||||
|
||||
|
||||
void fill_rach_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL_INFO, uint8_t ra_PreambleIndex, uint16_t ra_RNTI);
|
||||
|
||||
|
||||
void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subframe, UL_IND_t *UL_INFO, uint16_t rnti);
|
||||
|
||||
|
||||
void fill_ulsch_harq_indication_UE_MAC(int Mod_id, int frame,int subframe, UL_IND_t *UL_INFO, nfapi_ul_config_ulsch_harq_information *harq_information, uint16_t rnti);
|
||||
|
||||
void fill_uci_harq_indication_UE_MAC(int Mod_id, int frame, int subframe, UL_IND_t *UL_INFO,nfapi_ul_config_harq_information *harq_information, uint16_t rnti
|
||||
/*uint8_t tdd_mapping_mode,
|
||||
uint16_t tdd_multiplexing_mask*/);
|
||||
|
||||
int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int frame, int subframe, module_id_t Mod_id);
|
||||
|
||||
void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
uint16_t frame,uint8_t subframe,uint8_t srs_present, int index);
|
||||
|
||||
//int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, nfapi_tx_request_pdu_t* tx_request_pdu_list);
|
||||
int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id);
|
||||
|
||||
int tx_req_UE_MAC(nfapi_tx_request_t* req);
|
||||
|
||||
|
||||
int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req, module_id_t Mod_id);
|
||||
|
||||
// The following set of memcpy functions should be getting called as callback functions from
|
||||
// pnf_p7_subframe_ind.
|
||||
|
||||
int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req);
|
||||
|
||||
|
||||
int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req);
|
||||
|
||||
|
||||
int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req);
|
||||
|
||||
|
||||
int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req);
|
||||
|
||||
void UE_config_stub_pnf(void);
|
||||
|
||||
|
||||
|
||||
#endif /* PHY_STUB_UE_H_ */
|
||||
Reference in New Issue
Block a user