Commit 7b65478e authored by Manish's avatar Manish

ORAN 4G Removed

parent 52046caa
...@@ -52,8 +52,8 @@ include_directories(${CONFIG_INCLUDE_DIRS}) ...@@ -52,8 +52,8 @@ include_directories(${CONFIG_INCLUDE_DIRS})
pkg_search_module(CRYPTO libcrypto REQUIRED) pkg_search_module(CRYPTO libcrypto REQUIRED)
include_directories(${CRYPTO_INCLUDE_DIRS}) include_directories(${CRYPTO_INCLUDE_DIRS})
add_list2_option(TP_PROTO "None" "Ethernet" "benetel4g" "benetel5g" "oran_fhlib_4g" "oran_fhlib_5g") add_list2_option(TP_PROTO "None" "Ethernet" "benetel4g" "benetel5g" "oran_fhlib_5g")
if ((${TP_PROTO} STREQUAL "oran_fhlib_5g") OR (${TP_PROTO} STREQUAL "oran_fhlib_4g")) if (${TP_PROTO} STREQUAL "oran_fhlib_5g")
if(DEFINED ENV{RTE_SDK}) if(DEFINED ENV{RTE_SDK})
message("RTE_SDK $ENV{RTE_SDK}") message("RTE_SDK $ENV{RTE_SDK}")
else() else()
...@@ -647,31 +647,6 @@ target_link_libraries(benetel_4g PRIVATE ${DPDK_LIBS}) ...@@ -647,31 +647,6 @@ target_link_libraries(benetel_4g PRIVATE ${DPDK_LIBS})
target_link_libraries(benetel_4g PRIVATE pthread dl rt m numa) target_link_libraries(benetel_4g PRIVATE pthread dl rt m numa)
target_link_libraries(benetel_4g PRIVATE asn1_nr_rrc asn1_lte_rrc) target_link_libraries(benetel_4g PRIVATE asn1_nr_rrc asn1_lte_rrc)
# ORAN 4G library
######################################################################
include_directories("${XRAN_DIR}")
include_directories("${DPDK_DIR}")
include_directories("${INTEL_LIB}")
set(ORAN_FHLIB_4G_SOURCE
${OPENAIR_TARGETS}/ARCH/ETHERNET/oran/4g/oran.cpp
${OPENAIR_TARGETS}/ARCH/ETHERNET/oran/4g/shared_buffers.c
${OPENAIR_TARGETS}/ARCH/ETHERNET/oran/4g/low_oran.c
${OPENAIR_TARGETS}/ARCH/ETHERNET/oran/4g/low_dpdk_oran.c
${OPENAIR_TARGETS}/ARCH/ETHERNET/oran/4g/oran_isolate.c
)
add_library(oran_fhlib_4g MODULE ${ORAN_FHLIB_4G_SOURCE})
set_target_properties(oran_fhlib_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include")
SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive")
TARGET_LINK_LIBRARIES(oran_fhlib_4g PRIVATE ${DPDK_LIBS})
TARGET_LINK_LIBRARIES(oran_fhlib_4g PRIVATE -L${XRAN_LIB_DIR} -lxran)
#TARGET_LINK_LIBRARIES(oran_fhlib_4g PRIVATE -L${INTEL_LIB} -lirc)
TARGET_LINK_LIBRARIES(oran_fhlib_4g PRIVATE pthread dl rt m numa)
target_link_libraries(oran_fhlib_4g PRIVATE asn1_nr_rrc asn1_lte_rrc)
# Benetel 5G library # Benetel 5G library
###################################################################### ######################################################################
...@@ -710,7 +685,6 @@ set_target_properties(oran_fhlib_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidde ...@@ -710,7 +685,6 @@ set_target_properties(oran_fhlib_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidde
SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive")
TARGET_LINK_LIBRARIES(oran_fhlib_5g PRIVATE ${DPDK_LIBS}) TARGET_LINK_LIBRARIES(oran_fhlib_5g PRIVATE ${DPDK_LIBS})
TARGET_LINK_LIBRARIES(oran_fhlib_5g PRIVATE -L${XRAN_LIB_DIR} -lxran) TARGET_LINK_LIBRARIES(oran_fhlib_5g PRIVATE -L${XRAN_LIB_DIR} -lxran)
#TARGET_LINK_LIBRARIES(oran_fhlib_5g -L${INTEL_LIB} -lirc)
TARGET_LINK_LIBRARIES(oran_fhlib_5g PRIVATE pthread dl rt m numa) TARGET_LINK_LIBRARIES(oran_fhlib_5g PRIVATE pthread dl rt m numa)
target_link_libraries(oran_fhlib_5g PRIVATE asn1_nr_rrc asn1_lte_rrc) target_link_libraries(oran_fhlib_5g PRIVATE asn1_nr_rrc asn1_lte_rrc)
......
...@@ -117,7 +117,7 @@ Options: ...@@ -117,7 +117,7 @@ Options:
USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, None (Default) USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, None (Default)
Adds this RF board support (in external packages installation and in compilation) Adds this RF board support (in external packages installation and in compilation)
-t | --transport -t | --transport
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g, oran_fhlib_4g, oran_fhlib_5g Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g, oran_fhlib_5g
-P | --phy_simulators -P | --phy_simulators
Makes the unitary tests Layer 1 simulators Makes the unitary tests Layer 1 simulators
-S | --core_simulators -S | --core_simulators
...@@ -741,11 +741,6 @@ function main() { ...@@ -741,11 +741,6 @@ function main() {
compilations $BUILD_DIR benetel_5g compilations $BUILD_DIR benetel_5g
ln -sf libbenetel_5g.so liboai_transpro.so ln -sf libbenetel_5g.so liboai_transpro.so
echo_info "liboai_transpro.so is linked to BENETEL4G transport" echo_info "liboai_transpro.so is linked to BENETEL4G transport"
fi
if [ "$TP" == "oran_fhlib_4g" ]; then
compilations $BUILD_DIR oran_fhlib_4g
ln -sf liboran_fhlib_4g.so liboai_transpro.so
echo_info "liboai_transpro.so is linked to oran_fhlib_4G transport"
fi fi
if [ "$TP" == "oran_fhlib_5g" ]; then if [ "$TP" == "oran_fhlib_5g" ]; then
compilations $BUILD_DIR oran_fhlib_5g compilations $BUILD_DIR oran_fhlib_5g
......
...@@ -1397,7 +1397,6 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, ...@@ -1397,7 +1397,6 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
uint8_t fsize = 0, pos = 0; uint8_t fsize = 0, pos = 0;
gNB_MAC_INST *gNB_mac = RC.nrmac[0]; gNB_MAC_INST *gNB_mac = RC.nrmac[0];
uint8_t fsize = 0, pos = 0;
uint64_t *dci_pdu = (uint64_t *)pdcch_dci_pdu->Payload; uint64_t *dci_pdu = (uint64_t *)pdcch_dci_pdu->Payload;
*dci_pdu = 0; *dci_pdu = 0;
uint16_t alt_size = 0; uint16_t alt_size = 0;
......
...@@ -46,8 +46,6 @@ ...@@ -46,8 +46,6 @@
#include "common_lib.h" #include "common_lib.h"
#include "ethernet_lib.h" #include "ethernet_lib.h"
//#include "../../oran/4g/oran.h"
int num_devices_eth = 0; int num_devices_eth = 0;
struct sockaddr_in dest_addr[MAX_INST]; struct sockaddr_in dest_addr[MAX_INST];
......
/*
* 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
*/
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include "low_oran.h"
int oran_main(int argc, char **argv, oran_t *);
void *dpdk_thread(void *bs)
{
char *v[] = { "softmodem", "config_file_o_du.dat", "0000:81:0e.0", "0000:81:0e.1"};
oran_main(4, v, bs);
exit(1);
return 0;
}
void *oran_start_dpdk(char *ifname, shared_buffers *buffers)
{
oran_t *bs;
bs = calloc(1, sizeof(oran_t));
if (bs == NULL) {
printf("%s: out of memory\n", __FUNCTION__);
exit(1);
}
bs->buffers = buffers;
pthread_attr_t attr;
if (pthread_attr_init(&attr) != 0) {
printf("pthread_attr_init failed\n");
exit(1);
}
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(10,&cpuset);
if (pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset) != 0) {
printf("pthread_attr_setaffinity_np failed\n");
exit(1);
}
if (pthread_attr_setschedpolicy(&attr, SCHED_FIFO) != 0) {
printf("pthread_attr_setschedpolicy failed\n");
exit(1);
}
struct sched_param params;
params.sched_priority = sched_get_priority_max(SCHED_FIFO);
if (sched_get_priority_max(SCHED_FIFO) == -1) {
printf("sched_get_priority_max failed\n");
exit(1);
}
if (pthread_attr_setschedparam(&attr, &params) != 0) {
printf("pthread_setschedparam failed\n");
exit(1);
}
pthread_t t;
if (pthread_create(&t, &attr, dpdk_thread, bs) != 0) {
printf("%s: thread creation failed\n", __FUNCTION__);
exit(1);
}
if (pthread_attr_destroy(&attr) != 0) {
printf("pthread_attr_init failed\n");
exit(1);
}
return bs;
}
/*
* 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
*/
#include "low_oran.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void *oran_start_dpdk(char *ifname, shared_buffers *buffers);
void *oran_start(char *ifname, shared_buffers *buffers)
{
printf("oran_start\n");
if (!strcmp(ifname, "dpdk"))
return oran_start_dpdk(ifname, buffers);
else
return NULL;
}
/*
* 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
*/
#include "shared_buffers.h"
#ifndef LOW_ORAN_H
#define LOW_ORAN_H
void *oran_start(char *ifname, shared_buffers *buffers);
typedef struct {
shared_buffers *buffers;
int next_subframe;
int next_symbol;
int expected_oran_frame;
} oran_t;
#endif
This diff is collapsed.
/*
* 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
*/
#ifndef _ORAN_H_
#define _ORAN_H_
#include "shared_buffers.h"
#include "common_lib.h"
void oran_fh_if4p5_south_out(RU_t *ru,
int frame,
int subframe,
uint64_t timestamp);
void oran_fh_if4p5_south_in(RU_t *ru,
int *frame,
int *subframe);
int transport_init(openair0_device *device,
openair0_config_t *openair0_cfg,
eth_params_t * eth_params );
typedef struct {
eth_state_t e;
shared_buffers buffers;
rru_config_msg_type_t last_msg;
int capabilities_sent;
void *oran_priv;
} oran_eth_state_t;
#endif /* _ORAN_H_ */
This diff is collapsed.
/*
* 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
*/
#ifndef _ORAN_ISOLATE_H_
#define _ORAN_ISOLATE_H_
#include <stdio.h>
#include "shared_buffers.h"
#include "low_oran.h"
#ifdef __cplusplus
extern "C"
{
#endif
void* define_oran_pointer();
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int setup_oran( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int open_oran_callback( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int open_oran( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int initialize_oran( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int start_oran( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int register_physide_callbacks(void *xranlib_);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int load_iq_from_file(void *xranlib_);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int xran_fh_tx_send_buffer(void *xranlib_);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int compute_xran_statistics(void *xranlib_);
#ifdef __cplusplus
}
#endif
#endif /* _ORAN_ISOLATE_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.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
*/
#include "shared_buffers.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if 0
void init_buffers(shared_buffers *s)
{
int subframe;
memset(s, 0, sizeof(*s));
for (subframe = 0; subframe < 10; subframe++) {
if (pthread_mutex_init(&s->m[subframe], NULL) != 0 ||
pthread_cond_init(&s->c[subframe], NULL) != 0) {
printf("%s: error initializing mutex/cond\n", __FUNCTION__);
exit(1);
}
}
/* in FDD the eNB's first transmitted DL subframe is 4 but the device
* needs to have subframes 1, 2 and 3 ready. Let's pretend there are ready.
*/
s->dl_busy[1] = 0x3fff;
s->dl_busy[2] = 0x3fff;
s->dl_busy[3] = 0x3fff;
}
void lock_buffers(shared_buffers *s, int subframe)
{
if (pthread_mutex_lock(&s->m[subframe]) != 0) {
printf("%s: fatal: lock fails\n", __FUNCTION__);
exit(1);
}
}
void unlock_buffers(shared_buffers *s, int subframe)
{
if (pthread_mutex_unlock(&s->m[subframe]) != 0) {
printf("%s: fatal: unlock fails\n", __FUNCTION__);
exit(1);
}
}
void wait_buffers(shared_buffers *s, int subframe)
{
if (pthread_cond_wait(&s->c[subframe], &s->m[subframe]) != 0) {
printf("%s: fatal: cond_wait fails\n", __FUNCTION__);
exit(1);
}
}
void signal_buffers(shared_buffers *s, int subframe)
{
if (pthread_cond_broadcast(&s->c[subframe]) != 0) {
printf("%s: fatal: cond_broadcast fails\n", __FUNCTION__);
exit(1);
}
}
#endif
void init_buffers(shared_buffers *s)
{
int subframe;
memset(s, 0, sizeof(*s));
for (subframe = 0; subframe < 10; subframe++) {
if (pthread_mutex_init(&s->m_dl[subframe], NULL) != 0 ||
pthread_cond_init(&s->c_dl[subframe], NULL) != 0 ||
pthread_mutex_init(&s->m_ul[subframe], NULL) != 0 ||
pthread_cond_init(&s->c_ul[subframe], NULL) != 0) {
printf("%s: error initializing mutex/cond\n", __FUNCTION__);
exit(1);
}
}
/* in FDD the eNB's first transmitted DL subframe is 4 but the device
* * needs to have subframes 1, 2 and 3 ready. Let's pretend there are ready.
* */
s->dl_busy[0][1] = 0x3fff;
s->dl_busy[0][2] = 0x3fff;
s->dl_busy[0][3] = 0x3fff;
s->dl_busy[1][1] = 0x3fff;
s->dl_busy[1][2] = 0x3fff;
s->dl_busy[1][3] = 0x3fff;
}
void lock_dl_buffer(shared_buffers *s, int subframe)
{
if (pthread_mutex_lock(&s->m_dl[subframe]) != 0) {
printf("%s: fatal: lock fails\n", __FUNCTION__);
exit(1);
}
}
void unlock_dl_buffer(shared_buffers *s, int subframe)
{
if (pthread_mutex_unlock(&s->m_dl[subframe]) != 0) {
printf("%s: fatal: unlock fails\n", __FUNCTION__);
exit(1);
}
}
void wait_dl_buffer(shared_buffers *s, int subframe)
{
if (pthread_cond_wait(&s->c_dl[subframe], &s->m_dl[subframe]) != 0) {
printf("%s: fatal: cond_wait fails\n", __FUNCTION__);
exit(1);
}
}
void signal_dl_buffer(shared_buffers *s, int subframe)
{
if (pthread_cond_broadcast(&s->c_dl[subframe]) != 0) {
printf("%s: fatal: cond_broadcast fails\n", __FUNCTION__);
exit(1);
}
}
void lock_ul_buffer(shared_buffers *s, int subframe)
{
if (pthread_mutex_lock(&s->m_ul[subframe]) != 0) {
printf("%s: fatal: lock fails\n", __FUNCTION__);
exit(1);
}
}
void unlock_ul_buffer(shared_buffers *s, int subframe)
{
if (pthread_mutex_unlock(&s->m_ul[subframe]) != 0) {
printf("%s: fatal: unlock fails\n", __FUNCTION__);
exit(1);
}
}
void wait_ul_buffer(shared_buffers *s, int subframe)
{
if (pthread_cond_wait(&s->c_ul[subframe], &s->m_ul[subframe]) != 0) {
printf("%s: fatal: cond_wait fails\n", __FUNCTION__);
exit(1);
}
}
void signal_ul_buffer(shared_buffers *s, int subframe)
{
if (pthread_cond_broadcast(&s->c_ul[subframe]) != 0) {
printf("%s: fatal: cond_broadcast fails\n", __FUNCTION__);
exit(1);
}
}
/*
* 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
*/
#ifndef _SHARED_BUFFERS_H_
#define _SHARED_BUFFERS_H_
#include <pthread.h>
#include <stdint.h>
#if 0
typedef struct {
unsigned char dl[10][14*1200*4];
unsigned char ul[10][14*1200*4];
uint16_t dl_busy[10];
uint16_t ul_busy[10];
pthread_mutex_t m[10];
pthread_cond_t c[10];
unsigned char prach[10][849*4];
unsigned char prach_busy[10];
/* statistics/error counting */
int ul_overflow;
int dl_underflow;
} shared_buffers;
void init_buffers(shared_buffers *s);
void lock_buffers(shared_buffers *s, int subframe);
void unlock_buffers(shared_buffers *s, int subframe);
void wait_buffers(shared_buffers *s, int subframe);
void signal_buffers(shared_buffers *s, int subframe);
typedef struct {
/* [2] is for two antennas */
unsigned char dl[2][10][14*1200*4];
unsigned char ul[2][10][14*1200*4];
uint16_t dl_busy[2][10];
uint16_t ul_busy[2][10];
pthread_mutex_t m_ul[10];
pthread_cond_t c_ul[10];
pthread_mutex_t m_dl[10];
pthread_cond_t c_dl[10];
unsigned char prach[10][849*4];
unsigned char prach_busy[10];
/* statistics/error counting */
int ul_overflow;
int dl_underflow;
} shared_buffers;
void init_buffers(shared_buffers *s);
void lock_dl_buffer(shared_buffers *s, int subframe);
void unlock_dl_buffer(shared_buffers *s, int subframe);
void wait_dl_buffer(shared_buffers *s, int subframe);
void signal_dl_buffer(shared_buffers *s, int subframe);
void lock_ul_buffer(shared_buffers *s, int subframe);
void unlock_ul_buffer(shared_buffers *s, int subframe);
void wait_ul_buffer(shared_buffers *s, int subframe);
void signal_ul_buffer(shared_buffers *s, int subframe);
#endif
typedef struct {
/* [2] is for two antennas */
unsigned char dl[2][10][14*1200*4];
unsigned char ul[2][10][14*1200*4];
uint16_t dl_busy[2][10];
uint16_t ul_busy[2][10];
pthread_mutex_t m_ul[10];
pthread_cond_t c_ul[10];
pthread_mutex_t m_dl[10];
pthread_cond_t c_dl[10];
unsigned char prach[10][849*4];
unsigned char prach_busy[10];
/* statistics/error counting */
int ul_overflow;
int dl_underflow;
} shared_buffers;
void init_buffers(shared_buffers *s);
void lock_dl_buffer(shared_buffers *s, int subframe);
void unlock_dl_buffer(shared_buffers *s, int subframe);
void wait_dl_buffer(shared_buffers *s, int subframe);
void signal_dl_buffer(shared_buffers *s, int subframe);
void lock_ul_buffer(shared_buffers *s, int subframe);
void unlock_ul_buffer(shared_buffers *s, int subframe);
void wait_ul_buffer(shared_buffers *s, int subframe);
void signal_ul_buffer(shared_buffers *s, int subframe);
#endif /* _SHARED_BUFFERS_H_ */
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