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
Michael Black
OpenXG-RAN
Commits
ad2da99d
Commit
ad2da99d
authored
Jan 18, 2018
by
William Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing of Discovery transmission/reception
parent
ccdc09c8
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
208 additions
and
218 deletions
+208
-218
openair1/PHY/LTE_TRANSPORT/defs.h
openair1/PHY/LTE_TRANSPORT/defs.h
+12
-13
openair1/PHY/LTE_TRANSPORT/sldch.c
openair1/PHY/LTE_TRANSPORT/sldch.c
+4
-5
openair2/LAYER2/MAC/defs.h
openair2/LAYER2/MAC/defs.h
+74
-78
openair2/LAYER2/MAC/ue_procedures.c
openair2/LAYER2/MAC/ue_procedures.c
+23
-20
openair2/RRC/LITE/L2_interface.c
openair2/RRC/LITE/L2_interface.c
+10
-9
openair2/RRC/LITE/defs.h
openair2/RRC/LITE/defs.h
+5
-7
openair2/RRC/LITE/proto.h
openair2/RRC/LITE/proto.h
+7
-7
openair2/RRC/LITE/rrc_UE.c
openair2/RRC/LITE/rrc_UE.c
+43
-41
targets/RT/USER/lte-ue.c
targets/RT/USER/lte-ue.c
+30
-38
No files found.
openair1/PHY/LTE_TRANSPORT/defs.h
View file @
ad2da99d
...
@@ -939,8 +939,7 @@ typedef struct {
...
@@ -939,8 +939,7 @@ typedef struct {
typedef
struct
{
typedef
struct
{
/// payload length
/// payload length
int
payload_length
;
int
payload_length
;
/// pointer to payload
uint8_t
payload
[
100
];
uint8_t
*
payload
;
}
SLDCH_t
;
}
SLDCH_t
;
#define TTI_SYNC 0
#define TTI_SYNC 0
...
...
openair1/PHY/LTE_TRANSPORT/sldch.c
View file @
ad2da99d
...
@@ -42,14 +42,13 @@ void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx)
...
@@ -42,14 +42,13 @@ void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx)
pdu
.
header
.
packet_type
=
SLDCH
;
pdu
.
header
.
packet_type
=
SLDCH
;
pdu
.
header
.
absSF
=
(
frame_tx
*
10
)
+
subframe_tx
;
pdu
.
header
.
absSF
=
(
frame_tx
*
10
)
+
subframe_tx
;
memcpy
((
void
*
)
&
pdu
.
sldch
,(
void
*
)
sldch
,
sizeof
(
SLDCH_t
)
-
sizeof
(
uint8_t
*
));
AssertFatal
(
sldch
->
payload_length
<=
1500
-
sldch_header_len
-
sizeof
(
SLDCH_t
)
+
sizeof
(
uint8_t
*
),
AssertFatal
(
sldch
->
payload_length
<=
1500
-
sldch_header_len
-
sizeof
(
SLDCH_t
)
+
sizeof
(
uint8_t
*
),
"SLDCH payload length > %d
\n
"
,
"SLDCH payload length > %d
\n
"
,
1500
-
sldch_header_len
-
sizeof
(
SLDCH_t
)
+
sizeof
(
uint8_t
*
));
1500
-
sldch_header_len
-
sizeof
(
SLDCH_t
)
+
sizeof
(
uint8_t
*
));
memcpy
((
void
*
)
&
pdu
.
payload
[
0
]
,
memcpy
((
void
*
)
&
pdu
.
sldch
,
(
void
*
)
sldch
->
payload
,
(
void
*
)
sldch
,
s
ldch
->
payload_length
);
s
izeof
(
SLDCH_t
)
);
LOG_I
(
PHY
,
"SLDCH configuration %d bytes, TBS payload %d bytes => %d bytes
\n
"
,
LOG_I
(
PHY
,
"SLDCH configuration %d bytes, TBS payload %d bytes => %d bytes
\n
"
,
sizeof
(
SLDCH_t
)
-
sizeof
(
uint8_t
*
),
sizeof
(
SLDCH_t
)
-
sizeof
(
uint8_t
*
),
...
@@ -58,7 +57,7 @@ void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx)
...
@@ -58,7 +57,7 @@ void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx)
multicast_link_write_sock
(
0
,
multicast_link_write_sock
(
0
,
&
pdu
,
&
pdu
,
sldch_header_len
+
sizeof
(
SLDCH_t
)
-
sizeof
(
uint8_t
*
)
+
sldch
->
payload_length
);
sldch_header_len
+
sizeof
(
SLDCH_t
));
}
}
...
...
openair2/LAYER2/MAC/defs.h
View file @
ad2da99d
...
@@ -1378,7 +1378,6 @@ typedef struct {
...
@@ -1378,7 +1378,6 @@ typedef struct {
int
sltx_active
;
int
sltx_active
;
SLSCH_t
slsch
;
SLSCH_t
slsch
;
SLDCH_t
sldch
;
SLDCH_t
sldch
;
ULDCH_PDU
sldch_pdu
;
ULSCH_PDU
slsch_pdu
;
ULSCH_PDU
slsch_pdu
;
int
slsch_lcid
;
int
slsch_lcid
;
#endif
#endif
...
@@ -1498,6 +1497,3 @@ typedef struct {
...
@@ -1498,6 +1497,3 @@ typedef struct {
#include "proto.h"
#include "proto.h"
/*@}*/
/*@}*/
#endif
/*__LAYER2_MAC_DEFS_H__ */
#endif
/*__LAYER2_MAC_DEFS_H__ */
openair2/LAYER2/MAC/ue_procedures.c
View file @
ad2da99d
...
@@ -2748,24 +2748,27 @@ SLSS_t *ue_get_slss(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t su
...
@@ -2748,24 +2748,27 @@ SLSS_t *ue_get_slss(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t su
}
}
SLDCH_t
*
ue_get_sldch
(
module_id_t
Mod_id
,
int
CC_id
,
frame_t
frame_tx
,
sub_frame_t
subframe_tx
)
{
SLDCH_t
*
ue_get_sldch
(
module_id_t
Mod_id
,
int
CC_id
,
frame_t
frame_tx
,
sub_frame_t
subframe_tx
)
{
/* int sdu_length;
UE_MAC_INST
*
ue
=
&
UE_mac_inst
[
Mod_id
];
UE_MAC_INST
*
ue
=
&
UE_mac_inst
[
Mod_id
];
SLDCH_t
*
sldch
=
&
UE_mac_inst
[
Mod_id
].
sldch
;
SLDCH_t
*
sldch
=
&
UE_mac_inst
[
Mod_id
].
sldch
;
LOG_I(MAC, "[ue_get_sldch]");
int sdu
_length = mac_rrc_data_req(Mod_id,
sldch
->
payload
_length
=
mac_rrc_data_req
(
Mod_id
,
CC_id
,
CC_id
,
frame_tx
,
frame_tx
,
SL_DISCOVERY
,
SL_DISCOVERY
,
1
,
1
,
(char*)(
ue->sldch_pdu.
payload), //&UE_mac_inst[Mod_id].SL_Discovery[0].Tx_buffer.Payload[0],
(
char
*
)(
sldch
->
payload
),
//&UE_mac_inst[Mod_id].SL_Discovery[0].Tx_buffer.Payload[0],
0
,
0
,
0
,
//eNB_indexP
0
,
//eNB_indexP
0
);
0
);
if (sdu_length >0 ) return (&ue->sldch);
if
(
sldch
->
payload_length
>
0
)
{
LOG_I
(
MAC
,
"Got %d bytes from RRC for SLDCH @ %p
\n
"
,
sldch
->
payload_length
,
sldch
);
return
(
sldch
);
}
else
else
*/
return
((
SLDCH_t
*
)
NULL
);
return
((
SLDCH_t
*
)
NULL
);
}
}
...
...
openair2/RRC/LITE/L2_interface.c
View file @
ad2da99d
...
@@ -329,10 +329,11 @@ mac_rrc_data_req(
...
@@ -329,10 +329,11 @@ mac_rrc_data_req(
LOG_D
(
RRC
,
"[UE %d] Frame %d buffer_pP status %d,
\n
"
,
Mod_idP
,
frameP
,
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
payload_size
);
LOG_D
(
RRC
,
"[UE %d] Frame %d buffer_pP status %d,
\n
"
,
Mod_idP
,
frameP
,
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
payload_size
);
//TTN (for D2D)
//TTN (for D2D)
if
(
(
Srb_id
&
RAB_OFFSET
)
==
SL_DISCOVERY
){
if
(
Srb_id
==
SL_DISCOVERY
&&
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
payload_size
>
0
){
memcpy
(
&
buffer_pP
[
0
],
&
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
Payload
[
0
],
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
payload_size
);
memcpy
(
&
buffer_pP
[
0
],
&
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
Payload
[
0
],
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
payload_size
);
uint8_t
Ret_size
=
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
payload_size
;
uint8_t
Ret_size
=
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
payload_size
;
// msg("[RRC][UE %d] Sending SL_Discovery\n",Mod_id);
LOG_I
(
RRC
,
"[UE %d] Sending SL_Discovery, size %d bytes
\n
"
,
Mod_idP
,
Ret_size
);
UE_rrc_inst
[
Mod_idP
].
SL_Discovery
[
eNB_index
].
Tx_buffer
.
payload_size
=
0
;
return
(
Ret_size
);
return
(
Ret_size
);
}
}
#endif
#endif
...
@@ -513,7 +514,7 @@ mac_rrc_data_ind(
...
@@ -513,7 +514,7 @@ mac_rrc_data_ind(
}
}
//TTN (for D2D)
//TTN (for D2D)
if
(
(
srb_idP
&
RAB_OFFSET
)
==
SL_DISCOVERY
)
{
if
(
srb_idP
==
SL_DISCOVERY
)
{
decode_SL_Discovery_Message
(
&
ctxt
,
eNB_indexP
,
sduP
,
sdu_lenP
);
decode_SL_Discovery_Message
(
&
ctxt
,
eNB_indexP
,
sduP
,
sdu_lenP
);
}
}
...
...
openair2/RRC/LITE/defs.h
View file @
ad2da99d
...
@@ -134,11 +134,9 @@ struct PC5SEstablishRsp{
...
@@ -134,11 +134,9 @@ struct PC5SEstablishRsp{
//example of PC5_DSICOVERY ANNOUNCEMENT (for testing only)
//example of PC5_DSICOVERY ANNOUNCEMENT (for testing only)
typedef
struct
{
typedef
struct
{
uint8_t
msg_type
;
unsigned
char
bytes
[
29
];
uint32_t
discoveryGroupId
;
}
__attribute__
((
__packed__
))
PC5DiscoveryAnnouncement
;
//AnnouncerInfo
uint32_t
proSeUEId
;
}
__attribute__
((
__packed__
))
PC5DiscoveryAnnouncement
;
struct
sidelink_ctrl_element
{
struct
sidelink_ctrl_element
{
unsigned
short
type
;
unsigned
short
type
;
...
...
openair2/RRC/LITE/proto.h
View file @
ad2da99d
...
@@ -90,7 +90,7 @@ rrc_ue_decode_dcch(
...
@@ -90,7 +90,7 @@ rrc_ue_decode_dcch(
);
);
#ifdef Rel14
#ifdef Rel14
int
decode_SL_D
ISCOVERY
_Message
(
int
decode_SL_D
iscovery
_Message
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
eNB_index
,
const
uint8_t
eNB_index
,
uint8_t
*
const
Sdu
,
uint8_t
*
const
Sdu
,
...
...
openair2/RRC/LITE/rrc_UE.c
View file @
ad2da99d
...
@@ -5806,14 +5806,16 @@ void *rrc_control_socket_thread_fct(void *arg)
...
@@ -5806,14 +5806,16 @@ void *rrc_control_socket_thread_fct(void *arg)
#ifdef DEBUG_CTRL_SOCKET
#ifdef DEBUG_CTRL_SOCKET
LOG_I
(
RRC
,
"[PC5DiscoveryAnnouncement] Received on socket from ProSe App (msg type: %d)
\n
"
,
sl_ctrl_msg_recv
->
type
);
LOG_I
(
RRC
,
"[PC5DiscoveryAnnouncement] Received on socket from ProSe App (msg type: %d)
\n
"
,
sl_ctrl_msg_recv
->
type
);
LOG_I
(
RRC
,
"[PC5DiscoveryAnnouncement] type: %d
\n
"
,
sl_ctrl_msg_recv
->
sidelinkPrimitive
.
pc5_discovery_announcement
.
msg_type
);
//
LOG_I(RRC,"[PC5DiscoveryAnnouncement] type: %d\n",sl_ctrl_msg_recv->sidelinkPrimitive.pc5_discovery_announcement.msg_type);
LOG_I
(
RRC
,
"[PC5DiscoveryAnnouncement] discoveryGroupId: 0x%08x
\n
"
,
sl_ctrl_msg_recv
->
sidelinkPrimitive
.
pc5_discovery_announcement
.
discoveryGroupId
);
// LOG_D
(RRC,"[PC5DiscoveryAnnouncement] discoveryGroupId: 0x%08x\n",sl_ctrl_msg_recv->sidelinkPrimitive.pc5_discovery_announcement.discoveryGroupId);
LOG_I
(
RRC
,
"[PC5DiscoveryAnnouncement] proSeUEId: 0x%08x
\n
"
,
sl_ctrl_msg_recv
->
sidelinkPrimitive
.
pc5_discovery_announcement
.
proSeUEId
);
// LOG_D
(RRC,"[PC5DiscoveryAnnouncement] proSeUEId: 0x%08x\n",sl_ctrl_msg_recv->sidelinkPrimitive.pc5_discovery_announcement.proSeUEId);
#endif
#endif
//prepare SL_Discovery buffer
//prepare SL_Discovery buffer
if
(
UE_rrc_inst
)
{
memcpy
((
void
*
)
&
UE_rrc_inst
[
module_id
].
SL_Discovery
[
0
].
Tx_buffer
.
Payload
[
0
],
(
void
*
)
receive_buf
,
n
);
memcpy
((
void
*
)
&
UE_rrc_inst
[
module_id
].
SL_Discovery
[
0
].
Tx_buffer
.
Payload
[
0
],
(
void
*
)
receive_buf
,
n
);
UE_rrc_inst
[
module_id
].
SL_Discovery
[
0
].
Tx_buffer
.
payload_size
=
n
;
UE_rrc_inst
[
module_id
].
SL_Discovery
[
0
].
Tx_buffer
.
payload_size
=
n
;
LOG_I
(
RRC
,
"[PC5DiscoveryAnnouncement] Copied %d bytes
\n
"
,
n
);
}
break
;
break
;
default:
default:
break
;
break
;
...
@@ -5825,7 +5827,7 @@ void *rrc_control_socket_thread_fct(void *arg)
...
@@ -5825,7 +5827,7 @@ void *rrc_control_socket_thread_fct(void *arg)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int
decode_SL_D
ISCOVERY
_Message
(
int
decode_SL_D
iscovery
_Message
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
eNB_index
,
const
uint8_t
eNB_index
,
uint8_t
*
const
Sdu
,
uint8_t
*
const
Sdu
,
...
...
targets/RT/USER/lte-ue.c
View file @
ad2da99d
...
@@ -1640,11 +1640,3 @@ int init_timer_thread(void) {
...
@@ -1640,11 +1640,3 @@ int init_timer_thread(void) {
pthread_create
(
&
phy_stub_ticking
->
pthread_timer
,
NULL
,
&
timer_thread
,
NULL
);
pthread_create
(
&
phy_stub_ticking
->
pthread_timer
,
NULL
,
&
timer_thread
,
NULL
);
return
0
;
return
0
;
}
}
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