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
ZhouShuya
OpenXG-RAN
Commits
532a566c
Commit
532a566c
authored
Jan 03, 2018
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.eurecom.fr/matzakos/LTE-D2D
parents
86a308bb
109d6bb7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
4 deletions
+59
-4
openair1/PHY/defs.h
openair1/PHY/defs.h
+0
-1
openair2/LAYER2/MAC/proto.h
openair2/LAYER2/MAC/proto.h
+8
-0
openair2/LAYER2/MAC/ue_procedures.c
openair2/LAYER2/MAC/ue_procedures.c
+25
-0
targets/RT/USER/lte-ue.c
targets/RT/USER/lte-ue.c
+26
-3
No files found.
openair1/PHY/defs.h
View file @
532a566c
...
@@ -1587,7 +1587,6 @@ static inline int wakeup_thread(pthread_mutex_t *mutex,pthread_cond_t *cond,int
...
@@ -1587,7 +1587,6 @@ static inline int wakeup_thread(pthread_mutex_t *mutex,pthread_cond_t *cond,int
return
(
-
1
);
return
(
-
1
);
}
}
*
instance_cnt
=
*
instance_cnt
+
1
;
*
instance_cnt
=
*
instance_cnt
+
1
;
// the thread can now be woken up
// the thread can now be woken up
if
(
pthread_cond_signal
(
cond
)
!=
0
)
{
if
(
pthread_cond_signal
(
cond
)
!=
0
)
{
LOG_E
(
PHY
,
"ERROR pthread_cond_signal
\n
"
);
LOG_E
(
PHY
,
"ERROR pthread_cond_signal
\n
"
);
...
...
openair2/LAYER2/MAC/proto.h
View file @
532a566c
...
@@ -447,6 +447,14 @@ void ue_decode_p(module_id_t module_idP, int CC_id,frame_t frame, uint8_t CH_ind
...
@@ -447,6 +447,14 @@ void ue_decode_p(module_id_t module_idP, int CC_id,frame_t frame, uint8_t CH_ind
void
ue_send_sdu
(
module_id_t
module_idP
,
uint8_t
CC_id
,
frame_t
frame
,
sub_frame_t
subframe
,
uint8_t
*
sdu
,
uint16_t
sdu_len
,
uint8_t
CH_index
);
void
ue_send_sdu
(
module_id_t
module_idP
,
uint8_t
CC_id
,
frame_t
frame
,
sub_frame_t
subframe
,
uint8_t
*
sdu
,
uint16_t
sdu_len
,
uint8_t
CH_index
);
void
ue_send_sl_sdu
(
module_id_t
module_idP
,
uint8_t
CC_id
,
frame_t
frameP
,
sub_frame_t
subframeP
,
uint8_t
*
sdu
,
uint16_t
sdu_len
,
uint8_t
eNB_index
);
#if defined(Rel10) || defined(Rel14)
#if defined(Rel10) || defined(Rel14)
/* \brief Called by PHY to transfer MCH transport block to ue MAC.
/* \brief Called by PHY to transfer MCH transport block to ue MAC.
...
...
openair2/LAYER2/MAC/ue_procedures.c
View file @
532a566c
...
@@ -741,6 +741,31 @@ void ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint
...
@@ -741,6 +741,31 @@ void ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint
#endif
#endif
}
}
void
ue_send_sl_sdu
(
module_id_t
module_idP
,
uint8_t
CC_id
,
frame_t
frameP
,
sub_frame_t
subframeP
,
uint8_t
*
sdu
,
uint16_t
sdu_len
,
uint8_t
eNB_index
)
{
mac_rlc_data_ind
(
module_idP
,
0x1234
,
eNB_index
,
frameP
,
ENB_FLAG_NO
,
MBMS_FLAG_NO
,
3
,
(
char
*
)
sdu
,
sdu_len
,
1
,
NULL
);
}
int8_t
ue_get_mbsfn_sf_alloction
(
module_id_t
module_idP
,
uint8_t
mbsfn_sync_area
,
unsigned
char
eNB_index
)
int8_t
ue_get_mbsfn_sf_alloction
(
module_id_t
module_idP
,
uint8_t
mbsfn_sync_area
,
unsigned
char
eNB_index
)
{
{
// currently there is one-to-one mapping between sf allocation pattern and sync area
// currently there is one-to-one mapping between sf allocation pattern and sync area
...
...
targets/RT/USER/lte-ue.c
View file @
532a566c
...
@@ -760,7 +760,8 @@ void ue_stub_rx_handler(unsigned int num_bytes, char *rx_buffer) {
...
@@ -760,7 +760,8 @@ void ue_stub_rx_handler(unsigned int num_bytes, char *rx_buffer) {
PHY_VARS_UE
*
UE
;
PHY_VARS_UE
*
UE
;
UE
=
PHY_vars_UE_g
[
0
][
0
];
UE
=
PHY_vars_UE_g
[
0
][
0
];
LOG_I
(
PHY
,
"Received %d bytes on UE-UE link, packet type %d
\n
"
,
num_bytes
,((
UE_tport_header_t
*
)
rx_buffer
)
->
packet_type
);
UE_tport_t
*
pdu
=
(
UE_tport_t
*
)
rx_buffer
;
SLSCH_t
*
slsch
=
(
SLSCH_t
*
)
&
pdu
->
slsch
;
switch
(((
UE_tport_header_t
*
)
rx_buffer
)
->
packet_type
)
{
switch
(((
UE_tport_header_t
*
)
rx_buffer
)
->
packet_type
)
{
case
TTI_SYNC
:
case
TTI_SYNC
:
...
@@ -768,6 +769,23 @@ void ue_stub_rx_handler(unsigned int num_bytes, char *rx_buffer) {
...
@@ -768,6 +769,23 @@ void ue_stub_rx_handler(unsigned int num_bytes, char *rx_buffer) {
wakeup_thread
(
&
UE
->
timer_mutex
,
&
UE
->
timer_cond
,
&
UE
->
instance_cnt_timer
,
"timer_thread"
);
wakeup_thread
(
&
UE
->
timer_mutex
,
&
UE
->
timer_cond
,
&
UE
->
instance_cnt_timer
,
"timer_thread"
);
break
;
break
;
case
SLSCH
:
case
SLSCH
:
LOG_I
(
PHY
,
"Emulator SFN.SF %d.%d, Got SLSCH packet
\n
"
,
emulator_absSF
/
10
,
emulator_absSF
%
10
);
LOG_I
(
PHY
,
"Received %d bytes on UE-UE link for SFN.SF %d.%d, sending SLSCH payload (%d bytes) to MAC
\n
"
,
num_bytes
,
pdu
->
header
.
absSF
/
10
,
pdu
->
header
.
absSF
%
10
,
slsch
->
payload_length
);
printf
(
"SLSCH:"
);
for
(
int
i
=
0
;
i
<
sizeof
(
SLSCH_t
);
i
++
)
printf
(
"%x "
,((
uint8_t
*
)
slsch
)[
i
]);
printf
(
"
\n
"
);
ue_send_sl_sdu
(
0
,
0
,
pdu
->
header
.
absSF
/
10
,
pdu
->
header
.
absSF
%
10
,
pdu
->
payload
,
slsch
->
payload_length
,
0
);
break
;
break
;
}
}
}
}
...
@@ -1498,6 +1516,7 @@ static void* timer_thread( void* param ) {
...
@@ -1498,6 +1516,7 @@ static void* timer_thread( void* param ) {
timer_subframe
=
absSFm1
%
10
;
timer_subframe
=
absSFm1
%
10
;
pthread_mutex_lock
(
&
UE
->
timer_mutex
);
pthread_mutex_lock
(
&
UE
->
timer_mutex
);
UE
->
instance_cnt_timer
=
-
1
;
UE
->
instance_cnt_timer
=
-
1
;
pthread_mutex_unlock
(
&
UE
->
timer_mutex
);
LOG_I
(
PHY
,
"Running with external timer
\n
"
);
LOG_I
(
PHY
,
"Running with external timer
\n
"
);
}
}
else
LOG_I
(
PHY
,
"Running with internal timer
\n
"
);
else
LOG_I
(
PHY
,
"Running with internal timer
\n
"
);
...
@@ -1514,7 +1533,7 @@ static void* timer_thread( void* param ) {
...
@@ -1514,7 +1533,7 @@ static void* timer_thread( void* param ) {
timer_subframe
++
;
timer_subframe
++
;
}
}
//printf("[timer_thread] Frame: %d, Subframe: %d \n", timer_frame, timer_subframe);
//printf("[timer_thread] Frame: %d, Subframe: %d \n", timer_frame, timer_subframe);
LOG_D
(
MAC
,
" Panos-D [timer_thread] Frame: %d, Subframe: %d
\n
"
,
timer_frame
,
timer_subframe
);
//LOG_I
(MAC," Panos-D [timer_thread] Frame: %d, Subframe: %d \n", timer_frame, timer_subframe);
//AssertFatal( 0 == pthread_cond_signal(&phy_stub_ticking->cond_ticking), "");
//AssertFatal( 0 == pthread_cond_signal(&phy_stub_ticking->cond_ticking), "");
AssertFatal
(
pthread_mutex_lock
(
&
phy_stub_ticking
->
mutex_ticking
)
==
0
,
""
);
AssertFatal
(
pthread_mutex_lock
(
&
phy_stub_ticking
->
mutex_ticking
)
==
0
,
""
);
phy_stub_ticking
->
ticking_var
++
;
phy_stub_ticking
->
ticking_var
++
;
...
@@ -1587,7 +1606,11 @@ static void* timer_thread( void* param ) {
...
@@ -1587,7 +1606,11 @@ static void* timer_thread( void* param ) {
}
}
int
init_timer_thread
(
void
)
{
int
init_timer_thread
(
void
)
{
PHY_VARS_UE
*
UE
=
PHY_vars_UE_g
[
0
];
phy_stub_ticking
=
(
SF_ticking
*
)
malloc
(
sizeof
(
SF_ticking
));
phy_stub_ticking
=
(
SF_ticking
*
)
malloc
(
sizeof
(
SF_ticking
));
pthread_mutex_init
(
&
UE
->
timer_mutex
,
NULL
);
pthread_mutex_init
(
&
UE
->
timer_cond
,
NULL
);
UE
->
instance_cnt_timer
=
-
1
;
pthread_mutex_init
(
&
phy_stub_ticking
->
mutex_ticking
,
NULL
);
pthread_mutex_init
(
&
phy_stub_ticking
->
mutex_ticking
,
NULL
);
pthread_cond_init
(
&
phy_stub_ticking
->
cond_ticking
,
NULL
);
pthread_cond_init
(
&
phy_stub_ticking
->
cond_ticking
,
NULL
);
pthread_create
(
&
phy_stub_ticking
->
pthread_timer
,
NULL
,
&
timer_thread
,
NULL
);
pthread_create
(
&
phy_stub_ticking
->
pthread_timer
,
NULL
,
&
timer_thread
,
NULL
);
...
...
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