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
wangjie
OpenXG-RAN
Commits
bc123817
Commit
bc123817
authored
Dec 14, 2019
by
wujing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix L2 FAPI Simulator by diable mimo-vnf
parent
61e60919
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
309 additions
and
132 deletions
+309
-132
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+8
-3
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
+5
-3
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
+10
-10
nfapi/open-nFAPI/vnf/inc/vnf_p7.h
nfapi/open-nFAPI/vnf/inc/vnf_p7.h
+4
-0
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
+4
-3
nfapi/open-nFAPI/vnf/src/vnf_interface.c
nfapi/open-nFAPI/vnf/src/vnf_interface.c
+13
-7
nfapi/open-nFAPI/vnf/src/vnf_p7.c
nfapi/open-nFAPI/vnf/src/vnf_p7.c
+82
-55
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
+160
-38
openair1/SCHED/fapi_l1.c
openair1/SCHED/fapi_l1.c
+2
-0
openair2/LAYER2/MAC/mac.h
openair2/LAYER2/MAC/mac.h
+2
-1
openair2/PHY_INTERFACE/IF_Module.c
openair2/PHY_INTERFACE/IF_Module.c
+2
-0
openair2/PHY_INTERFACE/IF_Module.h
openair2/PHY_INTERFACE/IF_Module.h
+2
-0
targets/RT/USER/lte-ue.c
targets/RT/USER/lte-ue.c
+13
-10
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+2
-2
No files found.
nfapi/oai_integration/nfapi_vnf.c
View file @
bc123817
...
@@ -920,7 +920,9 @@ int vnf_pack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t *header, uint8_
...
@@ -920,7 +920,9 @@ int vnf_pack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t *header, uint8_
static
pthread_t
vnf_start_pthread
;
static
pthread_t
vnf_start_pthread
;
static
pthread_t
vnf_p7_start_pthread
;
static
pthread_t
vnf_p7_start_pthread
;
#ifdef PHY_RM
static
pthread_t
vnf_p7_time_pthread
;
static
pthread_t
vnf_p7_time_pthread
;
#endif
void
*
vnf_p7_start_thread
(
void
*
ptr
)
{
void
*
vnf_p7_start_thread
(
void
*
ptr
)
{
printf
(
"%s()
\n
"
,
__FUNCTION__
);
printf
(
"%s()
\n
"
,
__FUNCTION__
);
...
@@ -929,7 +931,7 @@ void *vnf_p7_start_thread(void *ptr) {
...
@@ -929,7 +931,7 @@ void *vnf_p7_start_thread(void *ptr) {
nfapi_vnf_p7_start
(
config
);
nfapi_vnf_p7_start
(
config
);
return
config
;
return
config
;
}
}
#ifdef PHY_RM
void
*
vnf_p7_time_thread
(
void
*
ptr
)
{
void
*
vnf_p7_time_thread
(
void
*
ptr
)
{
printf
(
"%s()
\n
"
,
__FUNCTION__
);
printf
(
"%s()
\n
"
,
__FUNCTION__
);
...
@@ -949,7 +951,7 @@ void* vnf_p7_time_thread(void *ptr) {
...
@@ -949,7 +951,7 @@ void* vnf_p7_time_thread(void *ptr) {
nfapi_vnf_p7_time
(
config
);
nfapi_vnf_p7_time
(
config
);
return
config
;
return
config
;
}
}
#endif
void
set_thread_priority
(
int
priority
);
void
set_thread_priority
(
int
priority
);
void
*
vnf_p7_thread_start
(
void
*
ptr
)
{
void
*
vnf_p7_thread_start
(
void
*
ptr
)
{
...
@@ -984,7 +986,9 @@ void *vnf_p7_thread_start(void *ptr) {
...
@@ -984,7 +986,9 @@ void *vnf_p7_thread_start(void *ptr) {
p7_vnf
->
config
->
deallocate_p7_vendor_ext
=
&
phy_deallocate_p7_vendor_ext
;
p7_vnf
->
config
->
deallocate_p7_vendor_ext
=
&
phy_deallocate_p7_vendor_ext
;
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"[VNF] Creating VNF NFAPI start thread %s
\n
"
,
__FUNCTION__
);
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"[VNF] Creating VNF NFAPI start thread %s
\n
"
,
__FUNCTION__
);
pthread_create
(
&
vnf_p7_start_pthread
,
NULL
,
&
vnf_p7_start_thread
,
p7_vnf
->
config
);
pthread_create
(
&
vnf_p7_start_pthread
,
NULL
,
&
vnf_p7_start_thread
,
p7_vnf
->
config
);
#ifdef PHY_RM
pthread_create
(
&
vnf_p7_time_pthread
,
NULL
,
&
vnf_p7_time_thread
,
p7_vnf
->
config
);
pthread_create
(
&
vnf_p7_time_pthread
,
NULL
,
&
vnf_p7_time_thread
,
p7_vnf
->
config
);
#endif
return
0
;
return
0
;
}
}
...
@@ -1279,7 +1283,7 @@ int oai_nfapi_ue_release_req(nfapi_ue_release_request_t *release_req){
...
@@ -1279,7 +1283,7 @@ int oai_nfapi_ue_release_req(nfapi_ue_release_request_t *release_req){
}
}
return
retval
;
return
retval
;
}
}
#ifdef PHY_RM
int
oai_nfapi_phy_rm_start_req
(
nfapi_phy_rm_start_request_t
*
rm_start_req
){
int
oai_nfapi_phy_rm_start_req
(
nfapi_phy_rm_start_request_t
*
rm_start_req
){
nfapi_vnf_p7_config_t
*
p7_config
=
vnf
.
p7_vnfs
[
0
].
config
;
nfapi_vnf_p7_config_t
*
p7_config
=
vnf
.
p7_vnfs
[
0
].
config
;
...
@@ -1295,3 +1299,4 @@ int oai_nfapi_phy_rm_start_req(nfapi_phy_rm_start_request_t *rm_start_req){
...
@@ -1295,3 +1299,4 @@ int oai_nfapi_phy_rm_start_req(nfapi_phy_rm_start_request_t *rm_start_req){
}
}
return
retval
;
return
retval
;
}
}
#endif
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
View file @
bc123817
...
@@ -148,7 +148,9 @@ typedef enum {
...
@@ -148,7 +148,9 @@ typedef enum {
NFAPI_NRACH_INDICATION
,
NFAPI_NRACH_INDICATION
,
NFAPI_UE_RELEASE_REQUEST
,
NFAPI_UE_RELEASE_REQUEST
,
NFAPI_UE_RELEASE_RESPONSE
,
NFAPI_UE_RELEASE_RESPONSE
,
#ifdef PHY_RM
NFAPI_PHY_RM_START_REQUEST
,
NFAPI_PHY_RM_START_REQUEST
,
#endif
NFAPI_PNF_PARAM_REQUEST
=
0x0100
,
NFAPI_PNF_PARAM_REQUEST
=
0x0100
,
NFAPI_PNF_PARAM_RESPONSE
,
NFAPI_PNF_PARAM_RESPONSE
,
...
@@ -3446,13 +3448,13 @@ typedef struct {
...
@@ -3446,13 +3448,13 @@ typedef struct {
uint32_t
error_code
;
uint32_t
error_code
;
nfapi_vendor_extension_tlv_t
vendor_extension
;
nfapi_vendor_extension_tlv_t
vendor_extension
;
}
nfapi_ue_release_response_t
;
}
nfapi_ue_release_response_t
;
#ifdef PHY_RM
typedef
struct
{
typedef
struct
{
nfapi_p7_message_header_t
header
;
nfapi_p7_message_header_t
header
;
uint16_t
sfn_sf
;
uint16_t
sfn_sf
;
nfapi_vendor_extension_tlv_t
vendor_extension
;
nfapi_vendor_extension_tlv_t
vendor_extension
;
}
nfapi_phy_rm_start_request_t
;
}
nfapi_phy_rm_start_request_t
;
#endif
//
//
// P4 Messages
// P4 Messages
//
//
...
...
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
View file @
bc123817
...
@@ -2653,7 +2653,7 @@ static uint8_t pack_timing_info(void *msg, uint8_t **ppWritePackedMsg, uint8_t *
...
@@ -2653,7 +2653,7 @@ static uint8_t pack_timing_info(void *msg, uint8_t **ppWritePackedMsg, uint8_t *
pushs32
(
pNfapiMsg
->
hi_dci0_earliest_arrival
,
ppWritePackedMsg
,
end
)
&&
pushs32
(
pNfapiMsg
->
hi_dci0_earliest_arrival
,
ppWritePackedMsg
,
end
)
&&
pack_p7_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
));
pack_p7_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
));
}
}
#ifdef PHY_RM
static
uint8_t
pack_phy_rm_start_request
(
void
*
msg
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
,
nfapi_p7_codec_config_t
*
config
)
static
uint8_t
pack_phy_rm_start_request
(
void
*
msg
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
,
nfapi_p7_codec_config_t
*
config
)
{
{
nfapi_phy_rm_start_request_t
*
pNfapiMsg
=
(
nfapi_phy_rm_start_request_t
*
)
msg
;
nfapi_phy_rm_start_request_t
*
pNfapiMsg
=
(
nfapi_phy_rm_start_request_t
*
)
msg
;
...
@@ -2661,7 +2661,7 @@ static uint8_t pack_phy_rm_start_request(void *msg, uint8_t **ppWritePackedMsg,
...
@@ -2661,7 +2661,7 @@ static uint8_t pack_phy_rm_start_request(void *msg, uint8_t **ppWritePackedMsg,
int
y
=
pack_p7_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
);
int
y
=
pack_p7_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
);
return
x
&&
y
;
return
x
&&
y
;
}
}
#endif
// Main pack function - public
// Main pack function - public
int
nfapi_p7_message_pack
(
void
*
pMessageBuf
,
void
*
pPackedBuf
,
uint32_t
packedBufLen
,
nfapi_p7_codec_config_t
*
config
)
int
nfapi_p7_message_pack
(
void
*
pMessageBuf
,
void
*
pPackedBuf
,
uint32_t
packedBufLen
,
nfapi_p7_codec_config_t
*
config
)
...
@@ -2722,11 +2722,11 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
...
@@ -2722,11 +2722,11 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
case
NFAPI_UE_RELEASE_RESPONSE
:
case
NFAPI_UE_RELEASE_RESPONSE
:
result
=
pack_ue_release_response
(
pMessageHeader
,
&
pWritePackedMessage
,
end
,
config
);
result
=
pack_ue_release_response
(
pMessageHeader
,
&
pWritePackedMessage
,
end
,
config
);
break
;
break
;
#ifdef PHY_RM
case
NFAPI_PHY_RM_START_REQUEST
:
case
NFAPI_PHY_RM_START_REQUEST
:
result
=
pack_phy_rm_start_request
(
pMessageHeader
,
&
pWritePackedMessage
,
end
,
config
);
result
=
pack_phy_rm_start_request
(
pMessageHeader
,
&
pWritePackedMessage
,
end
,
config
);
break
;
break
;
#endif
case
NFAPI_HARQ_INDICATION
:
case
NFAPI_HARQ_INDICATION
:
result
=
pack_harq_indication
(
pMessageHeader
,
&
pWritePackedMessage
,
end
,
config
);
result
=
pack_harq_indication
(
pMessageHeader
,
&
pWritePackedMessage
,
end
,
config
);
break
;
break
;
...
@@ -5956,7 +5956,7 @@ static uint8_t unpack_timing_info(uint8_t **ppReadPackedMsg, uint8_t *end, void
...
@@ -5956,7 +5956,7 @@ static uint8_t unpack_timing_info(uint8_t **ppReadPackedMsg, uint8_t *end, void
pulls32
(
ppReadPackedMsg
,
&
pNfapiMsg
->
hi_dci0_earliest_arrival
,
end
)
&&
pulls32
(
ppReadPackedMsg
,
&
pNfapiMsg
->
hi_dci0_earliest_arrival
,
end
)
&&
unpack_p7_tlv_list
(
unpack_fns
,
sizeof
(
unpack_fns
)
/
sizeof
(
unpack_tlv_t
),
ppReadPackedMsg
,
end
,
config
,
&
pNfapiMsg
->
vendor_extension
));
unpack_p7_tlv_list
(
unpack_fns
,
sizeof
(
unpack_fns
)
/
sizeof
(
unpack_tlv_t
),
ppReadPackedMsg
,
end
,
config
,
&
pNfapiMsg
->
vendor_extension
));
}
}
#ifdef PHY_RM
static
uint8_t
unpack_phy_rm_start_request
(
uint8_t
**
ppReadPackedMsg
,
uint8_t
*
end
,
void
*
msg
,
nfapi_p7_codec_config_t
*
config
)
static
uint8_t
unpack_phy_rm_start_request
(
uint8_t
**
ppReadPackedMsg
,
uint8_t
*
end
,
void
*
msg
,
nfapi_p7_codec_config_t
*
config
)
{
{
uint8_t
proceed
=
1
;
uint8_t
proceed
=
1
;
...
@@ -5968,7 +5968,7 @@ static uint8_t unpack_phy_rm_start_request(uint8_t **ppReadPackedMsg, uint8_t *e
...
@@ -5968,7 +5968,7 @@ static uint8_t unpack_phy_rm_start_request(uint8_t **ppReadPackedMsg, uint8_t *e
return
1
;
return
1
;
}
}
#endif
// unpack length check
// unpack length check
static
int
check_unpack_length
(
nfapi_message_id_e
msgId
,
uint32_t
unpackedBufLen
)
static
int
check_unpack_length
(
nfapi_message_id_e
msgId
,
uint32_t
unpackedBufLen
)
...
@@ -6081,12 +6081,12 @@ static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen
...
@@ -6081,12 +6081,12 @@ static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen
if
(
unpackedBufLen
>=
sizeof
(
nfapi_ue_release_response_t
))
if
(
unpackedBufLen
>=
sizeof
(
nfapi_ue_release_response_t
))
retLen
=
sizeof
(
nfapi_ue_release_response_t
);
retLen
=
sizeof
(
nfapi_ue_release_response_t
);
break
;
break
;
#ifdef PHY_RM
case
NFAPI_PHY_RM_START_REQUEST
:
case
NFAPI_PHY_RM_START_REQUEST
:
if
(
unpackedBufLen
>=
sizeof
(
nfapi_phy_rm_start_request_t
))
if
(
unpackedBufLen
>=
sizeof
(
nfapi_phy_rm_start_request_t
))
retLen
=
sizeof
(
nfapi_phy_rm_start_request_t
);
retLen
=
sizeof
(
nfapi_phy_rm_start_request_t
);
break
;
break
;
#endif
default:
default:
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"Unknown message ID %d
\n
"
,
msgId
);
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"Unknown message ID %d
\n
"
,
msgId
);
break
;
break
;
...
@@ -6213,12 +6213,12 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
...
@@ -6213,12 +6213,12 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
else
else
return
-
1
;
return
-
1
;
break
;
break
;
#ifdef PHY_RM
case
NFAPI_PHY_RM_START_REQUEST
:
case
NFAPI_PHY_RM_START_REQUEST
:
if
(
check_unpack_length
(
NFAPI_PHY_RM_START_REQUEST
,
unpackedBufLen
))
if
(
check_unpack_length
(
NFAPI_PHY_RM_START_REQUEST
,
unpackedBufLen
))
result
=
unpack_phy_rm_start_request
(
&
pReadPackedMessage
,
end
,
pMessageHeader
,
config
);
result
=
unpack_phy_rm_start_request
(
&
pReadPackedMessage
,
end
,
pMessageHeader
,
config
);
break
;
break
;
#endif
case
NFAPI_HARQ_INDICATION
:
case
NFAPI_HARQ_INDICATION
:
if
(
check_unpack_length
(
NFAPI_HARQ_INDICATION
,
unpackedBufLen
))
if
(
check_unpack_length
(
NFAPI_HARQ_INDICATION
,
unpackedBufLen
))
result
=
unpack_harq_indication
(
&
pReadPackedMessage
,
end
,
pMessageHeader
,
config
);
result
=
unpack_harq_indication
(
&
pReadPackedMessage
,
end
,
pMessageHeader
,
config
);
...
...
nfapi/open-nFAPI/vnf/inc/vnf_p7.h
View file @
bc123817
...
@@ -111,15 +111,19 @@ typedef struct {
...
@@ -111,15 +111,19 @@ typedef struct {
nfapi_vnf_p7_connection_info_t
*
p7_connections
;
nfapi_vnf_p7_connection_info_t
*
p7_connections
;
int
socket
;
int
socket
;
uint32_t
sf_start_time_hr
;
uint32_t
sf_start_time_hr
;
#ifdef PHY_RM
uint32_t
sf_start_time_hr_old
;
uint32_t
sf_start_time_hr_old
;
#endif
uint8_t
*
rx_message_buffer
;
// would this be better put in the p7 conenction info?
uint8_t
*
rx_message_buffer
;
// would this be better put in the p7 conenction info?
uint16_t
rx_message_buffer_size
;
uint16_t
rx_message_buffer_size
;
#ifdef PHY_RM
struct
timespec
sf_corr_tim
;
struct
timespec
sf_corr_tim
;
uint8_t
vnf_extend_flg
;
uint8_t
vnf_extend_flg
;
uint8_t
sf_duration_correct_flg
;
uint8_t
sf_duration_correct_flg
;
uint32_t
fapi_1ms_fd_list
[
6
];
uint32_t
fapi_1ms_fd_list
[
6
];
fd_set
watchset
;
fd_set
watchset
;
uint32_t
maxfd
;
uint32_t
maxfd
;
#endif
}
vnf_p7_t
;
}
vnf_p7_t
;
uint32_t
vnf_get_current_time_hr
(
void
);
uint32_t
vnf_get_current_time_hr
(
void
);
...
...
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
View file @
bc123817
...
@@ -883,9 +883,9 @@ void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config);
...
@@ -883,9 +883,9 @@ void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config);
*/
*/
int
nfapi_vnf_p7_start
(
nfapi_vnf_p7_config_t
*
config
);
int
nfapi_vnf_p7_start
(
nfapi_vnf_p7_config_t
*
config
);
#ifdef PHY_RM
int
nfapi_vnf_p7_time
(
nfapi_vnf_p7_config_t
*
config
);
int
nfapi_vnf_p7_time
(
nfapi_vnf_p7_config_t
*
config
);
#endif
/*! Stop the VNF P7 library.
/*! Stop the VNF P7 library.
* \param config A pointer to an vnf p7 configuration structure
* \param config A pointer to an vnf p7 configuration structure
* \return A status value. 0 equal success, -1 indicates failure
* \return A status value. 0 equal success, -1 indicates failure
...
@@ -999,7 +999,7 @@ int nfapi_vnf_p7_vendor_extension(nfapi_vnf_p7_config_t* config, nfapi_p7_messag
...
@@ -999,7 +999,7 @@ int nfapi_vnf_p7_vendor_extension(nfapi_vnf_p7_config_t* config, nfapi_p7_messag
* may be released after this function call has returned or at a later pointer
* may be released after this function call has returned or at a later pointer
*/
*/
int
nfapi_vnf_p7_ue_release_req
(
nfapi_vnf_p7_config_t
*
config
,
nfapi_ue_release_request_t
*
req
);
int
nfapi_vnf_p7_ue_release_req
(
nfapi_vnf_p7_config_t
*
config
,
nfapi_ue_release_request_t
*
req
);
#ifdef PHY_RM
/*! Send the PHY_RM_START.request
/*! Send the PHY_RM_START.request
* \param config A pointer to the vnf p7 configuration
* \param config A pointer to the vnf p7 configuration
* \param req A data structure for the decoded PHY_RM_START.request.
* \param req A data structure for the decoded PHY_RM_START.request.
...
@@ -1009,6 +1009,7 @@ int nfapi_vnf_p7_ue_release_req(nfapi_vnf_p7_config_t* config, nfapi_ue_release_
...
@@ -1009,6 +1009,7 @@ int nfapi_vnf_p7_ue_release_req(nfapi_vnf_p7_config_t* config, nfapi_ue_release_
* may be released after this function call has returned or at a later pointer
* may be released after this function call has returned or at a later pointer
*/
*/
int
nfapi_vnf_p7_phy_rm_start_req
(
nfapi_vnf_p7_config_t
*
config
,
nfapi_phy_rm_start_request_t
*
req
);
int
nfapi_vnf_p7_phy_rm_start_req
(
nfapi_vnf_p7_config_t
*
config
,
nfapi_phy_rm_start_request_t
*
req
);
#endif
#if defined(__cplusplus)
#if defined(__cplusplus)
}
}
#endif
#endif
...
...
nfapi/open-nFAPI/vnf/src/vnf_interface.c
View file @
bc123817
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <errno.h>
#include <errno.h>
#include <stdio.h>
#include <stdio.h>
#ifdef PHY_RM
#include <stdint.h>
#include <stdint.h>
#include <sys/un.h>
#include <sys/un.h>
#include <sys/signalfd.h>
#include <sys/signalfd.h>
...
@@ -35,8 +36,9 @@
...
@@ -35,8 +36,9 @@
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/time.h>
#include <pthread.h>
#include <pthread.h>
#endif
#include "vnf.h"
#include "vnf.h"
#ifdef PHY_RM
#include "vnf_p7.h"
#include "vnf_p7.h"
typedef
struct
{
typedef
struct
{
...
@@ -160,7 +162,7 @@ typedef struct {
...
@@ -160,7 +162,7 @@ typedef struct {
vnf_p7_info
p7_vnfs
[
2
];
vnf_p7_info
p7_vnfs
[
2
];
}
vnf_info
;
}
vnf_info
;
#endif
nfapi_vnf_config_t
*
nfapi_vnf_config_create
()
nfapi_vnf_config_t
*
nfapi_vnf_config_create
()
{
{
...
@@ -192,7 +194,7 @@ void nfapi_vnf_config_destory(nfapi_vnf_config_t* config)
...
@@ -192,7 +194,7 @@ void nfapi_vnf_config_destory(nfapi_vnf_config_t* config)
{
{
free
(
config
);
free
(
config
);
}
}
#ifdef PHY_RM
void
init_server_eventfd
(
int
*
watch_fd_list
,
int
client_num
,
char
*
path
)
void
init_server_eventfd
(
int
*
watch_fd_list
,
int
client_num
,
char
*
path
)
{
{
// eventfd server
// eventfd server
...
@@ -267,7 +269,7 @@ void init_server_eventfd(int *watch_fd_list, int client_num, char *path)
...
@@ -267,7 +269,7 @@ void init_server_eventfd(int *watch_fd_list, int client_num, char *path)
}
}
}
}
}
}
#endif
int
nfapi_vnf_start
(
nfapi_vnf_config_t
*
config
)
int
nfapi_vnf_start
(
nfapi_vnf_config_t
*
config
)
{
{
// Verify that config is not null
// Verify that config is not null
...
@@ -585,7 +587,7 @@ int nfapi_vnf_start(nfapi_vnf_config_t* config)
...
@@ -585,7 +587,7 @@ int nfapi_vnf_start(nfapi_vnf_config_t* config)
}
}
}
}
}
}
#ifdef PHY_RM
int
fd
[
6
];
int
fd
[
6
];
const
char
*
path
=
"/tmp/oai_fapi_1ms"
;
const
char
*
path
=
"/tmp/oai_fapi_1ms"
;
char
idx
[
2
];
char
idx
[
2
];
...
@@ -608,6 +610,7 @@ int nfapi_vnf_start(nfapi_vnf_config_t* config)
...
@@ -608,6 +610,7 @@ int nfapi_vnf_start(nfapi_vnf_config_t* config)
vnf_p7
->
maxfd
=
vnf_p7
->
fapi_1ms_fd_list
[
0
];
vnf_p7
->
maxfd
=
vnf_p7
->
fapi_1ms_fd_list
[
0
];
FD_SET
(
vnf_p7
->
fapi_1ms_fd_list
[
0
],
&
(
vnf_p7
->
watchset
));
FD_SET
(
vnf_p7
->
fapi_1ms_fd_list
[
0
],
&
(
vnf_p7
->
watchset
));
#endif
}
}
else
else
{
{
...
@@ -894,8 +897,11 @@ int nfapi_vnf_allocate_phy(nfapi_vnf_config_t* config, int p5_idx, uint16_t* phy
...
@@ -894,8 +897,11 @@ int nfapi_vnf_allocate_phy(nfapi_vnf_config_t* config, int p5_idx, uint16_t* phy
info
->
timing_window
=
30
;
// This seems to override what gets set by the user - why???
info
->
timing_window
=
30
;
// This seems to override what gets set by the user - why???
info
->
timing_info_mode
=
0x03
;
info
->
timing_info_mode
=
0x03
;
info
->
timing_info_period
=
32
;
#ifdef PHY_RM
info
->
timing_info_period
=
32
#else;
info
->
timing_info_period
=
128
;
#endif
nfapi_vnf_phy_info_list_add
(
config
,
info
);
nfapi_vnf_phy_info_list_add
(
config
,
info
);
(
*
phy_id
)
=
info
->
phy_id
;
(
*
phy_id
)
=
info
->
phy_id
;
...
...
nfapi/open-nFAPI/vnf/src/vnf_p7.c
View file @
bc123817
This diff is collapsed.
Click to expand it.
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
View file @
bc123817
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include "vnf_p7.h"
#include "vnf_p7.h"
#define FAPI2_IP_DSCP 0
#define FAPI2_IP_DSCP 0
#ifdef PHY_RM
#define SF_BAND_CORRECT_200US 200000
#define SF_BAND_CORRECT_200US 200000
#define SF_BAND_CORRECT_500US 500000
#define SF_BAND_CORRECT_500US 500000
...
@@ -43,7 +44,7 @@ uint8_t* vnf_msg_buf_ptr;
...
@@ -43,7 +44,7 @@ uint8_t* vnf_msg_buf_ptr;
uint8_t
vnf_reassembly_flg
=
0
;
uint8_t
vnf_reassembly_flg
=
0
;
//#define LOG
//#define LOG
#endif
nfapi_vnf_p7_config_t
*
nfapi_vnf_p7_config_create
()
nfapi_vnf_p7_config_t
*
nfapi_vnf_p7_config_create
()
{
{
vnf_p7_t
*
_this
=
(
vnf_p7_t
*
)
calloc
(
1
,
sizeof
(
vnf_p7_t
));
vnf_p7_t
*
_this
=
(
vnf_p7_t
*
)
calloc
(
1
,
sizeof
(
vnf_p7_t
));
...
@@ -145,7 +146,6 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -145,7 +146,6 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
addr
.
sin_family
=
AF_INET
;
addr
.
sin_family
=
AF_INET
;
addr
.
sin_port
=
htons
(
config
->
port
);
addr
.
sin_port
=
htons
(
config
->
port
);
addr
.
sin_addr
.
s_addr
=
INADDR_ANY
;
addr
.
sin_addr
.
s_addr
=
INADDR_ANY
;
// bind to the configured port
// bind to the configured port
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"VNF P7 binding too %s:%d
\n
"
,
inet_ntoa
(
addr
.
sin_addr
),
ntohs
(
addr
.
sin_port
));
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"VNF P7 binding too %s:%d
\n
"
,
inet_ntoa
(
addr
.
sin_addr
),
ntohs
(
addr
.
sin_port
));
if
(
bind
(
vnf_p7
->
socket
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
struct
sockaddr_in
))
<
0
)
if
(
bind
(
vnf_p7
->
socket
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
struct
sockaddr_in
))
<
0
)
...
@@ -162,15 +162,29 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -162,15 +162,29 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
struct
timespec
pselect_timeout
;
struct
timespec
pselect_timeout
;
pselect_timeout
.
tv_sec
=
0
;
pselect_timeout
.
tv_sec
=
0
;
pselect_timeout
.
tv_nsec
=
1000000
;
// ns in a 1 us
pselect_timeout
.
tv_nsec
=
1000000
;
// ns in a 1 us
#ifdef PHY_RM
vnf_msg_ptr
=
(
uint8_t
*
)
malloc
(
VNF_MSG_SIZE
);
vnf_msg_ptr
=
(
uint8_t
*
)
malloc
(
VNF_MSG_SIZE
);
vnf_msg_buf_ptr
=
(
uint8_t
*
)
malloc
(
VNF_MSG_BUF_SIZE
);
vnf_msg_buf_ptr
=
(
uint8_t
*
)
malloc
(
VNF_MSG_BUF_SIZE
);
vnf_p7
->
rx_message_buffer
=
(
uint8_t
*
)
malloc
(
VNF_RX_MESSAGE_BUF_SIZE
);
vnf_p7
->
rx_message_buffer
=
(
uint8_t
*
)
malloc
(
VNF_RX_MESSAGE_BUF_SIZE
);
vnf_p7
->
rx_message_buffer_size
=
VNF_RX_MESSAGE_BUF_SIZE
;
vnf_p7
->
rx_message_buffer_size
=
VNF_RX_MESSAGE_BUF_SIZE
;
#else
struct
timespec
pselect_start
;
struct
timespec
pselect_stop
;
//struct timespec sf_end;
//struct timespec sf_end;
long
last_millisecond
=
-
1
;
struct
timespec
sf_duration
;
sf_duration
.
tv_sec
=
0
;
sf_duration
.
tv_nsec
=
1e6
;
// We want 1ms pause
struct
timespec
sf_start
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
sf_start
);
long
millisecond
=
sf_start
.
tv_nsec
/
1e6
;
sf_start
=
timespec_add
(
sf_start
,
sf_duration
);
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"next subframe will start at %d.%d
\n
"
,
sf_start
.
tv_sec
,
sf_start
.
tv_nsec
);
#endif
while
(
vnf_p7
->
terminate
==
0
)
while
(
vnf_p7
->
terminate
==
0
)
{
{
fd_set
rfds
;
fd_set
rfds
;
...
@@ -183,7 +197,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -183,7 +197,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
maxSock
=
vnf_p7
->
socket
;
maxSock
=
vnf_p7
->
socket
;
//NFAPI_TRACE(NFAPI_TRACE_INFO, "pselect_start:%d.%d sf_start:%d.%d\n", pselect_start.tv_sec, pselect_start.tv_nsec, sf_start.tv_sec, sf_start.tv_nsec);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "pselect_start:%d.%d sf_start:%d.%d\n", pselect_start.tv_sec, pselect_start.tv_nsec, sf_start.tv_sec, sf_start.tv_nsec);
#ifdef PHY_RM
selectRetval
=
pselect
(
maxSock
+
1
,
&
rfds
,
NULL
,
NULL
,
&
pselect_timeout
,
NULL
);
selectRetval
=
pselect
(
maxSock
+
1
,
&
rfds
,
NULL
,
NULL
,
&
pselect_timeout
,
NULL
);
nfapi_vnf_p7_connection_info_t
*
phy
=
vnf_p7
->
p7_connections
;
nfapi_vnf_p7_connection_info_t
*
phy
=
vnf_p7
->
p7_connections
;
...
@@ -209,8 +223,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -209,8 +223,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
{
{
vnf_p7_read_dispatch_message
(
vnf_p7
);
vnf_p7_read_dispatch_message
(
vnf_p7
);
}
}
}
}
else
if
(
selectRetval
<
0
)
else
if
(
selectRetval
<
0
)
{
{
// pselect error
// pselect error
if
(
selectRetval
==
-
1
&&
errno
==
EINTR
)
if
(
selectRetval
==
-
1
&&
errno
==
EINTR
)
...
@@ -227,6 +240,110 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -227,6 +240,110 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
}
}
}
}
}
}
#else
clock_gettime
(
CLOCK_MONOTONIC
,
&
pselect_start
);
//long millisecond = pselect_start.tv_nsec / 1e6;
if
((
last_millisecond
==
-
1
)
||
(
millisecond
==
last_millisecond
)
||
(
millisecond
==
(
last_millisecond
+
1
)
%
1000
)
)
{
if
((
pselect_start
.
tv_sec
>
sf_start
.
tv_sec
)
||
((
pselect_start
.
tv_sec
==
sf_start
.
tv_sec
)
&&
(
pselect_start
.
tv_nsec
>
sf_start
.
tv_nsec
)))
{
// overran the end of the subframe we do not want to wait
pselect_timeout
.
tv_sec
=
0
;
pselect_timeout
.
tv_nsec
=
0
;
}
else
{
// still time before the end of the subframe wait
pselect_timeout
=
timespec_sub
(
sf_start
,
pselect_start
);
}
selectRetval
=
pselect
(
maxSock
+
1
,
&
rfds
,
NULL
,
NULL
,
&
pselect_timeout
,
NULL
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
pselect_stop
);
nfapi_vnf_p7_connection_info_t
*
phy
=
vnf_p7
->
p7_connections
;
if
(
selectRetval
==-
1
&&
errno
==
22
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"INVAL: pselect_timeout:%d.%ld adj[dur:%d adj:%d], sf_dur:%d.%ld
\n
"
,
pselect_timeout
.
tv_sec
,
pselect_timeout
.
tv_nsec
,
phy
->
insync_minor_adjustment_duration
,
phy
->
insync_minor_adjustment
,
sf_duration
.
tv_sec
,
sf_duration
.
tv_nsec
);
}
if
(
selectRetval
==
0
)
{
// calculate the start of the next subframe
sf_start
=
timespec_add
(
sf_start
,
sf_duration
);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
if
(
phy
&&
phy
->
in_sync
&&
phy
->
insync_minor_adjustment
!=
0
&&
phy
->
insync_minor_adjustment_duration
>
0
)
{
long
insync_minor_adjustment_ns
=
(
phy
->
insync_minor_adjustment
*
1000
);
sf_start
.
tv_nsec
-=
insync_minor_adjustment_ns
;
if
(
sf_start
.
tv_nsec
>
1e9
)
{
sf_start
.
tv_sec
++
;
sf_start
.
tv_nsec
-=
1e9
;
}
else
if
(
sf_start
.
tv_nsec
<
0
)
{
sf_start
.
tv_sec
--
;
sf_start
.
tv_nsec
+=
1e9
;
}
phy
->
insync_minor_adjustment_duration
--
;
NFAPI_TRACE
(
NFAPI_TRACE_NOTE
,
"[VNF] AFTER adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%d duration:%u
\n
"
,
phy
->
insync_minor_adjustment
,
sf_start
.
tv_nsec
,
phy
->
insync_minor_adjustment_duration
);
if
(
phy
->
insync_minor_adjustment_duration
==
0
)
{
phy
->
insync_minor_adjustment
=
0
;
}
}
millisecond
++
;
}
}
else
{
// we have overrun the subframe advance to go and collect $200
if
((
millisecond
-
last_millisecond
)
>
3
)
NFAPI_TRACE
(
NFAPI_TRACE_WARN
,
"subframe overrun %ld %ld (%ld)
\n
"
,
millisecond
,
last_millisecond
,
millisecond
-
last_millisecond
+
1
);
last_millisecond
=
(
last_millisecond
+
1
)
%
1000
;
selectRetval
=
0
;
}
if
(
selectRetval
==
0
)
{
vnf_p7
->
sf_start_time_hr
=
vnf_get_current_time_hr
();
// pselect timed out
nfapi_vnf_p7_connection_info_t
*
curr
=
vnf_p7
->
p7_connections
;
while
(
curr
!=
0
)
{
curr
->
sfn_sf
=
increment_sfn_sf
(
curr
->
sfn_sf
);
vnf_sync
(
vnf_p7
,
curr
);
curr
=
curr
->
next
;
}
send_mac_subframe_indications
(
vnf_p7
);
}
else
if
(
selectRetval
>
0
)
{
// have a p7 message
if
(
FD_ISSET
(
vnf_p7
->
socket
,
&
rfds
))
{
vnf_p7_read_dispatch_message
(
vnf_p7
);
}
}
else
{
// pselect error
if
(
selectRetval
==
-
1
&&
errno
==
EINTR
)
{
// a sigal was received.
}
else
{
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"P7 select failed result %d errno %d timeout:%d.%d orginal:%d.%d last_ms:%ld ms:%ld
\n
"
,
selectRetval
,
errno
,
pselect_timeout
.
tv_sec
,
pselect_timeout
.
tv_nsec
,
pselect_timeout
.
tv_sec
,
pselect_timeout
.
tv_nsec
,
last_millisecond
,
millisecond
);
// should we exit now?
if
(
selectRetval
==
-
1
&&
errno
==
22
)
// invalid argument??? not sure about timeout duration
{
usleep
(
100000
);
}
}
}
#endif
}
}
...
@@ -238,7 +355,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -238,7 +355,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
return
0
;
return
0
;
}
}
#ifdef PHY_RM
int
nfapi_vnf_p7_time
(
nfapi_vnf_p7_config_t
*
config
){
int
nfapi_vnf_p7_time
(
nfapi_vnf_p7_config_t
*
config
){
#ifdef LOG
#ifdef LOG
...
@@ -378,7 +495,7 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
...
@@ -378,7 +495,7 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"%s() returning
\n
"
,
__FUNCTION__
);
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"%s() returning
\n
"
,
__FUNCTION__
);
return
0
;
return
0
;
}
}
#endif
int
nfapi_vnf_p7_stop
(
nfapi_vnf_p7_config_t
*
config
)
int
nfapi_vnf_p7_stop
(
nfapi_vnf_p7_config_t
*
config
)
{
{
if
(
config
==
0
)
if
(
config
==
0
)
...
@@ -408,7 +525,11 @@ int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr,
...
@@ -408,7 +525,11 @@ int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr,
node
->
dl_out_sync_offset
=
30
;
node
->
dl_out_sync_offset
=
30
;
node
->
dl_out_sync_period
=
10
;
node
->
dl_out_sync_period
=
10
;
node
->
dl_in_sync_offset
=
30
;
node
->
dl_in_sync_offset
=
30
;
#ifdef PHY_RM
node
->
dl_in_sync_period
=
32
;
node
->
dl_in_sync_period
=
32
;
#else
node
->
dl_in_sync_period
=
512
;
#endif
node
->
sfn_sf
=
0
;
node
->
sfn_sf
=
0
;
node
->
min_sync_cycle_count
=
8
;
node
->
min_sync_cycle_count
=
8
;
...
@@ -525,7 +646,7 @@ int nfapi_vnf_p7_release_pdu(nfapi_vnf_p7_config_t* config, void* pdu)
...
@@ -525,7 +646,7 @@ int nfapi_vnf_p7_release_pdu(nfapi_vnf_p7_config_t* config, void* pdu)
return
0
;
return
0
;
}
}
#ifdef PHY_RM
int
nfapi_vnf_p7_phy_rm_start_req
(
nfapi_vnf_p7_config_t
*
config
,
nfapi_phy_rm_start_request_t
*
req
)
int
nfapi_vnf_p7_phy_rm_start_req
(
nfapi_vnf_p7_config_t
*
config
,
nfapi_phy_rm_start_request_t
*
req
)
{
{
if
(
config
==
0
||
req
==
0
)
if
(
config
==
0
||
req
==
0
)
...
@@ -534,3 +655,4 @@ int nfapi_vnf_p7_phy_rm_start_req(nfapi_vnf_p7_config_t* config, nfapi_phy_rm_st
...
@@ -534,3 +655,4 @@ int nfapi_vnf_p7_phy_rm_start_req(nfapi_vnf_p7_config_t* config, nfapi_phy_rm_st
vnf_p7_t
*
vnf_p7
=
(
vnf_p7_t
*
)
config
;
vnf_p7_t
*
vnf_p7
=
(
vnf_p7_t
*
)
config
;
return
vnf_p7_pack_and_send_p7_msg
(
vnf_p7
,
&
req
->
header
);
return
vnf_p7_pack_and_send_p7_msg
(
vnf_p7
,
&
req
->
header
);
}
}
#endif
openair1/SCHED/fapi_l1.c
View file @
bc123817
...
@@ -43,7 +43,9 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
...
@@ -43,7 +43,9 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
);
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
);
int
oai_nfapi_ue_release_req
(
nfapi_ue_release_request_t
*
release_req
);
int
oai_nfapi_ue_release_req
(
nfapi_ue_release_request_t
*
release_req
);
#ifdef PHY_RM
int
oai_nfapi_phy_rm_start_req
(
nfapi_phy_rm_start_request_t
*
rm_start_req
);
int
oai_nfapi_phy_rm_start_req
(
nfapi_phy_rm_start_request_t
*
rm_start_req
);
#endif
uint8_t
dl_pdus
[
8
][
MAX_NUM_DL_PDU
][
9422
];
uint8_t
dl_pdus
[
8
][
MAX_NUM_DL_PDU
][
9422
];
void
handle_nfapi_dci_dl_pdu
(
PHY_VARS_eNB
*
eNB
,
void
handle_nfapi_dci_dl_pdu
(
PHY_VARS_eNB
*
eNB
,
int
frame
,
int
subframe
,
int
frame
,
int
subframe
,
...
...
openair2/LAYER2/MAC/mac.h
View file @
bc123817
...
@@ -1452,9 +1452,10 @@ typedef struct eNB_MAC_INST_s {
...
@@ -1452,9 +1452,10 @@ typedef struct eNB_MAC_INST_s {
nfapi_tx_request_t
TX_req
[
NFAPI_CC_MAX
];
nfapi_tx_request_t
TX_req
[
NFAPI_CC_MAX
];
/// NFAPI UE_release_req structure
/// NFAPI UE_release_req structure
nfapi_ue_release_request_t
UE_release_req
;
nfapi_ue_release_request_t
UE_release_req
;
#ifdef PHY_RM
/// NFAPI phy rm start structure
/// NFAPI phy rm start structure
nfapi_phy_rm_start_request_t
PHY_rm_start_req
;
nfapi_phy_rm_start_request_t
PHY_rm_start_req
;
#endif
/// UL handle
/// UL handle
uint32_t
ul_handle
;
uint32_t
ul_handle
;
UE_list_t
UE_list
;
UE_list_t
UE_list
;
...
...
openair2/PHY_INTERFACE/IF_Module.c
View file @
bc123817
...
@@ -762,7 +762,9 @@ void UL_indication(UL_IND_t *UL_info) {
...
@@ -762,7 +762,9 @@ void UL_indication(UL_IND_t *UL_info) {
sched_info
->
TX_req
=
&
mac
->
TX_req
[
CC_id
];
sched_info
->
TX_req
=
&
mac
->
TX_req
[
CC_id
];
pthread_mutex_lock
(
&
lock_ue_freelist
);
pthread_mutex_lock
(
&
lock_ue_freelist
);
sched_info
->
UE_release_req
=
&
mac
->
UE_release_req
;
sched_info
->
UE_release_req
=
&
mac
->
UE_release_req
;
#ifdef PHY_RM
sched_info
->
PHY_rm_start_req
=
&
mac
->
PHY_rm_start_req
;
sched_info
->
PHY_rm_start_req
=
&
mac
->
PHY_rm_start_req
;
#endif
pthread_mutex_unlock
(
&
lock_ue_freelist
);
pthread_mutex_unlock
(
&
lock_ue_freelist
);
#ifdef DUMP_FAPI
#ifdef DUMP_FAPI
dump_dl
(
sched_info
);
dump_dl
(
sched_info
);
...
...
openair2/PHY_INTERFACE/IF_Module.h
View file @
bc123817
...
@@ -131,8 +131,10 @@ typedef struct{
...
@@ -131,8 +131,10 @@ typedef struct{
nfapi_tx_request_t
*
TX_req
;
nfapi_tx_request_t
*
TX_req
;
/// Pointers to ue_release
/// Pointers to ue_release
nfapi_ue_release_request_t
*
UE_release_req
;
nfapi_ue_release_request_t
*
UE_release_req
;
#ifdef PHY_RM
/// Pointers to phy rm
/// Pointers to phy rm
nfapi_phy_rm_start_request_t
*
PHY_rm_start_req
;
nfapi_phy_rm_start_request_t
*
PHY_rm_start_req
;
#endif
}
Sched_Rsp_t
;
}
Sched_Rsp_t
;
typedef
struct
{
typedef
struct
{
...
...
targets/RT/USER/lte-ue.c
View file @
bc123817
...
@@ -971,7 +971,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
...
@@ -971,7 +971,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
UE
=
rtd
->
UE
;
UE
=
rtd
->
UE
;
if
(
ue_thread_id
==
0
)
{
if
(
ue_thread_id
==
0
)
{
phy_stub_ticking
->
ticking_var
=
-
1
;
//
phy_stub_ticking->ticking_var = -1;
proc
->
subframe_rx
=
proc
->
sub_frame_start
;
proc
->
subframe_rx
=
proc
->
sub_frame_start
;
// Initializations for nfapi-L2-emulator mode
// Initializations for nfapi-L2-emulator mode
dl_config_req
=
NULL
;
dl_config_req
=
NULL
;
...
@@ -1224,7 +1224,10 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
...
@@ -1224,7 +1224,10 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
oai_nfapi_rx_ind
(
&
UL_INFO
->
rx_ind
);
oai_nfapi_rx_ind
(
&
UL_INFO
->
rx_ind
);
for
(
uint8_t
num_pdu
=
0
;
num_pdu
<
UL_INFO
->
rx_ind
.
rx_indication_body
.
number_of_pdus
;
num_pdu
++
)
{
for
(
uint8_t
num_pdu
=
0
;
num_pdu
<
UL_INFO
->
rx_ind
.
rx_indication_body
.
number_of_pdus
;
num_pdu
++
)
{
if
(
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
num_pdu
].
data
)
{
free
(
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
num_pdu
].
data
);
free
(
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
num_pdu
].
data
);
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
num_pdu
].
data
=
NULL
;
}
}
}
//LOG_I(MAC, "ul_config_req_UE_MAC 2.31 \n");
//LOG_I(MAC, "ul_config_req_UE_MAC 2.31 \n");
...
@@ -1246,22 +1249,22 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
...
@@ -1246,22 +1249,22 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
}
}
// Free UL_INFO messages
// Free UL_INFO messages
//
if(UL_INFO->crc_ind.crc_indication_body.crc_pdu_list != NULL){
if
(
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
!=
NULL
){
free
(
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
);
free
(
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
);
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
=
NULL
;
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
=
NULL
;
//
}
}
//
if(UL_INFO->rx_ind.rx_indication_body.rx_pdu_list != NULL){
if
(
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
!=
NULL
){
free
(
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
);
free
(
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
);
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
=
NULL
;
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
=
NULL
;
//
}
}
//
if(UL_INFO->harq_ind.harq_indication_body.harq_pdu_list !=NULL){
if
(
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
!=
NULL
){
free
(
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
);
free
(
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
);
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
=
NULL
;
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
=
NULL
;
//
}
}
//
if(UL_INFO->sr_ind.sr_indication_body.sr_pdu_list!=NULL){
if
(
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
!=
NULL
){
free
(
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
);
free
(
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
);
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
=
NULL
;
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
=
NULL
;
//
}
}
free
(
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
);
free
(
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
);
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
=
NULL
;
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
=
NULL
;
free
(
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_raw_pdu_list
);
free
(
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_raw_pdu_list
);
...
...
targets/RT/USER/lte-uesoftmodem.c
View file @
bc123817
...
@@ -691,9 +691,9 @@ int main( int argc, char **argv ) {
...
@@ -691,9 +691,9 @@ int main( int argc, char **argv ) {
frame_parms
[
CC_id
]
->
nb_antennas_rx
=
nb_antenna_rx
;
frame_parms
[
CC_id
]
->
nb_antennas_rx
=
nb_antenna_rx
;
frame_parms
[
CC_id
]
->
nb_antenna_ports_eNB
=
1
;
//initial value overwritten by initial sync later
frame_parms
[
CC_id
]
->
nb_antenna_ports_eNB
=
1
;
//initial value overwritten by initial sync later
}
}
#ifndef OPENAIR2
NB_INST
=
1
;
NB_INST
=
1
;
#endif
if
(
NFAPI_MODE
==
NFAPI_UE_STUB_PNF
)
{
if
(
NFAPI_MODE
==
NFAPI_UE_STUB_PNF
)
{
PHY_vars_UE_g
=
malloc
(
sizeof
(
PHY_VARS_UE
**
)
*
NB_UE_INST
);
PHY_vars_UE_g
=
malloc
(
sizeof
(
PHY_VARS_UE
**
)
*
NB_UE_INST
);
...
...
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