diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 271d54fdce..0c41328f32 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -312,6 +312,8 @@ typedef struct RU_t_s{ LTE_DL_FRAME_PARMS frame_parms; ///timing offset used in TDD int N_TA_offset; + /// SF extension used in TDD (unit: number of samples at 30.72MHz) (this is an expert option) + int sf_extension; /// RF device descriptor openair0_device rfdevice; /// HW configuration diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index b44ec9de16..edbb34461a 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -101,6 +101,7 @@ typedef enum { #define CONFIG_STRING_RU_NBIOTRRC_LIST "NbIoT_RRC_instances" #define CONFIG_STRING_RU_SDR_ADDRS "sdr_addrs" #define CONFIG_STRING_RU_SDR_CLK_SRC "clock_src" +#define CONFIG_STRING_RU_SF_EXTENSION "sf_extension" #define RU_LOCAL_IF_NAME_IDX 0 #define RU_LOCAL_ADDRESS_IDX 1 @@ -122,6 +123,7 @@ typedef enum { #define RU_NBIOTRRC_LIST_IDX 17 #define RU_SDR_ADDRS 18 #define RU_SDR_CLK_SRC 19 +#define RU_SF_EXTENSION_IDX 20 @@ -149,7 +151,8 @@ typedef enum { {CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \ {CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 787e630d17..002190ec53 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -835,7 +835,7 @@ void tx_rf(RU_t *ru) { (prevSF_type == SF_UL) && (nextSF_type == SF_DL)) { flags = 2; // start of burst - sf_extension = ru->N_TA_offset; + sf_extension = ru->sf_extension; } if ((fp->frame_type == TDD) && @@ -843,7 +843,7 @@ void tx_rf(RU_t *ru) { (prevSF_type == SF_UL) && (nextSF_type == SF_UL)) { flags = 4; // start of burst and end of burst (only one DL SF between two UL) - sf_extension = ru->N_TA_offset; + sf_extension = ru->sf_extension; } #if defined(__x86_64) || defined(__i386__) @@ -1386,6 +1386,14 @@ int setup_RU_buffers(RU_t *ru) { * TODO: find a proper cleaner solution */ ru->N_TA_offset = 0; + + if (frame_parms->N_RB_DL == 100) /* no scaling to do */; + else if (frame_parms->N_RB_DL == 50) ru->sf_extension /= 2; + else if (frame_parms->N_RB_DL == 25) ru->sf_extension /= 4; + else { printf("not handled, todo\n"); exit(1); } + } else { + ru->N_TA_offset = 0; + ru->sf_extension = 0; } if (ru->openair0_cfg.mmapped_dma == 1) { @@ -2883,6 +2891,8 @@ void RCconfig_RU(void) { RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; + /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */ + RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr); for (i=0; inum_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; } //strcmp(local_rf, "yes") == 0