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
canghaiwuhen
OpenXG-RAN
Commits
591cb51a
Commit
591cb51a
authored
Feb 22, 2016
by
MKassem
Committed by
Xenofon Foukas
Feb 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sf trigger API functions
Signed-off-by:
Xenofon Foukas
<
x.foukas@sms.ed.ac.uk
>
parent
1caa45ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
6 deletions
+65
-6
openair2/ENB_APP/enb_agent_common.c
openair2/ENB_APP/enb_agent_common.c
+50
-0
openair2/ENB_APP/enb_agent_common.h
openair2/ENB_APP/enb_agent_common.h
+3
-0
openair2/ENB_APP/enb_agent_mac.c
openair2/ENB_APP/enb_agent_mac.c
+12
-6
No files found.
openair2/ENB_APP/enb_agent_common.c
View file @
591cb51a
...
...
@@ -640,6 +640,56 @@ int get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id)
return
eNB_UE_stats
[
CC_id
].
rank
;
}
int
get_tpc
(
mid_t
mod_id
,
mid_t
ue_id
)
{
LTE_eNB_UE_stats
*
eNB_UE_stats
=
NULL
;
int32_t
normalized_rx_power
,
target_rx_power
;
int
tpc
=
1
;
int
pCCid
=
UE_PCCID
(
mod_id
,
ue_id
);
rnti_t
rnti
=
get_ue_crnti
(
mod_id
,
ue_id
);
eNB_UE_stats
=
mac_xface
->
get_eNB_UE_stats
(
mod_id
,
pCCid
,
rnti
);
normalized_rx_power
=
eNB_UE_stats
->
UL_rssi
[
0
];
target_rx_power
=
mac_xface
->
get_target_pusch_rx_power
(
mod_id
,
pCCid
);
if
(
normalized_rx_power
>
(
target_rx_power
+
1
))
{
tpc
=
0
;
//-1
}
else
if
(
normalized_rx_power
<
(
target_rx_power
-
1
))
{
tpc
=
2
;
//+1
}
else
{
tpc
=
1
;
//0
}
return
tpc
;
}
int
get_harq
(
mid_t
mod_id
,
uint8_t
CC_id
,
mid_t
ue_id
,
int
frame
,
uint8_t
subframe
,
int
flag_id_status
)
//flag_id_status = 0 then id, else status
{
/*TODO: Add int TB in function parameters to get the status of the second TB. This can be done to by editing in
* get_ue_active_harq_pid function in line 272 file: phy_procedures_lte_eNB.c to add
* DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/
uint8_t
*
harq_pid
=
malloc
(
sizeof
(
uint8_t
));
uint8_t
*
round
=
malloc
(
sizeof
(
uint8_t
));
uint16_t
rnti
=
get_ue_crnti
(
mod_id
,
ue_id
);
mac_xface
->
get_ue_active_harq_pid
(
mod_id
,
CC_id
,
rnti
,
frame
,
subframe
,
&
harq_pid
,
&
round
,
0
);
if
(
flag_id_status
==
0
)
return
*
harq_pid
;
else
if
(
flag_id_status
==
1
)
{
if
(
*
round
>
0
)
return
1
;
else
return
0
;
}
return
150
;
}
/*
* ************************************
...
...
openair2/ENB_APP/enb_agent_common.h
View file @
591cb51a
...
...
@@ -202,6 +202,9 @@ long get_si_window_length(mid_t mod_id, int CC_id);
int
get_num_pdcch_symb
(
mid_t
mod_id
,
int
CC_id
);
int
get_tpc
(
mid_t
mod_id
,
mid_t
ue_id
);
int
get_harq
(
mid_t
mod_id
,
uint8_t
CC_id
,
mid_t
ue_id
,
int
frame
,
uint8_t
subframe
,
int
flag_id_status
);
/*******************
* timer primitves
...
...
openair2/ENB_APP/enb_agent_mac.c
View file @
591cb51a
...
...
@@ -926,16 +926,16 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
dl_info
[
i
]
->
rnti
=
get_ue_crnti
(
mod_id
,
i
);
dl_info
[
i
]
->
has_rnti
=
1
;
/*TODO: fill in the right id of this round's HARQ process for this UE*/
dl_info
[
i
]
->
harq_process_id
=
1
;
dl_info
[
i
]
->
harq_process_id
=
get_harq
(
mod_id
,
UE_PCCID
(
mod_id
,
i
),
i
,
get_current_frame
(
mod_id
),
get_current_subframe
(
mod_id
),
0
)
;
dl_info
[
i
]
->
has_harq_process_id
=
1
;
/*TODO: fill in the status of the HARQ process (2 TBs)*/
dl_info
[
i
]
->
n_harq_status
=
2
;
dl_info
[
i
]
->
harq_status
=
malloc
(
sizeof
(
uint32_t
)
*
dl_info
[
i
]
->
n_harq_status
);
for
(
j
=
0
;
j
<
dl_info
[
j
]
->
n_harq_status
;
j
++
)
{
dl_info
[
i
]
->
harq_status
[
j
]
=
PROTOCOL__PRP_HARQ_STATUS__PRHS_ACK
;
dl_info
[
i
]
->
harq_status
[
j
]
=
get_harq
(
mod_id
,
UE_PCCID
(
mod_id
,
i
),
i
,
get_current_frame
(
mod_id
),
get_current_subframe
(
mod_id
),
1
)
;
}
/*TODO: fill in the serving cell index for this UE */
dl_info
[
i
]
->
serv_cell_index
=
0
;
dl_info
[
i
]
->
serv_cell_index
=
UE_PCCID
(
mod_id
,
i
)
;
dl_info
[
i
]
->
has_serv_cell_index
=
1
;
}
}
...
...
@@ -962,8 +962,14 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
ul_info
[
i
]
->
rnti
=
get_ue_crnti
(
mod_id
,
i
);
ul_info
[
i
]
->
has_rnti
=
1
;
/*TODO: fill in the Tx power control command for this UE (if available)*/
ul_info
[
i
]
->
tpc
=
1
;
ul_info
[
i
]
->
has_tpc
=
0
;
if
(
get_tpc
(
mod_id
,
i
)
!=
1
){
ul_info
[
i
]
->
tpc
=
get_tpc
(
mod_id
,
i
);
ul_info
[
i
]
->
has_tpc
=
1
;
}
else
{
ul_info
[
i
]
->
tpc
=
get_tpc
(
mod_id
,
i
);
ul_info
[
i
]
->
has_tpc
=
0
;
}
/*TODO: fill in the amount of data in bytes in the MAC SDU received in this subframe for the
given logical channel*/
ul_info
[
i
]
->
n_ul_reception
=
11
;
...
...
@@ -975,7 +981,7 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
ul_info
[
i
]
->
reception_status
=
PROTOCOL__PRP_RECEPTION_STATUS__PRRS_OK
;
ul_info
[
i
]
->
has_reception_status
=
1
;
/*TODO: fill in the serving cell index for this UE */
ul_info
[
i
]
->
serv_cell_index
=
0
;
ul_info
[
i
]
->
serv_cell_index
=
UE_PCCID
(
mod_id
,
i
)
;
ul_info
[
i
]
->
has_serv_cell_index
=
1
;
}
}
...
...
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