Commit 6559fc19 authored by David Price's avatar David Price

Merge from RU-RAU-split 9th Oct

parents 8da3d5cc 8e6cc019
......@@ -564,6 +564,15 @@ add_library(oai_mobipass MODULE ${TPLIB_MOBIPASS_SOURCE} )
get_target_property(mobipas_cflags oai_mobipass COMPILE_FLAGS)
set_target_properties(oai_mobipass PROPERTIES COMPILE_FLAGS "${mobipass_cflags} -fvisibility=hidden")
set(HWLIB_TCP_BRIDGE_SOURCE
${OPENAIR_TARGETS}/ARCH/tcp_bridge/tcp_bridge.c
)
add_library(oai_tcp_bridge MODULE ${HWLIB_TCP_BRIDGE_SOURCE} )
#get_target_property(tcp_bridge_cflags oai_tcp_bridge COMPILE_FLAGS)
#set_target_properties(oai_tcp_bridge PROPERTIES COMPILE_FLAGS "${tcp_bridge_cflags} -fvisibility=hidden")
set_target_properties(oai_tcp_bridge PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
##########################################################
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
......
......@@ -623,7 +623,6 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t
read_ret = read (itti_desc.threads[thread_id].task_event_fd, &sem_counter, sizeof(sem_counter));
AssertFatal (read_ret == sizeof(sem_counter), "Read from task message FD (%d) failed (%d/%d)!\n", thread_id, (int) read_ret, (int) sizeof(sem_counter));
printf("sem_counter %d task %d\n", (int)sem_counter, task_id);
if (lfds611_queue_dequeue (itti_desc.tasks[task_id].message_queue, (void **) &message) == 0) {
/* No element in list -> this should not happen */
AssertFatal (0, "No message in queue for task %d while there are %d events and some for the messages queue!\n", task_id, epoll_ret);
......@@ -632,7 +631,6 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t
AssertFatal(message != NULL, "Message from message queue is NULL!\n");
*received_msg = message->msg;
printf("ITTI: message %s\n", ITTI_MSG_NAME(message->msg));
result = itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
......
/*
* 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
*/
/* FT NOKBLF:
* this source is to be linked with the program using the telnet server, it looks for
* the telnet server dynamic library, possibly loads it and calls the telnet server
* init functions
*/
/*! \file common/utils/load_module_shlib.c
* \brief shared library loader implementation
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
......@@ -13,37 +38,71 @@
#include <dlfcn.h>
#include "openair1/PHY/defs.h"
#define LOAD_MODULE_SHLIB_MAIN
#include "common/config/config_userapi.h"
#include "load_module_shlib.h"
int load_module_shlib(char *modname)
void loader_init(void) {
paramdef_t LoaderParams[] = LOADER_PARAMS_DESC;
int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),LOADER_CONFIG_PREFIX);
if (ret <0) {
fprintf(stderr,"[LOADER] configuration couldn't be performed");
if (loader_data.shlibpath == NULL) {
loader_data.shlibpath=DEFAULT_PATH;
}
return;
}
}
int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf)
{
void *lib_handle;
initfunc_t fpi;
char *tmpstr;
int ret=0;
tmpstr = malloc(strlen(modname)+16);
if (loader_data.shlibpath == NULL) {
loader_init();
}
tmpstr = malloc(strlen(loader_data.shlibpath)+strlen(modname)+16);
if (tmpstr == NULL) {
fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno));
return -1;
}
sprintf(tmpstr,"lib%s.so",modname);
if(loader_data.shlibpath[0] != 0) {
ret=sprintf(tmpstr,"%s/",loader_data.shlibpath);
}
if(strstr(modname,".so") == NULL) {
sprintf(tmpstr+ret,"lib%s.so",modname);
} else {
sprintf(tmpstr+ret,"%s",modname);
}
ret = 0;
lib_handle = dlopen(tmpstr, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL);
if (!lib_handle) {
printf("[LOADER] library %s is not loaded: %s\n", tmpstr,dlerror());
fprintf(stderr,"[LOADER] library %s is not loaded: %s\n", tmpstr,dlerror());
ret = -1;
} else {
sprintf(tmpstr,"init_%s",modname);
printf("[LOADER] library %s uccessfully loaded loaded\n", tmpstr);
sprintf(tmpstr,"%s_autoinit",modname);
fpi = dlsym(lib_handle,tmpstr);
if (fpi != NULL )
{
fpi();
}
else
{
fprintf(stderr,"[LOADER] %s %d %s function not found %s\n",__FILE__, __LINE__, dlerror(),tmpstr);
ret = -1;
}
if (farray != NULL) {
for (int i=0; i<numf; i++) {
farray[i].fptr = dlsym(lib_handle,farray[i].fname);
if (farray[i].fptr == NULL ) {
fprintf(stderr,"[LOADER] %s %d %s function not found %s\n",__FILE__, __LINE__, dlerror(),farray[i].fname);
ret= -1;
}
} /* for int i... */
} /* farray ! NULL */
}
if (tmpstr != NULL) free(tmpstr);
......
/*
* 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
*/
/*! \file common/utils/load_module_shlib.h
* \brief include file for users of the shared lib loader
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#ifndef LOAD_SHLIB_H
#define LOAD_SHLIB_H
typedef int(*initfunc_t)(void);
typedef struct {
char *shlibpath;
}loader_data_t;
typedef struct {
char *fname;
int (*fptr)(void);
}loader_shlibfunc_t;
#ifdef LOAD_MODULE_SHLIB_MAIN
#define LOADER_CONFIG_PREFIX "loader"
#define DEFAULT_PATH ""
loader_data_t loader_data;
/*--------------------------------------------------------------------------------------------------------------------------------------*/
/* LOADER parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------*/
#define LOADER_PARAMS_DESC { \
{"shlibpath", NULL, 0, strptr:(char **)&(loader_data.shlibpath), defstrval:DEFAULT_PATH, TYPE_STRING, 0} \
}
/*-------------------------------------------------------------------------------------------------------------*/
#else
extern int load_module_shlib(char *modname);
extern int load_module_shlib(char *modname, loader_shlibfunc_t *farray, int numf);
#endif
#endif
......@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
/*! \file common/utils/telnetsrv.c
/*! \file common/utils/telnetsrv/telnetsrv.c
* \brief: implementation of a telnet server
* \author Francois TABURET
* \date 2017
......
/*
* 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
*/
/*! \file common/utils/telnetsrv/telnetsrv.h
* \brief: include file for telnet server implementation
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#ifndef TELNETSRV_H
#define TELNETSRV_H
......
/*
* 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
*/
/*! \file common/utils/telnetsrv/telnetsrv_phycmd.c
* \brief: implementation of telnet commands related to softmodem linux process
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#define _GNU_SOURCE
#include <string.h>
#include <pthread.h>
......@@ -89,7 +120,7 @@ int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt)
if (strcasestr(buf,"uedump") != NULL)
{
dump_uestats(debug, prnt,1);
}
}
return 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.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
*/
/*! \file common/utils/telnetsrv_proccmd.h
* \brief: Include file defining telnet commands related to softmodem linux process
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#ifdef TELNETSRV_PHYCMD_MAIN
......
/*
* 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
*/
/*! \file common/utils/telnetsrv/telnetsrv_proccmd.c
* \brief: implementation of telnet commands related to this linux process
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
......
......@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
/*! \file common/utils/telnetsrv_proccmd.h
/*! \file common/utils/telnetsrv/telnetsrv_proccmd.h
* \brief: Include file defining telnet commands related to this linux process
* \author Francois TABURET
* \date 2017
......
......@@ -2278,13 +2278,13 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
if (dci_alloc[i].L == (uint8_t)L) {
//#ifdef DEBUG_DCI_ENCODING
if (dci_alloc[i].rnti!=0xFFFF)
#ifdef DEBUG_DCI_ENCODING
if (dci_alloc[i].rnti==0x02)
LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L,
*(unsigned int*)dci_alloc[i].dci_pdu,
dci_alloc[i].rnti);
//dump_dci(frame_parms,&dci_alloc[i]);
//#endif
//dump_dci(frame_parms,&dci_alloc[i]);
#endif
if (dci_alloc[i].firstCCE>=0) {
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
......
......@@ -896,14 +896,14 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
int TB1_active;
uint16_t DL_pmi_single=0; // This should be taken from DLSCH parameters for PUSCH precoding
uint8_t I_mcs = 0;
dci_alloc->firstCCE = rel8->cce_idx;
dci_alloc->L = rel8->aggregation_level;
dci_alloc->rnti = rel8->rnti;
dci_alloc->harq_pid = rel8->harq_process;
dci_alloc->ra_flag = 0;
LOG_I(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n",
LOG_D(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n",
rel8->dci_format,rel8->cce_idx,rel8->aggregation_level,rel8->rnti,rel8->harq_process);
if ((rel8->rnti_type == 2 ) && (rel8->rnti != SI_RNTI) && (rel8->rnti != P_RNTI)) dci_alloc->ra_flag = 1;
......@@ -920,6 +920,10 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
dlsch1_harq = dlsch1->harq_processes[rel8->harq_process];
dlsch1_harq->codeword = 1;
dlsch0->subframe_tx[subframe] = 1;
if (dlsch0->rnti != rel8->rnti) { // if rnti of dlsch is not the same as in the config, this is a new entry
dlsch0_harq->round=0;
dlsch0->harq_mask=0;
}
if ((dlsch0->harq_mask & (1<<rel8->harq_process)) > 0 ) {
if (rel8->new_data_indicator_1 != dlsch0_harq->ndi)
dlsch0_harq->round=0;
......@@ -930,16 +934,22 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
}
dlsch0_harq->ndi = rel8->new_data_indicator_1;
LOG_I(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round,
dlsch0->active = 1;
if (rel8->rnti_type == 2)
dlsch0_harq->round = 0;
LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round,
dlsch0_harq->ndi,rel8->new_data_indicator_1);
switch (rel8->dci_format) {
case NFAPI_DL_DCI_FORMAT_1A:
AssertFatal(rel8->resource_block_coding < 8192, "Frame %d, Subframe %d: rel8->resource_block_coding (%p) %u >= 8192 (rnti %x, rnti_type %d, format %d, harq_id %d\n",
proc->frame_tx,subframe,
&rel8->resource_block_coding,rel8->resource_block_coding,rel8->rnti,rel8->rnti_type,rel8->dci_format,rel8->harq_process);
dci_alloc->format = format1A;
dlsch0->active = 1;
if (rel8->rnti == SI_RNTI)
dlsch0_harq->round = 0;
switch (fp->N_RB_DL) {
case 6:
......@@ -967,7 +977,11 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
((DCI1A_1_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
}
// check if PDCCH order
if (rel8->resource_block_coding == 63) {
dlsch0->active = 0;
return;
}
AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n");
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rel8->resource_block_coding];
dlsch0_harq->vrb_type = rel8->virtual_resource_block_assignment_flag;
......@@ -998,6 +1012,12 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
((DCI1A_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
}
// check if PDCCH order
if (rel8->resource_block_coding == 511) {
dlsch0->active = 0;
return;
}
AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n");
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rel8->resource_block_coding];
dlsch0_harq->vrb_type = rel8->virtual_resource_block_assignment_flag;
......@@ -1028,6 +1048,11 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
}
// check if PDCCH order
if (rel8->resource_block_coding == 2047) {
dlsch0->active = 0;
return;
}
AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n");
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rel8->resource_block_coding];
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rel8->resource_block_coding];
......@@ -1059,6 +1084,11 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
((DCI1A_20MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
}
// check if PDCCH order
if (rel8->resource_block_coding == 8191) {
dlsch0->active = 0;
return;
}
AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n");
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rel8->resource_block_coding];
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rel8->resource_block_coding];
......@@ -1079,7 +1109,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
NPRB = dlsch0_harq->nb_rb;
I_mcs = get_I_TBS(rel8->mcs_1);
}
AssertFatal(NPRB>0,"DCI 1A: NPRB == 0\n");
AssertFatal(NPRB>0,"DCI 1A: NPRB = 0 (rnti %x, rnti type %d, tpc %d, round %d, resource_block_coding %d)\n",rel8->rnti,rel8->rnti_type,rel8->tpc,dlsch0_harq->round,rel8->resource_block_coding);
dlsch0_harq->rvidx = rel8->redundancy_version_1;
dlsch0_harq->Nl = 1;
dlsch0_harq->mimo_mode = (fp->nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI;
......@@ -1097,7 +1127,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
if (dlsch0_harq->round == 0)
dlsch0_harq->status = ACTIVE;
LOG_D(PHY,"DCI 1A: mcs %d, rballoc %x,rv %d, rnti %x\n",rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti);
if (rel8->rnti_type == 1) LOG_I(PHY,"DCI 1A: round %d, mcs %d, rballoc %x,rv %d, rnti %x\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti);
break;
case NFAPI_DL_DCI_FORMAT_1:
......@@ -2285,7 +2315,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
void *dci_pdu = (void*)dci_alloc->dci_pdu;
LOG_I(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req,
LOG_D(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req,
mcs,hopping,rballoc,pdu->dci_pdu_rel8.resource_block_start,pdu->dci_pdu_rel8.number_of_resource_block,
ndi,TPC,cshift);
......@@ -2307,6 +2337,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc;
((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping;
((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type = 0;
((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->padding = 0;
dci_alloc->dci_length = sizeof_DCI0_1_5MHz_TDD_1_6_t;
} else {
((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req;
......@@ -2317,6 +2348,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc;
((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping = hopping;
((DCI0_1_5MHz_FDD_t *)dci_pdu)->type = 0;
((DCI0_1_5MHz_FDD_t *)dci_pdu)->padding = 0;
dci_alloc->dci_length = sizeof_DCI0_1_5MHz_FDD_t;
}
......@@ -2333,6 +2365,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc;
((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping;
((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->type = 0;
((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->padding = 0;
dci_alloc->dci_length = sizeof_DCI0_5MHz_TDD_1_6_t;
} else {
((DCI0_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req;
......@@ -2343,6 +2376,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc;
((DCI0_5MHz_FDD_t *)dci_pdu)->hopping = hopping;
((DCI0_5MHz_FDD_t *)dci_pdu)->type = 0;
((DCI0_5MHz_FDD_t *)dci_pdu)->padding = 0;
dci_alloc->dci_length = sizeof_DCI0_5MHz_FDD_t;
}
......@@ -2359,6 +2393,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc;
((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping;
((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->type = 0;
((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->padding = 0;
dci_alloc->dci_length = sizeof_DCI0_10MHz_TDD_1_6_t;
} else {
((DCI0_10MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req;
......@@ -2369,6 +2404,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc = rballoc;
((DCI0_10MHz_FDD_t *)dci_pdu)->hopping = hopping;
((DCI0_10MHz_FDD_t *)dci_pdu)->type = 0;
((DCI0_10MHz_FDD_t *)dci_pdu)->padding = 0;
dci_alloc->dci_length = sizeof_DCI0_10MHz_FDD_t;
}
......@@ -2385,6 +2421,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc;
((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping;
((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->type = 0;
((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->padding = 0;
dci_alloc->dci_length = sizeof_DCI0_20MHz_TDD_1_6_t;
} else {
((DCI0_20MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req;
......@@ -2395,6 +2433,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc = rballoc;
((DCI0_20MHz_FDD_t *)dci_pdu)->hopping = hopping;
((DCI0_20MHz_FDD_t *)dci_pdu)->type = 0;
((DCI0_20MHz_FDD_t *)dci_pdu)->padding = 0;
dci_alloc->dci_length = sizeof_DCI0_20MHz_FDD_t;
}
......@@ -2415,7 +2454,9 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
uint8_t UE_id;
AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
"No existing UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti);
"No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti);
boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE;
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
......@@ -2427,6 +2468,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
ulsch->harq_processes[harq_pid]->frame = frame;
ulsch->harq_processes[harq_pid]->subframe = subframe;
ulsch->harq_processes[harq_pid]->handled = 0;
ulsch->harq_processes[harq_pid]->first_rb = ulsch_pdu->ulsch_pdu_rel8.resource_block_start;
ulsch->harq_processes[harq_pid]->nb_rb = ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks;
......@@ -2470,7 +2512,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
ulsch->harq_processes[harq_pid]->O_ACK = 0;
if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) ||
(ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication)){
(ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication) ||
(new_ulsch == TRUE)){
ulsch->harq_processes[harq_pid]->status = ACTIVE;
ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3;
......@@ -2488,8 +2531,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else ulsch->harq_processes[harq_pid]->round++;
ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti;
LOG_I(PHY,"Filling ULSCH %x for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
ulsch->rnti,
LOG_D(PHY,"Filling ULSCH %x (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
ulsch->rnti, new_ulsch,
frame,
subframe,
harq_pid,
......
......@@ -400,6 +400,8 @@ typedef struct {
uint8_t subframe;
/// Frame for reception
uint32_t frame;
/// Flag to indicate that the UL configuration has been handled. Used to remove a stale ULSCH when frame wraps around
uint8_t handled;