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
7a1d8e30
Commit
7a1d8e30
authored
Aug 11, 2018
by
AlanLi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs for SIB23
parent
0daeb68d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
838 additions
and
1080 deletions
+838
-1080
openair1/SCHED/phy_procedures_lte_eNb_NB_IoT.c
openair1/SCHED/phy_procedures_lte_eNb_NB_IoT.c
+19
-2
openair2/LAYER2/MAC/config_NB_IoT.h
openair2/LAYER2/MAC/config_NB_IoT.h
+1
-1
openair2/LAYER2/MAC/eNB_scheduler_NB_IoT.c
openair2/LAYER2/MAC/eNB_scheduler_NB_IoT.c
+18
-54
openair2/LAYER2/MAC/eNB_scheduler_RA_NB_IoT.c
openair2/LAYER2/MAC/eNB_scheduler_RA_NB_IoT.c
+5
-156
openair2/LAYER2/MAC/main.c
openair2/LAYER2/MAC/main.c
+2
-2
openair2/LAYER2/MAC/main_NB_IoT.c
openair2/LAYER2/MAC/main_NB_IoT.c
+8
-57
openair2/LAYER2/MAC/schedule_tool_NB_IoT.c
openair2/LAYER2/MAC/schedule_tool_NB_IoT.c
+785
-808
No files found.
openair1/SCHED/phy_procedures_lte_eNb_NB_IoT.c
View file @
7a1d8e30
...
...
@@ -223,8 +223,10 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
LTE_DL_FRAME_PARMS
*
fp
=
&
eNB
->
frame_parms
;
NB_IoT_eNB_NPBCH_t
*
broadcast_str
=
&
eNB
->
npbch
;
//NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB;
NB_IoT_DL_eNB_SIB_t
*
sib1
=
&
eNB
->
ndlsch_SIB
.
content_sib1
;
NB_IoT_DL_eNB_SIB_t
*
sib23
=
&
eNB
->
ndlsch_SIB
.
content_sib23
;
NB_IoT_eNB_NDLSCH_t
*
ndlsch
=
&
eNB
->
ndlsch_SIB
;
NB_IoT_DL_eNB_SIB_t
*
sib1
=
&
ndlsch
->
content_sib1
;
NB_IoT_DL_eNB_SIB_t
*
sib23
=
&
ndlsch
->
content_sib23
;
int
**
txdataF
=
eNB
->
common_vars
.
txdataF
[
0
];
int
subframe
=
proc
->
subframe_tx
;
uint32_t
frame
=
proc
->
frame_tx
;
...
...
@@ -299,6 +301,10 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
if
(
subframe
==
0
)
{
LOG_I
(
PHY
,
"MIB NB-IoT content:
\n
"
);
for
(
int
i
=
0
;
i
<
6
;
i
++
)
printf
(
"%02X"
,
broadcast_str
->
pdu
[
i
]);
printf
(
"
\n
"
);
generate_npbch
(
broadcast_str
,
txdataF
,
...
...
@@ -313,6 +319,12 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////
if
((
subframe
==
4
)
&&
(
frame
%
2
==
0
)
&&
(
frame
%
32
<
16
)
)
////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{
LOG_I
(
PHY
,
"SIB1 NB-IoT content:
\n
"
);
for
(
int
i
=
0
;
i
<
6
;
i
++
)
printf
(
"%02X"
,
sib1
->
pdu
[
i
]);
printf
(
"
\n
"
);
if
(
frame
%
32
==
0
)
{
dlsch_encoding_NB_IoT
(
sib1_pdu
,
...
...
@@ -345,6 +357,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
//////////////////////////////////////////////////// SIB23 ////////////////////////////////////////////////////////////////////////
if
(
(
subframe
>
0
)
&&
(
subframe
!=
5
)
&&
(
With_NSSS
==
0
)
&&
(
frame
%
2
==
1
)
&&
(
frame
%
64
<
16
)
)
////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{
LOG_I
(
PHY
,
"SIB2 NB-IoT content:
\n
"
);
for
(
int
i
=
0
;
i
<
6
;
i
++
)
printf
(
"%02X"
,
sib23
->
pdu
[
i
]);
printf
(
"
\n
"
);
if
(
subframe
==
1
)
{
dlsch_encoding_NB_IoT
(
sib23_pdu
,
...
...
openair2/LAYER2/MAC/config_NB_IoT.h
View file @
7a1d8e30
openair2/LAYER2/MAC/eNB_scheduler_NB_IoT.c
View file @
7a1d8e30
/*
* 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.0 (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
*/
/*! \file eNB_scheduler_NB_IoT.c
* \brief top level of the scheduler, it scheduled in pdcch period based.
* \author NTUST BMW Lab./
Nick HO, Xavier LIU, Calvin HSU
* \date 2017
- 2018
* \email:
nick133371@gmail.com, sephiroth7277@gmail.com , kai-hsiang.hsu@eurecom.fr
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
...
...
@@ -37,17 +18,6 @@
#define flag_css_type2 0x2
#define flag_uss_v 0x4
#if 0 // disable now
#define flag_css_type1_ce0 0x1
#define flag_css_type1_ce1 0x2
#define flag_css_type1_ce2 0x4
#define flag_css_type2_ce0 0x8
#define flag_css_type2_ce1 0x10
#define flag_css_type2_ce2 0x20
#define flag_uss_v 0x40
#endif
// common
#define flag_mib 0x1
...
...
@@ -56,10 +26,6 @@
#define flag_nsss 0x8
#define num_flags 2
// type2 css, type1 css
//extern BCCH_DL_SCH_Message_NB_IoT_t SIB;
void
eNB_scheduler_computing_flag_NB_IoT
(
eNB_MAC_INST_NB_IoT
*
mac_inst
,
uint32_t
abs_subframe
,
uint32_t
*
scheduler_flags
,
uint32_t
*
common_flags
,
uint32_t
*
max_subframe
){
...
...
@@ -70,6 +36,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t
//NPRACH_Parameters_NB_IoT_r13_t **type2_css_info = SIB.message.choice.c1.choice.systemInformation_r13.criticalExtensions.choice.systemInformation_r13.sib_TypeAndInfo_r13.choice.sib2_r13.radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list.array;
// fixed scheduling part (e.g. MIB, NPSS, NSSS, SIB1)
if
(
subframe
==
0
){
*
common_flags
|=
flag_mib
;
}
else
if
(
subframe
==
5
){
...
...
@@ -81,7 +48,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t
}
/* uint32_t type2_css_pp[3] = { type2_css_info[0]->npdcch_NumRepetitions_RA_r13*type2_css_info[0]->npdcch_StartSF_CSS_RA_r13, type2_css_info[1]->npdcch_NumRepetitions_RA_r13*type2_css_info[1]->npdcch_StartSF_CSS_RA_r13, type2_css_info[2]->npdcch_NumRepetitions_RA_r13*type2_css_info[2]->npdcch_StartSF_CSS_RA_r13 };*/
uint32_t
type2_css_pp
[
3
]
=
{
256
,
256
,
256
};
uint32_t
type2_css_pp
[
3
]
=
{
256
,
256
,
256
};
// TODO RRC config should get from structure
uint32_t
start_subframe
;
for
(
i
=
0
;
i
<
1
;
++
i
){
// only CE0
start_subframe
=
0
;
...
...
@@ -119,7 +86,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t
}
}
*
max_subframe
=
max
;
*
max_subframe
=
max
;
// the maximum subframe to be extend
}
/*function description:
...
...
@@ -129,16 +96,13 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t
void
eNB_dlsch_ulsch_scheduler_NB_IoT
(
eNB_MAC_INST_NB_IoT
*
mac_inst
,
uint32_t
abs_subframe
){
int
i
;
uint8_t
MIB_flag
,
SIB1_flag
;
uint8_t
tx_mib
=
0
,
tx_sib1
=
0
;
uint32_t
scheduler_flags
,
max_subframe
,
common_flags
;
/*Check this subframe should schedule something, set the flag*/
scheduler_flags
=
0
;
common_flags
=
0
;
MIB_flag
=
0
;
SIB1_flag
=
0
;
uint32_t
h
,
f
,
sf
;
int
a
;
eNB_scheduler_computing_flag_NB_IoT
(
mac_inst
,
abs_subframe
,
&
scheduler_flags
,
&
common_flags
,
&
max_subframe
);
if
(
scheduler_flags
>
0
){
...
...
@@ -147,7 +111,7 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab
maintain_available_resource
(
mac_inst
);
if
((
abs_subframe
%
rachperiod
[
4
])
==
rachstart
[
0
]){
if
((
abs_subframe
%
rachperiod
[
4
])
==
rachstart
[
0
]){
//TODO, configuration should be pass by configuration module
add_UL_Resource
();
}
...
...
@@ -159,6 +123,7 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab
//Check if type1 searching space scheduling
if
((
scheduler_flags
&
flag_css_type1
)
>
0
){
// paging, direct indication
scheduler_flags
&=
~
(
flag_css_type1
);
}
//The scheduling time is current subframe + 1
...
...
@@ -175,22 +140,22 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab
}
}
if
(
common_flags
==
flag_mib
)
MIB_flag
=
1
;
if
(
common_flags
==
flag_sib1
)
SIB1_flag
=
1
;
convert_system_number
(
abs_subframe
,
&
h
,
&
f
,
&
sf
);
if
(
common_flags
&
flag_mib
){
tx_mib
=
1
;
}
if
(
common_flags
&
flag_sib1
){
tx_sib1
=
1
;
}
a
=
output_handler
(
mac_inst
,
(
module_id_t
)
0
,
0
,
h
,
f
,
sf
,
MIB_flag
,
SIB1_flag
,
abs_subframe
);
convert_system_number
(
abs_subframe
,
&
h
,
&
f
,
&
sf
);
if
(
a
!=
0
){
if
(
0
!=
output_handler
(
mac_inst
,
(
module_id_t
)
0
,
0
,
h
,
f
,
sf
,
tx_mib
,
tx_sib1
,
abs_subframe
)
){
LOG_D
(
MAC
,
"output handler error
\n
"
);
}
}
void
schedule_uss_NB_IoT
(
module_id_t
module_id
,
eNB_MAC_INST_NB_IoT
*
mac_inst
,
uint32_t
subframe
,
uint32_t
frame
,
uint32_t
hypersfn
,
int
index_ss
)
{
// printf_FUNCTION_IN("[USS]");
//SCHEDULE_NB_IoT_t *scheduler = &eNB->scheduler;
mac_inst
->
scheduling_flag
.
flag_uss
[
0
]
=
1
;
...
...
@@ -245,6 +210,5 @@ void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, u
UE_ID
=
UE_template_temp
->
next
;
}
// printf_FUNCTION_OUT("[USS]");
}
openair2/LAYER2/MAC/eNB_scheduler_RA_NB_IoT.c
View file @
7a1d8e30
/*
* 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.0 (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
*/
/*! \file eNB_scheduler_RA_NB_IoT.c
* \brief functions used in Random access scheduling
* \author NTUST BMW Lab./
Calvin HSU
* \date 2017
- 2018
* \email:
kai-hsiang.hsu@eurecom.fr
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
#include "assertions.h"
#include "platform_types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "msc.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/proto.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "T.h"
///////////////////////////////////////////////////////////////////////////////////////////////////////
#include "defs_NB_IoT.h"
#include "proto_NB_IoT.h"
#include "extern_NB_IoT.h"
...
...
@@ -146,7 +92,6 @@ uint16_t find_suit_i_delay(uint32_t rmax, uint32_t r, uint32_t dci_candidate){
void
schedule_rar_NB_IoT
(
eNB_MAC_INST_NB_IoT
*
mac_inst
,
int
abs_subframe
){
// printf_FUNCTION_IN("schedule rar");
RA_TEMPLATE_NB_IoT
*
msg2_nodes
=
mac_inst
->
RA_msg2_list
.
head
;
//RA_TEMPLATE_NB_IoT *msg3_list_tail = mac_inst->RA_msg3_list.tail;
RA_TEMPLATE_NB_IoT
*
migrate_node
;
...
...
@@ -282,11 +227,6 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
dci_result
->
R_harq
=
0
;
dci_result
->
next
=
(
schedule_result_t
*
)
0
;
dci_result
->
DCI_pdu
=
(
void
*
)
dci_n1_rar
;
//dci_result->printf_str = &str1[0];
//dci_result->dl_sdly = msg2_subframe - dci_end_subframe;
//dci_result->ul_sdly = msg3_subframe - msg2_end_subframe;
//dci_result->num_sf = msg2_end_subframe - msg2_subframe+1;
// for msg2
msg2_result
->
output_subframe
=
msg2_first_subframe
;
//msg2_subframe;
msg2_result
->
end_subframe
=
msg2_end_subframe
;
...
...
@@ -301,10 +241,7 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
msg2_result
->
R_harq
=
0
;
msg2_result
->
next
=
(
schedule_result_t
*
)
0
;
msg2_result
->
DCI_pdu
=
(
void
*
)
dci_n1_rar
;
//msg2_result->printf_str = str2;
msg2_result
->
rar_buffer
=
msg2_nodes
->
rar_buffer
;
//msg2_result->dl_sdly = -1;
//msg2_result->ul_sdly = -1;
// for msg3(fake DCI N0)
dci_n0
->
type
=
0
;
...
...
@@ -374,8 +311,6 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
if
(
flag
==
1
)
LOG_D
(
MAC
,
"[%04d][RA scheduler][MSG2] failed number: %d
\n
"
,
abs_subframe
-
1
,
fail_num
);
//printf_FUNCTION_OUT("schedule rar");
return
;
}
...
...
@@ -607,13 +542,6 @@ void schedule_msg3_retransimission_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs
dci_result
->
R_harq
=
0
;
dci_result
->
next
=
(
schedule_result_t
*
)
0
;
dci_result
->
DCI_pdu
=
(
void
*
)
dci_n0_msg3
;
// dci_result->printf_str = str6;
// dci_result->dl_sdly = msg3_subframe - dci_end_subframe + 1;
// dci_result->ul_sdly = -1;
//dci_result->num_sf = -1;
//dci_result->harq_round = msg3_nodes->msg3_retransmit_count;
//simulate_rx(&simulate_rx_msg3_list, msg3_nodes->ue_rnti, npusch_info.sf_start);
// fill dci resource
fill_resource_DL
(
mac_inst
,
dci_node
,
dci_first_subframe
,
dci_end_subframe
,
dci_result
);
...
...
@@ -699,7 +627,6 @@ void receive_msg4_ack_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, rnti_t rnti){
// msg4 scheduling: both first time or retransmit would be scheduled in this function(msg4_list).
void
schedule_msg4_NB_IoT
(
eNB_MAC_INST_NB_IoT
*
mac_inst
,
int
abs_subframe
){
//printf_FUNCTION_IN("[SCHEDULER RA MSG4]");
RA_TEMPLATE_NB_IoT
*
msg4_nodes
=
mac_inst
->
RA_msg4_list
.
head
;
//, *migrate_node;
available_resource_DL_t
*
dci_node
,
*
msg4_node
;
...
...
@@ -761,8 +688,6 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
if
(
msg4_nodes
->
wait_msg4_ack
==
0
){
fail
=
0
;
//printf_FUNCTION_IN("[SCHEDULER RA MSG4 DCI]");
// check dci resource
rmax
=
mac_inst
->
rrc_config
.
mac_NPRACH_ConfigSIB
[
msg4_nodes
->
ce_level
].
mac_npdcch_NumRepetitions_RA_NB_IoT
;
//32;
num_candidate
=
8
;
//rmax / r;
...
...
@@ -790,9 +715,6 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
//failed
fail
|=
1
;
}
//printf_FUNCTION_OUT("[SCHEDULER RA MSG4 DCI]");
//printf_FUNCTION_IN("[SCHEDULER RA MSG4 PAYLOAD]");
// check msg4 resource
rep
=
dl_rep
[
msg4_nodes
->
ce_level
];
num_msg4_subframe
=
1
*
rep
;
// 8 subframes
...
...
@@ -810,9 +732,7 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
//failed
fail
|=
2
;
}
//printf_FUNCTION_OUT("[SCHEDULER RA MSG4 PAYLOAD]");
//printf_FUNCTION_IN("[SCHEDULER RA MSG4 HARQ]");
rep
=
mac_inst
->
rrc_config
.
mac_NPRACH_ConfigSIB
[
msg4_nodes
->
ce_level
].
mac_numRepetitionsPerPreambleAttempt_NB_IoT
;
for
(
HARQ_delay
=
0
;
HARQ_delay
<
4
;
++
HARQ_delay
){
end_flagHARQ
=
Check_UL_resource
(
msg4_end_subframe
+
get_HARQ_delay
(
1
,
HARQ_delay
),
rep
,
&
HARQ_info
,
0
,
1
);
// RA_template->R
...
...
@@ -826,7 +746,6 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
if
(
4
==
HARQ_delay
){
fail
|=
4
;
}
//printf_FUNCTION_OUT("[SCHEDULER RA MSG4 HARQ]");
if
(
0
==
fail
){
LOG_D
(
MAC
,
"[%04d][RA scheduler][MSG4][CE%d] rnti: %d scheduling success
\n
"
,
abs_subframe
-
1
,
msg4_nodes
->
ce_level
,
msg4_nodes
->
ue_rnti
);
...
...
@@ -857,10 +776,6 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
dci_result
->
R_harq
=
0
;
dci_result
->
next
=
(
schedule_result_t
*
)
0
;
dci_result
->
DCI_pdu
=
(
void
*
)
dci_n1_msg4
;
//dci_result->dl_sdly = msg4_subframe - dci_end_subframe;
//dci_result->ul_sdly = harq_subframe - msg4_end_subframe;
//dci_result->num_sf = msg4_end_subframe - msg4_subframe+1;
//dci_result->harq_round = msg4_nodes->msg4_retransmit_count;
// for msg4
msg4_result
=
(
schedule_result_t
*
)
malloc
(
sizeof
(
schedule_result_t
));
...
...
@@ -876,7 +791,6 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
msg4_result
->
R_harq
=
0
;
msg4_result
->
next
=
(
schedule_result_t
*
)
0
;
msg4_result
->
DCI_pdu
=
(
void
*
)
dci_n1_msg4
;
//msg4_result->harq_round = msg4_nodes->msg4_retransmit_count;
harq_result
=
(
schedule_result_t
*
)
malloc
(
sizeof
(
schedule_result_t
));
harq_result
->
rnti
=
msg4_nodes
->
ue_rnti
;
...
...
@@ -891,18 +805,6 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
harq_result
->
channel
=
NPUSCH
;
harq_result
->
next
=
(
schedule_result_t
*
)
0
;
/*if(msg4_nodes->msg4_retransmit_count==0){
dci_result->printf_str = str3;
msg4_result->printf_str = str4;
harq_result->printf_str = str5;
}else{
dci_result->printf_str = str8;
msg4_result->printf_str = str9;
harq_result->printf_str = str10;
}*/
//simulate_rx(&simulate_rx_msg4_list, msg4_nodes->ue_rnti, harq_subframe);
LOG_D
(
MAC
,
"[%04d][RA scheduler][MSG4] UE:%x MSG4DCI %d-%d MSG4 %d-%d HARQ %d-%d
\n
"
,
abs_subframe
-
1
,
msg4_nodes
->
ue_rnti
,
dci_first_subframe
,
dci_end_subframe
,
msg4_first_subframe
,
msg4_end_subframe
,
HARQ_info
.
sf_start
,
HARQ_info
.
sf_end
);
LOG_D
(
MAC
,
"[%04d][RA scheduler][MSG4][CE%d] MSG4 DCI %d-%d MSG4 %d-%d HARQ %d-%d
\n
"
,
abs_subframe
-
1
,
msg4_nodes
->
ce_level
,
dci_first_subframe
,
dci_end_subframe
,
msg4_first_subframe
,
msg4_end_subframe
,
HARQ_info
.
sf_start
,
HARQ_info
.
sf_end
);
msg4_nodes
->
msg4_retransmit_count
++
;
...
...
@@ -933,12 +835,10 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
msg4_nodes
=
msg4_nodes
->
next
;
}
//printf_FUNCTION_OUT("[SCHEDULER RA MSG4]");
return
;
}
void
schedule_RA_NB_IoT
(
eNB_MAC_INST_NB_IoT
*
mac_inst
){
//printf_FUNCTION_IN("[SCHEDULER RA]");
uint32_t
schedule_subframe
=
mac_inst
->
current_subframe
+
1
;
schedule_subframe
=
schedule_subframe
%
1048576
;
// 20 bits, 10 bits + 10 bits
...
...
@@ -947,7 +847,6 @@ void schedule_RA_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst){
schedule_rar_NB_IoT
(
mac_inst
,
schedule_subframe
);
schedule_msg4_NB_IoT
(
mac_inst
,
schedule_subframe
);
//printf_FUNCTION_OUT("[SCHEDULER RA]");
return
;
}
...
...
@@ -1000,55 +899,5 @@ void fill_rar_NB_IoT(
rar
[
5
]
=
(
uint8_t
)(
ra_template
->
ue_rnti
&
0xff
);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////// NB-IoT testing /////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
void
initiate_ra_proc_NB_IoT
(
module_id_t
module_idP
,
int
CC_id
,
frame_t
frameP
,
uint16_t
preamble_index
,
int16_t
timing_offset
,
uint8_t
sect_id
,
sub_frame_t
subframeP
,
uint8_t
f_id
)
{
uint8_t
i
;
RA_TEMPLATE
*
RA_template
=
(
RA_TEMPLATE
*
)
&
eNB_mac_inst
[
module_idP
].
common_channels
[
CC_id
].
RA_template
[
0
];
printf
(
"xxxxxxxxxxxxxxxx NB-IoT xxxxxxxxxxxxxx"
);
for
(
i
=
0
;
i
<
NB_RA_PROC_MAX
;
i
++
)
{
if
(
RA_template
[
i
].
RA_active
==
FALSE
&&
RA_template
[
i
].
wait_ack_Msg4
==
0
)
{
// int loop = 0;
RA_template
[
i
].
RA_active
=
TRUE
;
RA_template
[
i
].
generate_rar
=
1
;
RA_template
[
i
].
generate_Msg4
=
0
;
RA_template
[
i
].
wait_ack_Msg4
=
0
;
RA_template
[
i
].
timing_offset
=
timing_offset
;
RA_template
[
i
].
RA_rnti
=
1
+
(
frameP
/
4
);
RA_template
[
i
].
preamble_index
=
preamble_index
;
/* TODO: find better procedure to allocate RNTI */
/* do {
RA_template[i].rnti = taus();
loop++;
} while (loop != 100 &&
// TODO: this is not correct, the rnti may be in use without
// being in the MAC yet. To be refined.
//
/// !(find_UE_id(module_idP, RA_template[i].rnti) == -1 &&
// 1024 and 60000 arbirarily chosen, not coming from standard //
// RA_template[i].rnti >= 1024 && RA_template[i].rnti < 60000));
if (loop == 100) {
printf("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
RA_template[i].RA_rnti = 1 + (frameP/4);
RA_template[i].preamble_index = preamble_index; /// preamble_index=000000;
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation for process %d, rnti %x, RA_active %d\n",
module_idP,CC_id,frameP,i,RA_template[i].rnti,
RA_template[i].RA_active);*/
return
;
}
}
LOG_E
(
MAC
,
"[eNB %d][RAPROC] FAILURE: CC_id %d Frame %d Initiating RA procedure for preamble index %d
\n
"
,
module_idP
,
CC_id
,
frameP
,
preamble_index
);
}
openair2/LAYER2/MAC/main.c
View file @
7a1d8e30
...
...
@@ -464,8 +464,8 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
mac_xface
->
eNB_dlsch_ulsch_scheduler
=
eNB_dlsch_ulsch_scheduler
;
mac_xface
->
get_dci_sdu
=
get_dci_sdu
;
mac_xface
->
fill_rar
=
fill_rar
;
//
mac_xface->initiate_ra_proc = initiate_ra_proc;
mac_xface
->
initiate_ra_proc
=
initiate_ra_proc_NB_IoT
;
mac_xface
->
initiate_ra_proc
=
initiate_ra_proc
;
//
mac_xface->initiate_ra_proc = initiate_ra_proc_NB_IoT;
mac_xface
->
cancel_ra_proc
=
cancel_ra_proc
;
mac_xface
->
set_msg3_subframe
=
set_msg3_subframe
;
mac_xface
->
SR_indication
=
SR_indication
;
...
...
openair2/LAYER2/MAC/main_NB_IoT.c
View file @
7a1d8e30
/*
* 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.0 (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
*/
/*! \file main_NB_IoT.c
* \brief top init of Layer 2
* \author NTUST BMW Lab./Nick HO, Xavier LIU, Calvin HSU
* \date 2017 - 2018
* \email: nick133371@gmail.com, sephiroth7277@gmail.com , kai-hsiang.hsu@eurecom.fr
* \author NTUST BMW LAB./
* \date 2017
* \version 1.0
*
*
\email:
*/
...
...
@@ -71,6 +51,7 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
LOG_I
(
MAC
,
"[NB-IoT] MAC start initialization
\n
"
);
mac_inst
->
current_subframe
=
0
;
for
(
i
=
0
;
i
<
64
;
++
i
)
{
mac_inst
->
sib1_flag
[
i
]
=
0
;
...
...
@@ -119,6 +100,7 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
mac_inst
->
rrc_config
.
si_window_length
=
ms160
;
mac_inst
->
rrc_config
.
sibs_NB_IoT_sched
[
0
].
si_periodicity
=
rf64
;
mac_inst
->
rrc_config
.
si_radio_frame_offset
=
1
;
for
(
i
=
0
;
i
<
256
;
++
i
){
mac_inst
->
sibs_table
[
i
]
=
-
1
;
...
...
@@ -184,44 +166,13 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
LOG_I
(
MAC
,
"[NB-IoT] List_number %d R_max %d G %.1f a_offset %.1f T %d SS_start %d
\n
"
,
i
,
(
mac_inst
->
UE_list_spec
+
i
)
->
NPDCCH_config_dedicated
.
R_max
,
(
mac_inst
->
UE_list_spec
+
i
)
->
NPDCCH_config_dedicated
.
G
,
(
mac_inst
->
UE_list_spec
+
i
)
->
NPDCCH_config_dedicated
.
a_offset
,
(
mac_inst
->
UE_list_spec
+
i
)
->
NPDCCH_config_dedicated
.
T
,
(
mac_inst
->
UE_list_spec
+
i
)
->
NPDCCH_config_dedicated
.
ss_start_uss
);
}
/*
//Initial one UE template
//UE_TEMPLATE_NB_IoT *UE_info=(UE_TEMPLATE_NB_IoT*)malloc(USER_NUM_USS*sizeof(UE_TEMPLATE_NB_IoT));
mac_inst->UE_list_spec->head=0;
mac_inst->UE_list_spec->tail=0;
for(i=0;i<USER_NUM_USS;++i)
{
UE_info_setting(mac_inst->UE_list_spec->UE_template_NB_IoT+i);
if(i==0)
{
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->prev=-1;
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->next=1;
//mac_inst->UE_list_spec->next[i]=-1;
}
else if(i>=USER_NUM_USS-1)
{
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->prev=i-1;
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->next=-1;
}
else
{
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->prev=i-1;
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->next=i+1;
}
//mac_inst->UE_list_spec->UE_template_NB_IoT[i]=UE_info[i];
mac_inst->UE_list_spec->tail=i;
}
*/
//UL initial
//Setting nprach configuration
setting_nprach
();
//Initialize uplink resource from nprach configuration
Initialize_Resource
();
//add_UL_Resource(mac_inst);
extend_available_resource_DL
(
mac_inst
,
mac_inst
->
current_subframe
+
1
+
160
);
extend_available_resource_DL
(
mac_inst
,
mac_inst
->
current_subframe
+
1
+
mac_inst
->
rrc_config
.
si_window_length
);
}
...
...
openair2/LAYER2/MAC/schedule_tool_NB_IoT.c
View file @
7a1d8e30
/*
* 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.0 (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
*/
/*! \file schedule_tool_NB_IoT.c
* \brief scheduler helper function
* \author NTUST BMW Lab./
Nick HO, Xavier LIU, Calvin HSU
* \date 2017
- 2018
* \email:
nick133371@gmail.com, sephiroth7277@gmail.com , kai-hsiang.hsu@eurecom.fr
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
...
...
@@ -941,23 +922,22 @@ void init_dl_list(eNB_MAC_INST_NB_IoT *mac_inst){
available_resource_DL_last
=
node
;
node
->
start_subframe
=
0
;
node
->
end_subframe
=
mac_inst
->
rrc_config
.
si_window_length
;
mac_inst
->
schedule_subframe_DL
=
mac_inst
->
rrc_config
.
si_window_length
;
node
->
end_subframe
=
0
;
mac_inst
->
schedule_subframe_DL
=
0
;
//node->end_subframe = mac_inst->rrc_config.si_window_length;
//mac_inst->schedule_subframe_DL = mac_inst->rrc_config.si_window_length;
// init sibs for first si-window
schedule_sibs
(
mac_inst
,
0
,
0
);
//schedule_sibs(mac_inst, 0, 0); // TODO, check init
}
// extend subframe align to si-period
void
extend_available_resource_DL
(
eNB_MAC_INST_NB_IoT
*
mac_inst
,
int
max_subframe
){
// assume max_subframe is found.
//printf_FUNCTION_IN("[EXTEND DL]");
void
extend_available_resource_DL
(
eNB_MAC_INST_NB_IoT
*
mac_inst
,
int
max_subframe
){
available_resource_DL_t
*
new_node
;
//int temp;
uint32_t
i
,
i_div_si_window
;
//uint32_t si_period_div_window;
//pt = available_resource_DL;
LOG_D
(
MAC
,
"[extend DL] max_subframe: %d, current schedule subframe: %d
\n
"
,
max_subframe
,
mac_inst
->
schedule_subframe_DL
);
print_available_resource_DL
(
mac_inst
);
...
...
@@ -984,23 +964,20 @@ void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subfram
}
// do schedule sibs after extend.
for
(
i
=
mac_inst
->
schedule_subframe_DL
;
i
<
max_subframe
;
i
+=
mac_inst
->
rrc_config
.
si_window_length
){
for
(
i
=
mac_inst
->
schedule_subframe_DL
;
i
<
max_subframe
;
i
+=
mac_inst
->
rrc_config
.
si_window_length
){
i_div_si_window
=
(
i
/
mac_inst
->
rrc_config
.
si_window_length
)
%
256
;
if
(
-
1
!=
mac_inst
->
sibs_table
[
i_div_si_window
]){
LOG_D
(
MAC
,
"[sibs%d] %d
\n
"
,
mac_inst
->
sibs_table
[
i_div_si_window
],
i
);
schedule_sibs
(
mac_inst
,
mac_inst
->
sibs_table
[
i_div_si_window
],
i
);
LOG_D
(
MAC
,
"[sibs%d] %d
\n
"
,
mac_inst
->
sibs_table
[
i_div_si_window
],
i
+
(
mac_inst
->
rrc_config
.
si_radio_frame_offset
*
10
)
);
schedule_sibs
(
mac_inst
,
mac_inst
->
sibs_table
[
i_div_si_window
],
i
+
(
mac_inst
->
rrc_config
.
si_radio_frame_offset
*
10
));
// add si-radio-frame-offset carried in SIB1
}
}
mac_inst
->
schedule_subframe_DL
=
max_subframe
;
}
//printf_FUNCTION_OUT("[EXTEND DL]");
return
;
}
void
maintain_available_resource
(
eNB_MAC_INST_NB_IoT
*
mac_inst
){
//printf_FUNCTION_IN("[MAINTAIN]");
available_resource_DL_t
*
pfree
,
*
iterator
;
available_resource_UL_t
*
pfree2
,
*
iterator2
;
schedule_result_t
*
iterator1
;
...
...
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