Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
7b65478e
Commit
7b65478e
authored
Jan 17, 2023
by
Manish
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ORAN 4G Removed
parent
52046caa
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
3 additions
and
1671 deletions
+3
-1671
CMakeLists.txt
CMakeLists.txt
+2
-28
cmake_targets/build_oai
cmake_targets/build_oai
+1
-6
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+0
-1
radio/ETHERNET/USERSPACE/LIB/ethernet_lib.c
radio/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+0
-2
targets/ARCH/ETHERNET/oran/4g/low_dpdk_oran.c
targets/ARCH/ETHERNET/oran/4g/low_dpdk_oran.c
+0
-99
targets/ARCH/ETHERNET/oran/4g/low_oran.c
targets/ARCH/ETHERNET/oran/4g/low_oran.c
+0
-41
targets/ARCH/ETHERNET/oran/4g/low_oran.h
targets/ARCH/ETHERNET/oran/4g/low_oran.h
+0
-39
targets/ARCH/ETHERNET/oran/4g/oran.cpp
targets/ARCH/ETHERNET/oran/4g/oran.cpp
+0
-510
targets/ARCH/ETHERNET/oran/4g/oran.h
targets/ARCH/ETHERNET/oran/4g/oran.h
+0
-49
targets/ARCH/ETHERNET/oran/4g/oran_isolate.c
targets/ARCH/ETHERNET/oran/4g/oran_isolate.c
+0
-463
targets/ARCH/ETHERNET/oran/4g/oran_isolate.h
targets/ARCH/ETHERNET/oran/4g/oran_isolate.h
+0
-134
targets/ARCH/ETHERNET/oran/4g/shared_buffers.c
targets/ARCH/ETHERNET/oran/4g/shared_buffers.c
+0
-175
targets/ARCH/ETHERNET/oran/4g/shared_buffers.h
targets/ARCH/ETHERNET/oran/4g/shared_buffers.h
+0
-124
No files found.
CMakeLists.txt
View file @
7b65478e
...
...
@@ -52,8 +52,8 @@ include_directories(${CONFIG_INCLUDE_DIRS})
pkg_search_module
(
CRYPTO libcrypto REQUIRED
)
include_directories
(
${
CRYPTO_INCLUDE_DIRS
}
)
add_list2_option
(
TP_PROTO
"None"
"Ethernet"
"benetel4g"
"benetel5g"
"oran_fhlib_
4g"
"oran_fhlib_
5g"
)
if
(
(
${
TP_PROTO
}
STREQUAL
"oran_fhlib_5g"
)
OR
(
${
TP_PROTO
}
STREQUAL
"oran_fhlib_4g"
)
)
add_list2_option
(
TP_PROTO
"None"
"Ethernet"
"benetel4g"
"benetel5g"
"oran_fhlib_5g"
)
if
(
${
TP_PROTO
}
STREQUAL
"oran_fhlib_5g"
)
if
(
DEFINED ENV{RTE_SDK}
)
message
(
"RTE_SDK $ENV{RTE_SDK}"
)
else
()
...
...
@@ -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 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
######################################################################
...
...
@@ -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"
)
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 -L${INTEL_LIB} -lirc)
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
)
...
...
cmake_targets/build_oai
View file @
7b65478e
...
...
@@ -117,7 +117,7 @@ Options:
USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, None (Default)
Adds this RF board support (in external packages installation and in compilation)
-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
Makes the unitary tests Layer 1 simulators
-S | --core_simulators
...
...
@@ -741,11 +741,6 @@ function main() {
compilations
$BUILD_DIR
benetel_5g
ln
-sf
libbenetel_5g.so liboai_transpro.so
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
if
[
"
$TP
"
==
"oran_fhlib_5g"
]
;
then
compilations
$BUILD_DIR
oran_fhlib_5g
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
7b65478e
...
...
@@ -1397,7 +1397,6 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
uint8_t
fsize
=
0
,
pos
=
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
;
*
dci_pdu
=
0
;
uint16_t
alt_size
=
0
;
...
...
radio/ETHERNET/USERSPACE/LIB/ethernet_lib.c
View file @
7b65478e
...
...
@@ -46,8 +46,6 @@
#include "common_lib.h"
#include "ethernet_lib.h"
//#include "../../oran/4g/oran.h"
int
num_devices_eth
=
0
;
struct
sockaddr_in
dest_addr
[
MAX_INST
];
...
...
targets/ARCH/ETHERNET/oran/4g/low_dpdk_oran.c
deleted
100644 → 0
View file @
52046caa
/*
* 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
;
}
targets/ARCH/ETHERNET/oran/4g/low_oran.c
deleted
100644 → 0
View file @
52046caa
/*
* 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
;
}
targets/ARCH/ETHERNET/oran/4g/low_oran.h
deleted
100644 → 0
View file @
52046caa
/*
* 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
targets/ARCH/ETHERNET/oran/4g/oran.cpp
deleted
100644 → 0
View file @
52046caa
This diff is collapsed.
Click to expand it.
targets/ARCH/ETHERNET/oran/4g/oran.h
deleted
100644 → 0
View file @
52046caa
/*
* 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_ */
targets/ARCH/ETHERNET/oran/4g/oran_isolate.c
deleted
100644 → 0
View file @
52046caa
This diff is collapsed.
Click to expand it.
targets/ARCH/ETHERNET/oran/4g/oran_isolate.h
deleted
100644 → 0
View file @
52046caa
/*
* 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_ */
targets/ARCH/ETHERNET/oran/4g/shared_buffers.c
deleted
100644 → 0
View file @
52046caa
/*
* 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
);
}
}
targets/ARCH/ETHERNET/oran/4g/shared_buffers.h
deleted
100644 → 0
View file @
52046caa
/*
* 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_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment