Commit 2a4a37c0 authored by Matthieu Kanj's avatar Matthieu Kanj

Code Separation for openair1/PHY/ + creation of new file:, (130 warnings)

openair1/PHY/LTE_TRANSPORT/vars_NB_IoT.h
parent 9b5d4c88
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
* \warning * \warning
*/ */
//#include "PHY/defs.h" //#include "PHY/defs.h"
//#include "PHY/extern_NB_IoT.h" #include "PHY/impl_defs_lte_NB_IoT.h"
#include "openair1/PHY/extern_NB_IoT.h"
//#include "PHY/LTE_TRANSPORT/extern_NB_IoT.h" //#include "PHY/LTE_TRANSPORT/extern_NB_IoT.h"
//#include "SCHED/defs_NB_IoT.h" //#include "SCHED/defs_NB_IoT.h"
/* /*
...@@ -141,7 +142,7 @@ int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -141,7 +142,7 @@ int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
} }
//map the Isf (DCI param) to the number of subframes (Nsf) //map the Isf (DCI param) to the number of subframes (Nsf)
int resource_to_subframe[8] = {1,2,3,4,5,6,8,10}; int resource_to_subframe[8] = {1,2,3,4,5,6,8,10};
int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
int frame, int frame,
...@@ -375,3 +376,99 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -375,3 +376,99 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
return(0); return(0);
} }
uint8_t subframe2harq_pid_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe)
{
/*
#ifdef DEBUG_DCI
if (frame_parms->frame_type == TDD)
printf("dci_tools.c: subframe2_harq_pid, subframe %d for TDD configuration %d\n",subframe,frame_parms->tdd_config);
else
printf("dci_tools.c: subframe2_harq_pid, subframe %d for FDD \n",subframe);
#endif
*/
uint8_t ret = 255;
if (frame_parms->frame_type == FDD_NB_IoT) {
ret = (((frame<<1)+subframe)&7);
} else {
switch (frame_parms->tdd_config) {
case 1:
if ((subframe==2) ||
(subframe==3) ||
(subframe==7) ||
(subframe==8))
switch (subframe) {
case 2:
case 3:
ret = (subframe-2);
break;
case 7:
case 8:
ret = (subframe-5);
break;
default:
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
ret = (255);
break;
}
break;
case 2:
if ((subframe!=2) && (subframe!=7)) {
LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
mac_xface->macphy_exit("subframe2_harq_pid_NB_IoT, Illegal subframe");
ret = (255);
}
ret = (subframe/7);
break;
case 3:
if ((subframe<2) || (subframe>4)) {
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
ret = (255);
}
ret = (subframe-2);
break;
case 4:
if ((subframe<2) || (subframe>3)) {
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
ret = (255);
}
ret = (subframe-2);
break;
case 5:
if (subframe!=2) {
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
ret = (255);
}
ret = (subframe-2);
break;
default:
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Unsupported TDD mode %d\n",frame_parms->tdd_config);
ret = (255);
}
}
if (ret == 255) {
LOG_E(PHY, "invalid harq_pid(%d) at SFN/SF = %d/%d\n", ret, frame, subframe);
mac_xface->macphy_exit("invalid harq_pid");
}
return ret;
}
...@@ -20,7 +20,16 @@ ...@@ -20,7 +20,16 @@
*/ */
#ifndef __PHY_LTE_TRANSPORT_EXTERN_NB_IOT__H__
#define __PHY_LTE_TRANSPORT_EXTERN_NB_IOT__H__
//NB-Iot //NB-Iot
extern unsigned int TBStable_NB_IoT[14][8]; extern unsigned int TBStable_NB_IoT[14][8];
extern unsigned char cs_ri_normal_NB_IoT[4];
extern unsigned char cs_ri_extended_NB_IoT[4];
extern unsigned char cs_ack_normal_NB_IoT[4];
extern unsigned char cs_ack_extended_NB_IoT[4];
extern int8_t wACK_RX_NB_IoT[5][4];
#endif
\ No newline at end of file
...@@ -174,6 +174,9 @@ NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag); ...@@ -174,6 +174,9 @@ NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag);
LTE_eNB_ULSCH_t **ulsch, LTE_eNB_ULSCH_t **ulsch,
uint8_t cooperation_flag); uint8_t cooperation_flag);
*/ */
uint8_t subframe2harq_pid_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe);
/** \fn dlsch_encoding(PHY_VARS_eNB *eNB, /** \fn dlsch_encoding(PHY_VARS_eNB *eNB,
uint8_t *input_buffer, uint8_t *input_buffer,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
......
/*
* 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.0 (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
*/
//#include "dlsch_tbs.h"
//#include "dlsch_tbs_full.h"
//#include "sss.h"
#ifndef __PHY_LTE_TRANSPORT_VARS_NB_IOT__H__
#define __PHY_LTE_TRANSPORT_VARS_NB_IOT__H__
unsigned char cs_ri_normal_NB_IoT[4] = {1,4,7,10};
unsigned char cs_ri_extended_NB_IoT[4] = {0,3,5,8};
unsigned char cs_ack_normal_NB_IoT[4] = {2,3,8,9};
unsigned char cs_ack_extended_NB_IoT[4] = {1,2,6,7};
int8_t wACK_RX_NB_IoT[5][4] = {{-1,-1,-1,-1},{-1,1,-1,1},{-1,-1,1,1},{-1,1,1,-1},{1,1,1,1}};
#endif
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/defs_NB_IoT.h" #include "PHY/defs_NB_IoT.h"
//#include "PHY_INTERFACE/defs.h" #include "openair2/PHY_INTERFACE/defs.h"
//#include "PHY_INTERFACE/IF_Module_NB_IoT.h" //#include "PHY_INTERFACE/IF_Module_NB_IoT.h"
/* /*
extern char* namepointer_chMag ; extern char* namepointer_chMag ;
...@@ -54,8 +54,9 @@ extern PHY_VARS_UE_NB_IoT * PHY_vars_UE_NB_IoT_g[MAX_UE][MAX_NUM_CCs]; ...@@ -54,8 +54,9 @@ extern PHY_VARS_UE_NB_IoT * PHY_vars_UE_NB_IoT_g[MAX_UE][MAX_NUM_CCs];
extern PHY_VARS_eNB_NB_IoT * PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs]; extern PHY_VARS_eNB_NB_IoT * PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs];
#endif #endif
/*
extern MAC_xface *mac_xface; extern MAC_xface *mac_xface;
/*
extern IF_Module_t *if_inst; extern IF_Module_t *if_inst;
...@@ -117,8 +118,9 @@ extern double beta2_dlsch[6][MCS_COUNT]; ...@@ -117,8 +118,9 @@ extern double beta2_dlsch[6][MCS_COUNT];
extern char eNB_functions[6][20]; extern char eNB_functions[6][20];
extern char eNB_timing[2][20]; extern char eNB_timing[2][20];
*/
extern int16_t unscrambling_lut[65536*16]; extern int16_t unscrambling_lut_NB_IoT[65536*16];
/*
extern uint8_t scrambling_lut[65536*16]; extern uint8_t scrambling_lut[65536*16];
extern unsigned short msrsb_6_40[8][4]; extern unsigned short msrsb_6_40[8][4];
......
...@@ -391,7 +391,8 @@ typedef struct { ...@@ -391,7 +391,8 @@ typedef struct {
uint8_t N_RB_DL; uint8_t N_RB_DL;
/// Number of resource blocks (RB) in UL of the LTE ((for knowing the bandwidth) /// Number of resource blocks (RB) in UL of the LTE ((for knowing the bandwidth)
uint8_t N_RB_UL; uint8_t N_RB_UL;
/// TDD subframe assignment (0-7) (default = 3) (254=RX only, 255=TX only)
uint8_t tdd_config;
/// Cell ID /// Cell ID
uint16_t Nid_cell; uint16_t Nid_cell;
/// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP) /// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP)
......
...@@ -147,9 +147,11 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682 ...@@ -147,9 +147,11 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682
char eNB_functions[6][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RCC_IF4p5","NGFI_RAI_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",}; char eNB_functions[6][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RCC_IF4p5","NGFI_RAI_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",};
char eNB_timing[2][20]={"synch_to_ext_device","synch_to_other"}; char eNB_timing[2][20]={"synch_to_ext_device","synch_to_other"};
#endif #endif
*/
/// lookup table for unscrambling in RX /// lookup table for unscrambling in RX
int16_t unscrambling_lut[65536*16] __attribute__((aligned(32))); int16_t unscrambling_lut_NB_IoT[65536*16] __attribute__((aligned(32)));
/*
/// lookup table for scrambling in TX /// lookup table for scrambling in TX
uint8_t scrambling_lut[65536*16] __attribute__((aligned(32))); uint8_t scrambling_lut[65536*16] __attribute__((aligned(32)));
......
...@@ -191,8 +191,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -191,8 +191,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
sub_frame_t subframe = Sched_INFO->subframe; sub_frame_t subframe = Sched_INFO->subframe;
// implicite declaration of AssertFatal // implicite declaration of AssertFatal
AsserFatal(proc->subframe_tx != subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe); //AsserFatal(proc->subframe_tx != subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe);
AsserFatal(proc->frame_tx != frame, "Current sframe %d != NFAPI frame %d\n", proc->frame_tx,frame ); //AsserFatal(proc->frame_tx != frame, "Current sframe %d != NFAPI frame %d\n", proc->frame_tx,frame );
uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu; uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu;
uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus; uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus;
......
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