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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
52dbc6fe
Commit
52dbc6fe
authored
May 03, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor linear allocator from LTE/NR; separate LTE/NR headers
parent
0c9006ec
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
100 additions
and
210 deletions
+100
-210
common/utils/collection/linear_alloc.h
common/utils/collection/linear_alloc.h
+71
-0
openair2/RRC/LTE/rrc_defs.h
openair2/RRC/LTE/rrc_defs.h
+3
-16
openair2/RRC/LTE/rrc_eNB_UE_context.c
openair2/RRC/LTE/rrc_eNB_UE_context.c
+2
-60
openair2/RRC/LTE/rrc_eNB_UE_context.h
openair2/RRC/LTE/rrc_eNB_UE_context.h
+0
-21
openair2/RRC/NR/nr_rrc_defs.h
openair2/RRC/NR/nr_rrc_defs.h
+10
-24
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+1
-1
openair2/RRC/NR/rrc_gNB_UE_context.c
openair2/RRC/NR/rrc_gNB_UE_context.c
+12
-67
openair2/RRC/NR/rrc_gNB_UE_context.h
openair2/RRC/NR/rrc_gNB_UE_context.h
+0
-21
openair2/RRC/NR_UE/L2_interface_ue.c
openair2/RRC/NR_UE/L2_interface_ue.c
+1
-0
No files found.
common/utils/collection/linear_alloc.h
0 → 100644
View file @
52dbc6fe
/*
* 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 LINEAR_ALLOC_H
#define LINEAR_ALLOC_H
#include <limits.h>
typedef
unsigned
int
uid_t
;
#define UID_LINEAR_ALLOCATOR_SIZE 1024
#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((UID_LINEAR_ALLOCATOR_SIZE/8)/sizeof(unsigned int)) + 1)
typedef
struct
uid_linear_allocator_s
{
unsigned
int
bitmap
[
UID_LINEAR_ALLOCATOR_BITMAP_SIZE
];
}
uid_allocator_t
;
static
inline
void
uid_linear_allocator_init
(
uid_allocator_t
*
uia
)
{
memset
(
uia
,
0
,
sizeof
(
uid_allocator_t
));
}
static
inline
uid_t
uid_linear_allocator_new
(
uid_allocator_t
*
uia
)
{
unsigned
int
bit_index
=
1
;
uid_t
uid
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
UID_LINEAR_ALLOCATOR_BITMAP_SIZE
;
i
++
)
{
if
(
uia
->
bitmap
[
i
]
!=
UINT_MAX
)
{
bit_index
=
1
;
uid
=
0
;
while
((
uia
->
bitmap
[
i
]
&
bit_index
)
==
bit_index
)
{
bit_index
=
bit_index
<<
1
;
uid
+=
1
;
}
uia
->
bitmap
[
i
]
|=
bit_index
;
return
uid
+
(
i
*
sizeof
(
unsigned
int
)
*
8
);
}
}
return
UINT_MAX
;
}
static
inline
void
uid_linear_allocator_free
(
uid_allocator_t
*
uia
,
uid_t
uid
)
{
const
unsigned
int
i
=
uid
/
sizeof
(
unsigned
int
)
/
8
;
const
unsigned
int
bit
=
uid
%
(
sizeof
(
unsigned
int
)
*
8
);
const
unsigned
int
value
=
~
(
1
<<
bit
);
if
(
i
<
UID_LINEAR_ALLOCATOR_BITMAP_SIZE
)
{
uia
->
bitmap
[
i
]
&=
value
;
}
}
#endif
/* LINEAR_ALLOC_H */
openair2/RRC/LTE/rrc_defs.h
View file @
52dbc6fe
...
@@ -36,11 +36,11 @@
...
@@ -36,11 +36,11 @@
#include <string.h>
#include <string.h>
#include "collection/tree.h"
#include "collection/tree.h"
#include "collection/linear_alloc.h"
#include "common/ngran_types.h"
#include "common/ngran_types.h"
#include "rrc_types.h"
#include "rrc_types.h"
//#include "PHY/phy_defs.h"
//#include "PHY/phy_defs.h"
#include "LAYER2/RLC/rlc.h"
#include "LAYER2/RLC/rlc.h"
#include "RRC/NR/nr_rrc_types.h"
#include "NR_UE-MRDC-Capability.h"
#include "NR_UE-MRDC-Capability.h"
#include "NR_UE-NR-Capability.h"
#include "NR_UE-NR-Capability.h"
...
@@ -219,17 +219,6 @@ void *send_UE_status_notification(void *);
...
@@ -219,17 +219,6 @@ void *send_UE_status_notification(void *);
#include "commonDef.h"
#include "commonDef.h"
//--------
typedef
unsigned
int
uid_t
;
#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((MAX_MOBILES_PER_ENB/8)/sizeof(unsigned int)) + 1)
typedef
struct
uid_linear_allocator_s
{
unsigned
int
bitmap
[
UID_LINEAR_ALLOCATOR_BITMAP_SIZE
];
}
uid_allocator_t
;
//--------
#define PROTOCOL_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define PROTOCOL_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
...
@@ -668,8 +657,6 @@ typedef struct eNB_RRC_UE_s {
...
@@ -668,8 +657,6 @@ typedef struct eNB_RRC_UE_s {
int
nr_capabilities_requested
;
int
nr_capabilities_requested
;
}
eNB_RRC_UE_t
;
}
eNB_RRC_UE_t
;
typedef
uid_t
ue_uid_t
;
typedef
struct
rrc_eNB_ue_context_s
{
typedef
struct
rrc_eNB_ue_context_s
{
/* Tree related data */
/* Tree related data */
RB_ENTRY
(
rrc_eNB_ue_context_s
)
entries
;
RB_ENTRY
(
rrc_eNB_ue_context_s
)
entries
;
...
@@ -680,7 +667,7 @@ typedef struct rrc_eNB_ue_context_s {
...
@@ -680,7 +667,7 @@ typedef struct rrc_eNB_ue_context_s {
rnti_t
ue_id_rnti
;
rnti_t
ue_id_rnti
;
// another key for protocol layers but should not be used as a key for RB tree
// another key for protocol layers but should not be used as a key for RB tree
u
e_uid_t
local_uid
;
u
id_t
local_uid
;
/* UE id for initial connection to S1AP */
/* UE id for initial connection to S1AP */
struct
eNB_RRC_UE_s
ue_context
;
struct
eNB_RRC_UE_s
ue_context
;
...
@@ -762,7 +749,7 @@ typedef struct eNB_RRC_INST_s {
...
@@ -762,7 +749,7 @@ typedef struct eNB_RRC_INST_s {
char
*
node_name
;
char
*
node_name
;
uint32_t
node_id
;
uint32_t
node_id
;
rrc_eNB_carrier_data_t
carrier
[
MAX_NUM_CCs
];
rrc_eNB_carrier_data_t
carrier
[
MAX_NUM_CCs
];
uid_allocator_t
uid_allocator
;
// for rrc_ue_head
uid_allocator_t
uid_allocator
;
RB_HEAD
(
rrc_ue_tree_s
,
rrc_eNB_ue_context_s
)
rrc_ue_head
;
// ue_context tree key search by rnti
RB_HEAD
(
rrc_ue_tree_s
,
rrc_eNB_ue_context_s
)
rrc_ue_head
;
// ue_context tree key search by rnti
uint8_t
HO_flag
;
uint8_t
HO_flag
;
uint8_t
Nb_ue
;
uint8_t
Nb_ue
;
...
...
openair2/RRC/LTE/rrc_eNB_UE_context.c
View file @
52dbc6fe
...
@@ -37,64 +37,6 @@
...
@@ -37,64 +37,6 @@
#include "rrc_eNB_UE_context.h"
#include "rrc_eNB_UE_context.h"
//------------------------------------------------------------------------------
void
uid_linear_allocator_init
(
uid_allocator_t
*
const
uid_pP
)
//------------------------------------------------------------------------------
{
memset
(
uid_pP
,
0
,
sizeof
(
uid_allocator_t
));
}
//------------------------------------------------------------------------------
uid_t
uid_linear_allocator_new
(
eNB_RRC_INST
*
const
rrc_instance_pP
)
//------------------------------------------------------------------------------
{
unsigned
int
i
;
unsigned
int
bit_index
=
1
;
uid_t
uid
=
0
;
uid_allocator_t
*
uia_p
=
&
rrc_instance_pP
->
uid_allocator
;
for
(
i
=
0
;
i
<
UID_LINEAR_ALLOCATOR_BITMAP_SIZE
;
i
++
)
{
if
(
uia_p
->
bitmap
[
i
]
!=
UINT_MAX
)
{
bit_index
=
1
;
uid
=
0
;
while
((
uia_p
->
bitmap
[
i
]
&
bit_index
)
==
bit_index
)
{
bit_index
=
bit_index
<<
1
;
uid
+=
1
;
}
uia_p
->
bitmap
[
i
]
|=
bit_index
;
return
uid
+
(
i
*
sizeof
(
unsigned
int
)
*
8
);
}
}
return
UINT_MAX
;
}
//------------------------------------------------------------------------------
void
uid_linear_allocator_free
(
eNB_RRC_INST
*
rrc_instance_pP
,
uid_t
uidP
)
//------------------------------------------------------------------------------
{
unsigned
int
i
=
uidP
/
sizeof
(
unsigned
int
)
/
8
;
unsigned
int
bit
=
uidP
%
(
sizeof
(
unsigned
int
)
*
8
);
unsigned
int
value
=
~
(
0x00000001
<<
bit
);
if
(
i
<
UID_LINEAR_ALLOCATOR_BITMAP_SIZE
)
{
rrc_instance_pP
->
uid_allocator
.
bitmap
[
i
]
&=
value
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
rrc_eNB_compare_ue_rnti_id
(
int
rrc_eNB_compare_ue_rnti_id
(
...
@@ -134,7 +76,7 @@ rrc_eNB_allocate_new_UE_context(
...
@@ -134,7 +76,7 @@ rrc_eNB_allocate_new_UE_context(
}
}
memset
(
new_p
,
0
,
sizeof
(
struct
rrc_eNB_ue_context_s
));
memset
(
new_p
,
0
,
sizeof
(
struct
rrc_eNB_ue_context_s
));
new_p
->
local_uid
=
uid_linear_allocator_new
(
rrc_instance_pP
);
new_p
->
local_uid
=
uid_linear_allocator_new
(
&
rrc_instance_pP
->
uid_allocator
);
for
(
int
i
=
0
;
i
<
NB_RB_MAX
;
i
++
)
{
for
(
int
i
=
0
;
i
<
NB_RB_MAX
;
i
++
)
{
new_p
->
ue_context
.
e_rab
[
i
].
xid
=
-
1
;
new_p
->
ue_context
.
e_rab
[
i
].
xid
=
-
1
;
...
@@ -210,7 +152,7 @@ void rrc_eNB_remove_ue_context(
...
@@ -210,7 +152,7 @@ void rrc_eNB_remove_ue_context(
RB_REMOVE
(
rrc_ue_tree_s
,
&
rrc_instance_pP
->
rrc_ue_head
,
ue_context_pP
);
RB_REMOVE
(
rrc_ue_tree_s
,
&
rrc_instance_pP
->
rrc_ue_head
,
ue_context_pP
);
rrc_eNB_free_mem_UE_context
(
ctxt_pP
,
ue_context_pP
);
rrc_eNB_free_mem_UE_context
(
ctxt_pP
,
ue_context_pP
);
uid_linear_allocator_free
(
rrc_instance_pP
,
ue_context_pP
->
local_uid
);
uid_linear_allocator_free
(
&
rrc_instance_pP
->
uid_allocator
,
ue_context_pP
->
local_uid
);
free
(
ue_context_pP
);
free
(
ue_context_pP
);
rrc_instance_pP
->
Nb_ue
--
;
rrc_instance_pP
->
Nb_ue
--
;
LOG_I
(
RRC
,
LOG_I
(
RRC
,
...
...
openair2/RRC/LTE/rrc_eNB_UE_context.h
View file @
52dbc6fe
...
@@ -34,27 +34,6 @@
...
@@ -34,27 +34,6 @@
#include "COMMON/platform_types.h"
#include "COMMON/platform_types.h"
#include "rrc_defs.h"
#include "rrc_defs.h"
void
uid_linear_allocator_init
(
uid_allocator_t
*
const
uid_pP
);
uid_t
uid_linear_allocator_new
(
eNB_RRC_INST
*
rrc_instance_pP
);
void
uid_linear_allocator_free
(
eNB_RRC_INST
*
rrc_instance_pP
,
uid_t
uidP
);
int
rrc_eNB_compare_ue_rnti_id
(
int
rrc_eNB_compare_ue_rnti_id
(
struct
rrc_eNB_ue_context_s
*
c1_pP
,
struct
rrc_eNB_ue_context_s
*
c1_pP
,
struct
rrc_eNB_ue_context_s
*
c2_pP
struct
rrc_eNB_ue_context_s
*
c2_pP
...
...
openair2/RRC/NR/nr_rrc_defs.h
View file @
52dbc6fe
...
@@ -36,12 +36,12 @@
...
@@ -36,12 +36,12 @@
#include <string.h>
#include <string.h>
#include "collection/tree.h"
#include "collection/tree.h"
#include "collection/linear_alloc.h"
#include "nr_rrc_types.h"
#include "nr_rrc_types.h"
#include "common/ngran_types.h"
#include "COMMON/platform_constants.h"
#include "COMMON/platform_constants.h"
#include "COMMON/platform_types.h"
#include "COMMON/platform_types.h"
#include "RRC/LTE/rrc_defs.h"
//#include "LAYER2/RLC/rlc.h"
#include "mac_rrc_dl.h"
#include "mac_rrc_dl.h"
//#include "COMMON/mac_rrc_primitives.h"
//#include "COMMON/mac_rrc_primitives.h"
...
@@ -80,17 +80,6 @@
...
@@ -80,17 +80,6 @@
#include "commonDef.h"
#include "commonDef.h"
/*I will change the name of the structure for compile purposes--> hope not to undo this process*/
typedef
unsigned
int
uid_nr_t
;
#define NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((MAX_MOBILES_PER_GNB/8)/sizeof(unsigned int)) + 1)
typedef
struct
nr_uid_linear_allocator_s
{
unsigned
int
bitmap
[
NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE
];
}
nr_uid_allocator_t
;
#define PROTOCOL_NR_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NR_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NR_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_NR_CTXT_ARGS(CTXT_Pp)
#define PROTOCOL_NR_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_NR_CTXT_ARGS(CTXT_Pp)
...
@@ -283,12 +272,11 @@ typedef struct pdu_session_param_s {
...
@@ -283,12 +272,11 @@ typedef struct pdu_session_param_s {
typedef
struct
gNB_RRC_UE_s
{
typedef
struct
gNB_RRC_UE_s
{
uint8_t
primaryCC_id
;
uint8_t
primaryCC_id
;
LTE_SCellToAddMod_r10_t
sCell_config
[
2
];
NR_SRB_ToAddModList_t
*
SRB_configList
;
NR_SRB_ToAddModList_t
*
SRB_configList
;
NR_SRB_ToAddModList_t
*
SRB_configList2
[
RRC_TRANSACTION_IDENTIFIER_NUMBER
];
NR_SRB_ToAddModList_t
*
SRB_configList2
[
NR_
RRC_TRANSACTION_IDENTIFIER_NUMBER
];
NR_DRB_ToAddModList_t
*
DRB_configList
;
NR_DRB_ToAddModList_t
*
DRB_configList
;
NR_DRB_ToAddModList_t
*
DRB_configList2
[
RRC_TRANSACTION_IDENTIFIER_NUMBER
];
NR_DRB_ToAddModList_t
*
DRB_configList2
[
NR_
RRC_TRANSACTION_IDENTIFIER_NUMBER
];
NR_DRB_ToReleaseList_t
*
DRB_Release_configList2
[
RRC_TRANSACTION_IDENTIFIER_NUMBER
];
NR_DRB_ToReleaseList_t
*
DRB_Release_configList2
[
NR_
RRC_TRANSACTION_IDENTIFIER_NUMBER
];
uint8_t
DRB_active
[
8
];
uint8_t
DRB_active
[
8
];
NR_SRB_INFO
SI
;
NR_SRB_INFO
SI
;
...
@@ -296,7 +284,7 @@ typedef struct gNB_RRC_UE_s {
...
@@ -296,7 +284,7 @@ typedef struct gNB_RRC_UE_s {
NR_SRB_INFO_TABLE_ENTRY
Srb1
;
NR_SRB_INFO_TABLE_ENTRY
Srb1
;
NR_SRB_INFO_TABLE_ENTRY
Srb2
;
NR_SRB_INFO_TABLE_ENTRY
Srb2
;
NR_MeasConfig_t
*
measConfig
;
NR_MeasConfig_t
*
measConfig
;
HANDOVER_INFO
*
handover_info
;
NR_HANDOVER_INFO
*
handover_info
;
NR_MeasResults_t
*
measResults
;
NR_MeasResults_t
*
measResults
;
...
@@ -353,7 +341,7 @@ typedef struct gNB_RRC_UE_s {
...
@@ -353,7 +341,7 @@ typedef struct gNB_RRC_UE_s {
/* Number of e_rab to be modified in the list */
/* Number of e_rab to be modified in the list */
uint8_t
nb_of_modify_e_rabs
;
uint8_t
nb_of_modify_e_rabs
;
uint8_t
nb_of_failed_e_rabs
;
uint8_t
nb_of_failed_e_rabs
;
e_rab_param_t
modify_e_rab
[
NB_RB_MAX
];
//[S1AP_MAX_E_RAB];
nr_e_rab_param_t
modify_e_rab
[
NB_RB_MAX
];
//[S1AP_MAX_E_RAB];
/* Total number of pdu session already setup in the list */
/* Total number of pdu session already setup in the list */
uint8_t
setup_pdu_sessions
;
uint8_t
setup_pdu_sessions
;
/* Number of pdu session to be setup in the list */
/* Number of pdu session to be setup in the list */
...
@@ -364,7 +352,7 @@ typedef struct gNB_RRC_UE_s {
...
@@ -364,7 +352,7 @@ typedef struct gNB_RRC_UE_s {
pdu_session_param_t
modify_pdusession
[
NR_NB_RB_MAX
];
pdu_session_param_t
modify_pdusession
[
NR_NB_RB_MAX
];
/* list of e_rab to be setup by RRC layers */
/* list of e_rab to be setup by RRC layers */
/* list of pdu session to be setup by RRC layers */
/* list of pdu session to be setup by RRC layers */
e_rab_param_t
e_rab
[
NB_RB_MAX
];
//[S1AP_MAX_E_RAB];
nr_e_rab_param_t
e_rab
[
NB_RB_MAX
];
//[S1AP_MAX_E_RAB];
pdu_session_param_t
pduSession
[
NR_NB_RB_MAX
];
//[NGAP_MAX_PDU_SESSION];
pdu_session_param_t
pduSession
[
NR_NB_RB_MAX
];
//[NGAP_MAX_PDU_SESSION];
//release e_rabs
//release e_rabs
uint8_t
nb_release_of_e_rabs
;
uint8_t
nb_release_of_e_rabs
;
...
@@ -411,8 +399,6 @@ typedef struct gNB_RRC_UE_s {
...
@@ -411,8 +399,6 @@ typedef struct gNB_RRC_UE_s {
}
gNB_RRC_UE_t
;
}
gNB_RRC_UE_t
;
typedef
uid_t
ue_uid_t
;
typedef
struct
rrc_gNB_ue_context_s
{
typedef
struct
rrc_gNB_ue_context_s
{
/* Tree related data */
/* Tree related data */
RB_ENTRY
(
rrc_gNB_ue_context_s
)
entries
;
RB_ENTRY
(
rrc_gNB_ue_context_s
)
entries
;
...
@@ -423,7 +409,7 @@ typedef struct rrc_gNB_ue_context_s {
...
@@ -423,7 +409,7 @@ typedef struct rrc_gNB_ue_context_s {
rnti_t
ue_id_rnti
;
rnti_t
ue_id_rnti
;
// another key for protocol layers but should not be used as a key for RB tree
// another key for protocol layers but should not be used as a key for RB tree
u
e_uid_t
local_uid
;
u
id_t
local_uid
;
/* UE id for initial connection to S1AP */
/* UE id for initial connection to S1AP */
struct
gNB_RRC_UE_s
ue_context
;
struct
gNB_RRC_UE_s
ue_context
;
...
@@ -495,7 +481,7 @@ typedef struct gNB_RRC_INST_s {
...
@@ -495,7 +481,7 @@ typedef struct gNB_RRC_INST_s {
int
module_id
;
int
module_id
;
eth_params_t
eth_params_s
;
eth_params_t
eth_params_s
;
rrc_gNB_carrier_data_t
carrier
;
rrc_gNB_carrier_data_t
carrier
;
nr_uid_allocator_t
uid_allocator
;
// for rrc_ue_head
uid_allocator_t
uid_allocator
;
RB_HEAD
(
rrc_nr_ue_tree_s
,
rrc_gNB_ue_context_s
)
rrc_ue_head
;
// ue_context tree key search by rnti
RB_HEAD
(
rrc_nr_ue_tree_s
,
rrc_gNB_ue_context_s
)
rrc_ue_head
;
// ue_context tree key search by rnti
int
Nb_ue
;
int
Nb_ue
;
hash_table_t
*
initial_id2_s1ap_ids
;
// key is content is rrc_ue_s1ap_ids_t
hash_table_t
*
initial_id2_s1ap_ids
;
// key is content is rrc_ue_s1ap_ids_t
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
52dbc6fe
...
@@ -230,7 +230,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
...
@@ -230,7 +230,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
rrc
->
Nb_ue
=
0
;
rrc
->
Nb_ue
=
0
;
rrc
->
carrier
.
Srb0
.
Active
=
0
;
rrc
->
carrier
.
Srb0
.
Active
=
0
;
rrc_gNB_mac_rrc_init
(
rrc
);
rrc_gNB_mac_rrc_init
(
rrc
);
nr_
uid_linear_allocator_init
(
&
rrc
->
uid_allocator
);
uid_linear_allocator_init
(
&
rrc
->
uid_allocator
);
RB_INIT
(
&
rrc
->
rrc_ue_head
);
RB_INIT
(
&
rrc
->
rrc_ue_head
);
rrc
->
initial_id2_s1ap_ids
=
hashtable_create
(
NUMBER_OF_UE_MAX
*
2
,
NULL
,
NULL
);
rrc
->
initial_id2_s1ap_ids
=
hashtable_create
(
NUMBER_OF_UE_MAX
*
2
,
NULL
,
NULL
);
rrc
->
s1ap_id2_s1ap_ids
=
hashtable_create
(
NUMBER_OF_UE_MAX
*
2
,
NULL
,
NULL
);
rrc
->
s1ap_id2_s1ap_ids
=
hashtable_create
(
NUMBER_OF_UE_MAX
*
2
,
NULL
,
NULL
);
...
...
openair2/RRC/NR/rrc_gNB_UE_context.c
View file @
52dbc6fe
...
@@ -37,61 +37,6 @@
...
@@ -37,61 +37,6 @@
#include "rrc_gNB_UE_context.h"
#include "rrc_gNB_UE_context.h"
//------------------------------------------------------------------------------
void
nr_uid_linear_allocator_init
(
nr_uid_allocator_t
*
const
uid_pP
)
//------------------------------------------------------------------------------
{
memset
(
uid_pP
,
0
,
sizeof
(
nr_uid_allocator_t
));
}
//------------------------------------------------------------------------------
uid_nr_t
nr_uid_linear_allocator_new
(
gNB_RRC_INST
*
const
rrc_instance_pP
)
//------------------------------------------------------------------------------
{
unsigned
int
i
;
unsigned
int
bit_index
=
1
;
uid_nr_t
uid
=
0
;
nr_uid_allocator_t
*
uia_p
=
&
rrc_instance_pP
->
uid_allocator
;
for
(
i
=
0
;
i
<
UID_LINEAR_ALLOCATOR_BITMAP_SIZE
;
i
++
)
{
if
(
uia_p
->
bitmap
[
i
]
!=
UINT_MAX
)
{
bit_index
=
1
;
uid
=
0
;
while
((
uia_p
->
bitmap
[
i
]
&
bit_index
)
==
bit_index
)
{
bit_index
=
bit_index
<<
1
;
uid
+=
1
;
}
uia_p
->
bitmap
[
i
]
|=
bit_index
;
return
uid
+
(
i
*
sizeof
(
unsigned
int
)
*
8
);
}
}
return
UINT_MAX
;
}
//------------------------------------------------------------------------------
void
nr_uid_linear_allocator_free
(
gNB_RRC_INST
*
rrc_instance_pP
,
uid_nr_t
uidP
)
//------------------------------------------------------------------------------
{
unsigned
int
i
=
uidP
/
sizeof
(
unsigned
int
)
/
8
;
unsigned
int
bit
=
uidP
%
(
sizeof
(
unsigned
int
)
*
8
);
unsigned
int
value
=
~
(
0x00000001
<<
bit
);
if
(
i
<
UID_LINEAR_ALLOCATOR_BITMAP_SIZE
)
{
rrc_instance_pP
->
uid_allocator
.
bitmap
[
i
]
&=
value
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
rrc_gNB_compare_ue_rnti_id
(
int
rrc_gNB_compare_ue_rnti_id
(
struct
rrc_gNB_ue_context_s
*
c1_pP
,
struct
rrc_gNB_ue_context_s
*
c2_pP
)
struct
rrc_gNB_ue_context_s
*
c1_pP
,
struct
rrc_gNB_ue_context_s
*
c2_pP
)
...
@@ -130,7 +75,7 @@ rrc_gNB_allocate_new_UE_context(
...
@@ -130,7 +75,7 @@ rrc_gNB_allocate_new_UE_context(
}
}
memset
(
new_p
,
0
,
sizeof
(
struct
rrc_gNB_ue_context_s
));
memset
(
new_p
,
0
,
sizeof
(
struct
rrc_gNB_ue_context_s
));
new_p
->
local_uid
=
nr_uid_linear_allocator_new
(
rrc_instance_pP
);
new_p
->
local_uid
=
uid_linear_allocator_new
(
&
rrc_instance_pP
->
uid_allocator
);
for
(
int
i
=
0
;
i
<
NB_RB_MAX
;
i
++
)
{
for
(
int
i
=
0
;
i
<
NB_RB_MAX
;
i
++
)
{
new_p
->
ue_context
.
e_rab
[
i
].
xid
=
-
1
;
new_p
->
ue_context
.
e_rab
[
i
].
xid
=
-
1
;
...
@@ -177,12 +122,12 @@ void rrc_gNB_free_mem_UE_context(
...
@@ -177,12 +122,12 @@ void rrc_gNB_free_mem_UE_context(
{
{
LOG_T
(
RRC
,
LOG_T
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Clearing UE context 0x%p (free internal structs)
\n
"
,
PROTOCOL_
NR_
RRC_CTXT_UE_FMT
" Clearing UE context 0x%p (free internal structs)
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_
NR_
RRC_CTXT_UE_ARGS
(
ctxt_pP
),
ue_context_pP
);
ue_context_pP
);
ASN_STRUCT_FREE_CONTENTS_ONLY
(
asn_DEF_LTE_SCellToAddMod_r10
,
&
ue_context_pP
->
ue_context
.
sCell_config
[
0
]);
//
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_LTE_SCellToAddMod_r10, &ue_context_pP->ue_context.sCell_config[0]);
ASN_STRUCT_FREE_CONTENTS_ONLY
(
asn_DEF_LTE_SCellToAddMod_r10
,
&
ue_context_pP
->
ue_context
.
sCell_config
[
1
]);
//
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_LTE_SCellToAddMod_r10, &ue_context_pP->ue_context.sCell_config[1]);
// empty the internal fields of the UE context here
// empty the internal fields of the UE context here
}
}
...
@@ -195,25 +140,25 @@ void rrc_gNB_remove_ue_context(
...
@@ -195,25 +140,25 @@ void rrc_gNB_remove_ue_context(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
{
{
if
(
rrc_instance_pP
==
NULL
)
{
if
(
rrc_instance_pP
==
NULL
)
{
LOG_E
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Bad RRC instance
\n
"
,
LOG_E
(
RRC
,
PROTOCOL_
NR_
RRC_CTXT_UE_FMT
" Bad RRC instance
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
));
PROTOCOL_
NR_
RRC_CTXT_UE_ARGS
(
ctxt_pP
));
return
;
return
;
}
}
if
(
ue_context_pP
==
NULL
)
{
if
(
ue_context_pP
==
NULL
)
{
LOG_E
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Trying to free a NULL UE context
\n
"
,
LOG_E
(
RRC
,
PROTOCOL_
NR_
RRC_CTXT_UE_FMT
" Trying to free a NULL UE context
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
));
PROTOCOL_
NR_
RRC_CTXT_UE_ARGS
(
ctxt_pP
));
return
;
return
;
}
}
RB_REMOVE
(
rrc_nr_ue_tree_s
,
&
rrc_instance_pP
->
rrc_ue_head
,
ue_context_pP
);
RB_REMOVE
(
rrc_nr_ue_tree_s
,
&
rrc_instance_pP
->
rrc_ue_head
,
ue_context_pP
);
rrc_gNB_free_mem_UE_context
(
ctxt_pP
,
ue_context_pP
);
rrc_gNB_free_mem_UE_context
(
ctxt_pP
,
ue_context_pP
);
nr_uid_linear_allocator_free
(
rrc_instance_pP
,
ue_context_pP
->
local_uid
);
uid_linear_allocator_free
(
&
rrc_instance_pP
->
uid_allocator
,
ue_context_pP
->
local_uid
);
free
(
ue_context_pP
);
free
(
ue_context_pP
);
rrc_instance_pP
->
Nb_ue
--
;
rrc_instance_pP
->
Nb_ue
--
;
LOG_I
(
RRC
,
LOG_I
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Removed UE context
\n
"
,
PROTOCOL_
NR_
RRC_CTXT_UE_FMT
" Removed UE context
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
));
PROTOCOL_
NR_
RRC_CTXT_UE_ARGS
(
ctxt_pP
));
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
openair2/RRC/NR/rrc_gNB_UE_context.h
View file @
52dbc6fe
...
@@ -34,27 +34,6 @@
...
@@ -34,27 +34,6 @@
#include "COMMON/platform_types.h"
#include "COMMON/platform_types.h"
#include "nr_rrc_defs.h"
#include "nr_rrc_defs.h"
void
nr_uid_linear_allocator_init
(
nr_uid_allocator_t
*
const
uid_pP
);
uid_t
nr_uid_linear_allocator_new
(
gNB_RRC_INST
*
rrc_instance_pP
);
void
nr_uid_linear_allocator_free
(
gNB_RRC_INST
*
rrc_instance_pP
,
uid_t
uidP
);
int
rrc_gNB_compare_ue_rnti_id
(
int
rrc_gNB_compare_ue_rnti_id
(
struct
rrc_gNB_ue_context_s
*
c1_pP
,
struct
rrc_gNB_ue_context_s
*
c1_pP
,
struct
rrc_gNB_ue_context_s
*
c2_pP
struct
rrc_gNB_ue_context_s
*
c2_pP
...
...
openair2/RRC/NR_UE/L2_interface_ue.c
View file @
52dbc6fe
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "rrc_proto.h"
#include "rrc_proto.h"
#include "assertions.h"
#include "assertions.h"
#include "rrc_vars.h"
#include "rrc_vars.h"
#include "MAC/mac.h"
typedef
uint32_t
channel_t
;
typedef
uint32_t
channel_t
;
...
...
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