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
3b7960d8
Commit
3b7960d8
authored
May 25, 2018
by
Calvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. nr_rrc_mac_config_req_ue 2. copy IF module from eNB to new folder
parent
6c1c711e
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1867 additions
and
11 deletions
+1867
-11
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+56
-11
openair2/LAYER2/NR_MAC_UE/defs.h
openair2/LAYER2/NR_MAC_UE/defs.h
+23
-0
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+6
-0
openair2/LAYER2/NR_MAC_UE/vars.c
openair2/LAYER2/NR_MAC_UE/vars.c
+34
-0
openair2/NR_UE_PHY_INTERFACE/IF_Module.c
openair2/NR_UE_PHY_INTERFACE/IF_Module.c
+647
-0
openair2/NR_UE_PHY_INTERFACE/IF_Module.h
openair2/NR_UE_PHY_INTERFACE/IF_Module.h
+142
-0
openair2/NR_UE_PHY_INTERFACE/defs.h
openair2/NR_UE_PHY_INTERFACE/defs.h
+373
-0
openair2/NR_UE_PHY_INTERFACE/extern.h
openair2/NR_UE_PHY_INTERFACE/extern.h
+27
-0
openair2/NR_UE_PHY_INTERFACE/mac_phy_primitives.c
openair2/NR_UE_PHY_INTERFACE/mac_phy_primitives.c
+283
-0
openair2/NR_UE_PHY_INTERFACE/mac_phy_primitives.h
openair2/NR_UE_PHY_INTERFACE/mac_phy_primitives.h
+232
-0
openair2/NR_UE_PHY_INTERFACE/vars.h
openair2/NR_UE_PHY_INTERFACE/vars.h
+44
-0
No files found.
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
3b7960d8
...
...
@@ -39,43 +39,88 @@ nr_rrc_mac_config_req_ue(
PhysicalCellGroupConfig_t
*
phy_cell_group_config
,
SpCellConfig_t
*
spcell_config
){
NR_UE_MAC_INST
*
mac
=
get_mac_inst
(
Mod_idP
);
ServingCellConfig_t
*
serving_cell_config
=
spcell_config
->
spCellConfigDedicated
;
// TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc.
if
(
mac_cell_group_config
!=
(
MAC_CellGroupConfig_t
*
)
0
){
if
(
mac_cell_group_config
->
drx_Config
!=
(
drx_Config_t
*
)
0
){
NR_UE_mac_inst
->
drx_Config
=
mac_cell_group_config
->
drx_Config
;
mac
->
drx_Config
=
mac_cell_group_config
->
drx_Config
;
}
if
(
mac_cell_group_config
->
SchedulingRequestConfig
!=
(
SchedulingRequestConfig_t
*
)
0
){
NR_UE_mac_inst
->
SchedulingRequestConfig
=
mac_cell_group_config
->
SchedulingRequestConfig
;
mac
->
SchedulingRequestConfig
=
mac_cell_group_config
->
SchedulingRequestConfig
;
}
if
(
mac_cell_group_config
->
BSR_Config
!=
(
BSR_Config_t
*
)
0
){
NR_UE_mac_inst
->
BSR_Config
=
mac_cell_group_config
->
BSR_Config
;
mac
->
BSR_Config
=
mac_cell_group_config
->
BSR_Config
;
}
if
(
mac_cell_group_config
->
TAG_Config
!=
(
TAG_Config_t
*
)
0
){
NR_UE_mac_inst
->
TAG_Config
=
mac_cell_group_config
->
TAG_Config
;
mac
->
TAG_Config
=
mac_cell_group_config
->
TAG_Config
;
}
if
(
mac_cell_group_config
->
phr_Config
!=
(
phr_Config_t
*
)
0
){
NR_UE_mac_inst
->
phr_Config
=
mac_cell_group_config
->
phr_Config
;
mac
->
phr_Config
=
mac_cell_group_config
->
phr_Config
;
}
if
(
mac_cell_group_config
->
cs_RNTI
!=
(
cs_RNTI_t
*
)
0
){
NR_UE_mac_inst
->
cs_RNTI
=
mac_cell_group_config
->
cs_RNTI
;
mac
->
cs_RNTI
=
mac_cell_group_config
->
cs_RNTI
;
}
}
if
(
phy_cell_group_config
!=
(
PhysicalCellGroupConfig_t
*
)
0
){
config_phy
(
phy_cell_group_config
,
NULL
);
}
if
(
spcell_config
!=
(
SpCellConfig_t
*
)
0
){
if
(
serving_cell_config_config
!=
(
SpCellConfig_t
*
)
0
){
config_phy
(
NULL
,
spcell_config
);
mac
->
servCellIndex
=
spcell_config
->
servCellIndex
;
}
if
(
serving_cell_config
!=
(
spCellConfigDedicated_t
*
)
0
){
if
(
serving_cell_config
->
tdd_UL_DL_ConfigurationDedicated
!=
(
TDD_UL_DL_ConfigDedicated_t
*
)
0
){
mac
->
tdd_UL_DL_ConfigurationDedicated
=
serving_cell_config
->
tdd_UL_DL_ConfigurationDedicated
;
}
if
(
spcell_config
->
initialDownlinkBWP
!=
(
BWP_DownlinkDedicated_t
*
)
0
){
mac
->
init_DL_BWP
=
spcell_config
->
initialDownlinkBWP
;
}
// storage list of DL BWP config. TODO should be modify to maintain(add/release) a list inside MAC instance, this implementation just use for one-shot RRC configuration setting.
if
(
spcell_config
->
downlinkBWP_ToAddModList
!=
(
struct
ServingCellConfig__downlinkBWP_ToAddModList
*
)
0
){
mac
->
BWP_Downlink_list
=
spcell_config
->
downlinkBWP_ToAddModList
->
list
;
mac
->
BWP_Downlink_count
=
spcell_config
->
downlinkBWP_ToAddModList
->
count
;
}
if
(
spcell_config
->
bwp_InactivityTimer
!=
(
long
*
)
0
){
mac
->
bwp_InactivityTimer
=
spcell_config
->
bwp_InactivityTimer
;
}
if
(
spcell_config
->
defaultDownlinkBWP_Id
!=
(
BWP_Id_t
*
)
0
){
mac
->
defaultDownlinkBWP_Id
=
spcell_config
->
defaultDownlinkBWP_Id
;
}
if
(
spcell_config
->
pdsch_ServingCellConfig
!=
(
PDSCH_ServingCellConfig_t
*
)
0
){
mac
->
pdsch_ServingCellConfig
=
spcell_config
->
pdsch_ServingCellConfig
;
}
if
(
spcell_config
->
csi_MeasConfig
!=
(
CSI_MeasConfig_t
*
)
0
){
mac
->
csi_MeasConfig
=
spcell_config
->
csi_MeasConfig
;
}
spcell_config
->
tag_Id
=
spcell_config
.
tag_Id
;
}
//scell config not yet
return
(
0
);
}
openair2/LAYER2/NR_MAC_UE/defs.h
View file @
3b7960d8
...
...
@@ -72,12 +72,35 @@
/*!\brief Top level UE MAC structure */
typedef
struct
{
//// MAC config
drx_Config_t
*
drx_config
;
SchedulingRequestConfig_t
*
SchedulingRequestConfig
;
BSR_Config_t
*
BSR_Config
;
TAG_Config_t
*
TAG_Config
;
phr_Config_t
*
phr_Config
;
cs_RNTI_t
*
cs_RNTI
;
ServCellIndex_t
*
servCellIndex
;
//// Serving cell config
TDD_UL_DL_ConfigDedicated_t
*
tdd_UL_DL_ConfigurationDedicated
;
// init DL BWP
BWP_DownlinkDedicated_t
*
init_DL_BWP
;
// DL BWP list, not default one
BWP_Downlink_t
**
BWP_Downlink_list
;
int
BWP_Downlink_count
;
//BWP_Id_t *firstActiveDownlinkBWP_Id;
long
*
bwp_InactivityTimer
;
BWP_Id_t
*
defaultDownlinkBWP_Id
;
//struct UplinkConfig *uplinkConfig;
//struct UplinkConfig *supplementaryUplink;
PDSCH_ServingCellConfig_t
*
pdsch_ServingCellConfig
;
CSI_MeasConfig_t
*
csi_MeasConfig
;
//SRS_CarrierSwitching_t *carrierSwitching;
//long *sCellDeactivationTimer /* OPTIONAL */;
//struct CrossCarrierSchedulingConfig *crossCarrierSchedulingConfig /* OPTIONAL */;
TAG_Id_t
tag_Id
;
//long *ue_BeamLockFunction /* OPTIONAL */;
//long *pathlossReferenceLinking /* OPTIONAL */;
}
UE_MAC_INST
;
#include "proto.h"
...
...
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
View file @
3b7960d8
...
...
@@ -34,6 +34,7 @@
#include "extern.h"
#include "assertions.h"
static
NR_UE_MAC_INST_t
*
nr_ue_mac_inst
;
int
nr_l2_init_ue
(
void
)
...
...
@@ -43,7 +44,12 @@ nr_l2_init_ue(void)
LOG_I
(
MAC
,
"[MAIN] init UE MAC functions
\n
"
);
//init mac here
nr_ue_mac_inst
=
(
NR_UE_MAC_INST_t
*
)
malloc
(
sizeof
(
NR_UE_MAC_INST_t
)
*
NB_NR_UE_MAC_INST
);
return
(
1
);
}
NR_UE_MAC_INST_t
*
get_mac_inst
(
Module_id_t
Mod_idP
){
return
&
nr_ue_mac_inst
[(
int
)
Mod_idP
];
}
openair2/LAYER2/NR_MAC_UE/vars.c
0 → 100644
View file @
3b7960d8
/*
* 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.1 (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 vars.h
* \brief mac vars
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \version 1.0
* \email navid.nikaein@eurecom.fr
* @ingroup _mac
*/
UE_MAC_INST_t
UE_mac_inst
;
//[NB_MODULE_MAX];
openair2/NR_UE_PHY_INTERFACE/IF_Module.c
0 → 100644
View file @
3b7960d8
This diff is collapsed.
Click to expand it.
openair2/NR_UE_PHY_INTERFACE/IF_Module.h
0 → 100644
View file @
3b7960d8
/*
* 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.1 (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 openair2/PHY_INTERFACE/IF_Module.h
* \brief data structures for PHY/MAC interface modules
* \author EURECOM/NTUST
* \date 2017
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __IF_MODULE__H__
#define __IF_MODULE__H__
#include <stdint.h>
#include "openair1/PHY/LTE_TRANSPORT/defs.h"
#include "nfapi_interface.h"
#define MAX_NUM_DL_PDU 100
#define MAX_NUM_UL_PDU 100
#define MAX_NUM_HI_DCI0_PDU 100
#define MAX_NUM_TX_REQUEST_PDU 100
#define MAX_NUM_HARQ_IND 100
#define MAX_NUM_CRC_IND 100
#define MAX_NUM_SR_IND 100
#define MAX_NUM_CQI_IND 100
#define MAX_NUM_RACH_IND 100
#define MAX_NUM_SRS_IND 100
typedef
struct
{
/// Module ID
module_id_t
module_id
;
/// CC ID
int
CC_id
;
/// frame
frame_t
frame
;
/// subframe
sub_frame_t
subframe
;
/// harq indication list
nfapi_harq_indication_t
harq_ind
;
/// crc indication list
nfapi_crc_indication_t
crc_ind
;
/// SR indication list
nfapi_sr_indication_t
sr_ind
;
/// CQI indication list
nfapi_cqi_indication_body_t
cqi_ind
;
/// RACH indication list
nfapi_rach_indication_t
rach_ind
;
#ifdef Rel14
/// RACH indication list for BR UEs
nfapi_rach_indication_t
rach_ind_br
;
#endif
/// SRS indication list
nfapi_srs_indication_body_t
srs_ind
;
/// RX indication
nfapi_rx_indication_t
rx_ind
;
}
UL_IND_t
;
// Downlink subframe P7
typedef
struct
{
/// Module ID
module_id_t
module_id
;
/// CC ID
uint8_t
CC_id
;
/// frame
frame_t
frame
;
/// subframe
sub_frame_t
subframe
;
/// nFAPI DL Config Request
nfapi_dl_config_request_t
*
DL_req
;
/// nFAPI UL Config Request
nfapi_ul_config_request_t
*
UL_req
;
/// nFAPI HI_DCI Request
nfapi_hi_dci0_request_t
*
HI_DCI0_req
;
/// Pointers to DL SDUs
nfapi_tx_request_t
*
TX_req
;
}
Sched_Rsp_t
;
typedef
struct
{
uint8_t
Mod_id
;
int
CC_id
;
nfapi_config_request_t
*
cfg
;
}
PHY_Config_t
;
typedef
struct
IF_Module_s
{
//define the function pointer
void
(
*
UL_indication
)(
UL_IND_t
*
UL_INFO
);
void
(
*
schedule_response
)(
Sched_Rsp_t
*
Sched_INFO
);
void
(
*
PHY_config_req
)(
PHY_Config_t
*
config_INFO
);
uint32_t
CC_mask
;
uint16_t
current_frame
;
uint8_t
current_subframe
;
pthread_mutex_t
if_mutex
;
}
IF_Module_t
;
/*Initial */
IF_Module_t
*
IF_Module_init
(
int
Mod_id
);
void
IF_Module_kill
(
int
Mod_id
);
/*Interface for uplink, transmitting the Preamble(list), ULSCH SDU, NAK, Tick (trigger scheduler)
*/
void
UL_indication
(
UL_IND_t
*
UL_INFO
);
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
void
Schedule_Response
(
Sched_Rsp_t
*
Sched_INFO
);
#endif
openair2/NR_UE_PHY_INTERFACE/defs.h
0 → 100644
View file @
3b7960d8
This diff is collapsed.
Click to expand it.
openair2/NR_UE_PHY_INTERFACE/extern.h
0 → 100644
View file @
3b7960d8
/*
* 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.1 (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
*/
#ifndef __PHY_INTERFACE_EXTERN_H__
#define __PHY_INTERFACE_EXTERN_H__
#endif
openair2/NR_UE_PHY_INTERFACE/mac_phy_primitives.c
0 → 100644
View file @
3b7960d8
/*
* 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.1 (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
*/
/*________________________mac_phy_primitives.c________________________
Authors : Hicham Anouar, Raymond Knopp
Company : EURECOM
Emails : anouar@eurecom.fr, knopp@eurecom.fr
________________________________________________________________*/
//#include "openair_extern.h"
#ifdef MAC_CONTEXT
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
//#include "extern.h"
#include "defs.h"
#endif //MAC_CONTEXT
//#define DEBUG_UE_DECODE_SACH
//#define DEBUG_NODEB_DECODE_SACH
#ifdef PHY_CONTEXT
#ifdef PHY_EMUL
#include "extern.h"
#include "SIMULATION/simulation_defs.h"
#else //PHY_EMUL
#include "MAC_INTERFACE/extern.h"
#endif //PHY_EMUL
void
clear_macphy_data_req
(
unsigned
char
Mod_id
)
{
//msg("CLEAR DATA_REQ\n");
unsigned
char
i
;
Macphy_req_table
[
Mod_id
].
Macphy_req_cnt
=
0
;
for
(
i
=
0
;
i
<
NB_REQ_MAX
;
i
++
)
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[
i
].
Active
=
0
;
}
/*
unsigned char phy_resources_compare(PHY_RESOURCES *Phy1,PHY_RESOURCES* Phy2 ){
if(Phy1->Time_alloc==Phy2->Time_alloc && Phy1->Freq_alloc==Phy2->Freq_alloc)// && Phy1->Coding_fmt==Phy2->Coding_fmt && Phy1->Seq_index==Phy2->Seq_index)
return 1;
else
return 0;
}
*/
MACPHY_DATA_REQ_TABLE_ENTRY
*
find_data_req_entry
(
unsigned
char
Mod_id
,
MACPHY_REQ_ENTRY_KEY
*
Search_key
)
{
unsigned
char
i
;
//msg("[MAC_PHY]MAC_PHY_REQUEST_CNT=%d\n",Macphy_req_table.Macphy_req_cnt);
if
(
Macphy_req_table
[
Mod_id
].
Macphy_req_cnt
>
0
)
{
#ifdef DEBUG_PHY
// msg("[MACPHY_FIND_REQ] SEARCH KEY=%d\n",Search_key->Key_type);
#endif //DEBUG_PHY
//msg("[MACPHY_FIND_REQ] SEARCH KEY=%d, NB_REQ_MAX=%d\n",Search_key->Key_type,NB_REQ_MAX);
switch
(
Search_key
->
Key_type
)
{
case
PDU_TYPE_KEY
:
for
(
i
=
0
;
i
<
NB_REQ_MAX
;
i
++
)
{
if
(
(
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[
i
].
Macphy_data_req
.
Pdu_type
==
Search_key
->
Key
.
Pdu_type
)
&&
(
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[
i
].
Active
==
1
)
)
{
//msg("[MACPHY_FIND] MACPHY_req_table_entry=%p,idx=%d,Phy_resources %p", &Macphy_req_table.Macphy_req_table_entry[i],i,Macphy_req_table.Macphy_req_table_entry[i].Macphy_data_req.Phy_Resources_Entry);
return
(
&
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[
i
]);
}
}
break
;
/*
case LCHAN_KEY:
for(i=0;i<NB_REQ_MAX;i++){
if ((Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Lchan_id.Index==Search_key->Key.Lchan_id->Index) &&
(Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Active == 1) )
return(&Macphy_req_table[Mod_id].Macphy_req_table_entry[i]);
}
break;
case PHY_RESOURCES_KEY:
for(i=0;i<NB_REQ_MAX;i++){
if(Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Active == 1)
if ( ( Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources->Time_alloc ==
Search_key->Key.Phy_resources.Time_alloc )
&&( Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources->Freq_alloc ==
Search_key->Key.Phy_resources.Freq_alloc )
&&( Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.CH_index ==
Search_key->CH_index )
&& ( Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Direction == RX))
return(&Macphy_req_table[Mod_id].Macphy_req_table_entry[i]);
}
break;
*/
}
}
#ifndef PHY_EMUL
// msg("[PHY][PHY_MAC] Frame %d : No data request\n",mac_xface->frame);
#endif //PHY_EMUL
return
(
MACPHY_DATA_REQ_TABLE_ENTRY
*
)
0
;
}
void
print_active_requests
(
unsigned
char
Mod_id
)
{
int
i
;
msg
(
"_________________________INST %d , FRAME %d ACTIVE_REQUESTS_________________
\n
"
,
Mod_id
,
mac_xface
->
frame
);
for
(
i
=
0
;
i
<
NB_REQ_MAX
;
i
++
)
{
if
(
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[
i
].
Active
==
1
)
{
msg
(
"[MACPHY][DATA][REQ] Request %d: Direction %d, Pdu_type %d
\n
"
,
i
,
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[
i
].
Macphy_data_req
.
Direction
,
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[
i
].
Macphy_data_req
.
Pdu_type
);
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Lchan_id.Index);
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources,
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources->Time_alloc,
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources->Freq_alloc);
//if(Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Pdu_type==RACH)
//msg("[RACH_REQ] Rach_pdu %p, Payload %p\n",Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Dir.Req_rx.Pdu.Rach_pdu,
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Dir.Req_rx.Pdu.Rach_pdu->Rach_payload);
}
}
}
/*___________________________________________________________________________________________________*/
#define RCNT Macphy_req_table[Mod_id].Macphy_req_cnt
MACPHY_DATA_REQ
*
new_macphy_data_req
(
unsigned
char
Mod_id
)
{
/*___________________________________________________________________________________________________*/
unsigned
char
i
;
for
(
i
=
0
;
i
<
NB_REQ_MAX
;
i
++
)
{
if
(
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[(
i
)
%
NB_REQ_MAX
].
Active
==
0
)
{
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[(
i
)
%
NB_REQ_MAX
].
Active
=
1
;
RCNT
=
(
RCNT
+
1
)
%
NB_REQ_MAX
;
// msg("[MAC_PHY]NEW MAC_REQUEST_CNT=%d,frame %d, Module %d, entry %d \n",Macphy_req_table[Mod_id].Macphy_req_cnt,mac_xface->frame,Mod_id,i);
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i%NB_REQ_MAX].Macphy_data_req.Phy_resources=(PHY_RESOURCES*)malloc16(sizeof(PHY_RESOURCES));
return
(
&
Macphy_req_table
[
Mod_id
].
Macphy_req_table_entry
[
i
%
NB_REQ_MAX
].
Macphy_data_req
);
}
}
msg
(
"[OPENAIR][MAC][ERROR] frame %d: No more DATA_REQ !!!!
\n
"
,
mac_xface
->
frame
);
print_active_requests
(
Mod_id
);
mac_xface
->
macphy_exit
(
"new_macphy_data_req: no more DATA_REQ"
);
//rt_sleep(nano2count(2000));
return
((
MACPHY_DATA_REQ
*
)
0
);
}
#endif //PHY_CONTEXT
#ifdef MAC_CONTEXT
#include "LAYER2/MAC/extern.h"
// Function called by PHY to indicate available data/measurements for MAC
/*___________________________________________________________________________________________________*/
void
macphy_data_ind
(
unsigned
char
Mod_id
,
unsigned
char
Pdu_type
,
void
*
pdu
,
unsigned
short
rnti
)
{
/*___________________________________________________________________________________________________*/
//msg("[OPENAIR][MACPHY] Calling mac_resp In\n");
int
i
;
// if (Req_rx->crc_status[0]!= -1) { //CRC_STATUS
// msg("[OPENAIR][MACPHY] Calling mac_indicate In\n");
// Req_rx->Meas.UL_meas=&UL_meas[Mod_id];
// Req_rx->Meas.DL_meas=&DL_meas[Mod_id];
switch
(
Pdu_type
)
{
case
ULSCH
:
// msg("[OPENAIR][MACPHY] Received RACH, Sending to MAC\n");
nodeb_decode_ulsch
(
Mod_id
,(
ULSCH_PDU
*
)
pdu
,
rnti
);
break
;
case
DLSCH
:
#ifdef DEBUG_UE_DECODE_SACH
msg
(
"[MAC][UE][MAC_PHY] TTI %d Inst %d
\n
"
,
mac_xface
->
frame
,
Mod_id
);
#endif
// ue_decode_dlsch(Mod_id-NB_CH_INST,
// (DLSCH_PDU *)pdu,rnti);
break
;
default:
break
;
}
// msg("Freeing Req %p\n",Macphy_data_req_table_entry);
// }
}
/*PHY_RESOURCES_TABLE_ENTRY *new_phy_resources() {
unsigned char i;
//msg("[OPENAIR][PHY][MAC Interface] New Phy Resource, cnt %d\n",Phy_resources_table.Phy_resources_cnt);
for (i=0;i<NB_PHY_RESOURCES_MAX;i++){
if (Phy_resources_table.Phy_resources_table_entry[(i+Phy_resources_table.Phy_resources_cnt+1)%NB_PHY_RESOURCES_MAX].Active == 0) {
Phy_resources_table.Phy_resources_table_entry[(i+Phy_resources_table.Phy_resources_cnt+1)%NB_PHY_RESOURCES_MAX].Active = 1;
Phy_resources_table.Phy_resources_cnt = (Phy_resources_table.Phy_resources_cnt + 1)%NB_PHY_RESOURCES_MAX;
// msg("[OPENAIR][PHY][MAC Interface] NEW PHY_RESOURCES: Taking index %d\n\n",(i+Phy_resources_table.Phy_resources_cnt+1)%NB_PHY_RESOURCES_MAX);
return(&Phy_resources_table.Phy_resources_table_entry[(i+Phy_resources_table.Phy_resources_cnt)%NB_PHY_RESOURCES_MAX]);
}
}
msg("[OPENAIR][MAC][ERROR] No more PHY_RESOURCES !!!!\n");
exit(-1);
}
*/
#endif //MAC_CONTEXT
// Measurements, etc ..
//short phy_resource_cnt = 0, macphy_data_req_cnt = 0, macphy_data_ind_cnt = 0;
openair2/NR_UE_PHY_INTERFACE/mac_phy_primitives.h
0 → 100644
View file @
3b7960d8
This diff is collapsed.
Click to expand it.
openair2/NR_UE_PHY_INTERFACE/vars.h
0 → 100644
View file @
3b7960d8
/*
* 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.1 (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
*/
#ifndef __PHY_INTERFACE_VARS_H__
#define __PHY_INTERFACE_VARS_H__
//#include "SIMULATION/PHY_EMULATION/spec_defs.h"
#include "defs.h"
#ifdef PHY_EMUL
#include "SIMULATION/PHY_EMULATION/DEVICE_DRIVER/defs.h"
#include "SIMULATION/simulation_defs.h"
#endif
unsigned
int
mac_debug
;
//MAC_xface *mac_xface;
//MACPHY_PARAMS MACPHY_params;
unsigned
int
mac_registered
;
#endif
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